WO2018045945A1 - 一种对焦方法及终端、存储介质 - Google Patents

一种对焦方法及终端、存储介质 Download PDF

Info

Publication number
WO2018045945A1
WO2018045945A1 PCT/CN2017/100533 CN2017100533W WO2018045945A1 WO 2018045945 A1 WO2018045945 A1 WO 2018045945A1 CN 2017100533 W CN2017100533 W CN 2017100533W WO 2018045945 A1 WO2018045945 A1 WO 2018045945A1
Authority
WO
WIPO (PCT)
Prior art keywords
phase difference
difference value
focal length
focusing
range
Prior art date
Application number
PCT/CN2017/100533
Other languages
English (en)
French (fr)
Inventor
马亮
Original Assignee
努比亚技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 努比亚技术有限公司 filed Critical 努比亚技术有限公司
Publication of WO2018045945A1 publication Critical patent/WO2018045945A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • H04N23/672Focus control based on electronic image sensor signals based on the phase difference signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/633Control of cameras or camera modules by using electronic viewfinders for displaying additional information relating to control or operation of the camera
    • H04N23/635Region indicators; Field of view indicators

Definitions

  • the present invention relates to image processing technologies, and in particular, to a focusing method, a terminal, and a storage medium.
  • embodiments of the present invention are expected to provide a focusing method, a terminal, and a storage medium, which can achieve focusing quickly, and are simple in operation and diverse.
  • Embodiments of the present invention provide a focusing method, including:
  • the shooting parameters include: initial object distance and initial image distance;
  • Calculating at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field range including:
  • the obtaining an initial focal length includes:
  • the preset phase difference value range is a value range of a phase difference value that triggers the terminal to achieve phase focusing
  • the method further includes:
  • the current phase difference value belongs to the preset phase difference value range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the method further includes:
  • the at least two second images are displayed.
  • the embodiment of the invention provides a terminal, including:
  • a receiving unit configured to receive a focus command
  • the acquiring unit is configured to: when the receiving unit receives the focus instruction, acquire the first image by using the image sensor, and acquire an initial focal length and a shooting parameter of the camera;
  • a determining unit configured to determine to capture a first depth of field range of the first image according to the initial focal length acquired by the acquiring unit and the shooting parameter;
  • a calculating unit configured to calculate at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field determined by the determining unit;
  • a focusing unit configured to perform focusing on the first image according to the at least two first focal lengths calculated by the calculating unit
  • the acquiring unit is further configured to acquire at least two second images corresponding to the at least two first focal lengths after the focusing unit is in focus.
  • the shooting parameters include: an initial object distance and an initial image distance;
  • the acquiring unit is further configured to adjust the initial object distance by adjusting a position of the photographing motor within the first depth of field range determined by the determining unit, and obtain the adjusted At least two first object distances;
  • the calculating unit is configured to calculate the at least two first focal lengths according to the at least two first object distances, the initial image distance, and the preset focal length model calculated by the calculating unit.
  • the terminal further includes: a detecting unit and a moving unit;
  • the acquiring unit is specifically configured to acquire a current phase difference value
  • the detecting unit is configured to detect whether the current phase difference value acquired by the acquiring unit belongs to a preset phase difference value range, where the preset phase difference value range is a phase difference of triggering the terminal to achieve phase focusing Range of values;
  • the moving unit is configured to move the photographing motor to a target corresponding to the current phase difference value if the detecting unit detects that the current phase difference value does not belong to the preset phase difference value range Adjusting the position of the photographing motor within the target focus range to determine a first target focus position, and achieving focusing based on the first target focus position;
  • the acquiring unit is further configured to acquire a current first focal length according to the first target focus position obtained after the moving unit moves, and use the current first focal length as the initial focal length.
  • the mobile unit is further configured to: after the detecting unit detects whether the current phase difference value belongs to a preset phase difference value range, if the detecting unit detects that the current phase difference value belongs to the Determining a preset phase difference range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the acquiring unit is further configured to acquire a current second focal length according to the second target focus position, and use the current second focal length as the initial focal length.
  • the terminal further includes: a display unit;
  • the display unit is configured to display the at least two second images acquired by the acquiring unit after the acquiring unit acquires at least two second images corresponding to the at least two first focal lengths after focusing.
  • the embodiment of the invention provides a terminal, including:
  • a memory configured to store an executable program
  • a processor configured to: when executing an executable program stored in the memory, implement the following operations:
  • the processor is further configured to: when executing the executable program stored in the memory, implement the following operations:
  • the shooting parameters include: initial object distance and initial image distance;
  • Calculating at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field range including:
  • the processor is further configured to: when executing the executable program stored in the memory, implement the following operations:
  • the preset phase is a range of values of the phase difference value that triggers the terminal to achieve phase focusing;
  • the processor is further configured to: when executing the executable program stored in the memory, implement the following operations:
  • the current phase difference value belongs to the preset phase difference value range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the processor is further configured to: when executing the executable program stored in the memory, implement the following operations:
  • the at least two second images After acquiring at least two second images corresponding to the at least two first focal lengths after focusing, the at least two second images are displayed.
  • Embodiments of the present invention provide a storage medium storing an executable program, and when the executable program is executed by a processor, the following operations are implemented:
  • the shooting parameters include: initial object distance and initial image distance;
  • Calculating at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field range including:
  • the preset phase difference value range is a value range of a phase difference value that triggers the terminal to achieve phase focusing
  • the current phase difference value belongs to the preset phase difference value range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the at least two second images After acquiring at least two second images corresponding to the at least two first focal lengths after focusing, the at least two second images are displayed.
  • the embodiment of the invention provides a focusing method, a terminal, and a storage medium. Since the terminal can simultaneously capture a plurality of focal lengths in a range capable of correct focusing in one shooting, a second image of various focal lengths is obtained.
  • the focusing process therefore, achieves fast focus and is very simple to operate, reflecting the variety of image types after focusing.
  • FIG. 1 is a schematic structural diagram of hardware of an optional terminal for implementing various embodiments of the present invention
  • 2 is a communication system that the mobile terminal of the present invention can operate
  • FIG. 3 is a flowchart 1 of a focusing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of an exemplary focus command triggering according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an exemplary imaging according to an embodiment of the present invention.
  • FIG. 6 is a second flowchart of a focusing method according to an embodiment of the present invention.
  • FIG. 7 is a preview diagram of an exemplary first image according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram 1 showing an exemplary second image according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram 2 showing an exemplary second image according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram 1 of a terminal according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram 2 of a terminal according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram 3 of a terminal according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram 4 of a terminal according to an embodiment of the present disclosure.
  • the focus obtaining apparatus may be a terminal, such as a computer or a mobile terminal, and the like, which can use a browser.
  • the mobile terminal can be implemented in various forms.
  • the terminals described in the present invention may include, for example, mobile phones, smart phones, notebook computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), navigation devices, and the like.
  • Mobile terminals and fixed terminals such as digital TVs, desktop computers, and the like.
  • the terminal is a mobile terminal.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • Mobile terminals and fixed terminals such as digital TVs, desktop computers, and the like.
  • the terminal is a mobile terminal.
  • those skilled in the art will appreciate that configurations in accordance with embodiments of the present invention can be applied to fixed type terminals in addition to components that are specifically for mobile purposes.
  • FIG. 1 is a schematic diagram showing the hardware structure of an optional mobile terminal for implementing various embodiments of the present invention.
  • the mobile terminal 1 may include an audio/video (A/V) input unit 120, a memory 160, and a controller 180.
  • A/V audio/video
  • the mobile terminal 1 may further include a wireless communication unit 110, a user input unit 130, a sensing unit 140, an output unit 150, an interface unit 170, and a power supply.
  • Figure 1 illustrates a mobile terminal having various components, but it should be understood that not all illustrated components are required to be implemented. More or fewer components can be implemented instead. The elements of the mobile terminal will be described in detail below.
  • Wireless communication unit 110 typically includes one or more components that allow mobile terminal 1 to be Radio communication between line communication systems or networks.
  • the wireless communication unit 110 may include at least one of the mobile communication module 112, the wireless internet module 113, the short-range communication module 114, and the location information module 115.
  • the mobile communication module 112 transmits the radio signals to and/or receives radio signals from at least one of a base station (e.g., an access point, a Node B, etc.), an external terminal, and a server.
  • a base station e.g., an access point, a Node B, etc.
  • Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received in accordance with text and/or multimedia messages.
  • the wireless internet module 113 supports wireless internet access of the mobile terminal.
  • the module can be internally or externally coupled to the terminal.
  • the wireless Internet access technologies involved in the module may include WLAN (Wireless LAN) (Wi-Fi), Wireless Broadband (Wibro), Worldwide Interoperability for Microwave Access (Wimax), High Speed Downlink Packet Access (HSDPA), etc. .
  • the short range communication module 114 is a module configured to support short range communication.
  • Some examples of short-range communication technology include Bluetooth TM, a radio frequency identification (RFID), infrared data association (IrDA), ultra wideband (UWB), ZigBee, etc. TM.
  • the location information module 115 is a module configured to check or acquire location information of the mobile terminal.
  • a typical example of a location information module is a Global Positioning System (GPS) module.
  • GPS Global Positioning System
  • the GPS module calculates distance information and accurate time information from three or more satellites and applies triangulation to the calculated information to accurately calculate three-dimensional current position information based on longitude, latitude, and altitude.
  • the method for calculating position and time information uses three satellites and corrects the calculated position and time information errors by using another satellite. Further, the GPS module can calculate the speed information by continuously calculating the current position information in real time.
  • the A/V input unit 120 is configured to receive an audio or video signal.
  • the A/V input unit 120 may include a camera 121 that processes image data of still pictures or video obtained by an image capturing device in a video capturing mode or an image capturing mode.
  • the processed image frame can be displayed on the display unit 151.
  • the image frames processed by the camera 121 may be stored in the memory 160. (or other storage medium) or transmitted via the wireless communication unit 110, two or more cameras 121 may be provided according to the configuration of the mobile terminal.
  • the user input unit 130 may generate key input data according to a command input by the user to control various operations of the mobile terminal.
  • the user input unit 130 allows the user to input various types of information, and may include a keyboard, a pot, a touch pad (eg, a touch sensitive component that detects changes in resistance, pressure, capacitance, etc. due to contact), a scroll wheel , rocker, etc.
  • a touch screen can be formed.
  • the sensing unit 140 detects the current state of the mobile terminal 1 (eg, the open or closed state of the mobile terminal 1), the location of the mobile terminal 1, the presence or absence of contact (ie, touch input) by the user with the mobile terminal 1, and the mobile terminal.
  • the orientation of 1, the acceleration or deceleration movement and direction of the mobile terminal 1, and the like, and generates a command or signal for controlling the operation of the mobile terminal 1.
  • the sensing unit 140 can sense whether the slide type phone is turned on or off.
  • the sensing unit 140 can detect whether the power supply unit 190 provides power or whether the interface unit 170 is coupled to an external device.
  • Sensing unit 140 may include proximity sensor 141 which will be described below in connection with a touch screen.
  • the interface unit 170 serves as an interface through which at least one external device can connect with the mobile terminal 1.
  • the external device may include a wired or wireless headset port, an external power (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, and an audio input/output. (I/O) port, video I/O port, headphone port, and more.
  • the identification module may be stored to verify various information used by the user using the mobile terminal 1 and may include a User Identification Module (UIM), a Customer Identification Module (SIM), a Universal Customer Identification Module (USIM), and the like.
  • the device having the identification module may take the form of a smart card, and thus the identification device may be connected to the mobile terminal 1 via a port or other connection device.
  • the interface unit 170 can be configured to receive input (eg, data information, power, etc.) from an external device and transmit the received input to one of the mobile terminals 1 or Multiple components may alternatively be used to transfer data between the mobile terminal and an external device.
  • the interface unit 170 may function as a path through which power is supplied from the base to the mobile terminal 1 or may be used as a variety of command signals allowed to be input from the base to be transmitted to the mobile The path to the terminal.
  • Various command signals or power input from the base can be used as signals for identifying whether the mobile terminal is accurately mounted on the base.
  • Output unit 150 is configured to provide an output signal (eg, an audio signal, a video signal, an alarm signal, a vibration signal, etc.) in a visual, audio, and/or tactile manner.
  • the output unit 150 may include a display unit 151 and the like.
  • the display unit 151 can display information processed in the mobile terminal 1. For example, when the mobile terminal 1 is in the phone call mode, the display unit 151 can display a user interface (UI) or a graphical user interface (GUI) related to a call or other communication (eg, text messaging, multimedia file download, etc.). When the mobile terminal 1 is in the video call mode or the image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or image and related functions, and the like.
  • UI user interface
  • GUI graphical user interface
  • the display unit 151 can function as an input device and an output device.
  • the display unit 151 may include at least one of a liquid crystal display (LCD), a thin film transistor LCD (TFT-LCD), an organic light emitting diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like.
  • LCD liquid crystal display
  • TFT-LCD thin film transistor LCD
  • OLED organic light emitting diode
  • a flexible display a three-dimensional (3D) display, and the like.
  • 3D three-dimensional
  • Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as a transparent display, and a typical transparent display may be, for example, a TOLED (Transparent Organic Light Emitting Diode) display or the like.
  • TOLED Transparent Organic Light Emitting Diode
  • the mobile terminal 1 may comprise two or more display units (or other display devices), for example, the mobile terminal may comprise an external display unit (not shown) and an internal display unit (not shown) .
  • the touch screen can be used to detect touch input pressure as well as touch input position and touch input area.
  • the memory 160 can store a software program that is processed and controlled by the controller 180. And so on, or data that has been output or is about to be output (for example, a phone book, a message, a still image, a video, etc.) can be temporarily stored. Moreover, the memory 160 can store data regarding vibrations and audio signals of various manners that are output when a touch is applied to the touch screen.
  • the memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (eg, SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, and the like.
  • the mobile terminal 1 can cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
  • the controller 180 typically controls the overall operation of the mobile terminal. For example, the controller 180 performs the control and processing associated with voice calls, data communications, video calls, and the like.
  • the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, which may be constructed within the controller 180 or may be configured to be separate from the controller 180.
  • the controller 180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
  • the power supply unit 190 receives external power or internal power under the control of the controller 180 and provides appropriate power required to operate the various components and components.
  • the various embodiments described herein can be implemented in a computer readable medium using, for example, computer software, hardware, or any combination thereof.
  • the embodiments described herein may be through the use of application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays ( An FPGA, a processor, a controller, a microcontroller, a microprocessor, at least one of the electronic units designed to perform the functions described herein, in some cases, such an embodiment may be at the controller 180 Implemented in the middle.
  • implementations such as procedures or functions may be implemented with separate software modules that permit the execution of at least one function or operation.
  • Software code can be used by The software application (or program) written in a suitable programming language is implemented, and the software code can be stored in the
  • the mobile terminal has been described in terms of its function.
  • a slide type mobile terminal among various types of mobile terminals such as a folding type, a bar type, a swing type, a slide type mobile terminal, and the like will be described as an example. Therefore, the present invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
  • the mobile terminal 1 as shown in FIG. 1 may be configured to operate using a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • a communication system such as a wired and wireless communication system and a satellite-based communication system that transmits data via frames or packets.
  • Such communication systems may use different air interfaces and/or physical layers.
  • air interfaces used by communication systems include, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)). ), Global System for Mobile Communications (GSM), etc.
  • FDMA Frequency Division Multiple Access
  • TDMA Time Division Multiple Access
  • CDMA Code Division Multiple Access
  • UMTS Universal Mobile Telecommunications System
  • LTE Long Term Evolution
  • GSM Global System for Mobile Communications
  • the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
  • a CDMA wireless communication system may include a plurality of mobile terminals 1, a plurality of base stations (BS) 270, a base station controller (BSC) 275, and a mobile switching center (MSC) 280.
  • the MSC 280 is configured to interface with a public switched telephone network (PSTN) 290.
  • PSTN public switched telephone network
  • the MSC 280 is also configured to interface with a BSC 275 that can be coupled to the BS 270 via a backhaul line.
  • the backhaul line can be constructed in accordance with any of a number of well known interfaces including, for example, E1/T1, ATM, IP, PPP, Frame Relay, HDSL, ADSL, or xDSL. It will be appreciated that the system as shown in FIG. 2 may include multiple BSCs 2750.
  • Each BS 270 can serve one or more partitions (or regions), with each partition covered by a multi-directional antenna or an antenna pointing in a particular direction radially away from the BS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS 270 can be configured to support multiple frequency allocations, and each frequency allocation has a particular frequency spectrum (eg, 1.25 MHz, 5 MHz) and many more).
  • BS 270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology.
  • BTS Base Transceiver Subsystem
  • the term "base station” can be used to generally mean a single BSC 275 and at least one BS 270.
  • a base station can also be referred to as a "cell station.”
  • each partition of a particular BS 270 may be referred to as multiple cellular stations.
  • a broadcast transmitter (BT) 295 transmits a broadcast signal to the mobile terminal 1 operating within the system.
  • BT broadcast transmitter
  • GPS Global Positioning System
  • a plurality of satellites 300 are depicted, but it is understood that useful positioning information can be obtained using any number of satellites.
  • the GPS module which is the location information module 115 shown in Figure 1, is typically configured to cooperate with the satellite 300 to obtain the desired positioning information. Instead of GPS tracking technology or in addition to GPS tracking technology, other techniques that can track the location of the mobile terminal can be used. Additionally, at least one GPS satellite 300 can selectively or additionally process satellite DMB transmissions.
  • the BS 270 receives reverse link signals from various mobile terminals 1.
  • the mobile terminal 1 typically participates in calls, messaging, and other types of communications.
  • Each reverse link signal received by a particular BS 270 is processed within a particular BS 270.
  • the obtained data is forwarded to the relevant BSC 275.
  • the BSC provides call resource allocation and coordinated mobility management functions including a soft handoff procedure between the BSs 270.
  • the BSC 275 also routes the received data to the MSC 280, which provides additional routing services for interfacing with the PSTN 290.
  • PSTN 290 interfaces with MSC 280, which forms an interface with BSC 275, and BSC 275 controls BS 270 accordingly to transmit forward link signals to mobile terminal 1.
  • An embodiment of the present invention provides a focusing method. As shown in FIG. 3, the method may include:
  • the first image is acquired by the image sensor, and the initial focal length and the shooting parameters of the camera are acquired.
  • the focus method provided by the embodiment of the present invention is implemented in a scene in which a photograph is taken on a terminal.
  • Focusing refers to adjusting the focus distance when using the camera. Focus is also called focusing and focusing.
  • the process of changing the distance between the animal and the distance by applying the focusing mechanism to the camera on the camera or the terminal makes the process of clearing the subject clear is the focus.
  • phase focusing is achieved by detecting the phase shift amount of the image.
  • a grid of parallel lines is placed at the position of the photosensitive image sensor, and the lines are successively transparent and opaque.
  • Two light-receiving elements are placed symmetrically with respect to the optical axis at appropriate positions behind the network board.
  • the network board reciprocates in a direction perpendicular to the optical axis.
  • the focusing surface coincides with the network board, the light passing through the grid plate transmits light to the two light receiving elements at the same time.
  • the beam can only reach two light-receiving elements one after the other, so there is a phase difference between their output signals.
  • the driving motor can be controlled to adjust the position of the objective lens, so that the focal plane coincides with the plane of the grid plate, thereby achieving autofocus.
  • an image sensor is disposed on the terminal, and the terminal acquires a first image by using an image sensor, where the first image is previewed on the display screen of the terminal after the camera application on the terminal is started. Image.
  • the image sensor in the embodiment of the present invention may be an image sensor including a CCD imaging element, a CMOS imaging element, and the like.
  • the user uses the terminal to take a photo.
  • the terminal clicks on the camera application and opens the camera application, when the camera button is triggered or clicks on the display screen of the terminal, that is, when the terminal receives the focus command, the terminal starts to pass.
  • the image sensor performs the first image acquisition, that is, the terminal starts to shoot the first image of the target object, and the terminal uses the initial focal length to shoot by default at the beginning of shooting, so the terminal can acquire the initial focal length when the first image is acquired.
  • the shooting parameters are obtained according to the setting parameters of the terminal.
  • the camera of the terminal when the user wants to take a picture, the camera of the terminal is activated.
  • the camera device may be a front camera, a rear camera, a dual camera, etc., which is not limited in the embodiment of the present invention.
  • the shooting parameters in the embodiment of the present invention may include: a diameter of a dispersion circle, a photographing aperture value of the lens, a focusing distance, and the like.
  • the display screen of the terminal may be clicked to trigger the camera of the terminal to perform auto focus in the focus area.
  • the initial focal length of the terminal is used, and the user's click operation is In order to send a focus command to the terminal, the terminal starts to enter the focus process according to the focus command.
  • the initial focal length f obtained by the terminal can be 200 mm
  • S102 Determine, according to an initial focal length and a shooting parameter, a first depth of field range in which the first image is captured.
  • the terminal may calculate (or determine) the first depth of field range in which the first image is taken according to the initial focal length and the shooting parameters of the camera.
  • the depth of field refers to the range of the distance between the front and back of the object measured by the imaging which can obtain a clear image at the front of the camera lens or other imager. After the focus is completed, the terminal can form a clear image in the range of the front and back of the focus, which is called the depth of field.
  • the first depth of field range when the terminal captures the first image is the distance range from the foreground depth to the back depth of field.
  • the terminal may calculate the foreground depth and the back depth of field according to formula (1) and formula (2), respectively, so as to determine the first depth of field range.
  • formula (1) and formula (2) are as follows:
  • ⁇ L 1 is the foreground depth
  • ⁇ L 2 is the back depth of field
  • f is the initial focal length
  • F is the photographing aperture value of the lens
  • L is the focusing distance
  • is the diffusion garden diameter
  • the device for realizing focusing is implemented by a lens group and an image sensor.
  • the terminal according to the formula ( 1)
  • a focusing method performs different focusing modes or effects on the basis of being able to capture a clear picture. Therefore, the premise of adjusting the focal length in the embodiment of the present invention To make adjustments in the first depth of field to get a clear picture of different focus processing.
  • the terminal adjusts the focal length within the first depth of field.
  • the terminal can calculate at least two first focal lengths by adjusting the position of the imaging motor.
  • the terminal needs to first determine the movement information of the shooting motor, that is, in which direction to move, how much distance to move, and the shooting motor can drive the movement of the camera lens.
  • the moving imaging motor must drive the movement of the camera lens. So that the camera lens is focused at the exact focus position to complete the shot.
  • S104 Perform focus focusing on the first image according to the at least two first focal lengths, and acquire at least two second images corresponding to the at least two first focal lengths after focusing.
  • the terminal calculates at least two first focal lengths, since the terminal can focus according to the focal length, a clear image is captured, so when the terminal can know at least two first focal lengths, the terminal can be according to at least two first The focal length focuses on the first image to generate corresponding at least two second images.
  • At least two second images in the embodiment of the present invention are effect images captured by the terminal using different focal lengths.
  • An embodiment of the present invention provides a focusing method, when receiving a focus command, acquiring a first image by an image sensor, acquiring an initial focal length and a shooting parameter of the camera; determining, according to the initial focal length and the shooting parameter, the first image of the first image a depth of field range; in the first depth of field range, calculating at least two first focal lengths by adjusting a position of the imaging motor; focusing the first image according to the at least two first focal lengths, obtaining at least two first after focusing At least two second images corresponding to the focal length.
  • the terminal can simultaneously capture a plurality of focal lengths in a range capable of correct focusing in one shooting, a second image of various focal lengths is obtained, and the focusing process is completed, thereby achieving fast focusing, And the operation is very simple, reflecting the variety of image types after focusing.
  • An embodiment of the present invention provides a focusing method. As shown in FIG. 6, the method may include:
  • the user uses the terminal to take a photo.
  • the photo button is triggered or clicks on the display screen of the terminal, that is, the terminal receives the focus command.
  • the first image is acquired by the image sensor, and the initial focal length and the shooting parameters of the camera are acquired.
  • the process of obtaining the initial focal length in the embodiment of the present invention may be: Taking the current phase difference value; detecting whether the current phase difference value belongs to a preset phase difference value range, where the preset phase difference value range is a range of phase difference values for triggering the terminal to achieve phase focusing; if detecting that the current phase difference value does not belong to The preset phase difference range moves the shooting motor to a target focus range corresponding to the current phase difference; adjusts the position of the shooting motor within the target focus range to determine the first target focus position to achieve focus; A target focus position, the current first focal length is acquired, and the current first focal length is taken as the initial focal length.
  • the terminal detects whether the current phase difference value belongs to a preset phase difference value range, where the preset phase difference value range is a range of phase difference values that triggers the terminal to achieve phase focusing. Since phase focusing has certain requirements on the light and details in the environment, it is not possible to use phase focusing to focus in any environment. When the light and details in the environment meet the requirements, the terminal can be triggered by phase focusing. It is understood that the phase difference value at this time can trigger phase focusing, and the phase difference value at this time is within the preset phase difference value range. However, when the light in the environment is not very sufficient and the details are not very rich, the phase difference at this time is small and is not within the preset phase difference range, so phase focusing cannot be triggered.
  • the terminal determines the movement information of the photographing motor based on the current phase difference value.
  • the current phase difference value cannot trigger the terminal to use phase focusing to perform focusing.
  • the movement information of the shooting motor that is, in which direction to move, how much distance to move, the shooting motor can drive the movement of the lens, and during the shooting process, the moving shooting motor must drive the movement of the lens, thereby Focus the lens at the exact focus position to complete the shot.
  • the photographing device directly moves the photographing motor to the focus position according to the current phase difference value.
  • the camera motor moves to the front end and then back to the back end to determine the focus position; if the lens is at the front end, the camera motor moves to the back end and then Move to the front Move to determine the focus position.
  • the terminal determines movement information of the photographing motor according to the current phase difference value, where the movement information includes a moving direction and a moving distance.
  • the terminal determines whether the shooting motor moves to the front end or the back end according to the positive or negative of the current phase difference value.
  • the shooting motor moves to the rear end; when the current phase difference value is negative
  • the shooting motor moves toward the front end.
  • the terminal determines the moving distance of the photographing motor based on the absolute value of the current phase difference value.
  • the terminal determines a target focus range of the photographing motor based on the movement information.
  • the terminal moves the shooting motor to the target position according to the moving distance, and the terminal determines a target focusing range of the shooting motor according to the target position and the preset distance, where the target point is at the midpoint of the target range
  • the range in which the front-rear distance of the target position is the preset distance is used as the target focus range.
  • the value of the preset distance is taught to be small, so that the target focus range is much smaller than the range of the contrast focus, and the specific value of the preset distance is set by the manufacturer of the terminal, depending on the specific situation.
  • the terminal moves the shooting motor to the target focus range.
  • the terminal moves the shooting motor to the target focus range, so that the camera of the terminal can find the target focus position, that is, the position of accurate focus, within the target focus range.
  • the terminal determines the second target focus according to the current phase difference value. Positioning, thereby achieving focusing; according to the second target focusing position, acquiring the current second focal length, and using the current second focal length as the initial focal length.
  • S203 Determine, according to an initial focal length and a shooting parameter, a first depth of field range in which the first image is captured.
  • S205 Calculate at least two first focal lengths according to at least two first object distances, an initial image distance, and a preset focal length model.
  • a focusing method performs different focusing modes or effects on the basis of being able to capture a clear picture. Therefore, the premise of adjusting the focal length in the embodiment of the present invention To make adjustments in the first depth of field to get a clear picture of different focus processing.
  • the terminal adjusts the focal length within the first depth of field.
  • the terminal can calculate at least two first focal lengths by adjusting the position of the imaging motor.
  • the terminal needs to first determine the movement information of the shooting motor, that is, in which direction to move, how much distance to move, and the shooting motor can drive the movement of the camera lens.
  • the moving imaging motor must drive the movement of the camera lens. So that the camera lens is focused at the exact focus position to complete the shot.
  • the terminal adjusts the initial object distance by adjusting the position of the photographing motor in the first depth of field, thereby acquiring the adjusted at least two first object distances, and then the terminal is further based on At least two first object distances, an initial image distance, and a preset focal length model, at least two first focal lengths are calculated.
  • the preset focal length model in the embodiment of the present invention is the correspondence between the focal length, the object distance and the image distance, that is, the formula (3), wherein the formula (3) is as follows:
  • f is the focal length
  • u is the first object distance
  • is the initial image distance
  • S206 Perform focusing on the first image according to the at least two first focal lengths, and acquire at least two second images corresponding to the at least two first focal lengths after the focusing.
  • S207 Display at least two second images.
  • the terminal After the terminal acquires at least two second images of different focal lengths, the terminal can directly display the at least two second images.
  • the first image shown in FIG. 7 is a preview image of the cup.
  • the first image is adjusted in the first depth of field by two focal lengths, and two seconds are obtained.
  • the image shows the two second images on the phone.
  • the terminal displays the second image as shown in FIG. 8
  • the upper image in FIG. 8 is obtained by focusing on the first cup (from left to right), and the lower one in FIG. 8 is the second.
  • the second image is shown in Figure 9, the upper one in Figure 9 is the focus on the third cup, and the lower one in Figure 9 is the focus on the fourth cup. owned.
  • the terminal can display a plurality of second images of different focal lengths when performing one shooting, the user can select the second image of the desired effect to achieve the desired special effect.
  • An embodiment of the present invention provides a focusing method, when receiving a focus command, acquiring a first image by an image sensor, acquiring an initial focal length and a shooting parameter of the camera; determining, according to the initial focal length and the shooting parameter, the first image of the first image a depth of field range; in the first depth of field range, calculating at least two first focal lengths by adjusting a position of the imaging motor; focusing the first image according to the at least two first focal lengths, obtaining at least two first after focusing At least two second images corresponding to the focal length.
  • the terminal can simultaneously capture a plurality of focal lengths in a range capable of correct focusing in one shooting, a second image of various focal lengths is obtained, and the focusing process is completed, thereby achieving fast focusing, And the operation is very simple, reflecting the variety of image types after focusing.
  • an embodiment of the present invention provides a terminal 1, which may include:
  • the receiving unit 11 is configured to receive a focus instruction
  • the obtaining unit 10 is configured to, when the receiving unit 11 receives the focus instruction, the collecting unit 18 The first image is acquired by the image sensor to obtain an initial focal length and a shooting parameter of the camera.
  • the determining unit 12 is configured to determine to capture a first depth of field range of the first image according to the initial focal length acquired by the acquiring unit 10 and the shooting parameter.
  • the calculating unit 13 is configured to calculate at least two first focal lengths by adjusting the position of the photographing motor within the first depth of field range determined by the determining unit 12.
  • the focusing unit 14 is configured to perform focusing on the first image according to the at least two first focal lengths calculated by the calculating unit 13;
  • the acquiring unit 10 is further configured to acquire at least two second images corresponding to the at least two first focal lengths after the focusing unit 14 is in focus.
  • the shooting parameters include: an initial object distance and an initial image distance.
  • the acquiring unit 10 is further configured to adjust the initial object distance by adjusting the position of the photographing motor within the first depth of field determined by the determining unit 12, and obtain at least two first adjusted Object distance.
  • the calculating unit 13 is specifically configured to calculate the at least two first focal lengths according to the at least two first object distances, the initial image distance, and the preset focal length model calculated by the calculating unit 13 .
  • the terminal 1 further includes: a detecting unit 15 and a moving unit 16.
  • the acquiring unit 10 is specifically configured to acquire a current phase difference value.
  • the detecting unit 15 is configured to detect whether the current phase difference value acquired by the acquiring unit 10 belongs to a preset phase difference value range, where the preset phase difference value range is a phase difference of triggering the terminal to achieve phase focusing. Range of values.
  • the moving unit 16 is configured to move the photographing motor to correspond to the current phase difference value if the detecting unit 15 detects that the current phase difference value does not belong to the preset phase difference value range.
  • Target within the focus range; and adjusting the shooting horse within the target focus range The position is reached to determine the first target focus position to achieve focus.
  • the acquiring unit 10 is further configured to acquire a current first focal length according to the first target focus position obtained after the moving unit 16 moves, and use the current first focal length as the initial focal length.
  • the mobile unit 16 is further configured to: after the detecting unit 15 detects whether the current phase difference value belongs to a preset phase difference value range, if the detecting unit 15 detects the current phase difference value And belonging to the preset phase difference range, determining a second target focus position according to the current phase difference value, thereby achieving focusing.
  • the acquiring unit 10 is further configured to acquire a current second focal length according to the second target focus position, and use the current second focal length as the initial focal length.
  • the terminal 1 further includes: a display unit 17.
  • the display unit 17 is configured to display the at least two second acquired by the acquiring unit 10 after the acquiring unit 10 acquires at least two second images corresponding to the at least two first focal lengths after focusing image.
  • the terminal in the embodiment of the present invention may be an electronic device having a shooting function or provided with a camera, such as a mobile phone, a tablet computer, or a camera.
  • the above-mentioned focusing unit 14, the obtaining unit 10, the determining unit 12, the calculating unit 13, the detecting unit 15, and the moving unit 16 may be implemented by the processor 19 located on the terminal 1, specifically for central processing.
  • the receiving unit 11 can be implemented by the receiver 110 on the terminal 1
  • the collecting unit 18 can be implemented by the terminal.
  • the camera 111 on 1 is implemented, and the display unit 17 can be implemented by the display 112 on the terminal 1.
  • the terminal 1 can further include a memory 113, which can be connected to the processor 19 via a system bus 114, wherein the memory 113 is used for storage.
  • Executing program code the program code includes computer operation instructions
  • the memory 113 may include a high speed RAM memory, and may also include a nonvolatile memory, for example, One less disk storage.
  • the memory 113 and the processor 19 in Fig. 13 will be described.
  • the memory 113 is configured to store an executable program
  • the processor 19 is configured to perform the following operations by executing an executable program stored in the memory 113:
  • the processor 19 is further configured to perform the following operations by executing an executable program stored in the memory 113:
  • the shooting parameters include: initial object distance and initial image distance;
  • Calculating at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field range including:
  • the processor 19 is further configured to perform the following operations by executing an executable program stored in the memory 113:
  • the preset phase difference value range is a value range of a phase difference value that triggers the terminal to achieve phase focusing
  • the processor 19 is further configured to perform the following operations by executing an executable program stored in the memory 113:
  • the current phase difference value belongs to the preset phase difference value range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the processor 19 is further configured to perform the following operations by executing an executable program stored in the memory 113:
  • the at least two second images After acquiring at least two second images corresponding to the at least two first focal lengths after focusing, the at least two second images are displayed.
  • the embodiment of the present invention further provides a storage medium, which may be implemented, for example, as the memory 160 shown in FIG. 1 or the memory 113 shown in FIG. 13, wherein an executable program is stored, and the executable program is executed by the processor.
  • a storage medium which may be implemented, for example, as the memory 160 shown in FIG. 1 or the memory 113 shown in FIG. 13, wherein an executable program is stored, and the executable program is executed by the processor.
  • the shooting parameters include: initial object distance and initial image distance;
  • Calculating at least two first focal lengths by adjusting a position of the photographing motor within the first depth of field range including:
  • the preset phase difference value range is a value range of a phase difference value that triggers the terminal to achieve phase focusing
  • the current phase difference value belongs to the preset phase difference value range, determining a second target focus position according to the current phase difference value, and achieving focusing based on the second target focus position;
  • the at least two second images After acquiring at least two second images corresponding to the at least two first focal lengths after focusing, the at least two second images are displayed.
  • the terminal can achieve multiple focal lengths in a range of correct focus at the same time, and obtain a second image of various focal lengths to complete the focusing process. Therefore, fast focusing is achieved, and the operation is very simple, which embodies The variety of image types after focusing.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • These computer program instructions can also be stored in a bootable computer or other programmable data processing
  • the apparatus is readable in a computer readable memory in a particular manner such that instructions stored in the computer readable memory produce an article of manufacture comprising instruction means implemented in one or more flows and/or block diagrams of the flowchart The function specified in the box or in multiple boxes.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the invention discloses a focusing method, a terminal, and a storage medium.
  • the method includes: when receiving a focus instruction, acquiring a first image by using an image sensor to obtain an initial focal length and a shooting parameter of the camera; according to an initial focal length and a shooting parameter, Determining a first depth of field range for capturing the first image; calculating at least two first focal lengths by adjusting a position of the imaging motor in the first depth of field; focusing and aiming the first image according to the at least two first focal lengths At least two second images corresponding to at least two first focal lengths after focusing.

Landscapes

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

Abstract

一种对焦方法及终端、存储介质;方法包括:当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;根据初始焦距和拍摄参数,确定拍摄该第一图像的第一景深范围;在第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。

Description

一种对焦方法及终端、存储介质
相关申请的交叉引用
本申请基于申请号为201610810527.X、申请日为2016年9月6日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的内容在此引入本申请作为参考。
技术领域
本发明涉及图像处理技术,尤其涉及一种对焦方法及终端、存储介质。
背景技术
随着移动终端的快速发展和逐渐普及,移动终端已成为人们日常生活中不可或缺的工具之一,带有摄像装置的移动终端更是广受用户青睐。为了获得更好的拍摄体验,人们对移动终端的拍照功能的要求也越来越高,不仅要求提高摄像装置像素,还要求提高摄像装置的拍摄速度。其中,拍摄速度主要由对焦方式决定。
目前,市面上的移动终端大多数采用反差式对焦方式或相位对焦方式,通过驱动马达带动镜片的来回移动来准确地找出目标对焦位置。然而不论采用哪种对焦方式,都是通过多次不同的对焦进行不同焦距的拍摄,这样的对焦操作复杂且费时。
发明内容
为解决上述技术问题,本发明实施例期望提供一种对焦方法及终端、存储介质,能够快速的实现对焦,并且操作简单,具有多样性。
本发明实施例的技术方案是这样实现的:
本发明实施例提供了一种对焦方法,包括:
当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
在上述方案中,所述拍摄参数包括:初始物距和初始像距;
所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
在上述方案中,所述获取初始焦距,包括:
获取当前相位差值;
检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一 焦距作为所述初始焦距。
在上述方案中,所述检测所述当前相位差值是否属于预设的相位差值范围之后,所述方法还包括:
若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
在上述方案中,所述获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,所述方法还包括:
显示所述至少两个第二图像。
本发明实施例提供了一种终端,包括:
接收单元,配置为接收对焦指令;
获取单元,配置为当所述接收单元接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
确定单元,配置为根据所述获取单元获取的所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
计算单元,配置为在所述确定单元确定的所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
对焦单元,配置为根据所述计算单元计算的所述至少两个第一焦距对所述第一图像进行对焦瞄准,
所述获取单元,还配置为所述对焦单元对焦后获取所述至少两个第一焦距对应的至少两个第二图像。
在上述终端中,所述拍摄参数包括:初始物距和初始像距;
所述获取单元,还配置为在所述确定单元确定的所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的 至少两个第一物距;
所述计算单元,具体配置为根据所述计算单元计算的所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
在上述终端中,所述终端还包括:检测单元和移动单元;
所述获取单元,具体配置为获取当前相位差值;
所述检测单元,配置为检测所述获取单元获取的所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差的取值范围;
所述移动单元,配置为若所述检测单元检测出所述当前相位差值不属于所述预设的相位差值范围,则将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;及在所述目标对焦范围内调节所述拍摄马达的位置,以确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
所述获取单元,还具体配置为根据所述移动单元移动后得到的所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
在上述终端中,所述移动单元,还配置为所述检测单元检测所述当前相位差值是否属于预设的相位差值范围之后,若所述检测单元检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于所述第二目标对焦位置实现对焦;
所述获取单元,还具体配置为根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
在上述终端中,所述终端还包括:显示单元;
所述显示单元,配置为所述获取单元获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述获取单元获取的所述至少两个第二图像。
本发明实施例提供了一种终端,包括:
存储器,配置为存储可执行程序;
处理器,配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
上述方案中,所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
所述拍摄参数包括:初始物距和初始像距;
所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
上述方案中,所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
获取当前相位差值;
检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相 位差值范围为触发终端实现相位对焦的相位差值的取值范围;
若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
上述方案中,所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
检测所述当前相位差值是否属于预设的相位差值范围之后,
若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
上述方案中,所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
本发明实施例提供了一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现以下操作:
当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第 一焦距;
根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
上述方案中,所述可执行程序被处理器执行时,还实现以下操作:
所述拍摄参数包括:初始物距和初始像距;
所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
上述方案中,所述可执行程序被处理器执行时,还实现以下操作:
获取当前相位差值;
检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
上述方案中,所述可执行程序被处理器执行时,还实现以下操作:
所述检测所述当前相位差值是否属于预设的相位差值范围之后,
若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
上述方案中,所述可执行程序被处理器执行时,还实现以下操作:
获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
本发明实施例提供了一种对焦方法及终端、存储介质,由于终端可以在一次拍摄时,在能够正确对焦的范围内,同时实现多种焦距的拍摄,得到多种焦距的第二图像,完成对焦过程,因此,实现了快速对焦,并且操作非常简单,体现了对焦后图像类型的多样性。
附图说明
图1为实现本发明各个实施例一种可选的终端的硬件结构示意图;
图2为本发明的移动终端能够操作的通信***;
图3为本发明实施例提供的一种对焦方法的流程图一;
图4为本发明实施例提供的一种示例性的对焦指令触发示意图;
图5为本发明实施例提供的一种示例性的成像的结构示意图;
图6为本发明实施例提供的一种对焦方法的流程图二;
图7为本发明实施例提供的示例性的第一图像的预览图;
图8为本发明实施例提供的示例性的第二图像的显示示意图一;
图9为本发明实施例提供的示例性的第二图像的显示示意图二;
图10为本发明实施例提供的终端的结构示意图一;
图11为本发明实施例提供的终端的结构示意图二;
图12为本发明实施例提供的终端的结构示意图三;
图13为本发明实施例提供的终端的结构示意图四。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
现在将参考附图描述实现本发明各个实施例的移动终端。在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。
需要说明的是,本发明实施例提供的一种焦点获取装置可以为终端,例如计算机或移动终端等可以使用浏览器的电子设备。
其中,移动终端可以以各种形式来实施。例如,本发明中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、数字广播接收器、个人数字助理(PDA)、平板电脑(PAD)、便携式多媒体播放器(PMP)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。
图1为实现本发明各个实施例的一种可选的移动终端的硬件结构示意。移动终端1可以包括音频/视频(A/V)输入单元120、存储器160和控制器180。
在一个实施例中,根据对移动终端的功能需求,如图1所示,移动终端1还可以包括无线通信单元110、用户输入单元130、感测单元140、输出单元150、接口单元170和电源单元190等等。图1示出了具有各种组件的移动终端,但是应理解的是,并不要求实施所有示出的组件。可以替代地实施更多或更少的组件。将在下面详细描述移动终端的元件。
无线通信单元110通常包括一个或多个组件,其允许移动终端1与无 线通信***或网络之间的无线电通信。例如,无线通信单元110可以包括移动通信模块112、无线互联网模块113、短程通信模块114和位置信息模块115中的至少一个。
移动通信模块112将无线电信号发送到基站(例如,接入点、节点B等等)、外部终端以及服务器中的至少一个和/或从其接收无线电信号。这样的无线电信号可以包括语音通话信号、视频通话信号、或者根据文本和/或多媒体消息发送和/或接收的各种类型的数据。
无线互联网模块113支持移动终端的无线互联网接入。该模块可以内部或外部地耦接到终端。该模块所涉及的无线互联网接入技术可以包括WLAN(无线LAN)(Wi-Fi)、无线宽带(Wibro)、全球微波互联接入(Wimax)、高速下行链路分组接入(HSDPA)等等。
短程通信模块114是配置为支持短程通信的模块。短程通信技术的一些示例包括蓝牙TM、射频识别(RFID)、红外数据协会(IrDA)、超宽带(UWB)、紫蜂TM等等。
位置信息模块115是配置为检查或获取移动终端的位置信息的模块。位置信息模块的典型示例是全球定位***(GPS)模块。根据当前的技术,GPS模块计算来自三个或更多卫星的距离信息和准确的时间信息并且对于计算的信息应用三角测量法,从而根据经度、纬度和高度准确地计算三维当前位置信息。当前,用于计算位置和时间信息的方法使用三颗卫星并且通过使用另外的一颗卫星校正计算出的位置和时间信息的误差。此外,GPS模块能够通过实时地连续计算当前位置信息来计算速度信息。
A/V输入单元120配置为接收音频或视频信号。A/V输入单元120可以包括相机121,相机121对在视频捕获模式或图像捕获模式中由图像捕获装置获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元151上。经相机121处理后的图像帧可以存储在存储器160 (或其它存储介质)中或者经由无线通信单元110进行发送,可以根据移动终端的构造提供两个或更多相机121。
用户输入单元130可以根据用户输入的命令生成键输入数据以控制移动终端的各种操作。用户输入单元130允许用户输入各种类型的信息,并且可以包括键盘、锅仔片、触摸板(例如,检测由于被接触而导致的电阻、压力、电容等等的变化的触敏组件)、滚轮、摇杆等等。特别地,当触摸板以层的形式叠加在显示单元151上时,可以形成触摸屏。
感测单元140检测移动终端1的当前状态,(例如,移动终端1的打开或关闭状态)、移动终端1的位置、用户对于移动终端1的接触(即,触摸输入)的有无、移动终端1的取向、移动终端1的加速或减速移动和方向等等,并且生成用于控制移动终端1的操作的命令或信号。例如,当移动终端1实施为滑动型移动电话时,感测单元140可以感测该滑动型电话是打开还是关闭。另外,感测单元140能够检测电源单元190是否提供电力或者接口单元170是否与外部装置耦接。感测单元140可以包括接近传感器141将在下面结合触摸屏来对此进行描述。
接口单元170用作至少一个外部装置与移动终端1连接可以通过的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。识别模块可以是存储用于验证用户使用移动终端1的各种信息并且可以包括用户识别模块(UIM)、客户识别模块(SIM)、通用客户识别模块(USIM)等等。另外,具有识别模块的装置(下面称为“识别装置”)可以采取智能卡的形式,因此,识别装置可以经由端口或其它连接装置与移动终端1连接。接口单元170可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到移动终端1内的一个或 多个元件或者可以用于在移动终端和外部装置之间传输数据。
另外,当移动终端1与外部底座连接时,接口单元170可以用作允许通过其将电力从底座提供到移动终端1的路径或者可以用作允许从底座输入的各种命令信号通过其传输到移动终端的路径。从底座输入的各种命令信号或电力可以用作用于识别移动终端是否准确地安装在底座上的信号。输出单元150被构造为以视觉、音频和/或触觉方式提供输出信号(例如,音频信号、视频信号、警报信号、振动信号等等)。输出单元150可以包括显示单元151等等。
显示单元151可以显示在移动终端1中处理的信息。例如,当移动终端1处于电话通话模式时,显示单元151可以显示与通话或其它通信(例如,文本消息收发、多媒体文件下载等等)相关的用户界面(UI)或图形用户界面(GUI)。当移动终端1处于视频通话模式或者图像捕获模式时,显示单元151可以显示捕获的图像和/或接收的图像、示出视频或图像以及相关功能的UI或GUI等等。
同时,当显示单元151和触摸板以层的形式彼此叠加以形成触摸屏时,显示单元151可以用作输入装置和输出装置。显示单元151可以包括液晶显示器(LCD)、薄膜晶体管LCD(TFT-LCD)、有机发光二极管(OLED)显示器、柔性显示器、三维(3D)显示器等等中的至少一种。这些显示器中的一些可以被构造为透明状,以允许用户从外部观看,这可以称为透明显示器,典型的透明显示器可以例如为TOLED(透明有机发光二极管)显示器等等。根据特定想要的实施方式,移动终端1可以包括两个或更多显示单元(或其它显示装置),例如,移动终端可以包括外部显示单元(未示出)和内部显示单元(未示出)。触摸屏可用于检测触摸输入压力以及触摸输入位置和触摸输入面积。
存储器160可以存储由控制器180执行的处理和控制操作的软件程序 等等,或者可以暂时地存储己经输出或将要输出的数据(例如,电话簿、消息、静态图像、视频等等)。而且,存储器160可以存储关于当触摸施加到触摸屏时输出的各种方式的振动和音频信号的数据。
存储器160可以包括至少一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等等。而且,移动终端1可以与通过网络连接执行存储器160的存储功能的网络存储装置协作。
控制器180通常控制移动终端的总体操作。例如,控制器180执行与语音通话、数据通信、视频通话等等相关的控制和处理。另外,控制器180可以包括用于再现(或回放)多媒体数据的多媒体模块181,多媒体模块181可以构造在控制器180内,或者可以构造为与控制器180分离。控制器180可以执行模式识别处理,以将在触摸屏上执行的手写输入或者图片绘制输入识别为字符或图像。
电源单元190在控制器180的控制下接收外部电力或内部电力并且提供操作各元件和组件所需的适当的电力。
这里描述的各种实施方式可以以使用例如计算机软件、硬件或其任何组合的计算机可读介质来实施。对于硬件实施,这里描述的实施方式可以通过使用特定用途集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理装置(DSPD)、可编程逻辑装置(PLD)、现场可编程门阵列(FPGA)、处理器、控制器、微控制器、微处理器、被设计为执行这里描述的功能的电子单元中的至少一种来实施,在一些情况下,这样的实施方式可以在控制器180中实施。对于软件实施,诸如过程或功能的实施方式可以与允许执行至少一种功能或操作的单独的软件模块来实施。软件代码可以由以任 何适当的编程语言编写的软件应用程序(或程序)来实施,软件代码可以存储在存储器160中并且由控制器180执行。
至此,己经按照其功能描述了移动终端。下面,为了简要起见,将描述诸如折叠型、直板型、摆动型、滑动型移动终端等等的各种类型的移动终端中的滑动型移动终端作为示例。因此,本发明能够应用于任何类型的移动终端,并且不限于滑动型移动终端。
如图1中所示的移动终端1可以被构造为利用经由帧或分组发送数据的诸如有线和无线通信***以及基于卫星的通信***来操作。
现在将参考图2描述其中根据本发明的移动终端能够操作的通信***。
这样的通信***可以使用不同的空中接口和/或物理层。例如,由通信***使用的空中接口包括例如频分多址(FDMA)、时分多址(TDMA)、码分多址(CDMA)和通用移动通信***(UMTS)(特别地,长期演进(LTE))、全球移动通信***(GSM)等等。作为非限制性示例,下面的描述涉及CDMA通信***,但是这样的教导同样适用于其它类型的***。
参考图2,CDMA无线通信***可以包括多个移动终端1、多个基站(BS)270、基站控制器(BSC)275和移动交换中心(MSC)280。MSC 280被构造为与公共电话交换网络(PSTN)290形成接口。MSC 280还被构造为与可以经由回程线路耦接到BS 270的BSC 275形成接口。回程线路可以根据若干己知的接口中的任一种来构造,所述接口包括例如E1/T1、ATM,IP、PPP、帧中继、HDSL、ADSL或xDSL。将理解的是,如图2中所示的***可以包括多个BSC 2750。
每个BS 270可以服务一个或多个分区(或区域),由多向天线或指向特定方向的天线覆盖的每个分区放射状地远离BS 270。或者,每个分区可以由用于分集接收的两个或更多天线覆盖。每个BS 270可以被构造为支持多个频率分配,并且每个频率分配具有特定频谱(例如,1.25MHz,5MHz 等等)。
分区与频率分配的交叉可以被称为CDMA信道。BS 270也可以被称为基站收发器子***(BTS)或者其它等效术语。在这样的情况下,术语“基站”可以用于笼统地表示单个BSC 275和至少一个BS 270。基站也可以被称为“蜂窝站”。或者,特定BS 270的各分区可以被称为多个蜂窝站。
如图2中所示,广播发射器(BT)295将广播信号发送给在***内操作的移动终端1。在图2中,示出了几个全球定位***(GPS)卫星300,卫星300帮助定位多个移动终端1中的至少一个。
在图2中,描绘了多个卫星300,但是理解的是,可以利用任何数目的卫星获得有用的定位信息。作为图1中所示的位置信息模块115的GPS模块通常被构造为与卫星300配合以获得想要的定位信息。替代GPS跟踪技术或者在GPS跟踪技术之外,可以使用可以跟踪移动终端的位置的其它技术。另外,至少一个GPS卫星300可以选择性地或者额外地处理卫星DMB传输。
作为无线通信***的一个典型操作,BS 270接收来自各种移动终端1的反向链路信号。移动终端1通常参与通话、消息收发和其它类型的通信。特定BS 270接收的每个反向链路信号被在特定BS 270内进行处理。获得的数据被转发给相关的BSC 275。BSC提供通话资源分配和包括BS 270之间的软切换过程的协调的移动管理功能。BSC 275还将接收到的数据路由到MSC 280,其提供用于与PSTN 290形成接口的额外的路由服务。类似地,PSTN 290与MSC 280形成接口,MSC与BSC 275形成接口,并且BSC 275相应地控制BS 270以将正向链路信号发送到移动终端1。
基于上述移动终端硬件结构以及通信***,提出本发明方法各个实施例。
本发明实施例提供了一种对焦方法,如图3所示,该方法可以包括:
S101、当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数。
需要说明的是,本发明实施例提供的一种对焦方法是在终端上进行拍照的场景下实现的。
对焦指使用照相机时调整好焦点距离,对焦也叫对光、聚焦。通过照相机或终端上的相机应用对焦机构改变动物距和相距的位置,使被拍物成像清晰的过程就是对焦。
其中,相位对焦是通过检测图像的相位偏移量实现自动对焦的。在感光的图像传感器的位置放置一个由平行线条组成的网格板,线条相继为透光和不透光。网络板后适当位置上与光轴对称地放置两个受光元件。网络板在与光轴垂直方向上往复振动。当聚焦面与网络板重合时,通过网格板透光线条的光同时到达其后面的两个受光元件。而当离焦时,光束只能先后到达两个受光元件,于是它们的输出信号之间有相位差。有相位差的两个信号经电路处理后即可控制驱动马达来调节物镜的位置,使聚焦面与网格板的平面重合,从而实现自动对焦。
需要说明的是,本发明实施例中的终端上设置有图像传感器,该终端通过图像传感器采集第一图像,其中,第一图像为终端上的相机应用启动后,在终端的显示屏幕上预览到的图像。
可选的,本发明实施例中的图像传感器可以为图像传感器包括CCD成像元件和CMOS成像元件等。
在本发明实施例中,用户使用终端进行拍照,当用户点击相机应用,打开相机应用后,在拍照按键被触发或是点击终端的显示屏时,即终端接收到对焦指令时,该终端开始通过图像传感器进行第一图像的采集,即终端开始对目标对象进行第一图像的拍摄,而该终端在一开始拍摄时默认采用初始焦距进行拍摄,因此,终端可以获取采集第一图像时的初始焦距, 并根据终端的设置参数获取到拍摄参数。
需要说明的是,在本发明实施例中,当用户想要拍照时便启动终端的拍摄装置,该拍摄装置可以是前置摄像头、后置摄像头、双摄像头等,本发明实施例不作限制。
可选的,本发明实施例中的拍摄参数可以包括:弥散园直径、镜头的拍摄光圈值、对焦距离等参数。
示例性的,如图4所示,当用户想要进行拍照时,可以点击终端的显示屏幕以触发终端的拍摄装置进行对焦区域的自动对焦,此时终端的采用初始焦距,用户的点击操作即为对终端发送对焦指令,终端根据对焦指令开始进入对焦流程,此时终端获取到的初始焦距f可以为200mm,镜头的拍摄光圈值F=2.8,对焦距离L=5000mm,弥散园直径δ=0.035mm。
S102、根据初始焦距和拍摄参数,确定拍摄第一图像的第一景深范围。
当终端获取到了初始焦距和相机的拍摄参数之后,该终端可以根据初始焦距和相机的拍摄参数计算(或确定出)拍摄第一图像是的第一景深范围。
需要说明的是,景深是指在摄影机镜头或其他成像器前沿能够取得清晰图像的成像所测定的被摄物体前后距离的范围。终端在聚焦完成后,在焦点前后的范围内都能形成清晰的像时这一前一后的距离范围,便叫做景深。
可以理解的是,对于终端拍摄第一图像时的第一景深范围就是从前景深到后景深的距离范围了。
可选的,在本发明实施例中,终端可以根据公式(1)和公式(2)分别计算出前景深和后景深,从而相加确定得到第一景深范围了。其中,公式(1)和公式(2)如下:
Figure PCTCN2017100533-appb-000001
Figure PCTCN2017100533-appb-000002
其中,ΔL1为前景深,ΔL2为后景深,f为初始焦距,F为镜头的拍摄光圈值,L为对焦距离,δ为弥散园直径。
需要说明的是,在本发明实施例中,实现对焦的装置由透镜组以及图像传感器组成一套***来实现。
示例性的,如图5所示,当初始焦距f可以为200毫米(mm),镜头的拍摄光圈值F=2.8,对焦距离L=5000mm,弥散园直径δ=0.035mm时,终端根据公式(1)算出前景深ΔL1=60mm,后景深ΔL1=60mm=62mm,因此,第一景深范围ΔL=122mm。
S103、在第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距。
在终端确定了第一景深范围之后,由于本发明实施例提出的一种对焦方法是在可以拍摄出清晰画面的基础上进行不同对焦方式或效果的实现,因此,本发明实施例调节焦距的前提要在第一景深范围内进行调节才能得到不同对焦处理的清晰照片。于是,终端在第一景深范围内进行焦距的调整,可选的,该终端可以通过调节拍摄马达的位置计算出至少两个第一焦距。
需要说明的是,终端需要先确定拍摄马达的移动信息,即向哪个方向移动,移动多少距离,拍摄马达可以驱动摄像头镜片的移动,在拍摄的过程中,移动拍摄马达必将驱动摄像头镜片的移动,从而使摄像头镜片在准确的合焦位置处进行对焦,以完成拍摄。
需要说明的是,终端通过调节拍摄马达的位置计算出至少两个第一焦距的过程将在后续实施例中进行详细的说明。
S104、根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。
终端在计算出至少两个第一焦距之后,由于该终端可以按照焦距进行对焦,拍摄出清晰的图像,因此,在终端可以知道至少两个第一焦距时,该终端可以根据至少两个第一焦距对第一图像进行对焦瞄准,分别生成对应的至少两个第二图像。
可以理解的是,本发明实施例中的至少两个第二图像为终端采用不同焦距拍摄出的效果图像。
本发明实施例提供了一种对焦方法,当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;根据初始焦距和拍摄参数,确定拍摄该第一图像的第一景深范围;在第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。采用上述技术实现方案,由于终端可以在一次拍摄时,在能够正确对焦的范围内,同时实现多种焦距的拍摄,得到多种焦距的第二图像,完成对焦过程,因此,实现了快速对焦,并且操作非常简单,体现了对焦后图像类型的多样性。
本发明实施例提供了一种对焦方法,如图6所示,该方法可以包括:
S201、接收对焦指令。
需要说明的是,在本发明实施例中,用户使用终端进行拍照,当用户点击相机应用,打开相机应用后,拍照按键被触发或是点击终端的显示屏,即终端接收到对焦指令。
S202、当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数。
本步骤的详细过程的描述与前续实施例中的S101的描述过程一致,此处不再赘述。
需要说明的是,本发明实施例中获取初始焦距的过程可以为:终端获 取当前相位差值;检测当前相位差值是否属于预设的相位差值范围,该预设的相位差值范围为触发终端实现相位对焦的相位差值范围;若检测出当前相位差值不属于预设的相位差值范围,则将拍摄马达移动至与当前相位差值对应的目标对焦范围内;在目标对焦范围内调节拍摄马达的位置,以确定第一目标对焦位置从而实现对焦;根据第一目标对焦位置,获取当前第一焦距,并将当前第一焦距作为初始焦距。
可选的,终端检测当前相位差值是否属于预设的相位差值范围,该预设的相位差值范围为触发终端实现相位对焦的相位差值范围。由于相位对焦对环境中的光线和细节有一定的要求,因此不是在任何环境中都能使用相位对焦进行对焦,当环境中的光线和细节满足要求时便能触发终端采用相位对焦进行对焦,可以理解的是此时的相位差值能够触发相位对焦,此时的相位差值在预设的相位差值范围内。但是,当环境中的光线不是很足,细节不是很丰富时,此时的相位差值较小,未在预设的相位差值范围内,因此无法触发相位对焦。
详细地,首选,当检测的结果为否时,终端根据当前相位差值确定拍摄马达的移动信息。
可选的,当检测的结果为否时,即当前相位差值不属于预设的相位差值范围,可以理解的是当前相位差值无法触发终端采用相位对焦进行对焦。无论采用哪种对焦方式都需要确定拍摄马达的移动信息,即向哪个方向移动,移动多少距离,拍摄马达可以驱动镜片的移动,在拍摄的过程中,移动拍摄马达必将驱动镜片的移动,从而使镜片在准确的合焦位置处进行对焦,以完成拍摄。当能够采用相位对焦方式进行对焦时,拍摄装置直接根据当前相位差值将拍摄马达移动至合焦位置处。当采用反差式对焦方式进行对焦时,若镜片在后端,则拍摄马达先往前端移动然后再退回后端,以确定合焦位置;若镜片在前端,则拍摄马达先往后端移动然后再往前端移 动,以确定合焦位置。
可选的,当检测的结果为否时,终端根据当前相位差值确定拍摄马达的移动信息,该移动信息包括移动方向和移动距离。终端根据当前相位差值的正负确定拍摄马达是往前端移动还是后端移动,可选的,当当前相位差值为正时,拍摄马达往后端移动;当当前相位差值为负时,拍摄马达往前端移动。终端根据当前相位差值的绝对值确定拍摄马达的移动距离。
其次,终端根据移动信息确定拍摄马达的目标对焦范围。
可选的,终端在确定移动方向之后便根据移动距离将拍摄马达移动到目标位置处,终端根据目标位置以及预设距离确定拍摄马达的目标对焦范围,该目标对焦范围的中点处为目标位置,将目标位置处前后距离为预设距离的范围作为目标对焦范围。其中,预设距离的数值教小,以使目标对焦范围相比反差式对焦的移动范围而言小得多,预设距离的具体值由终端的制造厂商设定,是具体情况而定。
最后,终端将拍摄马达移动至目标对焦范围内。
可选的,一旦所述目标对焦范围确定,终端便将拍摄马达移动至目标对焦范围内,以方便终端的拍摄装置在目标对焦范围内查找目标对焦位置,即准确对焦的位置。
可选的,终端检测当前相位差值是否属于预设的相位差值范围之后,若检测出当前相位差值属于预设的相位差值范围,该终端则根据当前相位差值确定第二目标对焦位置,从而实现对焦;根据第二目标对焦位置,获取当前第二焦距,并将当前第二焦距作为初始焦距。
S203、根据初始焦距和拍摄参数,确定拍摄第一图像的第一景深范围。
本步骤的详细过程的描述与前续实施例中的S102的描述过程一致,此处不再赘述。
S204、在第一景深范围内,通过调节拍摄马达的位置从而调节初始物 距,获取调节后的至少两个第一物距。
S205、根据至少两个第一物距、初始像距和预设焦距模型,计算出至少两个第一焦距。
在终端确定了第一景深范围之后,由于本发明实施例提出的一种对焦方法是在可以拍摄出清晰画面的基础上进行不同对焦方式或效果的实现,因此,本发明实施例调节焦距的前提要在第一景深范围内进行调节才能得到不同对焦处理的清晰照片。于是,终端在第一景深范围内进行焦距的调整,可选的,该终端可以通过调节拍摄马达的位置计算出至少两个第一焦距。
需要说明的是,终端需要先确定拍摄马达的移动信息,即向哪个方向移动,移动多少距离,拍摄马达可以驱动摄像头镜片的移动,在拍摄的过程中,移动拍摄马达必将驱动摄像头镜片的移动,从而使摄像头镜片在准确的合焦位置处进行对焦,以完成拍摄。
可选的,在本发明实施例中,终端在第一景深范围内,通过调节拍摄马达的位置从而调节初始物距,从而获取到了调节后的至少两个第一物距,然后该终端再根据至少两个第一物距、初始像距和预设焦距模型,计算出至少两个第一焦距。
在本发明实施例中的预设焦距模型为焦距、物距和像距之间的对应关系,即公式(3),其中,公式(3)如下:
Figure PCTCN2017100533-appb-000003
其中,f为焦距,u为第一物距,σ为初始像距,位置可以如图5所示。
S206、根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。
本步骤的详细过程的描述与前续实施例中的S104的描述过程一致,此处不再赘述。
S207、显示至少两个第二图像。
终端在获取了不同焦距的至少两个第二图像之后,该终端就可以直接显示该至少两个第二图像了。
示例性的,如图7所示的第一图像为杯子的预览图,在使用手机拍照的过程中,将该第一图像在第一景深中进行2个焦距的调节,得到了2个第二图像,如图8和9所示,手机显示这2个第二图像。其中,终端显示第二图像为图8所示时,图8中的上面一幅图是对第一个杯子(从左往右数)对焦得到的,图8中的下面一副是对第二个杯子对焦得到的;或者终端显示第二图像为图9所示时,图9中的上面一副是对第三个杯子对焦得到的,图9中的下面一副是对第四个杯子对焦得到的。
需要说明的是,由于终端进行一次拍摄时,可以显示出多张不同焦距的第二图像,因此,用户可以自己选择想要的效果的第二图像,达到自己想要的特效效果。
本发明实施例提供了一种对焦方法,当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;根据初始焦距和拍摄参数,确定拍摄该第一图像的第一景深范围;在第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。采用上述技术实现方案,由于终端可以在一次拍摄时,在能够正确对焦的范围内,同时实现多种焦距的拍摄,得到多种焦距的第二图像,完成对焦过程,因此,实现了快速对焦,并且操作非常简单,体现了对焦后图像类型的多样性。
如图10所示,本发明实施例提供了一种终端1,该终端1可以包括:
接收单元11,配置为接收对焦指令;
获取单元10,配置为当接收单元11接收到对焦指令时,采集单元18 通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数。
确定单元12,配置为根据所述获取单元10获取的所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围。
计算单元13,配置为在所述确定单元12确定的所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距。
对焦单元14,配置为根据所述计算单元13计算的所述至少两个第一焦距对所述第一图像进行对焦瞄准;
所述获取单元10,还配置为所述对焦单元14对焦后获取所述至少两个第一焦距对应的至少两个第二图像。
可选的,所述拍摄参数包括:初始物距和初始像距。
所述获取单元10,还配置为在所述确定单元12确定的所述第一景深范围内,通过调节所述拍摄马达的位置从而调节所述初始物距,获取调节后的至少两个第一物距。
所述计算单元13,具体配置为根据所述计算单元13计算的所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
可选的,基于图10,如图11所示,所述终端1还包括:检测单元15和移动单元16。
所述获取单元10,具体配置为获取当前相位差值。
所述检测单元15,配置为检测所述获取单元10获取的所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值范围。
所述移动单元16,配置为若所述检测单元15检测出所述当前相位差值不属于所述预设的相位差值范围,则将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;及在所述目标对焦范围内调节所述拍摄马 达的位置,以确定第一目标对焦位置,从而实现对焦。
所述获取单元10,还具体配置为根据所述移动单元16移动后得到的所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
可选的,所述移动单元16,还配置为所述检测单元15检测所述当前相位差值是否属于预设的相位差值范围之后,若所述检测单元15检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,从而实现对焦。
所述获取单元10,还具体配置为根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
可选的,基于图10,如图12所示,所述终端1还包括:显示单元17。
所述显示单元17,配置为所述获取单元10获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述获取单元10获取的所述至少两个第二图像。
可选的,本发明实施例中的终端可以为具有拍摄功能或设置有摄像头的电子设备,例如,手机、平板电脑或是照相机等。
如图13所示,在实际应用中,上述对焦单元14、获取单元10、确定单元12、计算单元13、检测单元15和移动单元16可由位于终端1上的处理器19实现,具体为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等实现,上述接收单元11可由终端1上的接收器110实现,采集单元18可由终端1上的摄像头111实现,显示单元17可由终端1上的显示器112实现,该终端1还可以包括存储器113,该存储器113可以通过***总线114与处理器19连接,其中,存储器113用于存储可执行程序代码,该程序代码包括计算机操作指令,存储器113可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至 少一个磁盘存储器。
对图13中的存储器113和处理器19进行说明。
存储器113,配置为存储可执行程序;
处理器19,配置为通过执行所述存储器113中存储的可执行程序时,实现以下操作:
当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
在一个实施例中,所述处理器19,还配置为通过执行所述存储器113中存储的可执行程序时,实现以下操作:
所述拍摄参数包括:初始物距和初始像距;
所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
在一个实施例中,所述处理器19,还配置为通过执行所述存储器113中存储的可执行程序时,实现以下操作:
获取当前相位差值;
检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
在一个实施例中,所述处理器19,还配置为通过执行所述存储器113中存储的可执行程序时,实现以下操作:
检测所述当前相位差值是否属于预设的相位差值范围之后,
若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
在一个实施例中,所述处理器19,还配置为通过执行所述存储器113中存储的可执行程序时,实现以下操作:
获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
本发明实施例还提供一种存储介质,例如可以实施为如图1所示的存储器160或如图13所示的存储器113,其中,存储有可执行程序,所述可执行程序被处理器执行时,实现以下操作:
当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景 深范围;
在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
在一个实施例中,所述可执行程序被处理器执行时,还实现以下操作:
所述拍摄参数包括:初始物距和初始像距;
所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
在一个实施例中,所述可执行程序被处理器执行时,还实现以下操作:
获取当前相位差值;
检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
在一个实施例中,所述可执行程序被处理器执行时,还实现以下操作:
所述检测所述当前相位差值是否属于预设的相位差值范围之后,
若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
在一个实施例中,所述可执行程序被处理器执行时,还实现以下操作:
获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
本发明实施例具有以下有益效果:
终端可以在一次拍摄时,在能够正确对焦的范围内,同时实现多种焦距的拍摄,得到多种焦距的第二图像,完成对焦过程,因此,实现了快速对焦,并且操作非常简单,体现了对焦后图像类型的多样性。
本领域内的技术人员应明白,本发明的实施例可提供为方法、***、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(***)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理 设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例公开了一种对焦方法及终端、存储介质;方法包括:当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;根据初始焦距和拍摄参数,确定拍摄该第一图像的第一景深范围;在第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;根据至少两个第一焦距对第一图像进行对焦瞄准,获取对焦后的至少两个第一焦距对应的至少两个第二图像。

Claims (20)

  1. 一种对焦方法,包括:
    当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
    根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
    在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
    根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
  2. 根据权利要求1所述的方法,其中,
    所述拍摄参数包括:初始物距和初始像距;
    所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
    在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
    根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
  3. 根据权利要求1所述的方法,其中,所述获取初始焦距,包括:
    获取当前相位差值;
    检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
    若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
    在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦 位置,基于所述第一目标对焦位置实现对焦;
    根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
  4. 根据权利要求3所述的方法,其中,所述检测所述当前相位差值是否属于预设的相位差值范围之后,所述方法还包括:
    若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
    根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
  5. 根据权利要求1所述的方法,其中,所述获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,所述方法还包括:
    显示所述至少两个第二图像。
  6. 一种终端,包括:
    接收单元,配置为接收对焦指令;
    获取单元,配置为当所述接收单元接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
    确定单元,配置为根据所述获取单元获取的所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
    计算单元,配置为在所述确定单元确定的所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
    对焦单元,配置为根据所述计算单元计算的所述至少两个第一焦距对所述第一图像进行对焦瞄准,
    所述获取单元,还配置为所述对焦单元对焦后获取所述至少两个第一焦距对应的至少两个第二图像。
  7. 根据权利要求6所述的终端,其中,所述拍摄参数包括:初始物距 和初始像距;
    所述获取单元,还配置为在所述确定单元确定的所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
    所述计算单元,具体配置为根据所述计算单元计算的所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
  8. 根据权利要求6所述的终端,其中,所述终端还包括:检测单元和移动单元;
    所述获取单元,具体配置为获取当前相位差值;
    所述检测单元,配置为检测所述获取单元获取的所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差的取值范围;
    所述移动单元,配置为若所述检测单元检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;在所述目标对焦范围内调节所述拍摄马达的位置,以确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
    所述获取单元,还具体配置为根据所述移动单元移动后得到的所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
  9. 根据权利要求8所述的终端,其中,
    所述移动单元,还配置为所述检测单元检测所述当前相位差值是否属于预设的相位差值范围之后,若所述检测单元检测出所述当前相位差值属于所述预设的相位差值范围,根据所述当前相位差值确定第二目标对焦位置,基于所述第二目标对焦位置实现对焦;
    所述获取单元,还具体配置为根据所述第二目标对焦位置,获取当前 第二焦距,并将所述当前第二焦距作为所述初始焦距。
  10. 根据权利要求6所述的终端,其中,所述终端还包括:
    显示单元,配置为所述获取单元获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述获取单元获取的所述至少两个第二图像。
  11. 一种终端,包括:
    存储器,配置为存储可执行程序;
    处理器,配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
    当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
    根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
    在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
    根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
  12. 根据权利要求11所述的终端,其中,
    所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
    所述拍摄参数包括:初始物距和初始像距;
    所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
    在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
    根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
  13. 根据权利要求11所述的终端,其中,
    所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
    获取当前相位差值;
    检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相位差值范围为触发终端实现相位对焦的相位差值的取值范围;
    若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
    在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
    根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
  14. 根据权利要求13所述的终端,其中,
    所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
    检测所述当前相位差值是否属于预设的相位差值范围之后,
    若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
    根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
  15. 根据权利要求11所述的终端,其中,
    所述处理器,还配置为通过执行所述存储器中存储的可执行程序时,实现以下操作:
    获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
  16. 一种存储介质,存储有可执行程序,所述可执行程序被处理器执行时,实现以下操作:
    当接收到对焦指令时,通过图像传感器采集第一图像,获取初始焦距和相机的拍摄参数;
    根据所述初始焦距和所述拍摄参数,确定拍摄所述第一图像的第一景深范围;
    在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距;
    根据所述至少两个第一焦距对所述第一图像进行对焦瞄准,获取对焦后的所述至少两个第一焦距对应的至少两个第二图像。
  17. 根据权利要求16所述的存储介质,其中,
    所述可执行程序被处理器执行时,还实现以下操作:
    所述拍摄参数包括:初始物距和初始像距;
    所述在所述第一景深范围内,通过调节拍摄马达的位置计算出至少两个第一焦距,包括:
    在所述第一景深范围内,通过调节所述拍摄马达的位置的方式,调节所述初始物距,获取调节后的至少两个第一物距;
    根据所述至少两个第一物距、所述初始像距和预设焦距模型,计算出所述至少两个第一焦距。
  18. 根据权利要求16所述的存储介质,其中,
    所述可执行程序被处理器执行时,还实现以下操作:
    获取当前相位差值;
    检测所述当前相位差值是否属于预设的相位差值范围,所述预设的相 位差值范围为触发终端实现相位对焦的相位差值的取值范围;
    若检测出所述当前相位差值不属于所述预设的相位差值范围,将所述拍摄马达移动至与所述当前相位差值对应的目标对焦范围内;
    在所述目标对焦范围内调节所述拍摄马达的位置,确定第一目标对焦位置,基于所述第一目标对焦位置实现对焦;
    根据所述第一目标对焦位置,获取当前第一焦距,并将所述当前第一焦距作为所述初始焦距。
  19. 根据权利要求18所述的存储介质,其中,
    所述可执行程序被处理器执行时,还实现以下操作:
    所述检测所述当前相位差值是否属于预设的相位差值范围之后,
    若检测出所述当前相位差值属于所述预设的相位差值范围,则根据所述当前相位差值确定第二目标对焦位置,基于第二目标对焦位置实现对焦;
    根据所述第二目标对焦位置,获取当前第二焦距,并将所述当前第二焦距作为所述初始焦距。
  20. 根据权利要求16所述的存储介质,其中,
    所述可执行程序被处理器执行时,还实现以下操作:
    获取对焦后的所述至少两个第一焦距对应的至少两个第二图像之后,显示所述至少两个第二图像。
PCT/CN2017/100533 2016-09-06 2017-09-05 一种对焦方法及终端、存储介质 WO2018045945A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610810527.XA CN106385534A (zh) 2016-09-06 2016-09-06 一种对焦方法及终端
CN201610810527.X 2016-09-06

Publications (1)

Publication Number Publication Date
WO2018045945A1 true WO2018045945A1 (zh) 2018-03-15

Family

ID=57939107

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/100533 WO2018045945A1 (zh) 2016-09-06 2017-09-05 一种对焦方法及终端、存储介质

Country Status (2)

Country Link
CN (1) CN106385534A (zh)
WO (1) WO2018045945A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110675458A (zh) * 2019-10-08 2020-01-10 Oppo广东移动通信有限公司 用于摄像头标定的方法、装置及存储介质
CN111753823A (zh) * 2019-09-10 2020-10-09 广东小天才科技有限公司 一种定焦扫描的方法及智能手表
CN111787224A (zh) * 2020-07-10 2020-10-16 深圳传音控股股份有限公司 图像的获取方法、终端设备和计算机可读存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106385534A (zh) * 2016-09-06 2017-02-08 努比亚技术有限公司 一种对焦方法及终端
CN110632734B (zh) * 2017-05-24 2021-09-14 Oppo广东移动通信有限公司 对焦方法及相关产品
CN107613200A (zh) * 2017-09-12 2018-01-19 努比亚技术有限公司 一种焦距调节方法、设备及计算机可读存储介质
CN111133746A (zh) * 2017-09-30 2020-05-08 深圳传音通讯有限公司 摄像对焦方法、移动终端及计算机可读存储介质
CN111277758B (zh) * 2020-02-25 2022-04-15 深圳传音控股股份有限公司 拍摄方法、终端及计算机可读存储介质
CN114125300B (zh) * 2021-11-29 2023-11-21 维沃移动通信有限公司 拍摄方法、拍摄装置、电子设备和可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1461968A (zh) * 2002-05-31 2003-12-17 金宝电子工业股份有限公司 配合景深的自动对焦方法
US20130114154A1 (en) * 2010-07-14 2013-05-09 Ilyong Lee Auto focus device and a method therefor
CN105007420A (zh) * 2015-07-14 2015-10-28 广东欧珀移动通信有限公司 一种对焦方法及移动终端
CN105282443A (zh) * 2015-10-13 2016-01-27 哈尔滨工程大学 一种全景深全景图像成像方法
CN106385534A (zh) * 2016-09-06 2017-02-08 努比亚技术有限公司 一种对焦方法及终端

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104601873B (zh) * 2013-10-30 2018-08-10 联咏科技股份有限公司 对焦方法
CN104202518A (zh) * 2014-08-25 2014-12-10 深圳市菲特数码技术有限公司 一体化摄像机的变焦方法及***

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1461968A (zh) * 2002-05-31 2003-12-17 金宝电子工业股份有限公司 配合景深的自动对焦方法
US20130114154A1 (en) * 2010-07-14 2013-05-09 Ilyong Lee Auto focus device and a method therefor
CN105007420A (zh) * 2015-07-14 2015-10-28 广东欧珀移动通信有限公司 一种对焦方法及移动终端
CN105282443A (zh) * 2015-10-13 2016-01-27 哈尔滨工程大学 一种全景深全景图像成像方法
CN106385534A (zh) * 2016-09-06 2017-02-08 努比亚技术有限公司 一种对焦方法及终端

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111753823A (zh) * 2019-09-10 2020-10-09 广东小天才科技有限公司 一种定焦扫描的方法及智能手表
CN110675458A (zh) * 2019-10-08 2020-01-10 Oppo广东移动通信有限公司 用于摄像头标定的方法、装置及存储介质
CN110675458B (zh) * 2019-10-08 2023-03-31 Oppo广东移动通信有限公司 用于摄像头标定的方法、装置及存储介质
CN111787224A (zh) * 2020-07-10 2020-10-16 深圳传音控股股份有限公司 图像的获取方法、终端设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN106385534A (zh) 2017-02-08

Similar Documents

Publication Publication Date Title
WO2018045945A1 (zh) 一种对焦方法及终端、存储介质
WO2018019122A1 (zh) 一种对焦方法、终端和计算机存储介质
CN106454121B (zh) 双摄像头拍照方法及装置
WO2017050115A1 (zh) 一种图像合成方法和装置
WO2018019124A1 (zh) 一种图像处理方法及电子设备、存储介质
CN106572303B (zh) 一种图片处理方法及终端
WO2017045650A1 (zh) 一种图片处理方法及终端
CN106909274B (zh) 一种图像显示方法和装置
WO2017020836A1 (zh) 一种虚化处理深度图像的装置和方法
CN106954020B (zh) 一种图像处理方法及终端
WO2018050014A1 (zh) 对焦方法及拍照设备、存储介质
CN107071263B (zh) 一种图像处理方法及终端
WO2017071476A1 (zh) 一种图像合成方法和装置、存储介质
CN106303273B (zh) 一种移动终端及其拍照控制方法
CN106911881B (zh) 一种基于双摄像头的动态照片拍摄装置、方法和终端
WO2017071475A1 (zh) 一种图像处理方法及终端、存储介质
WO2018019128A1 (zh) 一种夜景图像的处理方法和移动终端
CN106482641B (zh) 一种尺寸测量装置和方法
WO2018045961A1 (zh) 一种图片处理方法及终端、存储介质
CN106657782B (zh) 一种图片处理方法和终端
WO2017071532A1 (zh) 一种自拍合影的方法和装置
CN106851125B (zh) 一种移动终端及多重曝光拍摄方法
WO2017067523A1 (zh) 图像处理方法、装置及移动终端
WO2017210971A1 (zh) 一种基于移动终端的热成像方法、装置及移动终端
CN106534553B (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: 17848118

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.08.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17848118

Country of ref document: EP

Kind code of ref document: A1