[go: up one dir, main page]

WO2024169338A1 - Photographing method and electronic device - Google Patents

Photographing method and electronic device Download PDF

Info

Publication number
WO2024169338A1
WO2024169338A1 PCT/CN2023/136287 CN2023136287W WO2024169338A1 WO 2024169338 A1 WO2024169338 A1 WO 2024169338A1 CN 2023136287 W CN2023136287 W CN 2023136287W WO 2024169338 A1 WO2024169338 A1 WO 2024169338A1
Authority
WO
WIPO (PCT)
Prior art keywords
focus
frame
tracking
interface
face
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
Application number
PCT/CN2023/136287
Other languages
French (fr)
Chinese (zh)
Other versions
WO2024169338A9 (en
Inventor
易婕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2024169338A1 publication Critical patent/WO2024169338A1/en
Publication of WO2024169338A9 publication Critical patent/WO2024169338A9/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • 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/695Control of camera direction for changing a field of view, e.g. pan, tilt or based on tracking of objects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/52Details of telephonic subscriber devices including functional features of a camera

Definitions

  • the present application relates to the field of image processing technology, and in particular, to a photographing method and an electronic device.
  • the shooting function has become an essential function of smart terminals.
  • Users' demand and experience for shooting (photographing and/or shooting videos) of smart terminals are also increasing.
  • smart terminals can focus on faces when shooting.
  • the current focusing method is relatively simple, and the focus frame will automatically disappear after a few seconds, which is not a good shooting experience.
  • the present application provides a shooting method, an electronic device, a computer-readable storage medium and a computer program product, which can realize intelligent focus tracking and help improve the user's shooting experience.
  • a shooting method is provided, the method being applied to an electronic device, the method comprising:
  • a photographing mode or a video recording mode is entered.
  • a first interface is displayed, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.
  • a first focus tracking frame for example, a protagonist focus tracking frame
  • the above method can be executed by a terminal device or a chip in the terminal device. Based on the above scheme, it helps to improve the user's shooting experience.
  • the first focusing frame can be used to perform protagonist tracking (or continuous focusing) on the first focusing object.
  • the first focusing frame does not disappear after the preset time.
  • the first focusing frame is used to perform protagonist tracking on the first registered object, which means that when the first registered object moves in the picture, the first focusing frame moves with the first registered object.
  • the above-mentioned registration object may be a registered face. It is understandable that the registration object is not limited to a face, but may also be other objects, such as a cat, a dog, etc., depending on the user's choice or setting.
  • the registered face can be determined through image data in the gallery APP.
  • a preset number of faces with the highest appearance frequency in the album are automatically selected as registered faces.
  • the registered face may be manually selected by a user.
  • a preset number of faces in the album are added as registered faces. Users can decide which faces to register based on their needs, making smart focus tracking more in line with user expectations.
  • the first registered object when a single registered object is identified, the first registered object is the single registered object; or, when multiple registered objects are identified, the first registered object is a target object among the multiple registered objects that meets a preset condition. Whether it is a single-person shooting scene or a multi-person shooting scene, the embodiment of the present application can perform intelligent focus tracking when a registered object is identified.
  • the first interface also includes multiple second focus frames, and the multiple second focus frames are used to focus on the multiple registered objects except the first registered object, wherein the second focus frames are different in color from the first focus frames.
  • the first registered object is the object with the highest face ratio in the first interface among the multiple registered objects.
  • the first interface when an unregistered object is identified, the first interface further includes a conventional focus frame, the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after the preset time period;
  • the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration.
  • the first tracking focus frame is a double frame (i.e., including a main frame and a sub-frame).
  • the conventional focus frame is a single frame. Compared with a single frame, a double frame can better highlight the registered face or the protagonist's face, making it easier for the user to intuitively see the tracking focus object.
  • the embodiments of the present application are applicable to both the photo mode and the video recording mode, that is, intelligent focus tracking can be achieved regardless of photo taking or video recording, thereby improving the user experience.
  • the first interface is a photo preview interface, wherein the first operation is an operation of starting a camera application. Therefore, in the photo scene, intelligent focus tracking can be implemented.
  • the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode. Therefore, in the video recording scene, intelligent focus tracking can be implemented.
  • the method further includes:
  • a video recording interface is displayed, and the video recording interface includes the first registered object and the first focus frame.
  • the method further includes:
  • the first tracking focus frame is switched from the face frame to the body frame;
  • the first focus frame is switched from a human body frame to a face frame.
  • the first registered object can be continuously focused, and the first focusing frame can be switched based on the proportion of the face of the first registered object in the screen to achieve intelligent focusing.
  • the method further includes:
  • the first tracking focus frame During the continuous tracking focus process of the first registered object, if the first registered object cannot be recognized, the first tracking focus frame also disappears in the video recording interface, and the actually recognized face is tracked or focused;
  • the first focus frame continues to be displayed in the video recording interface.
  • the first registered object disappears and then recovers, the first registered object can continue to be intelligently tracked.
  • the method before displaying the first interface, the method further includes:
  • the embodiment of the present application allows the user to choose whether to turn on the "main character tracking focus” function. It should be noted that when turning on the "main character tracking focus” function, the "intelligent tracking focus” function needs to be turned on. The “intelligent tracking focus” function and the “main character tracking focus” function are linked. Generally speaking, in the embodiment of the present application, the "intelligent tracking focus” function is turned on by default.
  • a pop-up window can be used to prompt the user whether to turn on the "main character tracking focus". Since it is uncertain when the gallery can generate available portrait data, a pop-up window is set to prompt the user whether to turn on the "main character tracking focus" function, so that the user can know whether the "main character tracking focus” function can be turned on in a timely manner.
  • the “main character tracking focus” function is enabled, including:
  • the "main character tracking focus” function In response to a user clicking on a "main character tracking focus” option in a camera setting interface, the "main character tracking focus” function is turned on, wherein when it is detected that portrait data in a gallery has been generated, the “main character tracking focus” option is in an available state.
  • a first pop-up window is displayed on the camera preview interface, and the first pop-up window includes an option to turn on or off the "main character tracking focus" function;
  • the method further includes:
  • a first prompt box is displayed in the first interface, and the first prompt box is used to prompt the user that the main character has been identified and the focus has been tracked.
  • the main character label can be used to inform the user that the main character has been identified and the focus has been tracked.
  • the first prompt frame may move along with the main character tracking focus frame.
  • the first prompt frame may also move along with the main character tracking focus frame.
  • the first prompt box has a limited duration, for example, the first prompt box may automatically disappear after 3 seconds.
  • the first prompt box disappears immediately (or instantly).
  • the first prompt box is displayed only once in one shooting.
  • the method further includes:
  • the second interface includes a first focus control
  • the first focus control includes a third focus frame and a first icon
  • the first icon is used to adjust exposure
  • the third focus frame is used to focus on the target focus object
  • the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.
  • the method when focusing on the target focus object, the method further includes:
  • the exposure of the picture is adjusted accordingly.
  • the exposure can be adjusted by sliding the screen up and down. section, making it more convenient for users to operate.
  • the method further includes:
  • a second prompt box is displayed, where the second prompt box is used to prompt the user that the focus target has been locked.
  • the user can know whether the focus target is locked.
  • the target focus tracking object is a person, and in the process of continuously focusing on the target focus tracking object, the method further includes:
  • the face frame is converted into a body frame
  • the human body frame is still displayed.
  • the human body frame is still used to focus on the target object, which can avoid the problem of switching back and forth between the face frame and the human body frame.
  • an electronic device comprising a unit for executing the method in any implementation of the first aspect.
  • the electronic device may be a terminal or a chip in a terminal.
  • the electronic device comprises an input unit, a display unit and a processing unit.
  • the processing unit may be a processor
  • the input unit may be a communication interface
  • the display unit may be a graphics processing module and a screen
  • the terminal may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the terminal executes any one of the methods in the first aspect.
  • the processing unit may be a logic processing unit inside the chip, the input unit may be an input interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip;
  • the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods of the first aspect.
  • a computer-readable storage medium stores a computer program code.
  • the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect.
  • a computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect.
  • FIG1 is an example diagram of an application scenario of an embodiment of the present application.
  • FIG2 is a schematic diagram of the structure of an electronic device applicable to the present application.
  • FIG3 is an example diagram of a graphical user interface for setting items of the “Smart Focus Tracking” function
  • FIG4 is a schematic diagram of the interface for registering faces on the gallery discovery page
  • FIG5 is a schematic diagram of an interface for a user to select a registered face
  • FIG6 is a schematic diagram of an interface that prompts a user that the upper limit of registered faces has been exceeded
  • FIG7 is an example diagram of an interface for camera settings
  • FIG8 is an example of an interface that prompts the user whether to turn on “main character tracking focus” through a pop-up window
  • FIG9 is an example diagram of an interface that prompts the user through a prompt box that the main character has been identified for focus tracking;
  • FIG10 is a sample image of the camera preview interface after the “intelligent focus tracking” function is turned on;
  • FIG11 is an example diagram of an interface for a multi-person shooting scene in a camera mode
  • FIG12 is an example diagram of an interface in which multiple faces are recognized in a photo preview interface
  • FIG13 is an example diagram of an interface for performing intelligent focus tracking in video recording mode
  • FIG14 is an example diagram of an interface with human intervention in a single-person photo taking scenario
  • FIG15 is an example of an interface diagram showing human intervention in a multi-person photo shooting scenario when there is no registered face
  • FIG16 is an example diagram of an interface in a multi-person photo-taking scenario where human intervention occurs when a registered face is recognized;
  • FIG17 is an example of an interface diagram showing human intervention in the video recording mode
  • FIG18 is another example of an interface in which human intervention occurs in the video recording mode
  • FIG19 is an example diagram of the interface after the target focus object disappears
  • FIG20 is an example diagram of an interface for clicking on an identifiable target in a video recording scene
  • FIG21 is an example diagram of an interface for clicking on an unrecognizable target in a video recording scene
  • FIG22 is an example diagram of an interface for long pressing an unrecognizable object in a video recording scene
  • FIG23 is a schematic diagram of an interface for adjusting exposure by sliding the screen in a photo preview interface
  • FIG24 is a schematic diagram of an interface for adjusting exposure by sliding the screen during video recording
  • FIG25 is an example diagram of an interface showing changes in the focus frame when the face of the target focus object disappears
  • FIG. 26 is an example of an interface showing the change of the focus frame when the focus target is switched between near and far;
  • FIG27 is a schematic diagram of a double frame of face tracking focus frames of different sizes
  • FIG28 is a schematic diagram of a single frame of a face tracking focus frame of different sizes
  • FIG29 is a schematic diagram of human body tracking focus frames of different sizes provided in an embodiment of the present application.
  • FIG30 is a schematic flow chart of a photographing method provided in an embodiment of the present application.
  • FIG31 is a schematic diagram of a software architecture of an electronic device applicable to the present application.
  • FIG32 is a schematic block diagram of a photographing device suitable for an embodiment of the present application.
  • “plurality” may mean two or more than two.
  • the embodiments of the present application are applicable to electronic devices, which may be mobile phones, smart screens, tablet computers, wearable electronic devices, vehicle-mounted electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, and the like.
  • electronic devices may be mobile phones, smart screens, tablet computers, wearable electronic devices, vehicle-mounted electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, and the like.
  • the electronic device in the embodiment of the present application is equipped with an image collector (such as a camera).
  • an image collector such as a camera
  • the present application embodiment does not impose any restrictions on the specific type of electronic device.
  • the following takes the electronic device being a mobile phone as an example to describe the shooting method of the present application embodiment.
  • the key components of the mobile phone camera include an optical lens and an image sensor. After the camera is started, the sensor can output an image based on the image signal collected by the lens.
  • Figure 1 is an example diagram of an application scenario of an embodiment of the present application.
  • the interface can display multiple applications: Application 1, Application 2, ..., Application 7 and the camera application.
  • the user clicks the camera application and the mobile phone starts the camera.
  • the mobile phone interface displays the interface shown in (2) of Figure 1.
  • This interface can be called the camera shooting interface.
  • This shooting interface may include The viewfinder 11, zoom ratio 12 (default is 1x), album icon 13, shooting control 14 and camera rotation control etc.
  • the user can take a photo by clicking the shooting control 14.
  • the album icon 13 displays thumbnails.
  • the camera rotation control can be used to switch cameras.
  • the viewfinder 11 is used to obtain a preview image and can display the preview image in real time.
  • the phone supports digital zoom.
  • users can select different zoom ratios by operating on the touch screen.
  • the photo-taking scene in FIG1 is only a schematic illustration of an application scenario of the present application, and does not limit the embodiments of the present application.
  • the embodiments of the present application can also be applied to other scenes using cameras, such as video recording scenes, video call scenes, video live broadcast scenes, etc.
  • FIG. 1 shows an interface diagram of a user taking a photo with the mobile phone in portrait mode
  • the present application is not limited thereto.
  • the user can take a photo with the mobile phone in landscape mode.
  • FIG. 2 shows a hardware system of an electronic device suitable for the present application.
  • 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, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
  • the structure shown in FIG2 does not constitute a specific limitation on the electronic device 100.
  • the electronic device 100 may include more or fewer components than those shown in FIG2, or the electronic device 100 may include a combination of some of the components shown in FIG2, or the electronic device 100 may include sub-components of some of the components shown in FIG2.
  • the components shown in FIG2 may 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 at least one of the following processing units: an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU).
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated devices.
  • the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
  • the processor 110 may include one or more interfaces.
  • the processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit audio interface, a (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (general-purpose input/output, GPIO) interface, SIM interface, USB interface.
  • I2C inter-integrated circuit
  • I2S inter-integrated circuit sound
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous receiver/transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM interface USB interface
  • the electronic device 100 can realize the display function through the GPU, the display screen 194 and the application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 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 can be used to display images or videos.
  • the display screen 194 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED or a quantum dot light emitting diode (QLED).
  • the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
  • the display screen 194 can be used to display photos of MM at wonderful moments and selected short videos.
  • the electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
  • the ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
  • the ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters. In some embodiments, the ISP can be set in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV or other format.
  • the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
  • the processor 110 is configured to enter a photo taking mode or a video recording mode in response to a first operation of the user.
  • the display screen 194 is called to display a first interface, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.
  • a first focus tracking frame for example, a protagonist focus tracking frame
  • Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals.
  • the video codec is 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 various coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3 and MPEG4.
  • MPEG moving picture experts group
  • NPU is a processor that draws on the structure of biological neural networks, such as the transmission mode between neurons in the human brain to quickly process input information, and can also continuously self-learn. Through NPU, the electronic device 100 can realize intelligent cognition and other functions, such as image recognition, face recognition, voice recognition and text understanding.
  • the external memory interface 120 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the electronic device 100.
  • an external memory card such as a secure digital (SD) card
  • the internal memory 121 can be used to store computer executable program codes, which include instructions.
  • the internal memory 121 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, and an application required for at least one function (for example, a sound playback function and an image playback function).
  • the data storage area may store data created during the use of the electronic device 100 (for example, audio data and a phone book).
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as: at least one disk storage device, a flash memory device, and a universal flash storage (UFS).
  • the processor 110 executes various processing methods of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the electronic device 100 can implement audio functions, such as music playing and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor.
  • audio functions such as music playing and recording
  • the distance sensor 180F is used to measure the distance.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.
  • the fingerprint sensor 180H is used to collect fingerprints.
  • the electronic device 100 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking photos, and answering calls.
  • the touch sensor 180K is also called a touch control device.
  • the touch sensor 180K can be set on the display screen 194.
  • the touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch control screen.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K can also be set on the surface of the electronic device 100 and set at a different position from the display screen 194.
  • the key 190 includes a power key and a volume key.
  • the key 190 may be a mechanical key or a touch key.
  • the electronic device 100 may receive a key input signal and implement a function related to the key input signal.
  • This application will take the electronic device as a mobile phone, and install a camera application in the mobile phone as an example to introduce in detail the shooting method provided by this application.
  • the user can manually turn on or off the "intelligent focus tracking" provided in the embodiments of the present application.
  • the "intelligent focus tracking" can usually be turned on by default.
  • the electronic device can focus on the object recognized in the picture. If the subject in the picture is identified, the "focus tracking frame" will be displayed in the preview interface. The focus tracking frame will automatically track the subject in the picture, such as people, pets, etc., and will not disappear after a period of time. It should be noted that focus tracking can be understood as a dynamic process. For a certain subject in the picture, if the subject is the focus tracking object, then when the subject in the picture moves, the focus tracking frame will always follow the subject.
  • the regular focus frame can be understood as the focus frame in the current camera application, which only focuses on the face for a period of time and does not have the function of continuous focus tracking.
  • the embodiment of the present application can achieve continuous focus tracking on the subject in the picture.
  • FIG3 shows a graphical user interface (GUI) example of the “Smart Focus Tracking” function setting items.
  • the user can instruct the phone to open the camera application by touching a specific control on the phone screen, pressing a specific physical button or button combination, inputting a voice, performing an air gesture, etc.
  • the phone starts the camera and displays the shooting interface.
  • the screen display system of the mobile phone displays the currently output interface content, and the interface content displays multiple applications (applications, Apps).
  • the mobile phone displays the shooting interface shown in (2) of FIG3 .
  • the mobile phone when the mobile phone is in the lock screen state, the mobile phone responds to the user's gesture operation of sliding right (or left) on the mobile phone screen, and displays the shooting interface shown in (2) in Figure 3.
  • the mobile phone when the mobile phone is running other applications, the mobile phone opens the camera application to take pictures in response to the user clicking the corresponding control.
  • the mobile phone when the user is using an instant messaging application (such as WeChat application), the mobile phone opens the camera application in response to the user selecting the control of the camera function in the messaging application to take pictures and/or record videos.
  • the camera shooting interface generally includes a viewfinder 402, a setting control 403, a photo control, a video control, and other functional controls (such as a portrait mode control, a night scene mode control, a movie mode control, or more other controls).
  • the viewfinder 402 can display a photo preview interface; in the video mode, the viewfinder 402 can display a video preview interface.
  • the mobile phone In response to the user clicking on the setting control 403, the mobile phone displays the interface shown in FIG3 (3).
  • the interface shown in FIG3 (3) displays the option 404 of "Smart Focus Tracking".
  • Option 404 is used to turn on or off the "Smart Focus Tracking" function.
  • option 404 is in the off state.
  • the “Smart Focus Tracking” function is turned on, and the mobile phone displays the interface shown in FIG3 (4).
  • FIG3 (3) also shows a brief introduction to the "intelligent focus tracking" function for the user to understand, specifically: in the photo and video recording modes, it supports automatic recognition of people, cats, and dogs for automatic focus tracking. Click to lock the focus on any object.
  • the setting interface shown in (3) of Figure 3 can also display reference line setting items, level setting items, timer shooting switch controls, self-timer mirroring, automatic watermarking options, geographic location information recording options, shooting mute options, floating shutter button options, extended business controls, etc.
  • option 404 of “Smart Focus Tracking” is turned on.
  • the mobile phone will automatically and continuously focus on the subject in the picture when taking photos or recording videos.
  • the user can also manually turn off the “Smart Focus Tracking” function through option 404.
  • the embodiment of the present application also provides a "main character focus tracking” function.
  • the "main character focus tracking” option 405 and the “main character focus tracking” function introduction will appear in the interface, for example, the first five people who are frequently photographed in the "portraits" of the gallery will be identified and the focus tracking will be prioritized (effective when the portrait data meets the face recognition conditions).
  • the portrait data in the gallery has been generated, which can be understood as multiple registered faces have been determined.
  • the embodiment of the present application introduces "registered face" to describe the portrait data in the gallery.
  • a registered face refers to a face that an electronic device automatically focuses on through a focus frame.
  • the registered face can be predetermined.
  • the embodiment of the present application does not specifically limit the method for determining the registered face.
  • registered face is used as an example for description here, but the term can also be replaced by other names or terms, such as “focusing face”, “registered portrait”, “focusing portrait”, etc.
  • the description here is based on "registering a face" as an implementation method, and the embodiments of the present application are not limited to this.
  • the registered face can also be other registered objects, such as cats, dogs, and other objects.
  • the registered face can be determined through image data in the gallery APP.
  • a preset number of faces with the highest appearance frequency in the album are selected as registered faces.
  • the top five portraits that appear most frequently in the photo albums are used as registered faces according to their appearance frequencies.
  • FIG4 shows a schematic diagram of the interface for registering a face on the gallery discovery page.
  • the user can instruct the mobile phone to open the gallery application by touching a specific control on the mobile phone screen, pressing a specific physical key or key combination, inputting a voice, performing an air gesture, etc.
  • the gallery application is also called an album, photo, etc.
  • the mobile phone displays the photo interface.
  • the screen display system of the mobile phone displays the currently output interface content, and the interface content displays multiple application programs APP.
  • the mobile phone displays the interface shown in (2) of FIG4 .
  • the photo page is displayed in the gallery, where the photo page contains photos taken by the user (such as photos taken by the user today and photos taken by the user yesterday).
  • the gallery interface also includes albums, moments, and a discovery control 302.
  • the mobile phone displays the interface as shown in (3) of FIG4 .
  • the interface shown in (3) of FIG4 is the discovery page of the gallery.
  • the discovery page includes a portrait area 303.
  • portrait data in the gallery is displayed.
  • Figure 4 (3) shows four portraits.
  • the four portraits shown in (3) in Figure 4 are sorted from large to small according to the number of portraits that appear in the photo.
  • the dotted box shown in the portrait area 303 also includes a "more" control 304.
  • the mobile phone displays the interface shown in (4) in Figure 4.
  • the interface shown in (4) in Figure 4 is an example of a portrait page.
  • the portrait page can display the person that the mobile phone focuses on by default.
  • search bar shown in (3) in FIG. 4 One-click blockbuster control, free creation control, puzzle making control, micro-movie making control, honor editing control, community project, etc.
  • search bar is used to search for photos, people, places, etc.
  • One-click blockbuster control is used to generate videos.
  • Free creation control is used for users to make videos based on photos or edit and create photos.
  • Puzzle making control is used to perform editing operations such as splicing photos.
  • Micro-movie making control is used for users to make micro-movies.
  • Honor editing is used for users to edit photos or videos in the gallery.
  • Community project is used for users to enter the image community and share beautiful moments.
  • the dotted frame 306 is used to display the statistical data of the multiple portraits.
  • the statistical data of the multiple portraits displayed in the dotted frame 306 include the names of the portraits and the corresponding quantities.
  • the multiple portraits in the dotted frame 306 can be displayed in order from largest to smallest quantity.
  • the dotted frame 306 includes: a portrait named Dad (the corresponding number is 58), a portrait named Mom (the corresponding number is 53), a portrait named Sister (the corresponding number is 46), a portrait named Brother (the corresponding number is 45), and a portrait named Friends (the corresponding numbers are 42 and 30, respectively).
  • the name of each portrait is in the lower left corner of the portrait frame, and the number of times each portrait appears in the photo is in the lower right corner of the portrait frame.
  • the name of the portrait 307 is "Dad", and the number of times it appears in the photo is 58.
  • the first five registered faces automatically determined according to the number of photos may be: a portrait named Dad (corresponding to 58), a portrait named Mom (corresponding to 53), a portrait named Sister (corresponding to 46), a portrait named Brother (corresponding to 45), and a portrait named Friend (corresponding to 42). These five registered faces may be used as registered persons for automatic focus tracking by the mobile phone.
  • the portrait statistics shown in (4) of FIG. 4 are illustrated by taking photos of the "personal" category as an example, and the embodiments of the present application are not limited thereto.
  • the portrait interface shown in (4) of FIG. 4 also includes a "group photo" category. When the user clicks on the "group photo” category, the portrait statistics under the group photo category can be displayed in the interface.
  • the registered faces may be manually selected by the user.
  • a preset number of faces in the album may be added as registered faces based on the user's autonomous selection.
  • the user may decide which faces to register based on their needs, so that the smart focus tracking is more in line with the user's expectations.
  • the user can select one or more faces as registered faces, or cancel one or more faces as registered faces, by clicking.
  • FIG5 shows a schematic diagram of the interface for users to select registered faces on their own initiative.
  • the dotted box 306 shows the statistical data of each portrait.
  • the statistical data shown in FIG5 (1) is the same as the statistical data shown in FIG4 (4), and the relevant description can refer to the description at FIG4 (4).
  • the portrait 308 named "Sister” in FIG5 (1) as an example, when the user clicks on the portrait 308 named "Sister”, it means that the portrait is selected as the registered face, and the interface is shown in FIG5 (2).
  • a focus frame icon 309 appears in the upper right corner of the portrait 308, and a prompt box 310 is displayed in the interface, and the content in the prompt box 310 is "This person has been added for automatic focus tracking".
  • the focus frame icon 309 indicates that the portrait 308 has been selected as the registered face.
  • the focus frame icon 309 of the portrait 308 is different from the focus frame icons in other portrait frames. For example, the color of the line of the focus frame icon 309 is darker than that of the focus frame icon in the portrait 307.
  • FIG5 (3) shows an interface after selecting 5 portraits as registered faces.
  • the selected 5 portraits are: father, mother, sister, brother, and friend (the corresponding number is 42).
  • the user can also cancel a selected portrait by clicking.
  • the focus frame icon in the upper right corner of the portrait 311 changes, and its color is lighter than the focus frame icon in the upper right corner of the portrait 311 shown in Figure 5 (3).
  • a prompt box 312 will appear in the interface of Figure 5 (4), and the content of the prompt box 312 is "Automatic focus on this person has been canceled.”
  • the present embodiment of the application does not specifically limit the value of the preset number.
  • the number of registered faces can be set based on actual needs.
  • the preset number can be understood as the upper limit of the registered faces.
  • the electronic device will prompt the user through a pop-up window.
  • FIG6 shows a schematic diagram of an interface that prompts the user that the upper limit of the number of registered faces has been exceeded.
  • the following portraits in the dotted box 306 have been selected as registered faces, namely: a portrait named Dad (the corresponding number is 58), a portrait named Mom (the corresponding number is 53), a portrait named Sister (the corresponding number is 46), a portrait named Brother (the corresponding number is 45), and a portrait named Friend (the corresponding number is 42), that is, there are 5 portraits as registered faces.
  • a portrait named Dad the corresponding number is 58
  • a portrait named Mom the corresponding number is 53
  • a portrait named Sister the corresponding number is 46
  • a portrait named Brother the corresponding number is 45
  • a portrait named Friend the corresponding number is 42
  • a prompt box 314 appears in the interface, and the prompt box 314 is used to inform the user that the number of registered faces has reached the upper limit (for example, the upper limit is 5).
  • the content of the prompt box 314 is "Focus on the person, the upper limit can only be selected up to 5, and the selected person will be automatically focused when shooting with the camera.”
  • the prompt box 314 can also include an "OK" control, and when the user clicks the "OK" control, the prompt box 314 disappears.
  • the prompt box 314 shown in FIG6 is illustrated by taking the upper limit of 5 as an example, and the embodiment of the present application is not limited thereto.
  • the upper limit may be a number greater than 5 or a number less than 5.
  • FIG7 is an example of an interface diagram for camera settings.
  • FIG7 (1) shows an interface in which "Main Character Tracking" is unavailable, which is the same as the interface shown in FIG3 (4).
  • the interface is displayed as shown in FIG7 (2), and option 405 of "Main Character Tracking" in the setting interface is available.
  • the available state can also be understood as a non-grayed state, that is, the user can operate it.
  • the "main character tracking focus” option 405 shown in (2) of FIG. 7 can be clicked by the user.
  • the mobile phone turns on the "main character tracking focus” function, for example, displays the interface shown in (3) of FIG. 7 .
  • the "main character tracking focus” option 405 is turned on.
  • the user can click the "main character tracking focus” option to turn it off.
  • the electronic device can memorize the switch state of the "main character tracking focus” option operated by the user before. In this way, after the "smart tracking focus” option is turned on again, the "main character tracking focus” option can be automatically set using the memory operation. If the user previously set the "main character tracking focus” option to the on state, then the “main character tracking focus” option can be kept on; if the user previously set the "main character tracking focus” option to the off state, then the "main character tracking focus” option can be kept off.
  • a pop-up window can be used to prompt the user whether to turn on the "main character tracking focus". Since it is uncertain when the gallery can generate usable portrait data, a pop-up window is set to prompt the user whether to turn on the "main character tracking focus" function.
  • FIG8 shows an example of an interface that prompts the user whether to turn on the "main character tracking focus” function through a pop-up window.
  • the interface shown in FIG8 (1) is the same as that shown in FIG3 (1)
  • the interface shown in FIG8 (2) is the same as that shown in FIG3 (2).
  • the mobile phone recognizes that the gallery has generated usable portrait data
  • the interface is displayed as shown in FIG8 (3)
  • window 801 is displayed in the photo preview interface.
  • Window 801 is used to prompt the user whether to turn on the "main character tracking focus” function.
  • the content displayed in window 801 is: Do you want to turn on the "main character tracking focus” function? Identify the portraits that are often taken in the gallery and give priority to tracking focus.
  • the window 801 includes an on option and a cancel option.
  • the "main character tracking focus" function is turned on, and the state of the "main character tracking focus” option 405 in the setting interface is turned on, such as the interface shown in (4) of the interface Figure 8.
  • the interface shown in (4) of Figure 8 For how to enter the interface shown in (4) of Figure 8, please refer to the example of (2) in Figure 3 above, which will not be repeated here.
  • window 801 disappears and maintains the current state.
  • the status of the "main character tracking focus” option 405 is available, and the user can subsequently choose to turn on or off the "main character tracking focus” option 405.
  • the upper limit of the prompt can be a preset number of times, for example, 3 times. It can be understood that the preset number of times can also be other numbers, and 3 is used as an example here for illustration.
  • the window 801 also includes an option of "not prompting again".
  • the window 801 disappears and no prompt is given thereafter.
  • the main character tracking focus frame can be used for tracking focus, and the user is prompted through the first prompt frame that the main character tracking focus has been identified.
  • the main character refers to the single registered face
  • the main character refers to the face with the highest priority among the multiple registered faces, such as the face that appears most frequently or is closest to the camera.
  • the first prompt box may also have other names, for example, it may be called a protagonist label.
  • the first prompt frame may move along with the main character tracking focus frame.
  • the first prompt frame may also move along with the main character tracking focus frame.
  • the first prompt box has a limited duration.
  • the first prompt box automatically disappears after a preset duration.
  • the first prompt box may automatically disappear after 3 seconds.
  • the first prompt box disappears immediately (or instantly).
  • the first prompt box is displayed only once in a shooting. That is to say, for a certain shooting, when the first prompt box has appeared and automatically disappears after a preset time, the first prompt box will not appear again in this shooting. Only when the electronic device switches modes (for example, from photo mode to portrait mode) or the camera APP is switched to background operation, the first prompt box can be displayed again when the camera APP is entered next time and recognizes the protagonist again.
  • the first prompt box is displayed at most 3 times.
  • the subject tracking focus frame in the embodiment of the present application is different from the conventional focus frame.
  • the subject tracking focus frame is different from the conventional focus frame in at least one or more of the following: (1) the subject tracking focus frame is different in color from the conventional focus frame; (2) the subject tracking focus frame is different in frame type from the conventional focus frame; (3) the subject tracking focus frame is different in frame line thickness from the conventional focus frame.
  • the conventional focus frame is a white tracking focus frame;
  • the main character tracking focus frame is a tracking focus frame of a color other than white, such as yellow.
  • the conventional focus frame only includes a main frame, or the conventional focus frame is a single frame;
  • the main character tracking focus frame includes a main frame and a sub-frame, or the main character tracking focus frame is a double frame.
  • FIG. 9 shows an example of an interface that prompts the user through a prompt box that the main character has been identified and the focus is being tracked.
  • the interfaces shown in FIG. 9 (1) to FIG. 9 (3) are respectively the same as the interfaces shown in FIG. 8 (1) to FIG. 8 (3), and the relevant description can be referred to in the previous text.
  • FIG. 9 (2) assuming that face A is identified in the viewfinder 402, since the "main character focus tracking" function has not been turned on at this time, the identified face A is focused using the conventional focus frame 901.
  • the mobile phone responds to the user clicking the turn-on option in window 801 and turns on the "main character focus tracking" function. At this time, the mobile phone will identify face A in the photo preview interface. If face A is identified as a registered face and is the main character, the mobile phone displays the interface shown in FIG. 9 (4).
  • the mobile phone uses the main character tracking focus frame 902 to track the face A, and prompts the user through the prompt box 802 that the main character tracking focus has been identified.
  • the content in the prompt box 802 is: "The main character tracking focus" has been identified.
  • the prompt box 802 may disappear automatically.
  • the prompt box 802 is no longer displayed in the interface, and the main character tracking focus frame 902 continues to automatically track the face A.
  • FIG9 is illustrated by taking the recognition of a single registered face A as an example, and the present application embodiment is not limited thereto. For example, if multiple registered faces are recognized, one of the multiple registered faces will be selected as the protagonist for continuous tracking.
  • the conventional tracking focus frame 901 shown in FIG. 9 (2) is conventionally displayed and includes only the main frame; while the protagonist tracking focus frame 902 shown in FIG. 9 (4) or FIG. 9 (5) can be highlighted and includes the main frame and the sub-frame. It should be understood that the protagonist tracking focus frame 902 shown in FIG. 9 (4) or FIG. 9 (5) can be yellow or other highlighted colors in a specific implementation to distinguish it from the conventional focus frame.
  • the protagonist tracking focus frame shown in the embodiment of the present application is only an example.
  • the electronic device When “Smart Focus Tracking” and “Main Subject Focus Tracking” are turned on, when the user uses the camera to shoot, the electronic device will automatically identify whether the subject is a registered face. If a registered face is recognized, the electronic device will focus on the registered face.
  • Figure 10 shows an example of the camera preview interface after turning on the "Smart Focus Tracking" and "Main Character Focus Tracking" functions.
  • face A is recognized in the camera preview interface, and face A is not a registered face.
  • the tracking focus frame for face A is a regular focus frame 901.
  • Regular focus frame 901 will automatically disappear after a period of time (for example, 5 seconds).
  • Regular focus frame 901 is usually displayed in white in the preview interface.
  • the focus frame for face B is the main focus frame (or first focus frame) proposed in this application.
  • (2) in FIG. 10 is described by taking a photo scene of a single registered face as an example.
  • the preview interface displays face B and main focus frame 902.
  • Main focus frame 902 is used to perform main focus (or continuous focus) on face B.
  • the main character tracking focus frame 902 when face B moves, the main character tracking focus frame 902 will also move with face B. For example, when face B moves, in the picture frame shown in (2) of FIG. 10 and the picture frame shown in (3) of FIG. 10 , the main character tracking focus frame 902 always moves with face B. Moreover, the size of the main character tracking focus frame will also change as face B moves.
  • the conventional tracking focus frame shown in FIG. 10 (1) is a conventional display and includes only a main frame; while the main character tracking focus frame shown in FIG. 10 (2) or FIG. 10 (3) is highlighted and includes a main frame and a sub-frame. It should be understood that the main character tracking focus frame shown in FIG. 10 (2) or FIG. 10 (3) can be yellow or other highlighted colors in a specific implementation to distinguish it from the conventional focus frame.
  • the main character tracking focus frame 902 shown in FIG. 10 (2) or FIG. 10 (3) is only an example.
  • the interface examples shown in (2) or (3) of FIG. 10 are all for shooting scenes with a single registered face. For shooting scenes with multiple people, the embodiments of the present application are still applicable.
  • a multi-person shooting scene means that there may be multiple subjects when shooting. For multiple subjects, if no registered face is recognized among the multiple subjects, that is, the multiple subjects are all non-registered faces, then the focus tracking frame for each non-registered face is a regular focus frame; if the multiple subjects are all registered faces, that is, there are multiple registered faces, then the multiple registered faces will be sorted according to priority, and the protagonist focus tracking frame will be used for the registered face with the highest priority, and the non-protagonist focus tracking frame (second focus tracking frame) will be used for the registered faces other than the registered face with the highest priority.
  • the main character tracking focus frame and the non-main character tracking focus frame can both be considered as registered tracking focus frames, that is, tracking focus frames for registered faces.
  • the difference between the non-main character tracking focus frame and the main character tracking focus frame is that the two have different colors.
  • the main character tracking focus frame will be highlighted in the interface to highlight the main character portrait. For example, the main character tracking focus frame line is yellow, and the non-main character tracking focus frame is white.
  • the non-protagonist tracking focus frame has the same frame type as the protagonist tracking focus frame, that is, the non-protagonist tracking focus frame includes a main frame and a sub-frame.
  • the conventional tracking focus frame is a single frame. Therefore, from the perspective of frame type, the non-protagonist tracking focus frame is different from the conventional tracking focus frame.
  • FIG. 11 shows an example interface diagram of a multi-person shooting scene in the photo mode.
  • face A, face B, face C, and face D appear in the photo preview interface
  • the mobile phone recognizes that face A is an unregistered face, and faces B, face C, and face D are all registered faces, and face B is the face closest to the camera among multiple registered faces (such as face B, face C, and face D)
  • a conventional focus frame 901 is used for face A
  • the tracking focus frame for face B is the protagonist tracking focus frame 902 (or the first tracking focus frame) proposed in this application
  • the tracking focus frames for faces C and face D are the non-protagonist tracking focus frames 903 proposed in this application.
  • the protagonist frame 902 and the non-protagonist tracking focus frame 903 are both composed of a main frame and a sub-frame. The difference is that the protagonist frame 902 is highlighted compared to the non-protagonist tracking focus frame 903 to highlight the protagonist portrait.
  • the regular focus frame 901 for face A disappears automatically. For example, after 5 seconds, the interface is displayed as shown in (2) in Figure 11.
  • the regular focus frame 901 for face A disappears, while the main character tracking focus frame 902 for face B and the non-main character tracking focus frames 903 for faces C and D do not disappear.
  • the order of faces approaching the camera in the picture changes, and face C becomes one of the multiple registered faces.
  • face C is used as the subject focus frame
  • the tracking focus frame of face B is switched to the non-subject tracking focus frame.
  • the tracking focus frame for face C is the subject tracking focus frame 902 (or the first tracking focus frame) proposed in this application
  • the tracking focus frames for faces B and D are the non-subject tracking focus frames 903.
  • the shooting scenes change, shooting scenes with a large number of faces may be involved.
  • a maximum of a first number of objects in the picture are automatically identified for focus and/or tracking, and a maximum of a second number of registered faces are identified for tracking.
  • the first number is the sum of the number of faces tracked through the tracking focus frame and the number of objects focused through the regular focus frame.
  • the upper limit of the sum of the number of faces tracked through the tracking focus frame and the number of objects focused through the regular focus frame is the first number
  • the upper limit of the number of faces tracked through the tracking focus frame is the second number.
  • the second number is less than or equal to the first number. For example, the first number is 10 and the second number is 5.
  • the photo preview interface when taking a photo, includes face A, face B, face C, face D, face E, face F, pet K, pet H, face I, face G, and face J, and face F, face I, face G, pet K, and pet H are recognized as unregistered faces, so conventional focus frames are used for face F, face I, face G, pet G, and pet H; and, face A, face B, face C, face D, and face E are recognized as registered faces, and face B is the registered face closest to the lens among the five registered faces, so the protagonist tracking focus frame 902 is used for face B, and the non-protagonist tracking focus frame 903 is used for face A, face C, face D, and face E. Due to the limitation of quantity, face J is not focused on with a focus frame or a tracking focus frame.
  • the objects focused on by the conventional focus frame 901 are: face F, face I, face G, pet K and pet H
  • the objects focused on by the tracking focus frame are: face A, face B, face C, face D and face E, that is, the total number (or the first number) is 10, and the second number is 5.
  • FIG12 is only for ease of understanding, and the embodiments of the present application are not limited thereto.
  • FIG12 may include more human faces.
  • FIG13 shows an example of an interface for performing intelligent focus tracking in the video recording mode.
  • a conventional focus frame 901 will be displayed in the photo preview interface to focus on face A. If the user clicks on the video recording mode, the camera switches to the video recording preview interface, and the interface is shown in FIG13 (2).
  • the main character tracking focus frame 902 is used to track the focus on face B.
  • face A is also recognized in the video preview interface and face A is a non-registered face
  • the conventional focus frame 901 is used to focus on the non-registered face.
  • the non-main character tracking focus frame 903 is used in the video preview interface to track the focus on other registered faces (such as face C and face D).
  • the interface also includes a control 1201 for starting video recording.
  • the control 1201 for starting video recording.
  • the mobile phone starts recording the video.
  • the interface is displayed as shown in (3) of FIG. 13 .
  • the interface includes a photo control 1202, a stop control 1203, and a pause control 1204. If the user clicks the stop control 1203, the recording can be ended; if the user clicks the control 1202, a manual snapshot can be taken during the video recording; if the user clicks the pause control 1204, the recording can be paused.
  • the interface displays the recording screen at the 5th second.
  • a main character tracking focus frame 902 is displayed for the recognized registered face B. That is, when the video recording starts, the main character tracking focus frame 902 is displayed in the video preview interface, and the registered face B is continuously tracked.
  • the regular focus frame 901 disappears immediately when the video recording starts;
  • a non-main character tracking focus frame 903 is displayed in the video preview interface, the non-main character tracking focus frames 903 for other registered faces (such as face C and face D) will also disappear immediately when the video recording starts.
  • the single registered face When starting to record a video, if a single registered face is recognized, the single registered face will be continuously tracked in the recording screen. For example, as shown in (4) in FIG. 13 , the interface shows the recording screen at the 12th second. In the recording screen at the 12th second, the registered face B can still be recognized, so the main character tracking focus frame 902 is still used to continuously track the registered face B.
  • the interface shows the recording screen at the 20th second.
  • the registered face B is lost and the unregistered face A appears in the lens.
  • the conventional focus frame 901 will still be used to focus on the unregistered face A.
  • the main character tracking focus frame 902 will not be used to track the registered face B when the registered face B is restored.
  • the interface displays the recording image at the 24th second. In the recording image at the 24th second, the registered face B appears in the camera image again, and at this time, the main character tracking focus frame 902 is used to continuously track the registered face B.
  • the preset time for example, the preset time can be 30 seconds
  • another registered face such as registered face D
  • the registered face will no longer be tracked based on the priority of the registered face, and the registered face will be tracked based on the priority of the registered face. For example, if registered face D is closer to the front than registered face B, registered face D will be tracked using the main character tracking focus frame.
  • the above describes the relevant embodiments of focusing when there is no human intervention in the photo or video mode.
  • the following describes the relevant embodiments of focusing when there is human intervention.
  • Human intervention refers to the user actively clicking on a certain area or object in the interface to select the object to be focused.
  • the interface includes but is not limited to the photo preview interface, the video preview interface or the video recording interface (i.e., the screen during the video recording process).
  • the electronic device When there is no human intervention in the interface, the electronic device automatically identifies the subject of the shooting and performs tracking focus. As mentioned above, if the registered face is not recognized, the conventional focus frame is used to track the face. If a registered face is recognized, the registered tracking focus frame is used for tracking focus, specifically including: if it is a single registered face, the protagonist tracking focus frame is used for tracking focus; if multiple registered faces are recognized, the protagonist tracking focus frame is used for tracking focus for the registered face with the highest priority, and the non-protagonist tracking focus frame is used for tracking focus for other registered faces except the registered face with the highest priority.
  • the electronic device when there is human intervention in the interface, for example, the user actively clicks on a face in the photo preview interface or the video preview interface, the electronic device will take the person or object selected by the user as the object to be focused, without considering the factor of the registered face.
  • the electronic device receives a second operation from the user, where the second operation is used to select a target focus object; when the target focus object is a recognizable target, a first focus control is displayed in the second interface (photo preview interface, video preview interface, or video recording interface), where the first focus control includes a third focus frame and a first icon, where the first icon is used to adjust exposure, and the third focus frame is used to focus on the target focus object; when the target focus object is an unrecognizable target, a second focus control is displayed in the second interface (photo preview interface, video preview interface, or video recording interface), where the second focus control includes a fourth focus frame and a second icon, and the second icon The icon is used to adjust the exposure, the fourth focus frame is used to focus on the target focus object, the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.
  • the target focus object can be a person or an object, or a picture of a certain area, and the embodiments of the present application do not specifically limit this.
  • the second operation may be a click operation or a long press operation.
  • the method further includes: determining whether the target focus object is a recognizable target. That is, after receiving the second operation of the user, the electronic device may first determine whether the object selected by the user to focus is a recognizable target. If it is a recognizable target, the first focus control is displayed in the interface, that is, the recognizable target is locked using the first focus control; if it is an unrecognizable target, the second focus control is displayed in the interface.
  • the method also includes: receiving a third operation of the user; in response to the third operation of the user, not displaying the second focus control and continuing focus tracking.
  • the first focus control and the second focus control have different colors.
  • the target focus object may be a face selected by a user.
  • the first icon is a small sun icon. It can be understood that the small sun icon is only an example description, and in fact it can be replaced by other icons indicating the exposure amount, and the embodiments of the present application are not limited thereto.
  • FIG14 shows an example of an interface with human intervention in a single-person photo scene.
  • a conventional focus frame 901 is used to focus on the unregistered face A.
  • the user can actively click on face A to set face A as the target focus object.
  • the interface is displayed as shown in (2) in Figure 14.
  • the highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above.
  • FIG15 shows an example of an interface diagram of human intervention in a multi-person photo scene when there is no registered face.
  • the conventional focus frame 901 is used to focus on the unregistered face A
  • the conventional focus frame 901 is used to focus on the unregistered face B.
  • the user can actively click on face A to set face A as the target focus object.
  • the mobile phone displays the interface as shown in FIG15 (2).
  • a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are displayed for face A.
  • the highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above, and the regular focus frame 901 of face B disappears.
  • FIG16 shows an example of a human intervention interface in a multi-person photo scene when a registered face is recognized.
  • the non-registered face A is focused using the conventional focus frame 901
  • the registered face B is focused using the main focus frame 902
  • the registered face C is focused using the non-main focus frame 903. Focus tracking.
  • the user can actively click on face C to set face C as the target focus tracking object.
  • the interface is shown in (2) of FIG16.
  • a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are displayed for face C.
  • the highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above, and the regular focus frame 901 of face A and the main focus frame 902 of face B both disappear.
  • FIG. 17 is an example of an interface diagram in which human intervention exists in the video recording mode.
  • FIG. 17 (1) shows that the video recording preview interface includes an unregistered face A and a registered face B.
  • the unregistered face A is focused using a conventional focus frame 901
  • the registered face B is focused using a main character tracking focus frame 902.
  • the mobile phone will focus on the unregistered face A, that is, face A is the target tracking object.
  • the interface display is as shown in FIG. 17 (2).
  • the video preview interface also includes a control 1601 for starting video recording.
  • the mobile phone displays a recording interface as shown in FIG. 17 (3).
  • the recording interface For example, in the 5th second screen, only the focus frame 904 of the non-registered face A is displayed, and the small sun icon 905 disappears.
  • the non-registered face A is the focus lock target.
  • the method further includes: displaying a second prompt frame, wherein the second prompt frame is used to prompt the user that the focus target has been locked.
  • the second prompt box may automatically disappear after a preset time, for example, the second prompt box may automatically disappear after 3 seconds.
  • Figure 18 shows another example of an interface with human intervention in the video recording mode.
  • Figure 18 (1) shows that the video recording preview interface includes an unregistered face A and a registered face B.
  • the unregistered face A is focused using a conventional focus frame 901
  • the registered face B is focused using a main character tracking focus frame 902.
  • the mobile phone In response to the user's operation of adjusting the shooting angle, the mobile phone displays a video preview interface as shown in FIG18 (2).
  • the video preview interface after adjusting the shooting angle includes an unregistered face C, wherein the unregistered face C is focused using a conventional focus frame 901.
  • the mobile phone In response to the user's operation of manually clicking on the unregistered face C, the mobile phone will focus on the unregistered face C, and the unregistered face C is now the target focus object.
  • the interface is shown in (3) of FIG. 18 , where the video preview interface displays a highlighted focus frame 904 (corresponding to the third focus frame) of the target focus object C, and a prompt frame 920 (corresponding to the second prompt frame).
  • the content in prompt frame 920 is “Focus locked”. Prompt frame 920 may automatically disappear after 3 seconds.
  • the interface is shown in (4) of FIG. 18 .
  • the prompt box 920 has disappeared from the interface, and the highlight tracking frame 904 will continue to follow the target tracking object C.
  • the highlight tracking frame 904 will continue to move with the target tracking object C.
  • a small sun icon (not shown in the figure) may also be displayed simultaneously with the display of the highlight focus frame 904, and the small sun icon may automatically disappear after a period of time.
  • FIG19 shows an example of an interface after the target focus object (or locked target) disappears.
  • the interface shows the 5th second of the video recording, and the target face A locked by the user is shown in the screen (for example, the target focus object A shown in FIG17 (3)), and the locked target A is focused using the focus frame 904.
  • FIG. 19 (2) shows the picture at the 12th second of the video recording, when the locked target A is lost, and the focus tracking frame for the locked target A in the interface also disappears accordingly.
  • the focus tracking frame is still used to lock and focus the registered face B; if the preset time is exceeded, the target will not be focused on when the target is restored.
  • FIG19 (3) shows the image at the 20th second of the video recording, and the target A appears again.
  • the focus tracking frame 904 appears again in the interface to focus on the target A.
  • FIG20 is an example of an interface for clicking on a recognizable target in a video recording scene.
  • the video preview interface includes an unregistered face A and a registered face B.
  • the unregistered face A is focused using a conventional focus frame 901
  • the registered face B is focused using a main character tracking focus frame 902.
  • the start video recording control 1801 the mobile phone starts recording.
  • the interface is shown in FIG20 (2). In the 5th second recording screen, only the main character tracking focus frame 902 for the registered face B is displayed in the video recording interface.
  • object C As the object being filmed changes, other objects may appear in the video recording interface. For example, as shown in (3) of FIG. 20, in the 12th second recording screen, object C appears in the screen, and the user clicks on object C. If object C is a recognizable target (for example, object C is a ball), object C will be focused on as a locked target. For example, in response to the user clicking on object C, the mobile phone displays an interface as shown in (4) of FIG. 20. As shown in (4) of FIG. 20, a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are used for object C, and other focus frames disappear, that is, the main focus frame 902 of the registered face B disappears.
  • a highlight focus frame 904 corresponding to the third focus frame
  • a small sun icon 905 corresponding to the first icon
  • the highlight focus frame also moves accordingly.
  • the interface is shown in (5) of FIG. 20.
  • the highlight focus frame 904 of object C is displayed, the small sun icon 905 disappears, and other focus frames also disappear, that is, object C is used as a locked focus target.
  • FIG. 21 is an example of the interface for clicking on an unrecognizable target in a video recording scene.
  • the registered face B is displayed in the interface, and the main character tracking focus frame 902 is used to track the registered face B.
  • the user clicks on the first area in the recording screen the first area is a blank background of the screen (i.e., there is no object or person to be locked), and the mobile phone determines that the first area is an unrecognizable target, then the interface is displayed as shown in (2) in FIG. 21 .
  • the non-highlighted tracking focus frame 906 (corresponding to the fourth tracking focus frame) and the small sun icon 907 (corresponding to the second icon), and the other tracking focus frames disappear, that is, the main character tracking focus frame 902 of the registered face B disappears.
  • the focus can continue to be tracked on face B.
  • the interface display is shown in (3) of Figure 21.
  • the registered face B is displayed again in the interface.
  • the main character focus frame 902 is used to track the registered face B, and the non-highlight focus frame 906 and the small sun icon 907 for the first area disappear.
  • the embodiment of the present application does not specifically limit the method of adjusting the exposure.
  • the exposure can be adjusted by adjusting the small sun icon 907.
  • the exposure can also be adjusted by sliding the screen up and down.
  • Figure 22 is an example of the interface for long pressing an unrecognizable target in a video recording scene.
  • the interface displays the registered face B, and the main character tracking focus frame 902 is used to track the registered face B.
  • the user long presses the first area in the recorded screen, the first area is the screen background, and the mobile phone determines that the first area is an unrecognizable target, then the interface is displayed as shown in (2) in Figure 22.
  • a non-highlighted focus frame 906 (corresponding to the fourth focus frame) and a small sun icon 907 (corresponding to the second icon) are displayed in the first area, and other focus frames disappear (that is, the focus frame 902 of the protagonist of the registered face B disappears), and “Exposure and focus are locked” is displayed on the screen.
  • the focus lock state of the first area can be released.
  • the mobile phone responds to the user clicking on a certain area in the screen again, and focuses on the area clicked by the user again.
  • the highlighted focus frame 904 and the small sun icon 905 are displayed in the area clicked by the user, and the non-highlighted focus frame 906 and the small sun icon 907 for the first area disappear.
  • the automatic focus tracking will be restored.
  • the automatic focus tracking is performed again on the registered face B in the recording screen.
  • the area of the screen that the user clicks or long presses may contain an object or a face, or it may be the background of the screen, and the background of the screen does not contain a recognizable object.
  • the operation of the user clicking or long pressing the area of the screen can be understood as the object or person that the user wants to select for focus tracking.
  • the method when focusing on the target focusing object, the method further includes: receiving an operation of sliding the screen by the user; and adjusting the exposure of the picture accordingly in response to the operation of sliding the screen.
  • the user sliding the screen includes sliding the screen upward or downward.
  • the exposure of the picture is increased; when the user slides the screen downward, the exposure of the picture is reduced.
  • the exposure of the picture can be adjusted by sliding the screen.
  • the purpose of this setting is that during the focus tracking process, the first focus tracking control (including the third focus tracking frame and the first icon) will move with the target focus tracking object. At this time, it is inconvenient to click the first icon (such as the small sun icon) to adjust the exposure. Therefore, by introducing the operation of sliding the screen to adjust the exposure, the user's exposure adjustment operation experience can be effectively improved. For a moving focus tracking object, this adjustment method by sliding the screen will have a better experience than adjusting the exposure by adjusting the small sun icon.
  • a first guidance may be provided, prompting the user to slide the screen up and down to adjust the exposure.
  • a prompt may be provided, and the prompt content "Slide up and down to adjust the exposure" may be displayed in the interface.
  • the prompt content may disappear automatically after 3 seconds.
  • the user when adjusting the exposure for the first time, can be guided by an exposure adjustment prompt box.
  • an exposure adjustment prompt box For example, after the user selects the target tracking object and a small sun icon appears on the screen, the phone can also display an exposure adjustment prompt box on the screen to inform the user that they can slide the screen up and down to adjust the exposure.
  • the exposure adjustment prompt box may automatically disappear after a period of time, for example, 3 seconds.
  • Figure 23 shows a schematic diagram of the interface for adjusting exposure by sliding the screen in the photo preview interface.
  • a highlighted focus frame 904 is used to focus on the object selected by the user, and a small sun icon 905 is also displayed for adjusting exposure.
  • the content in the dotted box 2301 in the interface of (2) in FIG. 23 can be used to guide the user on how to adjust the exposure.
  • the dotted box 2301 includes an upward or downward arrow and a prompt text "Slide up and down to adjust the exposure".
  • the content in the dotted box 2301 may automatically disappear after 3 seconds.
  • the content in the dashed box 2301 can be highlighted for user viewing.
  • the user can slide the screen downward to adjust the exposure.
  • the interface shown in FIG. 23 (4) is displayed, and an exposure bar 908 appears in the interface.
  • the exposure is adjusted to -0.5 by sliding the screen downward.
  • the user releases the screen, the exposure bar 908 disappears, and the interface shown in FIG. 23 (5) is displayed.
  • the mobile phone continues to lock and focus on the object 904.
  • FIG. 24 is a schematic diagram showing an interface for adjusting exposure by sliding the screen during video recording.
  • the object selected by the user (such as the sphere shown in the figure) is focused using a highlight focus frame 904, and a small sun icon 905 is also displayed for adjusting the exposure. Since the selected sphere will move during the recording process, the highlight focus frame 904 and the small sun icon 905 will also shift with the moving sphere. Therefore, it is not very convenient to adjust the exposure by clicking the small sun icon 905. For this reason, the embodiment of the present application can adjust the exposure by sliding the screen up and down.
  • FIG24 (2) When the user slides the screen downward, the interface is shown as shown in FIG24 (2).
  • an exposure bar 908 appears in the interface.
  • the exposure is adjusted to -0.5 by sliding the screen downward.
  • the exposure bar 908 disappears, and the interface is shown as shown in FIG24 (3).
  • the mobile phone continues to lock the object with a highlighted focus frame 904, and a small sun icon 905 is also displayed for adjusting the exposure.
  • the focus object actively selected by the user may move.
  • the target focus object is a person
  • the face frame or face frame
  • the human frame is still displayed.
  • the human body frame is still used to track the target object, which can avoid the problem of switching back and forth between the face frame and the human body frame.
  • Figure 25 shows an example of an interface showing the focus frame changes when the face of the target focus object disappears.
  • the main focus frame 902 is used for focus tracking on the registered face B
  • the conventional focus frame 901 is used for focus tracking on the non-registered face A.
  • the interface is displayed as shown in FIG25 (2), and the mobile phone uses a highlight focus frame 2302 to track face A, that is, face A is taken as the target tracking object or locked target.
  • the highlight focus frame 2302 is a face tracking focus frame (referred to as face frame).
  • (2) in FIG. 25 also includes a video recording control 2301. After the user clicks the start video recording control 2301, the mobile phone starts recording, and the interface is displayed as shown in (3) in FIG. 25.
  • a highlight focus frame 2302 is used to continuously focus on face A.
  • the mobile phone may not be able to recognize the face of the locked target, but can recognize the human body.
  • the face frame can be converted to the human body frame to continue tracking.
  • the face tracking focus frame 2302 for face A will be converted to the human body tracking focus frame 2303 (referred to as the human body frame).
  • the human body frame 2303 is still used for tracking. The advantage of this is that it can avoid the problem of switching back and forth between the face frame and the human body frame, thereby reducing interference to the user and improving the shooting experience.
  • the focus target may refer to the first registered object, or the protagonist
  • the first focus frame is switched from a face frame to a body frame; if it is recognized that the face of the focus target occupies a greater proportion than or equal to the first threshold on the screen, the first focus frame is switched from a body frame to a face frame.
  • the embodiment of the present application does not specifically limit the value of the first threshold, and the first threshold can be set based on actual needs.
  • a facial recognition algorithm can be used to accurately identify the user's facial features.
  • a skeleton algorithm can be used to accurately identify the user's torso.
  • the switching between the face frame and the body frame may be enhanced with an animation effect so that the frame switching is smoother and the user's visual experience is enhanced.
  • Figure 26 shows an example of an interface in which the focus frame changes when the focus target switches between near and far.
  • the main character focus frame 2401 or face focus frame, abbreviated as face frame
  • face frame is used to automatically focus on the registered face B identified.
  • the human body frame 2402 is used to automatically focus on the person.
  • the focus is switched from the human body frame 2402 to the face frame 2401 to track the face B.
  • the embodiment of the present application does not specifically limit the size of the focus tracking frame.
  • the focus tracking frame mentioned here can be various types of focus tracking frames in the embodiment of the present application.
  • Some focus tracking frames can be used interchangeably in different scenarios.
  • the protagonist focus tracking frame 2401 mentioned in (1) of Figure 26 can also be called a face focus tracking frame.
  • the size of the tracking focus frame may depend on the proportion of the subject in the screen and the posture of the subject.
  • the tracking focus frame may be a face tracking focus frame, a body tracking focus frame, or a torso tracking focus frame.
  • the size of the face tracking focus frame may be related to the proportion of the face in the screen.
  • FIG27 shows a schematic diagram of a double frame of face tracking focus frames of different sizes.
  • the face tracking focus frame 2501 shown in FIG27 (1) and the face tracking focus frame 2502 shown in FIG27 (2) can be adjusted in real time based on the size of the registered face (or the proportion of the registered face in the screen). It can be seen that the face tracking focus frame 2501 and the face tracking focus frame 2502 are tracking focus frames of different sizes.
  • FIG. 27 is an example of the interface during the video recording process, and the embodiments of the present application are not limited to this.
  • the face tracking focus frame shown in FIG. 27 is illustrated by taking a double frame as an example, and the embodiments of the present application are not limited to this.
  • the size of the face tracking focus frame may also be related to the proportion of the face in the screen.
  • the face tracking focus frame is a single frame, including: a tracking focus frame used when tracking the target tracking object selected by the user.
  • FIG28 shows a schematic diagram of a single frame of face tracking focus frames of different sizes.
  • the face tracking focus frame 2503 shown in FIG28 (1) and the face tracking focus frame 2504 shown in FIG28 (2) can be adjusted in real time based on the size of the registered face (or the proportion of the registered face in the screen). It can be seen that the face tracking focus frame 2503 and the face tracking focus frame 2504 are tracking focus frames of different sizes.
  • the size of the human body tracking focus frame may be related to the proportion of the human body (or the human body's torso) in the screen or the human body's posture.
  • the human body tracking focus frame can identify and track the human body (or the human body's torso).
  • the mobile phone can use a tracking focus frame of a suitable size to identify and track the human body (or the human body's torso).
  • FIG29 shows a schematic diagram of human body tracking focus frames of different sizes.
  • human body tracking focus frame 2601 As shown in Figure 29 (2) human body tracking focus frame 2602, as shown in Figure 29 (3) human body tracking focus frame 2603, and as shown in Figure 29 (4) human body tracking focus frame 2604, when tracking the focus on the human body, the human body can be identified and the human body tracking focus frame can be adjusted in real time based on the identified human body (or the proportion of the torso in the screen). It can be seen that human body tracking focus frame 2601, human body tracking focus frame 2602, human body tracking focus frame 2603, and human body tracking focus frame 2604 are tracking focus frames of different sizes.
  • Figure 30 is a schematic flow chart of a shooting method provided in an embodiment of the present application. As shown in Figure 30, the method includes:
  • Step 1101 in response to a first operation of the user, entering a photo taking mode or a video recording mode.
  • the first operation is an operation in which the user clicks the camera 401 .
  • the first operation is an operation in which the user clicks on the recording mode.
  • Step 1102 when a single registered object or multiple registered objects are identified, a first interface is displayed, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.
  • a first focus tracking frame for example, a protagonist focus tracking frame
  • the first focusing frame when a single registered object or multiple registered objects are identified, the first focusing frame can be used to perform protagonist tracking (or continuous focusing) on the first focusing object. Moreover, in the process of continuous focusing, compared to the conventional focusing frame that automatically disappears after a preset time period, the first focusing frame does not disappear after the preset time period.
  • the premise that the first focusing frame does not disappear after the preset time period is that the first registered object can be identified, or the first registered object is always in the picture.
  • the first focusing frame is used to perform protagonist tracking on the first registered object, which means that when the first registered object moves in the picture, the first focusing frame moves with the first registered object.
  • the first focus frame is the protagonist focus frame 902 shown in FIG. 10 above, and the first registered object is the face B in FIG. 10 .
  • the first registered object is the single registered object.
  • the shooting scene shown in FIG10 is a case where a single registered object is identified.
  • the first registered object is a target object that meets a preset condition among the multiple registered objects.
  • the first registered object is the object with the highest proportion of faces in the first interface among the multiple registered objects.
  • the first registered object is face B, that is, the face closest to the camera.
  • the first interface further includes multiple second focus tracking frames, and the multiple second focus tracking frames are used to focus on registered objects other than the first registered object among the multiple registered objects, wherein the second focus tracking frame has a different color from the first focus tracking frame.
  • the second focus tracking frame is the non-protagonist focus tracking frame 903 shown in (1) of FIG. 11 above.
  • the first interface when an unregistered object is identified, the first interface also includes a conventional focus frame, and the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after the preset time period; wherein, the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration.
  • the unregistered object is face A in Figure 11
  • the conventional focus frame is conventional focus frame 901 in Figure 11. Therefore, the first tracking focus frame of the embodiment of the present application is significantly different from the conventional focus frame, and the first tracking focus frame can be used to achieve continuous tracking of the protagonist.
  • the first focus tracking frame is a double frame.
  • the first interface is a photo preview interface, wherein the first operation is an operation of starting a camera application.
  • the interface shown in FIG10 or FIG11 is an interface in the photo mode.
  • the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode.
  • the interface shown in FIG13 is an interface in the video recording mode.
  • the method further includes:
  • a video recording interface is displayed, and the video recording interface includes the first registered object and the first focus frame.
  • the method further includes: during the continuous tracking of the first registered object, if it is recognized that the proportion of the face of the first registered object in the screen is less than a first threshold, the first tracking frame is switched from the face frame to the human frame; if it is recognized that the proportion of the face of the first registered object in the screen is greater than or equal to the first threshold, the first tracking frame is switched from the human frame to the face frame.
  • the change of the first tracking frame can refer to the interface shown in Figure 26, and the first registered object is the face B in Figure 26.
  • the method further includes: during the continuous tracking of the first registered object, if the first registered object cannot be recognized, the first tracking frame disappears in the video recording interface, and the actually recognized face is tracked or focused; if the first registered object is recognized and restored, the first tracking frame continues to be displayed in the video recording interface.
  • Figure 13 (5) and Figure 13 (6) show examples of interfaces where registered face B disappears and is restored.
  • the method before displaying the first interface, the method further includes: turning on a “protagonist tracking focus” function.
  • enabling the "main character tracking focus” function includes: in response to a user clicking on the "main character tracking focus” option in the camera setting interface, enabling the "main character tracking focus” function, wherein when it is detected that the portrait data in the gallery has been generated, the "main character tracking focus” option is in an available state. For example, as shown in FIG7 (2), the user clicks on the "main character tracking focus” option 405 to enable the "main character tracking focus” function.
  • a first pop-up window (for example, window 801 shown in (3) of FIG8 ) is displayed in the camera preview interface, and the first pop-up window includes an option to turn on or off the “main character tracking focus” function; wherein, turning on the “main character tracking focus” function includes: in response to the user clicking the turn-on option in the first pop-up window, turning on the “main character tracking focus” function. For example, as shown in (3) of FIG8 , when the user clicks the turn-on option in window 801, the “main character tracking focus” function is turned on.
  • the method further includes: displaying a first prompt box in the first interface, the first prompt box being used to prompt the user that the main character tracking focus has been identified.
  • the first prompt box is prompt box 802 shown in (4) of FIG. 9 .
  • the method further includes:
  • the second interface includes a first focus control
  • the first focus control includes a third focus frame and a first icon
  • the first icon is used to adjust exposure
  • the third focus frame is used to focus on the target focus object
  • the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the fourth focus frame is different in color from the third focus frame.
  • the first icon has a different color from the second icon.
  • the method when performing focus tracking on the target focus tracking object, the method further includes:
  • FIG23 shows an interface for adjusting exposure.
  • the method further includes: displaying a second prompt frame, the second prompt frame being used to prompt the user that the focus target has been locked.
  • the second prompt frame is the prompt frame 920 shown in (3) of FIG. 18 .
  • the target focus tracking object is a person
  • the method further includes: if the face of the target focus tracking object cannot be recognized, converting the face frame into a human frame; when the face of the target focus tracking object is re-recognized, still displaying the human frame.
  • FIG25 shows an interface of the focus tracking frame change when the face of the target focus tracking object disappears.
  • Figure 31 is a schematic diagram of the architecture (including software system and some hardware) of the application of the embodiment of the present application.
  • the application architecture is divided into several layers, each layer has a clear role and division of labor.
  • the layers communicate with each other through software interfaces.
  • the application architecture can be divided into five layers, from top to bottom, respectively, the application layer, the application framework layer, the hardware abstraction layer HAL, the kernel driver layer (kernel) and the hardware layer.
  • the application layer includes a camera. It is understood that FIG31 shows some applications. In fact, the application layer may also include other applications (including system applications and/or third-party applications), which is not limited in this application. For example, the application layer also includes applications such as gallery, information, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, and Alipay.
  • FIG31 is a schematic diagram of the architecture (including software system and some hardware) of the application of the embodiment of the present application.
  • the application architecture is divided into several layers, each layer has a clear role and division of labor.
  • the layers communicate with each other through software interfaces.
  • the application architecture can be divided into five layers, from top to bottom, respectively, the application layer, the application framework layer, the hardware abstraction layer HAL, the driver layer (driver) and the hardware layer.
  • the application layer includes a camera APP and a gallery APP.
  • the gallery can transmit the image data to the camera application.
  • the registered face of the embodiment of the present application can be determined by the image data in the APP.
  • a preset number of faces with the highest appearance frequency in the album are selected as registered faces.
  • the application layer may also include other applications, which is not limited in this application.
  • the application layer also includes information, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, Alipay and other applications.
  • the application framework layer includes a camera access interface.
  • the camera access interface includes camera management and camera devices.
  • the hardware abstraction layer includes a camera hardware abstraction layer and a camera algorithm library.
  • the camera hardware abstraction layer includes multiple camera devices.
  • the camera algorithm library includes an algorithm processing module.
  • the driver layer is used to drive hardware resources.
  • the driver layer can include multiple driver modules. As shown in Figure 31, the driver layer includes Camera device drivers, digital signal processor drivers, and graphics processor drivers, etc.
  • the hardware layer includes sensors, image signal processors, digital signal processors, and graphics processors.
  • the sensors include multiple sensors, TOF cameras, and multi-spectral sensors.
  • a user may click on a camera application.
  • the photo taking instruction may be sent to the camera hardware abstraction layer through the camera access interface.
  • the camera hardware abstraction layer calls the camera device driver and calls the camera algorithm library.
  • the camera algorithm library may send relevant processing parameters to the camera hardware abstraction layer.
  • the camera hardware abstraction layer sends the parameters to the camera device driver.
  • the camera device driver sends the parameters sent by the camera hardware abstraction layer to the hardware layer.
  • the sensor outputs the image based on the sensor output mode.
  • the image signal processor performs corresponding processing based on the parameter configuration of each ISP module.
  • the camera algorithm library is also used to send digital signals to the digital signal processor driver in the driver layer so that the digital signal processor driver calls the digital signal processor in the hardware layer for digital signal processing.
  • the digital signal processor may return the processed digital signal to the camera algorithm library through the digital signal processor driver.
  • the camera algorithm library is also used to send digital signals to the graphics signal processor driver in the driver layer so that the graphics signal processor driver calls the graphics processor in the hardware layer for digital signal processing.
  • the graphics processor may return the processed graphics data to the camera algorithm library through the graphics processor driver.
  • the image output by the image signal processor can be sent to the camera device driver.
  • the camera device driver can send the image output by the image signal processor to the camera hardware abstraction layer.
  • the camera hardware abstraction layer can send the image to the post-processing algorithm module for further processing, or send the image to the camera access interface.
  • the camera access interface can send the image returned by the camera hardware abstraction layer to the camera.
  • Fig. 32 is a schematic block diagram of a photographing device 3200 according to an embodiment of the present application. It should be understood that the device 3200 can execute the photographing method shown above.
  • the apparatus 3200 includes: an input unit 3210, a processing unit 3220, and a display unit 3230.
  • the apparatus 3200 may be an electronic device.
  • the input unit 3210 is used to receive a first operation of a user
  • the processing unit 3220 is used to enter a photo taking mode or a video recording mode in response to a first operation of the user;
  • the display unit 3230 is used to display a first interface when a single registered object or multiple registered objects are identified.
  • the first interface includes a first registered object and a first focus frame.
  • the first focus frame is used to focus on the first registered object, and the first focus frame does not disappear after a preset time.
  • the first registered object in the case where a single registered object is identified, is the single registered object; or, in the case where multiple registered objects are identified, the first registered object is a target object among the multiple registered objects that meets a preset condition.
  • the first interface also includes multiple second focus frames, and the multiple second focus frames are used to focus on the multiple registered objects except the first registered object, wherein the second focus frame is different in color from the first focus frame.
  • the first registered object is the object with the highest face ratio in the first interface among the multiple registered objects.
  • the registered face can be determined through image data in the gallery APP.
  • the person who appears most frequently in the album is automatically selected.
  • a preset number of faces are selected as registered faces.
  • a preset number of faces in the album are added as registered faces.
  • the first interface when an unregistered object is identified, the first interface further includes displaying a conventional focus frame, the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after a preset time period;
  • the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration.
  • the first tracking focus frame is a double frame
  • the conventional focus frame is a single frame
  • the first interface is a photo taking preview interface, wherein the first operation is an operation of starting a camera application.
  • the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode.
  • the display unit 3230 is also used to display a video recording interface in response to a user clicking a recording control, where the video recording interface includes the first registered object and the first focus frame.
  • the first tracking focus frame is switched from the face frame to the body frame;
  • the first focus frame is switched from a human body frame to a face frame.
  • the first tracking focus frame also disappears in the video recording interface, and the actually recognized face is tracked or focused;
  • the first focus frame continues to be displayed in the video recording interface.
  • the processing unit 3220 before displaying the first interface, is also used to enable a “protagonist tracking focus” function.
  • the processing unit 3220 is used to enable the “main character tracking focus” function, including:
  • the "main character tracking focus” function In response to a user clicking on a "main character tracking focus” option in a camera setting interface, the "main character tracking focus” function is turned on, wherein when it is detected that portrait data in a gallery has been generated, the “main character tracking focus” option is in an available state.
  • the display unit 3230 is further configured to display a first pop-up window on the camera preview interface when the camera application is opened and if it is detected that the portrait data in the gallery has been generated, the first pop-up window includes an option to turn on or off the "main character tracking focus" function;
  • the processing unit 3220 is used to enable the “main character tracking focus” function, including:
  • the method further includes:
  • the display unit 3230 is further configured to display a first prompt box in the first interface, wherein the first prompt box is configured to prompt the user that the focus on the protagonist has been identified.
  • the input unit 3210 is further used to receive a second operation of the user, where the second operation is used to select a target focus tracking object;
  • the display unit 3230 is also used to display a second interface; when the target focus object is a recognizable target, the second interface includes a first focus control, the first focus control includes a third focus frame and a first icon, the first icon is used to adjust the exposure, and the third focus frame is used to focus on the target focus object; when the target focus object is an unrecognizable target, the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.
  • the input unit 3210 when focusing on the target focusing object, is further used to receive an operation of sliding the screen by the user;
  • the processing unit 3220 is further configured to adjust the exposure of the picture accordingly in response to the operation of sliding the screen.
  • the display unit 3230 is also used to display a second prompt frame, and the second prompt frame is used to prompt the user that the focus target has been locked.
  • the target focus tracking object is a person, and in the process of continuously tracking the target focus tracking object, the processing unit 3220 is further configured to:
  • the face frame is converted into a body frame
  • the human body frame is still displayed.
  • processing unit 3220 is further configured to:
  • the first tracking frame is switched from the face frame to the body frame;
  • the first focus frame is switched from a human body frame to a face frame.
  • the input unit 3210 and the processing unit 3220 may be implemented by a processor or a processing unit, and the display unit 3230 may be implemented by a display screen.
  • the above-mentioned device 3200 is embodied in the form of a functional unit.
  • the term "unit" here may be implemented in the form of software and/or hardware, and this embodiment of the application does not specifically limit this.
  • a "unit” may be a software program, a hardware circuit, or a combination of the two that implements the above functions.
  • the hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory that executes one or more software or firmware programs, an integrated logic circuit, and/or other suitable devices that can provide the above functions.
  • ASIC application specific integrated circuit
  • a processor such as a shared processor, a dedicated processor, or a group processor, etc.
  • memory that executes one or more software or firmware programs, an integrated logic circuit, and/or other suitable devices that can provide the above functions.
  • the device 3200 can take the form shown in Figure 2.
  • the present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.
  • the computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.
  • the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented.
  • the computer program can be a high-level language program or an executable target program.
  • the computer readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory.
  • the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory.
  • the volatile memory may be a random access memory (RAM), which is used as an external cache.
  • RAM synchronous RAM
  • SDRAM synchronous DRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous link DRAM
  • DR RAM direct rambus RAM
  • the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not executed.
  • the device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system.
  • the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
  • the size of the serial number of each process does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
  • system and “network” are often used interchangeably in this article.
  • the term “and/or” in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships.
  • a and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
  • the character "/" in this article generally indicates that the associated objects before and after are in an "or” relationship.
  • the above is an example of three elements, A, B and C, to illustrate the optional items of the item.

Landscapes

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

Abstract

A photographing method and an electronic device, applied to the technical field of image processing. The method comprises: in response to a first operation of a user, entering a photographing mode or a video filming mode; and upon recognizing a single registered subject or a plurality of registered subjects, displaying a first interface, wherein the first interface comprises a first registered subject and a first follow shot frame, the first follow shot frame is used for performing protagonist follow shot on the first registered subject, the first follow shot frame does not disappear after a preset duration, and the first follow shot frame being used for performing protagonist follow shot on the first registered subject refers to: when the first registered subject moves in a picture, the first follow shot frame moves along with the first registered subject, so as to achieve intelligent follow shot during a photographing process, thus improving the photographing experience of users.

Description

一种拍摄方法和电子设备Shooting method and electronic device

本申请要求于2023年02月16日提交国家知识产权局、申请号为202310153109.8、申请名称为“一种拍摄方法和电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed with the State Intellectual Property Office on February 16, 2023, with application number 202310153109.8 and application name “A shooting method and electronic device”, all contents of which are incorporated by reference in this application.

技术领域Technical Field

本申请涉及图像处理技术领域,并且具体地,涉及一种拍摄方法和电子设备。The present application relates to the field of image processing technology, and in particular, to a photographing method and an electronic device.

背景技术Background Art

随着智能终端日益发展,拍摄功能成为智能终端的必备功能。用户对智能终端的拍摄(拍照和/或摄像)需求以及体验也不断增强。目前,智能终端在拍摄时可以对人脸进行对焦。但是目前的对焦方式比较单一,对焦框在持续数秒后会自动消失,拍摄体验不好。With the development of smart terminals, the shooting function has become an essential function of smart terminals. Users' demand and experience for shooting (photographing and/or shooting videos) of smart terminals are also increasing. At present, smart terminals can focus on faces when shooting. However, the current focusing method is relatively simple, and the focus frame will automatically disappear after a few seconds, which is not a good shooting experience.

发明内容Summary of the invention

有鉴于此,本申请提供了一种拍摄方法、电子设备、计算机可读存储介质和计算机程序产品,能够实现智能追焦,有助于提升用户的拍摄体验。In view of this, the present application provides a shooting method, an electronic device, a computer-readable storage medium and a computer program product, which can realize intelligent focus tracking and help improve the user's shooting experience.

第一方面,提供了一种拍摄方法,所述方法应用于电子设备,所述方法包括:In a first aspect, a shooting method is provided, the method being applied to an electronic device, the method comprising:

响应于用户的第一操作,进入拍照模式或录像模式。In response to a first operation by the user, a photographing mode or a video recording mode is entered.

在识别到单个注册对象或多个注册对象时,显示第一界面,所述第一界面包括第一注册对象以及第一追焦框(比如,主角追焦框),所述第一追焦框用于对所述第一注册对象进行主角追焦,且,所述第一追焦框在预设时长后不消失,其中,所述第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。When a single registered object or multiple registered objects are identified, a first interface is displayed, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.

上述方法可以由终端设备或终端设备中的芯片执行。基于上述方案,通过有助于提升用户的拍摄体验。在本申请实施例中,当识别到单个注册对象或多个注册对象时,可通过第一追焦框对第一追焦对象进行主角追焦(或者说持续追焦)。并且,在持续追焦的过程中,相比于常规对焦框在预设时长后自动消失,所述第一追焦框在预设时长后不消失。第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。通过引入第一追焦框,能够实现对拍摄对象进行智能追焦,提升拍摄体验。The above method can be executed by a terminal device or a chip in the terminal device. Based on the above scheme, it helps to improve the user's shooting experience. In an embodiment of the present application, when a single registered object or multiple registered objects are identified, the first focusing frame can be used to perform protagonist tracking (or continuous focusing) on the first focusing object. Moreover, in the process of continuous focusing, compared to the conventional focusing frame that automatically disappears after a preset time, the first focusing frame does not disappear after the preset time. The first focusing frame is used to perform protagonist tracking on the first registered object, which means that when the first registered object moves in the picture, the first focusing frame moves with the first registered object. By introducing the first focusing frame, intelligent focusing of the photographed object can be achieved, thereby improving the shooting experience.

可选地,上述注册对象可为注册人脸。可以理解,注册对象不限于是人脸,也可以是其他物,比如,猫、狗等,具体可取决于用户的选择或设置。Optionally, the above-mentioned registration object may be a registered face. It is understandable that the registration object is not limited to a face, but may also be other objects, such as a cat, a dog, etc., depending on the user's choice or setting.

可选地,以注册对象是注册人脸为例,注册人脸可通过图库APP中的图像数据确定。Optionally, taking the registration object as a registered face as an example, the registered face can be determined through image data in the gallery APP.

可选地,根据图库的人像数据,自动选取相册中出镜频率最高的预设数量的人脸,作为注册人脸。Optionally, based on the portrait data in the gallery, a preset number of faces with the highest appearance frequency in the album are automatically selected as registered faces.

可选地,以注册对象是注册人脸为例,注册人脸可以是用户手动选择的。Optionally, taking the registration object as a registered face as an example, the registered face may be manually selected by a user.

可选地,根据用户的自主选择,将相册中预设数量的人脸,添加为注册人脸。也就是说, 用户可以根据自己的需求决定将哪些人脸作为注册人脸,使得智能追焦更符合用户的预期。Optionally, based on the user's own choice, a preset number of faces in the album are added as registered faces. Users can decide which faces to register based on their needs, making smart focus tracking more in line with user expectations.

在一种可能的实现方式中,对于识别到单个注册对象的情况,所述第一注册对象是所述单个注册对象;或者,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中满足预设条件的目标对象。不论是单人拍摄场景还是多人拍摄场景,本申请实施例在识别到注册对象时,均可进行智能追焦。In a possible implementation, when a single registered object is identified, the first registered object is the single registered object; or, when multiple registered objects are identified, the first registered object is a target object among the multiple registered objects that meets a preset condition. Whether it is a single-person shooting scene or a multi-person shooting scene, the embodiment of the present application can perform intelligent focus tracking when a registered object is identified.

在一种可能的实现方式中,对于识别到多个注册对象的情况,所述第一界面还包括多个第二追焦框,所述多个第二追焦框用于对所述多个注册对象中除去所述第一注册对象外的注册对象进行追焦,其中,所述第二追焦框与所述第一追焦框的颜色不同。In one possible implementation, in the case where multiple registered objects are identified, the first interface also includes multiple second focus frames, and the multiple second focus frames are used to focus on the multiple registered objects except the first registered object, wherein the second focus frames are different in color from the first focus frames.

可选地,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中在所述第一界面的人脸占比最高的对象。Optionally, in the case where multiple registered objects are identified, the first registered object is the object with the highest face ratio in the first interface among the multiple registered objects.

在一种可能的实现方式中,在识别到非注册对象时,所述第一界面中还包括常规对焦框,所述常规对焦框用于对所述非注册对象进行对焦,所述常规对焦框在所述预设时长后自动消失;In a possible implementation, when an unregistered object is identified, the first interface further includes a conventional focus frame, the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after the preset time period;

其中,所述第一追焦框与所述常规对焦框的不同体现在以下一项或多项因素:颜色、框型、线条、显示时长。Among them, the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration.

可选地,所述第一追焦框为双框(即包括主框和副框)。所述常规对焦框为单框。相比于单框,双框更能凸显出注册人脸或主角人脸,便于用户直观看到追焦对象。Optionally, the first tracking focus frame is a double frame (i.e., including a main frame and a sub-frame). The conventional focus frame is a single frame. Compared with a single frame, a double frame can better highlight the registered face or the protagonist's face, making it easier for the user to intuitively see the tracking focus object.

本申请实施例对于拍照模式和录像模式均适用,即无论是拍照还是录像均可实现智能追焦,提升用户使用体验。The embodiments of the present application are applicable to both the photo mode and the video recording mode, that is, intelligent focus tracking can be achieved regardless of photo taking or video recording, thereby improving the user experience.

在一种可能的实现方式中,对于拍照模式,所述第一界面是拍照预览界面,其中,所述第一操作是启动相机应用的操作。因此,在拍照场景中,可实现智能追焦。In a possible implementation, for the photo mode, the first interface is a photo preview interface, wherein the first operation is an operation of starting a camera application. Therefore, in the photo scene, intelligent focus tracking can be implemented.

在一种可能的实现方式中,对于录像模式,所述第一界面是录像预览界面,其中,所述第一操作是切换到录像模式的操作。因此,在录像场景中,可实现智能追焦。In a possible implementation, for the video recording mode, the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode. Therefore, in the video recording scene, intelligent focus tracking can be implemented.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

响应于用户点击录制控件的操作,显示视频录制界面,所述视频录制界面包括所述第一注册对象以及所述第一追焦框。In response to the user clicking the recording control, a video recording interface is displayed, and the video recording interface includes the first registered object and the first focus frame.

在一种可能的实现方式中,在录制视频过程中,所述方法还包括:In a possible implementation, during the video recording process, the method further includes:

在对所述第一注册对象的持续追焦过程中,如果识别到所述第一注册对象的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;During the continuous tracking focus process of the first registered object, if it is recognized that the proportion of the face of the first registered object in the screen is less than a first threshold, the first tracking focus frame is switched from the face frame to the body frame;

如果识别到所述第一注册对象的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。If it is recognized that the proportion of the face of the first registered object in the screen is greater than or equal to a first threshold, the first focus frame is switched from a human body frame to a face frame.

因此,在录像过程中,可对第一注册对象进行持续追焦,并且第一追焦框可基于第一注册对象的面部在屏幕中的占比进行切换,以便实现智能追焦。Therefore, during the video recording process, the first registered object can be continuously focused, and the first focusing frame can be switched based on the proportion of the face of the first registered object in the screen to achieve intelligent focusing.

在一种可能的实现方式中,在录制视频过程中,所述方法还包括:In a possible implementation, during the video recording process, the method further includes:

在对所述第一注册对象的持续追焦过程中,如果无法识别到所述第一注册对象时,在所述视频录制界面中所述第一追焦框也消失,并对实际识别到的人脸进行追焦或对焦;During the continuous tracking focus process of the first registered object, if the first registered object cannot be recognized, the first tracking focus frame also disappears in the video recording interface, and the actually recognized face is tracked or focused;

如果识别到所述第一注册对象恢复时,在所述视频录制界面中继续显示所述第一追焦框。If it is recognized that the first registered object is restored, the first focus frame continues to be displayed in the video recording interface.

因此,当第一注册对象消失又恢复后,可持续对第一注册对象进行智能追焦。Therefore, when the first registered object disappears and then recovers, the first registered object can continue to be intelligently tracked.

在一种可能的实现方式中,在显示所述第一界面之前,所述方法还包括: In a possible implementation manner, before displaying the first interface, the method further includes:

开启“主角追焦”功能。Turn on the "Protagonist Focus" function.

本申请实施例可供用户选择是否开启“主角追焦”功能。需要说明的是,在开启“主角追焦”功能时,需打开“智能追焦”功能。“智能追焦”功能与“主角追焦”功能是联动的。通常而言,在本申请实施例中,“智能追焦”功能是默认打开的。The embodiment of the present application allows the user to choose whether to turn on the "main character tracking focus" function. It should be noted that when turning on the "main character tracking focus" function, the "intelligent tracking focus" function needs to be turned on. The "intelligent tracking focus" function and the "main character tracking focus" function are linked. Generally speaking, in the embodiment of the present application, the "intelligent tracking focus" function is turned on by default.

在一些可能的实现方式中,当用户打开相机后,在识别到图库已经生成可用人像数据时,可通过弹窗向用户提示是否开启“主角追焦”。由于不确定图库何时能生成可用人像数据,因此设置弹窗向用户提示是否开启“主角追焦”功能,以便用户及时获知是否可以开启“主角追焦”功能。In some possible implementations, after the user opens the camera, when it is recognized that the gallery has generated available portrait data, a pop-up window can be used to prompt the user whether to turn on the "main character tracking focus". Since it is uncertain when the gallery can generate available portrait data, a pop-up window is set to prompt the user whether to turn on the "main character tracking focus" function, so that the user can know whether the "main character tracking focus" function can be turned on in a timely manner.

在一种可能的实现方式中,开启“主角追焦”功能,包括:In a possible implementation, the “main character tracking focus” function is enabled, including:

响应于用户点击相机设置界面中的“主角追焦”选项的操作,开启所述“主角追焦”功能,其中,在检测到图库中的人像数据已生成时,所述“主角追焦”选项为可用状态。In response to a user clicking on a "main character tracking focus" option in a camera setting interface, the "main character tracking focus" function is turned on, wherein when it is detected that portrait data in a gallery has been generated, the "main character tracking focus" option is in an available state.

在一种可能的实现方式中,在打开相机应用时,如果检测到图库中的人像数据已生成时,在相机预览界面显示第一弹窗,所述第一弹窗包括开启或关闭“主角追焦”功能的选项;In a possible implementation, when a camera application is opened, if it is detected that portrait data in the gallery has been generated, a first pop-up window is displayed on the camera preview interface, and the first pop-up window includes an option to turn on or off the "main character tracking focus" function;

其中,开启“主角追焦”功能,包括:Among them, turning on the "Protagonist Focus" function includes:

响应于用户点击所述第一弹窗中的开启选项的操作,开启所述“主角追焦”功能。In response to the user clicking on the enable option in the first pop-up window, the "main character tracking" function is enabled.

在一种可能的实现方式中,对于首次开启“主角追焦”功能的情况,所述方法还包括:In a possible implementation, when the “main character tracking focus” function is enabled for the first time, the method further includes:

在所述第一界面中显示第一提示框,所述第一提示框用于向用户提示已经识别到主角追焦。也就是说,可以通过主角标签告知用于已经识别到主角并进行追焦。A first prompt box is displayed in the first interface, and the first prompt box is used to prompt the user that the main character has been identified and the focus has been tracked. In other words, the main character label can be used to inform the user that the main character has been identified and the focus has been tracked.

可选地,第一提示框可跟随主角追焦框进行移动。当主角追焦框跟随主角移动时,第一提示框也可跟随主角追焦框随之移动。Optionally, the first prompt frame may move along with the main character tracking focus frame. When the main character tracking focus frame moves along with the main character, the first prompt frame may also move along with the main character tracking focus frame.

可选地,第一提示框的存在时长有限。比如,第一提示框可在3秒后自动消失。Optionally, the first prompt box has a limited duration, for example, the first prompt box may automatically disappear after 3 seconds.

可选地,当之前识别到的注册人脸丢失无法识别到时,比如,注册人脸移动至屏幕边缘或丢焦(丢焦可以理解为无法对其进行追焦),第一提示框立即(或即刻)消失。Optionally, when the previously recognized registered face is lost and cannot be recognized, for example, the registered face moves to the edge of the screen or loses focus (loss of focus can be understood as the inability to track the face), the first prompt box disappears immediately (or instantly).

可选地,第一提示框在一次拍摄中仅显示一次。Optionally, the first prompt box is displayed only once in one shooting.

在一种可能的实现方式中,所述方法还包括:In a possible implementation, the method further includes:

接收到用户的第二操作,所述第二操作用于选择目标追焦对象;receiving a second operation of the user, where the second operation is used to select a target focus tracking object;

显示第二界面;当所述目标追焦对象为可识别目标时,所述第二界面包括第一追焦控件,所述第一追焦控件包括第三追焦框以及第一图标,所述第一图标用于调节曝光,所述第三追焦框用于对所述目标追焦对象进行追焦;Displaying a second interface; when the target focus object is a recognizable target, the second interface includes a first focus control, the first focus control includes a third focus frame and a first icon, the first icon is used to adjust exposure, and the third focus frame is used to focus on the target focus object;

当所述目标追焦对象为不可识别目标时,所述第二界面包括第二追焦控件,所述第二追焦控件包括第四追焦框以及第二图标;所述第二图标用于调节曝光,所述第四追焦框用于对所述目标追焦对象进行追焦,其中,所述第四追焦框与所述第三追焦框的颜色不同,所述第一图标与所述第二图标的颜色不同。When the target focus object is an unrecognizable target, the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.

因此,用户可自主选择目标追焦对象进行追焦,提升用户的拍摄体验。Therefore, users can independently select the target focus object for focus tracking, which improves the user's shooting experience.

在一种可能的实现方式中,在对目标追焦对象进行追焦时,所述方法还包括:In a possible implementation, when focusing on the target focus object, the method further includes:

接收到用户滑动屏幕的操作;Receive the user's screen sliding operation;

响应于所述滑动屏幕的操作,对画面的曝光量进行相应调节。In response to the operation of sliding the screen, the exposure of the picture is adjusted accordingly.

示例性地,在对目标追焦对象进行追焦时,可通过上下滑动屏幕的方式进行曝光量的调 节,更方便用户操作。For example, when tracking the target focus object, the exposure can be adjusted by sliding the screen up and down. section, making it more convenient for users to operate.

在一种可能的实现方式中,在所述目标追焦对象是可识别目标且采用所述第三追焦框对所述目标追焦对象进行追焦时,所述方法还包括:In a possible implementation, when the target focus tracking object is a recognizable target and the third focus tracking frame is used to track the target focus tracking object, the method further includes:

显示第二提示框,所述第二提示框用于向用户提示已锁定追焦目标。A second prompt box is displayed, where the second prompt box is used to prompt the user that the focus target has been locked.

因此,通过引入第二提示框,可便于用户得知追焦目标是否被锁定。Therefore, by introducing the second prompt box, the user can know whether the focus target is locked.

在一种可能的实现方式中,所述目标追焦对象为人物,在对目标追焦对象进行持续追焦的过程中,所述方法还包括:In a possible implementation, the target focus tracking object is a person, and in the process of continuously focusing on the target focus tracking object, the method further includes:

若无法识别到所述目标追焦对象的面部,则将人脸框转换为人体框;If the face of the target focus object cannot be recognized, the face frame is converted into a body frame;

在重新识别到所述目标追焦对象的面部时,仍然显示人体框。When the face of the target focus object is re-identified, the human body frame is still displayed.

因此,在重新识别到目标对象的面部时,仍然采用人体框对目标对象进行追焦,能够避免人脸框与人体框来回切换的问题。Therefore, when the face of the target object is re-identified, the human body frame is still used to focus on the target object, which can avoid the problem of switching back and forth between the face frame and the human body frame.

第二方面,提供了一种电子设备,包括用于执行第一方面中任一实现方式中的方法的单元。该电子设备可以是终端,也可以是终端内的芯片。该电子设备包括输入单元、显示单元和处理单元。In a second aspect, an electronic device is provided, comprising a unit for executing the method in any implementation of the first aspect. The electronic device may be a terminal or a chip in a terminal. The electronic device comprises an input unit, a display unit and a processing unit.

当该电子设备是终端时,该处理单元可以是处理器,该输入单元可以是通信接口,该显示单元可以是图形处理模块和屏幕;该终端还可以包括存储器,该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该终端执行第一方面中的任一种方法。When the electronic device is a terminal, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the terminal may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the terminal executes any one of the methods in the first aspect.

当该电子设备是终端内的芯片时,该处理单元可以是芯片内部的逻辑处理单元,该输入单元可以是输入接口、管脚或电路等,该显示单元可以是芯片内部的图形处理单元;该芯片还可以包括存储器,该存储器可以是该芯片内的存储器(例如,寄存器、缓存等),也可以是位于该芯片外部的存储器(例如,只读存储器、随机存取存储器等);该存储器用于存储计算机程序代码,当该处理器执行该存储器所存储的计算机程序代码时,使得该芯片执行第一方面的任一种方法。When the electronic device is a chip in a terminal, the processing unit may be a logic processing unit inside the chip, the input unit may be an input interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods of the first aspect.

第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第一方面中的任一种方法。According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect.

第四方面,提供了一种计算机程序产品,所述计算机程序产品包括:计算机程序代码,当所述计算机程序代码被电子设备运行时,使得该电子设备执行第一方面中的任一种方法。According to a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本申请实施例的应用场景的一个示例图;FIG1 is an example diagram of an application scenario of an embodiment of the present application;

图2是一种适用于本申请的电子设备的结构示意图;FIG2 is a schematic diagram of the structure of an electronic device applicable to the present application;

图3是“智能追焦”功能设置项的图形用户界面示例图;FIG3 is an example diagram of a graphical user interface for setting items of the “Smart Focus Tracking” function;

图4是图库发现页的注册人脸的界面示意图;FIG4 is a schematic diagram of the interface for registering faces on the gallery discovery page;

图5是用户自主选择注册人脸的界面示意图;FIG5 is a schematic diagram of an interface for a user to select a registered face;

图6是提示用户超过注册人脸上限的界面示意图;FIG6 is a schematic diagram of an interface that prompts a user that the upper limit of registered faces has been exceeded;

图7是相机设置的一个界面示例图;FIG7 is an example diagram of an interface for camera settings;

图8是通过弹窗提示用户是否开启“主角追焦”的界面示例图;FIG8 is an example of an interface that prompts the user whether to turn on “main character tracking focus” through a pop-up window;

图9是通过提示框向用户提示已经识别到主角追焦的界面示例图; FIG9 is an example diagram of an interface that prompts the user through a prompt box that the main character has been identified for focus tracking;

图10是开启“智能追焦”功能后的相机预览界面示例图;FIG10 is a sample image of the camera preview interface after the “intelligent focus tracking” function is turned on;

图11是在拍照模式下多人拍摄场景的界面示例图;FIG11 is an example diagram of an interface for a multi-person shooting scene in a camera mode;

图12是拍照预览界面中识别到多个人脸的界面示例图;FIG12 is an example diagram of an interface in which multiple faces are recognized in a photo preview interface;

图13是在录像模式下进行智能追焦的界面示例图;FIG13 is an example diagram of an interface for performing intelligent focus tracking in video recording mode;

图14是单人拍照场景下存在人为干预的界面示例图;FIG14 is an example diagram of an interface with human intervention in a single-person photo taking scenario;

图15是多人拍照场景下且无注册人脸时存在人为干预的界面示例图;FIG15 is an example of an interface diagram showing human intervention in a multi-person photo shooting scenario when there is no registered face;

图16是多人拍照场景下且识别到注册人脸时存在人为干预的界面示例图;FIG16 is an example diagram of an interface in a multi-person photo-taking scenario where human intervention occurs when a registered face is recognized;

图17是录像模式下存在人为干预的一个界面示例图;FIG17 is an example of an interface diagram showing human intervention in the video recording mode;

图18是录像模式下存在人为干预的另一界面示例图;FIG18 is another example of an interface in which human intervention occurs in the video recording mode;

图19是在目标追焦对象消失后的界面示例图;FIG19 is an example diagram of the interface after the target focus object disappears;

图20是在录像场景中点击可识别目标的界面示例图;FIG20 is an example diagram of an interface for clicking on an identifiable target in a video recording scene;

图21是在录像场景中点击不可识别目标的界面示例图;FIG21 is an example diagram of an interface for clicking on an unrecognizable target in a video recording scene;

图22是在录像场景中长按不可识别目标的界面示例图;FIG22 is an example diagram of an interface for long pressing an unrecognizable object in a video recording scene;

图23是拍照预览界面下滑动屏幕调节曝光的界面示意图;FIG23 is a schematic diagram of an interface for adjusting exposure by sliding the screen in a photo preview interface;

图24是录像过程中滑动屏幕调节曝光的界面示意图;FIG24 is a schematic diagram of an interface for adjusting exposure by sliding the screen during video recording;

图25是在目标追焦对象的面部消失时追焦框变化的界面示例图;FIG25 is an example diagram of an interface showing changes in the focus frame when the face of the target focus object disappears;

图26是在追焦目标远近切换时追焦框变化的界面示例;FIG. 26 is an example of an interface showing the change of the focus frame when the focus target is switched between near and far;

图27是不同尺寸人脸追焦框的双框的示意图;FIG27 is a schematic diagram of a double frame of face tracking focus frames of different sizes;

图28是不同尺寸人脸追焦框的单框的示意图;FIG28 is a schematic diagram of a single frame of a face tracking focus frame of different sizes;

图29是本申请实施例提供的不同尺寸的人体追焦框的示意图;FIG29 is a schematic diagram of human body tracking focus frames of different sizes provided in an embodiment of the present application;

图30是本申请实施例提供的拍摄方法的示意性流程图;FIG30 is a schematic flow chart of a photographing method provided in an embodiment of the present application;

图31是一种适用于本申请的电子设备的软件架构的示意图;FIG31 is a schematic diagram of a software architecture of an electronic device applicable to the present application;

图32是一种适用于本申请实施例的拍摄装置的示意性框图。FIG32 is a schematic block diagram of a photographing device suitable for an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.

本申请实施例中,除非另有说明,“多个”的含义可以是两个或两个以上。In the embodiments of the present application, unless otherwise specified, “plurality” may mean two or more than two.

本申请实施例适用于电子设备,该电子设备可以为手机、智慧屏、平板电脑、可穿戴电子设备、车载电子设备、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、投影仪等等。The embodiments of the present application are applicable to electronic devices, which may be mobile phones, smart screens, tablet computers, wearable electronic devices, vehicle-mounted electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, and the like.

本申请实施例的电子设备中装备有图像采集器(比如摄像头)。The electronic device in the embodiment of the present application is equipped with an image collector (such as a camera).

本申请实施例对电子设备的具体类型不作任何限制。下文以电子设备是手机为例描述本申请实施例的拍摄方法。The present application embodiment does not impose any restrictions on the specific type of electronic device. The following takes the electronic device being a mobile phone as an example to describe the shooting method of the present application embodiment.

在一些实施例中,手机摄像头的关键器件包括光学镜片(lens)和图像传感器(sensor)。在摄像头启动后,sensor可基于lens采集到的图像信号出图。In some embodiments, the key components of the mobile phone camera include an optical lens and an image sensor. After the camera is started, the sensor can output an image based on the image signal collected by the lens.

以下结合图1中的场景示例说明。图1是本申请实施例的一个应用场景示例图。The following is an explanation in conjunction with the scenario example in Figure 1. Figure 1 is an example diagram of an application scenario of an embodiment of the present application.

如图1中(1)所示的手机界面中,界面可以显示多个应用程序:应用1、应用2、…、应用7以及相机应用程序。用户点击相机应用程序,手机启动相机。在相机运行后,手机界面显示如图1中(2)所示的界面。该界面可以称为相机的拍摄界面。该拍摄界面中可以包括 取景框11、变焦倍率12(默认为1x)、相册图标13、拍摄控件14和摄像头旋转控件等。用户点击拍摄控件14,可以进行拍照。在该界面中,相册图标13显示的是缩略图。摄像头旋转控件可以用于切换摄像头。In the mobile phone interface shown in (1) of Figure 1, the interface can display multiple applications: Application 1, Application 2, ..., Application 7 and the camera application. The user clicks the camera application and the mobile phone starts the camera. After the camera is running, the mobile phone interface displays the interface shown in (2) of Figure 1. This interface can be called the camera shooting interface. This shooting interface may include The viewfinder 11, zoom ratio 12 (default is 1x), album icon 13, shooting control 14 and camera rotation control etc. The user can take a photo by clicking the shooting control 14. In this interface, the album icon 13 displays thumbnails. The camera rotation control can be used to switch cameras.

其中,取景框11用于获取拍摄预览的图像,可以实时显示预览图像。The viewfinder 11 is used to obtain a preview image and can display the preview image in real time.

手机支持数字变焦。用户在使用拍摄功能时,可通过在触摸屏上操作来选择不同的变焦倍率。The phone supports digital zoom. When using the shooting function, users can select different zoom ratios by operating on the touch screen.

应理解,图1中的拍照场景只是示意性说明本申请的一个应用场景,这并不对本申请实施例构成限定。事实上,本申请实施例也可以应用于其他使用摄像头的场景,比如录像场景、视频通话场景、视频直播场景等。It should be understood that the photo-taking scene in FIG1 is only a schematic illustration of an application scenario of the present application, and does not limit the embodiments of the present application. In fact, the embodiments of the present application can also be applied to other scenes using cameras, such as video recording scenes, video call scenes, video live broadcast scenes, etc.

还应理解,图1中(2)示出的是用户在手机竖屏下进行拍照的一个界面示意图,但本申请并不限于此。比如,用户可以在手机横屏下进行拍摄。It should also be understood that (2) in FIG. 1 shows an interface diagram of a user taking a photo with the mobile phone in portrait mode, but the present application is not limited thereto. For example, the user can take a photo with the mobile phone in landscape mode.

以下结合图2描述本申请实施例应用的硬件架构。The hardware architecture of the embodiment of the present application is described below in conjunction with FIG. 2 .

参考图2,图2示出了一种适用于本申请的电子设备的硬件系统。Refer to FIG. 2 , which shows a hardware system of an electronic device suitable for the present application.

电子设备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等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。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, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

需要说明的是,图2所示的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图2所示的部件更多或更少的部件,或者,电子设备100可以包括图2所示的部件中某些部件的组合,或者,电子设备100可以包括图2所示的部件中某些部件的子部件。图2示的部件可以以硬件、软件、或软件和硬件的组合实现。It should be noted that the structure shown in FIG2 does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than those shown in FIG2, or the electronic device 100 may include a combination of some of the components shown in FIG2, or the electronic device 100 may include sub-components of some of the components shown in FIG2. The components shown in FIG2 may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元。例如,处理器110可以包括以下处理单元中的至少一个:应用处理器(application processor,AP)、调制解调处理器、图形处理器(graphics processing unit,GPU)、图像信号处理器(image signal processor,ISP)、控制器、视频编解码器、数字信号处理器(digital signal processor,DSP)、基带处理器、神经网络处理器(neural-network processing unit,NPU)。其中,不同的处理单元可以是独立的器件,也可以是集成的器件。The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). Different processing units may be independent devices or integrated devices.

控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器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)接口、SIM接口、USB接口。图2所示的各模块间的连接关系只是示意性说明,并不构成对电子设备100的各模块间的连接关系的限定。可选地,电子设备100的各模块也可以采用上述实施例中多种连接方式的组合。In some embodiments, the processor 110 may include one or more interfaces. For example, the processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit audio interface, a (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver/transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input/output (general-purpose input/output, GPIO) interface, SIM interface, USB interface. The connection relationship between the modules shown in Figure 2 is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 100. Optionally, the modules of the electronic device 100 can also adopt a combination of multiple connection methods in the above embodiments.

电子设备100可以通过GPU、显示屏194以及应用处理器实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 can realize the display function through the GPU, the display screen 194 and the application processor. The GPU is a microprocessor for image processing, which connects the display screen 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.

显示屏194可以用于显示图像或视频。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD)、有机发光二极管(organic light-emitting diode,OLED)、有源矩阵有机发光二极体(active-matrix organic light-emitting diode,AMOLED)、柔性发光二极管(flex light-emitting diode,FLED)、迷你发光二极管(mini light-emitting diode,Mini LED)、微型发光二极管(micro light-emitting diode,Micro LED)、微型OLED(Micro OLED)或量子点发光二极管(quantum dot light emitting diodes,QLED)。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。作为一种可能的实现方式,在用户查看精彩时刻的照片和精选短视频时,显示屏194可用于显示精彩时刻MM的照片以及精选短视频。The display screen 194 can be used to display images or videos. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED or a quantum dot light emitting diode (QLED). In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1. As a possible implementation, when a user views photos of wonderful moments and selected short videos, the display screen 194 can be used to display photos of MM at wonderful moments and selected short videos.

电子设备100可以通过ISP、摄像头193、视频编解码器、GPU、显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.

ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP可以对图像的噪点、亮度和色彩进行算法优化,ISP还可以优化拍摄场景的曝光和色温等参数。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene and other parameters. In some embodiments, the ISP can be set in the camera 193.

摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的红绿蓝(red green blue,RGB),YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

在一些实施例中,处理器110用于响应于用户的第一操作,进入拍照模式或录像模式。In some embodiments, the processor 110 is configured to enter a photo taking mode or a video recording mode in response to a first operation of the user.

在识别到单个注册对象或多个注册对象时,调用显示屏194显示第一界面,所述第一界面包括第一注册对象以及第一追焦框(比如,主角追焦框),所述第一追焦框用于对所述第一注册对象进行主角追焦,且,所述第一追焦框在预设时长后不消失,其中,所述第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。When a single registered object or multiple registered objects are identified, the display screen 194 is called to display a first interface, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals.

视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编 解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1、MPEG2、MPEG3和MPEG4。The video codec is 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 various coding formats, such as moving picture experts group (MPEG) 1, MPEG2, MPEG3 and MPEG4.

NPU是一种借鉴生物神经网络结构的处理器,例如借鉴人脑神经元之间传递模式对输入信息快速处理,还可以不断地自学习。通过NPU可以实现电子设备100的智能认知等功能,例如:图像识别、人脸识别、语音识别和文本理解。NPU is a processor that draws on the structure of biological neural networks, such as the transmission mode between neurons in the human brain to quickly process input information, and can also continuously self-learn. Through NPU, the electronic device 100 can realize intelligent cognition and other functions, such as image recognition, face recognition, voice recognition and text understanding.

外部存储器接口120可以用于连接外部存储卡,例如安全数码(secure digital,SD)卡,实现扩展电子设备100的存储能力。The external memory interface 120 can be used to connect an external memory card, such as a secure digital (SD) card, to expand the storage capacity of the electronic device 100.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能(例如,声音播放功能和图像播放功能)所需的应用程序。存储数据区可存储电子设备100使用过程中所创建的数据(例如,音频数据和电话本)。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如:至少一个磁盘存储器件、闪存器件和通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种处理方法。The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, and an application required for at least one function (for example, a sound playback function and an image playback function). The data storage area may store data created during the use of the electronic device 100 (for example, audio data and a phone book). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as: at least one disk storage device, a flash memory device, and a universal flash storage (UFS). The processor 110 executes various processing methods of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.

电子设备100可以通过音频模块170、扬声器170A、受话器170B、麦克风170C、耳机接口170D以及应用处理器等实现音频功能,例如,音乐播放和录音。The electronic device 100 can implement audio functions, such as music playing and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor.

距离传感器180F用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,例如在拍摄场景中,电子设备100可以利用距离传感器180F测距以实现快速对焦。The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.

环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

指纹传感器180H用于采集指纹。电子设备100可以利用采集的指纹特性实现解锁、访问应用锁、拍照和接听来电等功能。The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking photos, and answering calls.

触摸传感器180K,也称为触控器件。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,触摸屏也称为触控屏。触摸传感器180K用于检测作用于其上或其附近的触摸操作。触摸传感器180K可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,并且与显示屏194设置于不同的位置。The touch sensor 180K is also called a touch control device. The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch control screen. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100 and set at a different position from the display screen 194.

按键190包括开机键和音量键。按键190可以是机械按键,也可以是触摸式按键。电子设备100可以接收按键输入信号,实现于按键输入信号相关的功能。The key 190 includes a power key and a volume key. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive a key input signal and implement a function related to the key input signal.

以下实施例中所涉及的技术方案均可以在具有上述硬件架构的电子设备100中实现。The technical solutions involved in the following embodiments can all be implemented in the electronic device 100 having the above hardware architecture.

为了便于理解,本申请以下实施例将以具有图2所示结构的电子设备为例,结合附图和应用场景,对本申请实施例提供的拍摄方法进行具体阐述。For ease of understanding, the following embodiments of the present application will take an electronic device having the structure shown in FIG. 2 as an example, and will specifically describe the shooting method provided in the embodiments of the present application in combination with the accompanying drawings and application scenarios.

本申请将以电子设备为手机,手机中安装相机应用为例,详细介绍本申请提供的拍摄方法。This application will take the electronic device as a mobile phone, and install a camera application in the mobile phone as an example to introduce in detail the shooting method provided by this application.

在本申请的一些实施例中,用户可以手动开启或关闭本申请实施例提供的“智能追焦”。可选地,通常可默认开启“智能追焦”。In some embodiments of the present application, the user can manually turn on or off the "intelligent focus tracking" provided in the embodiments of the present application. Optionally, the "intelligent focus tracking" can usually be turned on by default.

如果开启了“智能追焦”,电子设备可以对画面中识别到的对象进行追焦。在开启了“智 能追焦”的情况下,如果识别到画面中的主体,预览界面中会显示“追焦框”。追焦框会自动追画面中的主体,比如,人物、宠物等,且在一段时间后不会消失。需要说明的是,追焦可以理解为动态的过程。对于画面中的某一主体,若该主体为追焦对象,那么当画面中的该主体发生移动时,追焦框会一直跟随该主体移动。If "Smart Focus Tracking" is turned on, the electronic device can focus on the object recognized in the picture. If the subject in the picture is identified, the "focus tracking frame" will be displayed in the preview interface. The focus tracking frame will automatically track the subject in the picture, such as people, pets, etc., and will not disappear after a period of time. It should be noted that focus tracking can be understood as a dynamic process. For a certain subject in the picture, if the subject is the focus tracking object, then when the subject in the picture moves, the focus tracking frame will always follow the subject.

如果未开启“智能追焦”,那么电子设备的预览画面显示的是常规对焦框。常规对焦框可以理解为目前相机应用中的对焦框,仅在一段时间内对人脸进行对焦,不具备持续追焦的功能。If "Smart Focus Tracking" is not turned on, the preview screen of the electronic device will show the regular focus frame. The regular focus frame can be understood as the focus frame in the current camera application, which only focuses on the face for a period of time and does not have the function of continuous focus tracking.

本申请实施例在启用了“智能追焦”后,可实现对画面中的主体进行持续追焦。After enabling “intelligent focus tracking”, the embodiment of the present application can achieve continuous focus tracking on the subject in the picture.

图3示出了“智能追焦”功能设置项的图形用户界面(graphical user interface,GUI)示例。FIG3 shows a graphical user interface (GUI) example of the “Smart Focus Tracking” function setting items.

示例性的,用户可以通过触摸手机屏幕上特定的控件、按压特定的物理按键或按键组合、输入语音、隔空手势等方式,指示手机开启相机应用。响应于接收到用户开启相机的指示后,手机启动相机,显示拍摄界面。For example, the user can instruct the phone to open the camera application by touching a specific control on the phone screen, pressing a specific physical button or button combination, inputting a voice, performing an air gesture, etc. In response to receiving the user's instruction to open the camera, the phone starts the camera and displays the shooting interface.

例如,如图3中(1)所示,手机的屏幕显示系统显示了当前输出的界面内容,该界面内容显示了多款应用程序(application,App)。手机响应于用户在手机桌面上点击“相机”应用图标401的操作,显示如图3中(2)所示的拍摄界面。For example, as shown in (1) of FIG3 , the screen display system of the mobile phone displays the currently output interface content, and the interface content displays multiple applications (applications, Apps). In response to the user clicking the "camera" application icon 401 on the mobile phone desktop, the mobile phone displays the shooting interface shown in (2) of FIG3 .

再例如,在手机处于锁屏状态时,手机响应于用户在手机屏幕上向右(或向左)滑动的手势操作,显示如图3中(2)所示的拍摄界面。For another example, when the mobile phone is in the lock screen state, the mobile phone responds to the user's gesture operation of sliding right (or left) on the mobile phone screen, and displays the shooting interface shown in (2) in Figure 3.

或者,手机处于锁屏状态时,响应于用户在锁屏界面上点击“相机”应用的快捷图标的操作,显示如图3中(2)所示的拍摄界面。Alternatively, when the mobile phone is in the lock screen state, in response to the user clicking the shortcut icon of the "Camera" application on the lock screen interface, the shooting interface shown in (2) in Figure 3 is displayed.

又例如,在手机运行其他应用时,手机响应于用户点击相应的控件,开启相机应用进行拍照。比如,在用户正在使用即时通信类应用(例如微信应用)时,手机响应于用户在通信类应用中选择相机功能的控件,开启相机应用,以便进行拍照和/或录制视频。For another example, when the mobile phone is running other applications, the mobile phone opens the camera application to take pictures in response to the user clicking the corresponding control. For example, when the user is using an instant messaging application (such as WeChat application), the mobile phone opens the camera application in response to the user selecting the control of the camera function in the messaging application to take pictures and/or record videos.

如图3中(2)所示,相机的拍摄界面一般包括有取景框402、设置控件403、拍照控件、录像控件以及其他功能控件(比如人像模式控件、夜景模式控件、电影模式控件或更多其他控件)。可以理解,在拍照模式下,取景框402可显示拍照预览界面;在录像模式下,取景框402可显示录像预览界面。As shown in (2) of FIG3 , the camera shooting interface generally includes a viewfinder 402, a setting control 403, a photo control, a video control, and other functional controls (such as a portrait mode control, a night scene mode control, a movie mode control, or more other controls). It can be understood that in the photo mode, the viewfinder 402 can display a photo preview interface; in the video mode, the viewfinder 402 can display a video preview interface.

手机响应于用户点击设置控件403的操作,显示如图3中(3)所示的界面。图3中(3)所示的界面中显示“智能追焦”的选项404。选项404用于开启或关闭“智能追焦”功能。在图3中(3)所示的界面中,选项404处于关闭状态。当用户手动点击选项404后,“智能追焦”功能被开启,手机显示如图3中(4)所示的界面。In response to the user clicking on the setting control 403, the mobile phone displays the interface shown in FIG3 (3). The interface shown in FIG3 (3) displays the option 404 of "Smart Focus Tracking". Option 404 is used to turn on or off the "Smart Focus Tracking" function. In the interface shown in FIG3 (3), option 404 is in the off state. When the user manually clicks option 404, the "Smart Focus Tracking" function is turned on, and the mobile phone displays the interface shown in FIG3 (4).

可选地,图3中(3)中还显示了对“智能追焦”的功能的简单介绍以便用户了解,具体即:在拍照、录像模式支持自动识别人物、猫、狗进行自动追焦,点击可锁定任意对象追焦。Optionally, FIG3 (3) also shows a brief introduction to the "intelligent focus tracking" function for the user to understand, specifically: in the photo and video recording modes, it supports automatic recognition of people, cats, and dogs for automatic focus tracking. Click to lock the focus on any object.

可以理解,除了“智能追焦”设置选项外,图3中(3)所示的界面中还可以显示其他设置项。比如,图3中(3)所示的设置界面中还可以显示参考线设置项,水平仪设置项,定时拍摄开关控件,自拍镜像,自动添加水印选项,记录地理位置信息选项,拍摄静音选项,悬浮快门键选项,扩展业务控件等。It can be understood that in addition to the "Smart Focus Tracking" setting option, other setting items can also be displayed in the interface shown in (3) of Figure 3. For example, the setting interface shown in (3) of Figure 3 can also display reference line setting items, level setting items, timer shooting switch controls, self-timer mirroring, automatic watermarking options, geographic location information recording options, shooting mute options, floating shutter button options, extended business controls, etc.

如图3中(4)所示,“智能追焦”的选项404处于开启状态。当用户开启“智能追焦”的选项404后,手机在拍照或录像时会自动对画面中的主体进行持续追焦。当然,用户也可以通过该选项404,手动关闭“智能追焦”功能。 As shown in (4) of FIG3 , option 404 of “Smart Focus Tracking” is turned on. When the user turns on option 404 of “Smart Focus Tracking”, the mobile phone will automatically and continuously focus on the subject in the picture when taking photos or recording videos. Of course, the user can also manually turn off the “Smart Focus Tracking” function through option 404.

进一步地,在开启了“智能追焦”功能后,本申请实施例还提供了“主角追焦”的功能。如图3中(4)所示,在“智能追焦”的选项404开启后,界面中会出现“主角追焦”的选项405以及对“主角追焦”的功能介绍,比如,识别图库“人像”中常拍的前5人,将优先进行追焦(当人像数据满足人脸识别条件时生效)。Furthermore, after the "intelligent focus tracking" function is turned on, the embodiment of the present application also provides a "main character focus tracking" function. As shown in FIG3 (4), after the "intelligent focus tracking" option 404 is turned on, the "main character focus tracking" option 405 and the "main character focus tracking" function introduction will appear in the interface, for example, the first five people who are frequently photographed in the "portraits" of the gallery will be identified and the focus tracking will be prioritized (effective when the portrait data meets the face recognition conditions).

需要说明的是,“主角追焦”是否可用还需取决于图库中的人像数据是否生成。当图库数据已生成时,“主角追焦”可用;当图库数据未生成时,“主角追焦”不可用。“主角追焦”不可用时会在界面中显示置灰状态,比如图3中(4)所示的“主角追焦”的选项405即为置灰状态,用户无法对“主角追焦”的选项进行操作。It should be noted that whether "Main Character Tracking" is available depends on whether the portrait data in the gallery is generated. When the gallery data has been generated, "Main Character Tracking" is available; when the gallery data has not been generated, "Main Character Tracking" is not available. When "Main Character Tracking" is not available, it will be displayed in a grayed-out state in the interface. For example, option 405 of "Main Character Tracking" shown in (4) of FIG. 3 is in a grayed-out state, and the user cannot operate the option of "Main Character Tracking".

其中,图库中的人像数据已生成可以理解为多个注册人脸已确定。本申请实施例引入“注册人脸”对图库中的人像数据进行描述。注册人脸是指电子设备通过追焦框进行自动追焦的人脸。注册人脸可以是预先确定好的。本申请实施例对注册人脸的确定方式不作具体限定。Among them, the portrait data in the gallery has been generated, which can be understood as multiple registered faces have been determined. The embodiment of the present application introduces "registered face" to describe the portrait data in the gallery. A registered face refers to a face that an electronic device automatically focuses on through a focus frame. The registered face can be predetermined. The embodiment of the present application does not specifically limit the method for determining the registered face.

可以理解,此处是以术语“注册人脸”为例进行描述,但该术语也可以替换为其他命名或术语,比如,“追焦人脸”,“注册人像”,“追焦人像”等等。It can be understood that the term "registered face" is used as an example for description here, but the term can also be replaced by other names or terms, such as "focusing face", "registered portrait", "focusing portrait", etc.

还可以理解,此处是以“注册人脸”为一种实现方式为例描述的,本申请实施例并不限于此。比如,注册人脸也可以是其他的注册对象,比如,猫,狗,等其他物。It can also be understood that the description here is based on "registering a face" as an implementation method, and the embodiments of the present application are not limited to this. For example, the registered face can also be other registered objects, such as cats, dogs, and other objects.

在一些实现方式中,注册人脸可通过图库APP中的图像数据确定。In some implementations, the registered face can be determined through image data in the gallery APP.

可选地,根据图库的人像数据,选取相册中出镜频率最高的预设数量的人脸,作为注册人脸。Optionally, based on the portrait data in the gallery, a preset number of faces with the highest appearance frequency in the album are selected as registered faces.

示例性地,通过获取图库中的相册,按照出镜频率,将相册中出现频率最高的前5张人像作为注册人脸。Exemplarily, by obtaining photo albums in a gallery, the top five portraits that appear most frequently in the photo albums are used as registered faces according to their appearance frequencies.

可以理解,此处是以5张注册人脸为例进行说明,本申请实施例并不限于此。事实上,也可以是更多或更少数量的注册人脸。It is understood that here, 5 registered faces are used as an example for explanation, and the embodiment of the present application is not limited thereto. In fact, there may be a greater or lesser number of registered faces.

图4示出了图库发现页的注册人脸的界面示意图。示例性的,用户可以通过触摸手机屏幕上特定的控件、按压特定的物理按键或按键组合、输入语音、隔空手势等方式,指示手机开启图库应用。图库应用也称作相册、照片等。响应于接收到用户开启图库的指示后,手机显示照片界面。FIG4 shows a schematic diagram of the interface for registering a face on the gallery discovery page. For example, the user can instruct the mobile phone to open the gallery application by touching a specific control on the mobile phone screen, pressing a specific physical key or key combination, inputting a voice, performing an air gesture, etc. The gallery application is also called an album, photo, etc. In response to receiving the user's instruction to open the gallery, the mobile phone displays the photo interface.

例如,如图4中(1)所示,手机的屏幕显示系统显示了当前输出的界面内容,该界面内容显示了多款应用程序APP。手机响应于用户在手机桌面上点击“图库”应用图标301的操作,显示如图4中(2)所示的界面。For example, as shown in (1) of FIG4 , the screen display system of the mobile phone displays the currently output interface content, and the interface content displays multiple application programs APP. In response to the user clicking the "Gallery" application icon 301 on the mobile phone desktop, the mobile phone displays the interface shown in (2) of FIG4 .

如图4中(2)所示,图库中显示的是照片页面,其中,照片页面中包含用户拍摄的照片(比如今天用户拍摄的照片和昨天用户拍摄的照片)。图库界面中还包括相册、时刻、发现控件302。手机响应于用户点击发现控件302的操作,界面显示如图4中(3)所示。图4中(3)所示的界面图库的发现页面。As shown in (2) of FIG4 , the photo page is displayed in the gallery, where the photo page contains photos taken by the user (such as photos taken by the user today and photos taken by the user yesterday). The gallery interface also includes albums, moments, and a discovery control 302. In response to the user clicking the discovery control 302, the mobile phone displays the interface as shown in (3) of FIG4 . The interface shown in (3) of FIG4 is the discovery page of the gallery.

如图4中(3)所示,发现页面中包括人像专区303。在人像专区303所示的虚线框内,显示有图库中的人像数据,比如,图4中(3)示出了4个人像。可选地,图4中(3)示出的4个人像的排序按照出现在照片中的数量由大到小排序。在人像专区303所示的虚线框内还包括“更多”控件304。手机响应于用户点击控件304的操作,显示图4中(4)所示的界面。图4中(4)所示的界面为人像页面的一种示例。比如,人像页面中可显示手机默认追焦的人物。As shown in (3) in Figure 4, the discovery page includes a portrait area 303. In the dotted box shown in the portrait area 303, portrait data in the gallery is displayed. For example, Figure 4 (3) shows four portraits. Optionally, the four portraits shown in (3) in Figure 4 are sorted from large to small according to the number of portraits that appear in the photo. The dotted box shown in the portrait area 303 also includes a "more" control 304. In response to the user clicking the control 304, the mobile phone displays the interface shown in (4) in Figure 4. The interface shown in (4) in Figure 4 is an example of a portrait page. For example, the portrait page can display the person that the mobile phone focuses on by default.

可选地,如图4中(3)所示还可以包括其他项目。比如,图4中(3)示出的搜索栏, 一键大片控件,自由创作控件,拼图制作控件,微电影制作控件,荣耀剪辑控件,社区项目等。其中,搜索栏用于搜索照片、人物、地点等。一键大片控件用于生成视频。自由创作控件用于用户基于照片制作视频或对照片进行编辑创作等。拼图制作控件用于对照片进行拼接等编辑操作。微电影制作控件用于用户制作微电影。荣耀剪辑用于用户对图库中的照片或视频进行剪辑等操作。社区项目用于用户进入影像社区,分享美好瞬间。Optionally, other items may be included as shown in (3) in FIG. 4 . For example, the search bar shown in (3) in FIG. 4 , One-click blockbuster control, free creation control, puzzle making control, micro-movie making control, honor editing control, community project, etc. Among them, the search bar is used to search for photos, people, places, etc. One-click blockbuster control is used to generate videos. Free creation control is used for users to make videos based on photos or edit and create photos. Puzzle making control is used to perform editing operations such as splicing photos. Micro-movie making control is used for users to make micro-movies. Honor editing is used for users to edit photos or videos in the gallery. Community project is used for users to enter the image community and share beautiful moments.

应理解,上述示例的如图4中(3)包括的其他项目仅是示例说明,并不对本申请实施例构成限定。It should be understood that the other items included in the above example (3) in FIG. 4 are merely illustrative and do not constitute a limitation on the embodiments of the present application.

如图4中(4)所示,虚线框306内用于显示多个人像的统计数据。可选地,虚线框306内显示的多个人像的统计数据包括人像的命名和对应的数量。可选地,虚线框306内的多个人像可以按照数量从大到小的顺序进行显示。As shown in (4) of FIG4 , the dotted frame 306 is used to display the statistical data of the multiple portraits. Optionally, the statistical data of the multiple portraits displayed in the dotted frame 306 include the names of the portraits and the corresponding quantities. Optionally, the multiple portraits in the dotted frame 306 can be displayed in order from largest to smallest quantity.

比如,虚线框306内包括:命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对应数量分别为42和30)。其中,每个人像的命名为人像框的左下角,每个人像在照片中出现的数量位于人像框的右下角。比如,以虚线框306中的人像307为例,人像307的名称为“爸爸”,出现在照片的数量为58。For example, the dotted frame 306 includes: a portrait named Dad (the corresponding number is 58), a portrait named Mom (the corresponding number is 53), a portrait named Sister (the corresponding number is 46), a portrait named Brother (the corresponding number is 45), and a portrait named Friends (the corresponding numbers are 42 and 30, respectively). The name of each portrait is in the lower left corner of the portrait frame, and the number of times each portrait appears in the photo is in the lower right corner of the portrait frame. For example, taking the portrait 307 in the dotted frame 306 as an example, the name of the portrait 307 is "Dad", and the number of times it appears in the photo is 58.

对于图4中(4)所示的界面,按照照片数量的大小(或者说人脸的出镜频率)自动确定的前5个注册人脸可分别为:命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对应数量为42)。这5个注册人脸可作为手机自动追焦的注册人物。For the interface shown in (4) of FIG4 , the first five registered faces automatically determined according to the number of photos (or the frequency of appearance of faces) may be: a portrait named Dad (corresponding to 58), a portrait named Mom (corresponding to 53), a portrait named Sister (corresponding to 46), a portrait named Brother (corresponding to 45), and a portrait named Friend (corresponding to 42). These five registered faces may be used as registered persons for automatic focus tracking by the mobile phone.

可以理解,图4中示出的虚线框303和虚线框306仅是便于描述引入,并不对本申请实施例构成限定。It can be understood that the dotted frame 303 and the dotted frame 306 shown in FIG. 4 are only introduced for ease of description and do not constitute a limitation to the embodiments of the present application.

可以理解,图4中(4)示出的人像统计数据是以“个人”类目的照片为例进行说明,本申请实施例并不限于此。比如,图4中(4)示出的人像界面还包括“合影”类目,当用户点击“合影”类目后,界面中可显示合影类目下的人像统计数据。It can be understood that the portrait statistics shown in (4) of FIG. 4 are illustrated by taking photos of the "personal" category as an example, and the embodiments of the present application are not limited thereto. For example, the portrait interface shown in (4) of FIG. 4 also includes a "group photo" category. When the user clicks on the "group photo" category, the portrait statistics under the group photo category can be displayed in the interface.

在另一些实现方式中,注册人脸可以是用户手动选择的。可选地,根据用户的自主选择,将相册中预设数量的人脸,添加为注册人脸。也就是说,用户可以根据自己的需求决定将哪些人脸作为注册人脸,使得智能追焦更符合用户的预期。In other implementations, the registered faces may be manually selected by the user. Optionally, a preset number of faces in the album may be added as registered faces based on the user's autonomous selection. In other words, the user may decide which faces to register based on their needs, so that the smart focus tracking is more in line with the user's expectations.

示例性地,用户可通过点击操作,选中某个或多个人脸作为注册人脸,或者,取消某个或多个人脸作为注册人脸。For example, the user can select one or more faces as registered faces, or cancel one or more faces as registered faces, by clicking.

图5示出了用户自主选择注册人脸的界面示意图。如图5中(1)所示,虚线框内306中示出的是各个人像的统计数据。比如,图5中(1)所示的统计数据与图4中(4)所示的统计数据相同,相关描述可参考图4中(4)处的描述。以图5中(1)中的命名为“姐姐”的人像308为例,当用户点击命名为“姐姐”的人像308后,代表选择该人像作为注册人脸,界面显示如图5中(2)所示。FIG5 shows a schematic diagram of the interface for users to select registered faces on their own initiative. As shown in FIG5 (1), the dotted box 306 shows the statistical data of each portrait. For example, the statistical data shown in FIG5 (1) is the same as the statistical data shown in FIG4 (4), and the relevant description can refer to the description at FIG4 (4). Taking the portrait 308 named "Sister" in FIG5 (1) as an example, when the user clicks on the portrait 308 named "Sister", it means that the portrait is selected as the registered face, and the interface is shown in FIG5 (2).

如图5中(2)所示的界面,人像308的右上角出现追焦框图标309,同时,界面中显示提示框310,提示框310中的内容为“已添加自动追焦此人”。追焦框图标309表示人像308已被选中作为注册人脸。人像308的追焦框图标309区别于其他人像框中的追焦框图标,比如,追焦框图标309的线条的颜色深于人像307中的追焦框图标。As shown in the interface of (2) in FIG. 5 , a focus frame icon 309 appears in the upper right corner of the portrait 308, and a prompt box 310 is displayed in the interface, and the content in the prompt box 310 is "This person has been added for automatic focus tracking". The focus frame icon 309 indicates that the portrait 308 has been selected as the registered face. The focus frame icon 309 of the portrait 308 is different from the focus frame icons in other portrait frames. For example, the color of the line of the focus frame icon 309 is darker than that of the focus frame icon in the portrait 307.

类似地,用户可以点击图5中(1)示出的命名为爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对 应数量为42)作为注册人脸。选择的过程与前面选择人像308的方式相同。比如,图5中(3)示出的是选中了5个人像作为注册人脸后的界面,选中的5个人像分别为:爸爸、妈妈、姐姐、哥哥、朋友(对应数量为42)。Similarly, the user can click on the portrait named Dad (the corresponding number is 58), the portrait named Mom (the corresponding number is 53), the portrait named Brother (the corresponding number is 45), the portrait named Friend (the corresponding number is 56), and the portrait named Friend (the corresponding number is 57). The selection process is the same as the previous method of selecting portrait 308. For example, FIG5 (3) shows an interface after selecting 5 portraits as registered faces. The selected 5 portraits are: father, mother, sister, brother, and friend (the corresponding number is 42).

进一步地,用户也可以通过点击操作,取消某个已选中的人像。比如,用户点击图5中(3)中的命名为哥哥的人像311,界面显示如图5中(4)所示。如图5中(4)所示,人像311的右上角的追焦框图标发生变化,其颜色浅于图5中(3)所示的人像311的右上角的追焦框图标。并且,图5中(4)的界面还会出现提示框312,提示框312中的内容为“已取消自动追焦此人”。Furthermore, the user can also cancel a selected portrait by clicking. For example, the user clicks on the portrait 311 named brother in Figure 5 (3), and the interface is displayed as shown in Figure 5 (4). As shown in Figure 5 (4), the focus frame icon in the upper right corner of the portrait 311 changes, and its color is lighter than the focus frame icon in the upper right corner of the portrait 311 shown in Figure 5 (3). In addition, a prompt box 312 will appear in the interface of Figure 5 (4), and the content of the prompt box 312 is "Automatic focus on this person has been canceled."

可以理解,不论是哪种实现方式确定注册人脸,本申请实施例对预设数量的取值不作具体限定。或者说,注册人脸的数量可以基于实际需求进行设定。预设数量可以理解为注册人脸的上限。It is understood that no matter which implementation method is used to determine the registered faces, the present embodiment of the application does not specifically limit the value of the preset number. In other words, the number of registered faces can be set based on actual needs. The preset number can be understood as the upper limit of the registered faces.

可选地,当用户自主选择的注册人脸超过预设数量时,电子设备会通过弹窗提示用户。以下结合图6的界面示例进行说明。Optionally, when the number of registered faces selected by the user exceeds a preset number, the electronic device will prompt the user through a pop-up window.

图6示出了提示用户超过注册人脸上限的界面示意图。如图6中(1)所示,虚线框306中的以下人像已被选择作为注册人脸,分别为:命名爸爸的人像(对应数量为58),命名为妈妈的人像(对应数量为53),命名为姐姐的人像(对应数量为46),命名为哥哥的人像(对应数量为45),命名为朋友的人像(对应数量为42),即已有5个人像作为注册人脸。当用户点击命名为朋友的人像313时,界面显示如图6中(2)所示。如图6中(2)所示,界面中出现提示框314,提示框314用于告知用户注册人脸的数量已达上限(比如,上限为5)。比如,提示框314的内容为“追焦人物,上限最多只能选择5个,已选中的人物,在使用相机拍摄时,会进行自动追焦。”。可选地,提示框314还可以包括“知道了”控件,当用户点击“知道了”控件后,提示框314消失。FIG6 shows a schematic diagram of an interface that prompts the user that the upper limit of the number of registered faces has been exceeded. As shown in FIG6 (1), the following portraits in the dotted box 306 have been selected as registered faces, namely: a portrait named Dad (the corresponding number is 58), a portrait named Mom (the corresponding number is 53), a portrait named Sister (the corresponding number is 46), a portrait named Brother (the corresponding number is 45), and a portrait named Friend (the corresponding number is 42), that is, there are 5 portraits as registered faces. When the user clicks on the portrait named Friend 313, the interface is displayed as shown in FIG6 (2). As shown in FIG6 (2), a prompt box 314 appears in the interface, and the prompt box 314 is used to inform the user that the number of registered faces has reached the upper limit (for example, the upper limit is 5). For example, the content of the prompt box 314 is "Focus on the person, the upper limit can only be selected up to 5, and the selected person will be automatically focused when shooting with the camera." Optionally, the prompt box 314 can also include an "OK" control, and when the user clicks the "OK" control, the prompt box 314 disappears.

可以理解,图6中示出的提示框314中是以上限是5个为例进行说明,本申请实施例并不限于此。比如,上限可以是比5个更多的数量,也可以是比5个更少的数量。It is understood that the prompt box 314 shown in FIG6 is illustrated by taking the upper limit of 5 as an example, and the embodiment of the present application is not limited thereto. For example, the upper limit may be a number greater than 5 or a number less than 5.

不论是哪种确定注册人脸的方式,在图库中的注册人脸数据生效后,“主角追焦”为可用状态。用户可以通过设置界面点击“主角追焦”的选项,开启或关闭“主角追焦”。Regardless of the method used to determine the registered face, after the registered face data in the gallery takes effect, "Main Character Focus Tracking" is available. Users can click the "Main Character Focus Tracking" option in the settings interface to turn "Main Character Focus Tracking" on or off.

图7是相机设置的一个界面示例图。图7中(1)示出了“主角追焦”不可用的状态的界面,该界面与图3中(4)示出的界面相同。当图库中的注册人脸数据生效后,界面显示如图7中(2)所示,设置界面中的“主角追焦”的选项405为可用状态。可用状态也可以理解为非置灰状态,即用户可以对其进行操作。FIG7 is an example of an interface diagram for camera settings. FIG7 (1) shows an interface in which "Main Character Tracking" is unavailable, which is the same as the interface shown in FIG3 (4). When the registered face data in the gallery takes effect, the interface is displayed as shown in FIG7 (2), and option 405 of "Main Character Tracking" in the setting interface is available. The available state can also be understood as a non-grayed state, that is, the user can operate it.

相比于图3中(4)示出的“主角追焦”选项405或图7中(1)示出的“主角追焦”选项405,图7中(2)所示的“主角追焦”的选项405可以被用户点击。手机响应于用户点击“主角追焦”的选项405的操作,打开“主角追焦”的功能,比如,显示如图7中(3)所示的界面。如图7中(3)所示,“主角追焦”的选项405为开启状态。当然,在“主角追焦”的选项开启后,用户可以点击“主角追焦”的选项进行关闭。Compared to the "main character tracking focus" option 405 shown in (4) of FIG. 3 or the "main character tracking focus" option 405 shown in (1) of FIG. 7 , the "main character tracking focus" option 405 shown in (2) of FIG. 7 can be clicked by the user. In response to the user clicking the "main character tracking focus" option 405, the mobile phone turns on the "main character tracking focus" function, for example, displays the interface shown in (3) of FIG. 7 . As shown in (3) of FIG. 7 , the "main character tracking focus" option 405 is turned on. Of course, after the "main character tracking focus" option is turned on, the user can click the "main character tracking focus" option to turn it off.

进一步地,用户还可以点击“智能追焦”的选项进行关闭。由于“智能追焦”与“主角追焦”是联动的,且开启“主角追焦”的前提是“智能追焦”已打开,因此当“智能追焦”的选项关闭后,“主角追焦”的选项也自动关闭。Furthermore, users can also click on the "Smart Focus Tracking" option to turn it off. Since "Smart Focus Tracking" and "Main Character Focus Tracking" are linked, and the premise of turning on "Main Character Focus Tracking" is that "Smart Focus Tracking" is turned on, when the "Smart Focus Tracking" option is turned off, the "Main Character Focus Tracking" option is also automatically turned off.

比如,用户点击图7中(3)所示的“智能追焦”的选项404关闭“智能追焦”,界面显示如图7中(4)所示。如图7中(4)所示,“智能追焦”的选项404为关闭状态,设置选项 中也不显示“主角追焦”的选项。For example, the user clicks on the "Smart Focus Tracking" option 404 shown in FIG. 7 (3) to turn off the "Smart Focus Tracking", and the interface is shown in FIG. 7 (4). As shown in FIG. 7 (4), the "Smart Focus Tracking" option 404 is turned off, and the setting options There is no option for "main character tracking" either.

应理解,图7中设置界面的其他相关设置项与图3中的类似,为了简洁,此处不再赘述。It should be understood that other relevant setting items in the setting interface in FIG. 7 are similar to those in FIG. 3 , and are not described again here for the sake of brevity.

可选地,电子设备可以记忆之前用户操作“主角追焦”的选项的开关状态。这样,在“智能追焦”的选项再次开启后,可自动利用记忆操作设置“主角追焦”的选项。如果之前用户将“主角追焦”的选项置为开启状态,那么可以保持“主角追焦”的选项为开启状态;如果之前用户将“主角追焦”的选项置为关闭状态,那么可以保持“主角追焦”的选项为关闭状态。Optionally, the electronic device can memorize the switch state of the "main character tracking focus" option operated by the user before. In this way, after the "smart tracking focus" option is turned on again, the "main character tracking focus" option can be automatically set using the memory operation. If the user previously set the "main character tracking focus" option to the on state, then the "main character tracking focus" option can be kept on; if the user previously set the "main character tracking focus" option to the off state, then the "main character tracking focus" option can be kept off.

但是,无论是“主角追焦”的开启状态还是“主角追焦”的关闭状态,其是否被置灰禁用需取决于图库中的注册人脸数据是否生效。如果判断出图库中的注册人脸数据生效,或者说判断图库已经生成可用人像数据,那么“主角追焦”的选项为可用状态。如果图库中的注册人脸数据未生效,那么“主角追焦”的选项为不可用状态,比如,通过置灰禁用的方式告知用户“主角追焦”不可用。However, whether "Main Character Tracking" is turned on or off, whether it is grayed out and disabled depends on whether the registered face data in the gallery is effective. If it is determined that the registered face data in the gallery is effective, or if it is determined that the gallery has generated usable portrait data, then the "Main Character Tracking" option is available. If the registered face data in the gallery is not effective, then the "Main Character Tracking" option is unavailable, for example, by graying it out and disabling it to inform the user that "Main Character Tracking" is unavailable.

在一些可能的实现方式中,当用户打开相机后,在识别到图库已经生成可用人像数据时,可通过弹窗向用户提示是否开启“主角追焦”。由于不确定图库何时能生成可用人像数据,因此设置弹窗向用户提示是否开启“主角追焦”功能。In some possible implementations, after the user opens the camera, when it is recognized that the gallery has generated usable portrait data, a pop-up window can be used to prompt the user whether to turn on the "main character tracking focus". Since it is uncertain when the gallery can generate usable portrait data, a pop-up window is set to prompt the user whether to turn on the "main character tracking focus" function.

图8示出了通过弹窗提示用户是否开启“主角追焦”的界面示例图。如图8中(1)示出的界面与图3中(1)示出的相同,图8中(2)示出的界面与图3中(2)示出的界面相同,相关描述可参考前文。在手机识别到图库已经生成可用人像数据时,界面显示如图8中(3)所示的界面,拍照预览界面中显示窗口801,窗口801用于提示用户是否开启“主角追焦”功能。比如,窗口801中展示的内容为:是否开启“主角追焦”功能?识别图库中常拍的人像,优先进行追焦。FIG8 shows an example of an interface that prompts the user whether to turn on the "main character tracking focus" function through a pop-up window. The interface shown in FIG8 (1) is the same as that shown in FIG3 (1), and the interface shown in FIG8 (2) is the same as that shown in FIG3 (2). For related descriptions, please refer to the previous text. When the mobile phone recognizes that the gallery has generated usable portrait data, the interface is displayed as shown in FIG8 (3), and window 801 is displayed in the photo preview interface. Window 801 is used to prompt the user whether to turn on the "main character tracking focus" function. For example, the content displayed in window 801 is: Do you want to turn on the "main character tracking focus" function? Identify the portraits that are often taken in the gallery and give priority to tracking focus.

可选地,窗口801中包括开启选项和取消选项。当用户点击窗口801中的开启选项后,“主角追焦”功能开启,设置界面中“主角追焦”选项405的状态为开启状态,比如界面图8中(4)示出的界面。关于如何从进入到图8中(4)示出的界面可参考前文图3中(2)的示例,此处不再赘述。Optionally, the window 801 includes an on option and a cancel option. When the user clicks the on option in the window 801, the "main character tracking focus" function is turned on, and the state of the "main character tracking focus" option 405 in the setting interface is turned on, such as the interface shown in (4) of the interface Figure 8. For how to enter the interface shown in (4) of Figure 8, please refer to the example of (2) in Figure 3 above, which will not be repeated here.

当然,如果用户点击窗口801中的取消选项,那么窗口801消失,并且维持当前状态,“主角追焦”选项405的状态为可用状态,后续用户可自主选择开启或关闭“主角追焦”选项405。本次使用相机的过程中将不再进行提示。另外,对于本次选择窗口801中的取消选项的情况,当用户在后台杀掉进程,重新进入相机时,如果识别到已经生成可用人像数据时,还是会再次进行提示。可选地,提示上限可为预设次数,比如,3次。可以理解,预设次数也可以是其他数量,此处仅是以3为例进行说明。Of course, if the user clicks the cancel option in window 801, window 801 disappears and maintains the current state. The status of the "main character tracking focus" option 405 is available, and the user can subsequently choose to turn on or off the "main character tracking focus" option 405. There will be no more prompts during the use of the camera this time. In addition, for the case of selecting the cancel option in window 801 this time, when the user kills the process in the background and re-enters the camera, if it is recognized that available portrait data has been generated, it will still prompt again. Optionally, the upper limit of the prompt can be a preset number of times, for example, 3 times. It can be understood that the preset number of times can also be other numbers, and 3 is used as an example here for illustration.

可选地,窗口801中还包括“不再提示”的选项。当用户点击窗口801中的取消选项并勾选“不再提示”的选项后,窗口801会消失,且之后不再进行提示。Optionally, the window 801 also includes an option of "not prompting again". When the user clicks the cancel option in the window 801 and checks the option of "not prompting again", the window 801 disappears and no prompt is given thereafter.

在一些可能的实现方式中,在首次开启“主角追焦”功能后,如果识别到注册人脸中的主角时,可采用主角追焦框进行追焦,同时通过第一提示框向用户提示已经识别到主角追焦。以识别到单个注册人脸为例,主角是指该单个注册人脸;以识别多个注册人脸为例,主角是指多个注册人脸中优先级最高的人脸,比如,出镜频率最高或最靠近镜头的人脸。In some possible implementations, after the "main character tracking focus" function is turned on for the first time, if the main character among the registered faces is identified, the main character tracking focus frame can be used for tracking focus, and the user is prompted through the first prompt frame that the main character tracking focus has been identified. Taking the identification of a single registered face as an example, the main character refers to the single registered face; taking the identification of multiple registered faces as an example, the main character refers to the face with the highest priority among the multiple registered faces, such as the face that appears most frequently or is closest to the camera.

上述第一提示框也可以有其他命名,比如,可称作主角标签。The first prompt box may also have other names, for example, it may be called a protagonist label.

可选地,第一提示框可跟随主角追焦框进行移动。当主角追焦框跟随主角移动时,第一提示框也可跟随主角追焦框随之移动。 Optionally, the first prompt frame may move along with the main character tracking focus frame. When the main character tracking focus frame moves along with the main character, the first prompt frame may also move along with the main character tracking focus frame.

第一提示框的存在时长有限。可选地,第一提示框在预设时长后自动消失。比如,第一提示框可在3秒后自动消失。The first prompt box has a limited duration. Optionally, the first prompt box automatically disappears after a preset duration. For example, the first prompt box may automatically disappear after 3 seconds.

可选地,当之前识别到的注册人脸丢失无法识别到时,比如,注册人脸移动至屏幕边缘或丢焦(丢焦可以理解为无法对其进行追焦),第一提示框立即(或即刻)消失。Optionally, when the previously recognized registered face is lost and cannot be recognized, for example, the registered face moves to the edge of the screen or loses focus (loss of focus can be understood as the inability to track the face), the first prompt box disappears immediately (or instantly).

可选地,第一提示框在一次拍摄中仅显示一次。也就是说,对于某次拍摄,当第一提示框已出现且在预设时长自动消失后,那么在本次拍摄中将不会再出现第一提示框。只有当电子设备切换模式(比如,从拍照模式切换至人像模式)或将相机APP切换至后台运行,下次进入相机APP再次识别到主角时,可再次显示第一提示框。Optionally, the first prompt box is displayed only once in a shooting. That is to say, for a certain shooting, when the first prompt box has appeared and automatically disappears after a preset time, the first prompt box will not appear again in this shooting. Only when the electronic device switches modes (for example, from photo mode to portrait mode) or the camera APP is switched to background operation, the first prompt box can be displayed again when the camera APP is entered next time and recognizes the protagonist again.

可选地,第一提示框的显示次数存在上限。比如,在多次进入相机APP时,第一提示框最多显示3次。Optionally, there is an upper limit to the number of times the first prompt box is displayed. For example, when the camera APP is entered multiple times, the first prompt box is displayed at most 3 times.

本申请实施例中的主角追焦框与常规对焦框不同。在一些实施方式中,主角追焦框与常规对焦框的区别至少在于以下一项或多项:(1)主角追焦框与常规对焦框的颜色不同;(2)主角追焦框与常规对焦框的框型不同;(3)主角追焦框与常规对焦框的框线条粗细不同。The subject tracking focus frame in the embodiment of the present application is different from the conventional focus frame. In some embodiments, the subject tracking focus frame is different from the conventional focus frame in at least one or more of the following: (1) the subject tracking focus frame is different in color from the conventional focus frame; (2) the subject tracking focus frame is different in frame type from the conventional focus frame; (3) the subject tracking focus frame is different in frame line thickness from the conventional focus frame.

示例性地,常规对焦框为白色追焦框;主角追焦框为不同于白色的其他颜色的追焦框,比如,黄色。常规对焦框仅包括主框,或者说常规对焦框为单框;主角追焦框包括主框和副框,或者说主角追焦框为双框。For example, the conventional focus frame is a white tracking focus frame; the main character tracking focus frame is a tracking focus frame of a color other than white, such as yellow. The conventional focus frame only includes a main frame, or the conventional focus frame is a single frame; the main character tracking focus frame includes a main frame and a sub-frame, or the main character tracking focus frame is a double frame.

图9示出了通过提示框向用户提示已经识别到主角追焦的界面示例图。图9中(1)至图9中(3)示出的界面分别与图8中(1)至图8中(3)所示的界面相同,相关描述可参考前文。如图9中(2)所示,假设取景框402中识别到人脸A,由于此时还未开启“主角追焦”,识别到的人脸A采用常规对焦框901进行对焦。在图9中(3)所示的界面中,手机响应于用户点击窗口801中的开启选项的操作,开启“主角追焦”功能,此时手机会对拍照预览界面中的人脸A进行识别。如果识别到人脸A为注册人脸且为主角,那么手机显示如图9中(4)所示的界面。FIG. 9 shows an example of an interface that prompts the user through a prompt box that the main character has been identified and the focus is being tracked. The interfaces shown in FIG. 9 (1) to FIG. 9 (3) are respectively the same as the interfaces shown in FIG. 8 (1) to FIG. 8 (3), and the relevant description can be referred to in the previous text. As shown in FIG. 9 (2), assuming that face A is identified in the viewfinder 402, since the "main character focus tracking" function has not been turned on at this time, the identified face A is focused using the conventional focus frame 901. In the interface shown in FIG. 9 (3), the mobile phone responds to the user clicking the turn-on option in window 801 and turns on the "main character focus tracking" function. At this time, the mobile phone will identify face A in the photo preview interface. If face A is identified as a registered face and is the main character, the mobile phone displays the interface shown in FIG. 9 (4).

如图9中(4)所示,手机对人脸A采用主角追焦框902进行追焦,并通过提示框802向用户提示已经识别到主角追焦。比如,提示框802中的内容为:“主角追焦”已识别。在一段时间后,提示框802可自动消失。比如,如图9中(5)所示,界面中已不再显示提示框802,主角追焦框902对人脸A进行持续自动追焦。As shown in (4) of FIG9 , the mobile phone uses the main character tracking focus frame 902 to track the face A, and prompts the user through the prompt box 802 that the main character tracking focus has been identified. For example, the content in the prompt box 802 is: "The main character tracking focus" has been identified. After a period of time, the prompt box 802 may disappear automatically. For example, as shown in (5) of FIG9 , the prompt box 802 is no longer displayed in the interface, and the main character tracking focus frame 902 continues to automatically track the face A.

应理解,图9中(4)是以识别到单个注册人脸A为例进行说明,本申请实施例并不限于此。比如,如果识别到多个注册人脸,那么将在多个注册人脸中选择一个注册人脸作为主角进行持续追焦。It should be understood that (4) in FIG9 is illustrated by taking the recognition of a single registered face A as an example, and the present application embodiment is not limited thereto. For example, if multiple registered faces are recognized, one of the multiple registered faces will be selected as the protagonist for continuous tracking.

比如,图9中(2)示出的常规追焦框901为常规显示,且仅包括主框;而图9中(4)或图9中(5)示出的主角追焦框902可高亮显示,且包括主框和副框。应理解,图9中(4)或图9中(5)示出的主角追焦框902在具体实现时可以为黄色或其他高亮颜色,以区分于常规对焦框。这里作统一说明,本申请实施例示出的主角追焦框仅是示例。For example, the conventional tracking focus frame 901 shown in FIG. 9 (2) is conventionally displayed and includes only the main frame; while the protagonist tracking focus frame 902 shown in FIG. 9 (4) or FIG. 9 (5) can be highlighted and includes the main frame and the sub-frame. It should be understood that the protagonist tracking focus frame 902 shown in FIG. 9 (4) or FIG. 9 (5) can be yellow or other highlighted colors in a specific implementation to distinguish it from the conventional focus frame. Here, it is uniformly explained that the protagonist tracking focus frame shown in the embodiment of the present application is only an example.

以上描述了“智能追焦”和“主角追焦”的相关介绍。应理解,上述各个示例仅是示例性描述,本申请实施例并不限于此。The above describes the relevant introduction of "intelligent focus tracking" and "main character focus tracking". It should be understood that the above examples are only exemplary descriptions, and the embodiments of the present application are not limited thereto.

当开启了“智能追焦”和“主角追焦”后,用户在使用相机拍摄时,电子设备会自动识别拍摄主体是否为注册人脸。如果识别到注册人脸,则电子设备对注册人脸进行追焦。When "Smart Focus Tracking" and "Main Subject Focus Tracking" are turned on, when the user uses the camera to shoot, the electronic device will automatically identify whether the subject is a registered face. If a registered face is recognized, the electronic device will focus on the registered face.

以下将结合各个界面详细介绍识别到注册人脸进行自动追焦的实施例。The following will introduce in detail the implementation example of automatically tracking focus after recognizing a registered face in conjunction with various interfaces.

图10示出了开启“智能追焦”和“主角追焦”功能后的相机预览界面示例图。如图10 中(1)所示,相机拍照预览界面中识别到人脸A,且人脸A并非注册人脸,此时针对人脸A的追焦框为常规对焦框901。常规对焦框901在一段时间(比如,5秒)后会自动消失。常规对焦框901通常在预览界面中通常显示为白色。Figure 10 shows an example of the camera preview interface after turning on the "Smart Focus Tracking" and "Main Character Focus Tracking" functions. As shown in (1), face A is recognized in the camera preview interface, and face A is not a registered face. At this time, the tracking focus frame for face A is a regular focus frame 901. Regular focus frame 901 will automatically disappear after a period of time (for example, 5 seconds). Regular focus frame 901 is usually displayed in white in the preview interface.

随着镜头的移动,当拍照预览界面出现人脸B时,且识别到人脸B为注册人脸时,此时针对人脸B的追焦框为本申请提出的主角追焦框(或者称作第一追焦框)。图10中(2)是以单个注册人脸的拍照场景为例进行描述。如图10中(2)所示,预览界面显示人脸B以及主角追焦框902。主角追焦框902用于对人脸B进行主角追焦(或持续追焦)。As the lens moves, when face B appears in the photo preview interface and face B is recognized as a registered face, the focus frame for face B is the main focus frame (or first focus frame) proposed in this application. (2) in FIG. 10 is described by taking a photo scene of a single registered face as an example. As shown in (2) in FIG. 10 , the preview interface displays face B and main focus frame 902. Main focus frame 902 is used to perform main focus (or continuous focus) on face B.

另外,当人脸B发生移动时,主角追焦框902也会跟随人脸B进行移动。比如,当人脸B发生移动时,图10中(2)示出的画面帧和图10中(3)示出的画面帧中,主角追焦框902一直跟随人脸B发生移动。并且,主角追焦框的大小也会随着人脸B的移动随之发生变化。In addition, when face B moves, the main character tracking focus frame 902 will also move with face B. For example, when face B moves, in the picture frame shown in (2) of FIG. 10 and the picture frame shown in (3) of FIG. 10 , the main character tracking focus frame 902 always moves with face B. Moreover, the size of the main character tracking focus frame will also change as face B moves.

比如,图10中(1)示出的常规追焦框为常规显示,且仅包括主框;而图10中(2)或图10中(3)示出的主角追焦框高亮显示,且包括主框和副框。应理解,图10中(2)或图10中(3)示出的主角追焦框在具体实现时可以为黄色或其他高亮颜色,以区分于常规对焦框。图10中(2)或图10中(3)示出的主角追焦框902仅是示例。For example, the conventional tracking focus frame shown in FIG. 10 (1) is a conventional display and includes only a main frame; while the main character tracking focus frame shown in FIG. 10 (2) or FIG. 10 (3) is highlighted and includes a main frame and a sub-frame. It should be understood that the main character tracking focus frame shown in FIG. 10 (2) or FIG. 10 (3) can be yellow or other highlighted colors in a specific implementation to distinguish it from the conventional focus frame. The main character tracking focus frame 902 shown in FIG. 10 (2) or FIG. 10 (3) is only an example.

上述图10中(2)或图10中(3)示出的界面示例均为单个注册人脸的拍摄场景。对于多人拍摄场景,本申请实施例仍然适用。The interface examples shown in (2) or (3) of FIG. 10 are all for shooting scenes with a single registered face. For shooting scenes with multiple people, the embodiments of the present application are still applicable.

多人拍摄场景是指:在进行拍摄时,拍摄对象可能会有多个的情况。对于多个拍摄对象,若在多个拍摄对象中没有识别到注册人脸,即多个拍摄对象均为非注册人脸,那么针对每个非注册人脸的追焦框均为常规对焦框;若多个拍摄对象均为注册人脸,即存在多个注册人脸,那么将根据优先级对多个注册人脸进行排序,并对优先级最高的注册人脸采用主角追焦框进行主角追焦,对多个注册人脸中除去优先级最高的注册人脸以外的注册人脸,采用非主角追焦框(第二追焦框)进行追焦。A multi-person shooting scene means that there may be multiple subjects when shooting. For multiple subjects, if no registered face is recognized among the multiple subjects, that is, the multiple subjects are all non-registered faces, then the focus tracking frame for each non-registered face is a regular focus frame; if the multiple subjects are all registered faces, that is, there are multiple registered faces, then the multiple registered faces will be sorted according to priority, and the protagonist focus tracking frame will be used for the registered face with the highest priority, and the non-protagonist focus tracking frame (second focus tracking frame) will be used for the registered faces other than the registered face with the highest priority.

其中,主角追焦框与非主角追焦框可以均认为是注册追焦框,即针对注册人脸的追焦框。非主角追焦框与主角追焦框的区别在于:二者的颜色不同。相比于非主角追焦框而言,主角追焦框会在界面中高亮显示,以突出主角人像。比如,主角追焦框的线条采用黄色,非主角追焦框采用白色。Among them, the main character tracking focus frame and the non-main character tracking focus frame can both be considered as registered tracking focus frames, that is, tracking focus frames for registered faces. The difference between the non-main character tracking focus frame and the main character tracking focus frame is that the two have different colors. Compared with the non-main character tracking focus frame, the main character tracking focus frame will be highlighted in the interface to highlight the main character portrait. For example, the main character tracking focus frame line is yellow, and the non-main character tracking focus frame is white.

另外,非主角追焦框与主角追焦框的框型相同,即非主角追焦框包括主框和副框。而常规追焦框为单框。因此,从框型的角度来讲,非主角追焦框不同于常规追焦框。In addition, the non-protagonist tracking focus frame has the same frame type as the protagonist tracking focus frame, that is, the non-protagonist tracking focus frame includes a main frame and a sub-frame. The conventional tracking focus frame is a single frame. Therefore, from the perspective of frame type, the non-protagonist tracking focus frame is different from the conventional tracking focus frame.

图11示出了在拍照模式下多人拍摄场景的界面示例图。如图11中(1)所示,拍照预览界面中出现人脸A、人脸B、人脸C、人脸D时,如果手机识别到人脸A为非注册人脸,人脸B、人脸C和人脸D均为注册人脸,并且,人脸B是多个注册人脸(比如人脸B、人脸C和人脸D)中最靠近镜头的人脸,那么此时针对人脸A采用常规对焦框901,针对人脸B的追焦框为本申请提出的主角追焦框902(或者称作第一追焦框),针对人脸C和人脸D的追焦框为本申请提出的非主角追焦框903。常规对焦框901的相关描述可以参考图10处的描述。主角框902和非主角追焦框903均由主框和副框组成,区别在于主角框902相比于非主角追焦框903而言会高亮显示,以突出主角人像。FIG. 11 shows an example interface diagram of a multi-person shooting scene in the photo mode. As shown in (1) of FIG. 11 , when face A, face B, face C, and face D appear in the photo preview interface, if the mobile phone recognizes that face A is an unregistered face, and faces B, face C, and face D are all registered faces, and face B is the face closest to the camera among multiple registered faces (such as face B, face C, and face D), then at this time, a conventional focus frame 901 is used for face A, and the tracking focus frame for face B is the protagonist tracking focus frame 902 (or the first tracking focus frame) proposed in this application, and the tracking focus frames for faces C and face D are the non-protagonist tracking focus frames 903 proposed in this application. For the relevant description of the conventional focus frame 901, please refer to the description in FIG. 10 . The protagonist frame 902 and the non-protagonist tracking focus frame 903 are both composed of a main frame and a sub-frame. The difference is that the protagonist frame 902 is highlighted compared to the non-protagonist tracking focus frame 903 to highlight the protagonist portrait.

在一段时间后,针对人脸A的常规对焦框901自动消失,比如,在5秒后,界面显示如图11中(2)所示,针对人脸A的常规对焦框901消失,而针对人脸B的主角追焦框902、针对人脸C和人脸D的非主角追焦框903未消失。After a period of time, the regular focus frame 901 for face A disappears automatically. For example, after 5 seconds, the interface is displayed as shown in (2) in Figure 11. The regular focus frame 901 for face A disappears, while the main character tracking focus frame 902 for face B and the non-main character tracking focus frames 903 for faces C and D do not disappear.

随着人脸或镜头的移动,画面中人脸靠近镜头的排序发生变化,人脸C成为多个注册人 脸(比如人脸B、人脸C和人脸D)中最靠近镜头的人脸,那么此时针对人脸C采用主角对焦框,并同时将人脸B的追焦框切换为非主角追焦框。如图11中(3)所示,在拍照预览界面中,针对人脸C的追焦框为本申请提出的主角追焦框902(或者称作第一追焦框),针对人脸B和人脸D的追焦框为非主角追焦框903。As the face or the camera moves, the order of faces approaching the camera in the picture changes, and face C becomes one of the multiple registered faces. For example, if the face closest to the camera among the faces (such as face B, face C, and face D) is the subject focus frame, then face C is used as the subject focus frame, and the tracking focus frame of face B is switched to the non-subject tracking focus frame. As shown in (3) of FIG. 11 , in the photo preview interface, the tracking focus frame for face C is the subject tracking focus frame 902 (or the first tracking focus frame) proposed in this application, and the tracking focus frames for faces B and D are the non-subject tracking focus frames 903.

随着拍摄场景的变化,可能会涉及超多人脸的拍摄场景。当拍照预览界面中识别到更多拍摄对象时,画面中最多自动识别第一数量的对象进行对焦和/或追焦,且最多识别第二数量的注册人脸进行追焦。第一数量为通过追焦框进行追焦的人脸数量与通过常规对焦框进行对焦的对象数量之和。也就是说,通过追焦框进行追焦的人脸数量与通过常规对焦框进行对焦的对象数量之和的上限为第一数量,通过追焦框进行追焦的人脸数量上限为第二数量。第二数量小于或等于第一数量。比如,第一数量为10个,第二数量为5个。As the shooting scenes change, shooting scenes with a large number of faces may be involved. When more shooting subjects are identified in the photo preview interface, a maximum of a first number of objects in the picture are automatically identified for focus and/or tracking, and a maximum of a second number of registered faces are identified for tracking. The first number is the sum of the number of faces tracked through the tracking focus frame and the number of objects focused through the regular focus frame. In other words, the upper limit of the sum of the number of faces tracked through the tracking focus frame and the number of objects focused through the regular focus frame is the first number, and the upper limit of the number of faces tracked through the tracking focus frame is the second number. The second number is less than or equal to the first number. For example, the first number is 10 and the second number is 5.

示例性地,如图12所示,在拍照时,拍照预览界面中包括人脸A、人脸B、人脸C、人脸D、人脸E、人脸F、宠物K、宠物H、人脸I、人脸G以及人脸J,且识别到人脸F、人脸I、人脸G、宠物K和宠物H为非注册人脸,那么针对人脸F、人脸I、人脸G、宠物G和宠物H采用常规对焦框;以及,识别到人脸A、人脸B、人脸C、人脸D和人脸E是注册人脸,且,人脸B是5个注册人脸中最靠近镜头的注册人脸,那么针对人脸B采用主角追焦框902,针对人脸A、人脸C、人脸D和人脸E采用非主角追焦框903。由于存在数量的限制,未对人脸J采用对焦框进行对焦或采用追焦框进行追焦。Exemplarily, as shown in FIG12 , when taking a photo, the photo preview interface includes face A, face B, face C, face D, face E, face F, pet K, pet H, face I, face G, and face J, and face F, face I, face G, pet K, and pet H are recognized as unregistered faces, so conventional focus frames are used for face F, face I, face G, pet G, and pet H; and, face A, face B, face C, face D, and face E are recognized as registered faces, and face B is the registered face closest to the lens among the five registered faces, so the protagonist tracking focus frame 902 is used for face B, and the non-protagonist tracking focus frame 903 is used for face A, face C, face D, and face E. Due to the limitation of quantity, face J is not focused on with a focus frame or a tracking focus frame.

可以看到,图12中通过常规对焦框901进行对焦的对象分别为:人脸F、人脸I、人脸G、宠物K和宠物H,通过追焦框(包括主角追焦框902和非主角追焦框903)进行追焦的对象分别为:人脸A、人脸B、人脸C、人脸D和人脸E,即总数量(或者说第一数量)为10,第二数量为5。It can be seen that in Figure 12, the objects focused on by the conventional focus frame 901 are: face F, face I, face G, pet K and pet H, and the objects focused on by the tracking focus frame (including the protagonist tracking focus frame 902 and the non-protagonist tracking focus frame 903) are: face A, face B, face C, face D and face E, that is, the total number (or the first number) is 10, and the second number is 5.

应理解,图12中示出的示例仅是便于理解,本申请实施例并不限于此。比如,图12中可以包括更多的人脸。It should be understood that the example shown in FIG12 is only for ease of understanding, and the embodiments of the present application are not limited thereto. For example, FIG12 may include more human faces.

需要说明的是,本申请实施例对拍照场景和录像场景均适用。前述各个界面示例是以拍照预览场景为例进行描述。可以理解的是,上述各个界面的示例在录像预览场景、或者录像过程中也是适用的。It should be noted that the embodiments of the present application are applicable to both photo shooting and video recording. The above-mentioned interface examples are described by taking the photo preview scene as an example. It is understandable that the above-mentioned interface examples are also applicable in the video preview scene or the video recording process.

图13示出了在录像模式下进行智能追焦的界面示例图。如图13中(1)所示,当识别到人脸A,且人脸A为非注册人脸时,在拍照预览界面中会显示常规对焦框901对人脸A进行对焦。如果用户点击录像模式,那么相机切换到录像预览界面,界面显示图13中(2)所示。FIG13 shows an example of an interface for performing intelligent focus tracking in the video recording mode. As shown in FIG13 (1), when face A is recognized and face A is not a registered face, a conventional focus frame 901 will be displayed in the photo preview interface to focus on face A. If the user clicks on the video recording mode, the camera switches to the video recording preview interface, and the interface is shown in FIG13 (2).

比如,如图13中(2)所示,在录像预览界面中,如果识别到单个人脸B,且人脸B为注册人脸,那么采用主角追焦框902对人脸B进行追焦。可选地,如果在录像预览界面中还识别到人脸A,且人脸A为非注册人脸,那么采用常规对焦框901对非注册人脸进行对焦。可选地,如果识别到多个注册人脸且人脸B是多个注册人脸中优先级最高的,那么在录像预览界面中采用非主角追焦框903对其他注册人脸(比如人脸C和人脸D)进行追焦。For example, as shown in (2) of FIG. 13 , in the video preview interface, if a single face B is recognized and face B is a registered face, then the main character tracking focus frame 902 is used to track the focus on face B. Optionally, if face A is also recognized in the video preview interface and face A is a non-registered face, then the conventional focus frame 901 is used to focus on the non-registered face. Optionally, if multiple registered faces are recognized and face B has the highest priority among the multiple registered faces, then the non-main character tracking focus frame 903 is used in the video preview interface to track the focus on other registered faces (such as face C and face D).

如图13中(2)所示,界面中还包括开始录像的控件1201,当用户点击控件1201后,手机开始录制视频,比如,界面显示如图13中(3)所示。As shown in (2) of FIG. 13 , the interface also includes a control 1201 for starting video recording. When the user clicks the control 1201 , the mobile phone starts recording the video. For example, the interface is displayed as shown in (3) of FIG. 13 .

如图13中(3)所示的界面,在录像开始后,界面中包括拍照控件1202、停止控件1203和暂停控件1204。如果用户点击停止控件1203,可结束录制;如果用户点击控件1202,可以在录像过程中进行手动抓拍;如果用户点击暂停控件1204,可暂停录制。As shown in the interface (3) of FIG. 13 , after the video recording starts, the interface includes a photo control 1202, a stop control 1203, and a pause control 1204. If the user clicks the stop control 1203, the recording can be ended; if the user clicks the control 1202, a manual snapshot can be taken during the video recording; if the user clicks the pause control 1204, the recording can be paused.

比如,如图13中(3)所示,界面中显示的是第5秒时的录制画面。在第5秒的录制画 面中,对识别到的注册人脸B显示有主角追焦框902。也就是说,当开始录制视频时,录像预览界面中显示主角追焦框902,对注册人脸B进行持续追焦。并且,如果在录像预览界面显示有常规对焦框,那么在开始录制视频时常规对焦框会901即刻消失;如果在录像预览界面显示有非主角追焦框903,那么在开始录制视频时针对其他注册人脸(比如人脸C和人脸D)的非主角追焦框903也会即刻消失。For example, as shown in (3) of FIG. 13 , the interface displays the recording screen at the 5th second. In the video, a main character tracking focus frame 902 is displayed for the recognized registered face B. That is, when the video recording starts, the main character tracking focus frame 902 is displayed in the video preview interface, and the registered face B is continuously tracked. In addition, if a regular focus frame is displayed in the video preview interface, the regular focus frame 901 disappears immediately when the video recording starts; if a non-main character tracking focus frame 903 is displayed in the video preview interface, the non-main character tracking focus frames 903 for other registered faces (such as face C and face D) will also disappear immediately when the video recording starts.

在开始录制视频时,如果识别到单个注册人脸,那么录制画面中会对该单个注册人脸进行持续追焦。比如,如图13中(4)所示,界面中显示的是第12秒时的录制画面。在第12秒的录制画面中,注册人脸B仍可以识别到,因此仍采用主角追焦框902对注册人脸B进行持续追焦。When starting to record a video, if a single registered face is recognized, the single registered face will be continuously tracked in the recording screen. For example, as shown in (4) in FIG. 13 , the interface shows the recording screen at the 12th second. In the recording screen at the 12th second, the registered face B can still be recognized, so the main character tracking focus frame 902 is still used to continuously track the registered face B.

如果在录制过程中,注册人脸B丢失或无法识别到,那么将对实际识别到的人脸进行追焦或对焦。比如,如图13中(5)所示,界面中显示的是第20秒时的录制画面。在第20秒的录制画面中,注册人脸B丢失,非注册人脸A出现在镜头中,那么此时仍会采用常规对焦框901对非注册人脸A进行对焦。If the registered face B is lost or cannot be recognized during the recording process, the actual recognized face will be tracked or focused. For example, as shown in (5) in FIG. 13 , the interface shows the recording screen at the 20th second. In the recording screen at the 20th second, the registered face B is lost and the unregistered face A appears in the lens. At this time, the conventional focus frame 901 will still be used to focus on the unregistered face A.

进一步地,在注册人脸B丢失后,如果在预设时长(比如,该预设时长可以为30秒)内,注册人脸B恢复,重新出现在镜头画面中,那么仍然采用主角追焦框对注册人脸B进行持续追焦;如果超出了预设时间,那么在注册人脸B恢复时,不会对注册人脸B进行主角追焦。比如,如图13中(6)所示,界面中显示的是第24秒时的录制画面。在第24秒的录制画面中,注册人脸B又出现在镜头中,那么此时采用主角追焦框902对注册人脸B进行持续追焦。Furthermore, after the registered face B is lost, if the registered face B is restored and reappears in the camera image within a preset time (for example, the preset time may be 30 seconds), the main character tracking focus frame is still used to continuously track the registered face B; if the preset time is exceeded, the main character tracking focus frame 902 will not be used to track the registered face B when the registered face B is restored. For example, as shown in (6) in FIG. 13 , the interface displays the recording image at the 24th second. In the recording image at the 24th second, the registered face B appears in the camera image again, and at this time, the main character tracking focus frame 902 is used to continuously track the registered face B.

另外,在注册人脸丢失后,如果在预设时长(比如,该预设时长可以为30秒)内,在注册人脸恢复的同时还出现了另一注册人脸(比如注册人脸D),那么对注册人脸进行追焦不再考虑是否超出预设时长的因素,而是以注册人脸的优先级为准则对注册人脸进行追焦。比如,如果注册人脸D比注册人脸B更靠前,那么将对注册人脸D采用主角追焦框进行追焦。In addition, after the registered face is lost, if within a preset time (for example, the preset time can be 30 seconds), another registered face (such as registered face D) appears at the same time as the registered face is restored, then the registered face will no longer be tracked based on the priority of the registered face, and the registered face will be tracked based on the priority of the registered face. For example, if registered face D is closer to the front than registered face B, registered face D will be tracked using the main character tracking focus frame.

上面描述的是拍照或录像模式下不存在人为干预时进行追焦的相关实施例。以下将描述存在人为干预时进行追焦的相关实施例。人为干预是指用户通过主动点击界面中的某个区域或某个对象,以选择期望被追焦的对象。界面包括但不限于拍照预览界面、录像预览界面或录制视频界面(即录制视频过程中的画面)。The above describes the relevant embodiments of focusing when there is no human intervention in the photo or video mode. The following describes the relevant embodiments of focusing when there is human intervention. Human intervention refers to the user actively clicking on a certain area or object in the interface to select the object to be focused. The interface includes but is not limited to the photo preview interface, the video preview interface or the video recording interface (i.e., the screen during the video recording process).

当界面无人为干预时,电子设备自动识别拍摄主体进行追焦。如前文所述,如果未识别到注册人脸,则采用常规对焦框对人脸进行追焦。如果识别到注册人脸,则采用注册追焦框进行追焦,具体包括:如果是单个注册人脸,则采用主角追焦框进行追焦;如果识别到多个注册人脸,则对优先级最高的注册人脸采用主角追焦框进行追焦,对除去优先级最高的注册人脸以外的其他注册人脸,采用非主角追焦框进行追焦。但是,当界面存在人为干预时,比如,用户主动点击拍照预览界面或录像预览界面中的某个人脸,那么电子设备以用户选择的人或物为准,将用户选择的人或物作为被追焦的对象,而不考虑注册人脸的因素。When there is no human intervention in the interface, the electronic device automatically identifies the subject of the shooting and performs tracking focus. As mentioned above, if the registered face is not recognized, the conventional focus frame is used to track the face. If a registered face is recognized, the registered tracking focus frame is used for tracking focus, specifically including: if it is a single registered face, the protagonist tracking focus frame is used for tracking focus; if multiple registered faces are recognized, the protagonist tracking focus frame is used for tracking focus for the registered face with the highest priority, and the non-protagonist tracking focus frame is used for tracking focus for other registered faces except the registered face with the highest priority. However, when there is human intervention in the interface, for example, the user actively clicks on a face in the photo preview interface or the video preview interface, the electronic device will take the person or object selected by the user as the object to be focused, without considering the factor of the registered face.

在一种可能的实现方式中,电子设备接收到用户的第二操作,所述第二操作用于选择目标追焦对象;当所述目标追焦对象为可识别目标时,在第二界面(拍照预览界面或录像预览界面或录制视频界面)中显示第一追焦控件,所述第一追焦控件包括第三追焦框以及第一图标,所述第一图标用于调节曝光,所述第三追焦框用于对所述目标追焦对象进行追焦;当所述目标追焦对象为不可识别目标时,在第二界面(拍照预览界面或录像预览界面或录制视频界面)中显示第二追焦控件,所述第二追焦控件包括第四追焦框以及第二图标,所述第二图 标用于调节曝光,所述第四追焦框用于对所述目标追焦对象进行追焦,所述第四追焦框与所述第三追焦框的颜色不同,所述第一图标与所述第二图标的颜色不同。In a possible implementation, the electronic device receives a second operation from the user, where the second operation is used to select a target focus object; when the target focus object is a recognizable target, a first focus control is displayed in the second interface (photo preview interface, video preview interface, or video recording interface), where the first focus control includes a third focus frame and a first icon, where the first icon is used to adjust exposure, and the third focus frame is used to focus on the target focus object; when the target focus object is an unrecognizable target, a second focus control is displayed in the second interface (photo preview interface, video preview interface, or video recording interface), where the second focus control includes a fourth focus frame and a second icon, and the second icon The icon is used to adjust the exposure, the fourth focus frame is used to focus on the target focus object, the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.

需要说明的是,当用户选中目标追焦对象后,界面中仅会显示针对目标追焦对象的第一追焦控件,其他框均会消失。其他框包括追焦框和/或对焦框。换句话说,无论在用户选择目标追焦对象之前界面中显示的是主角追焦框或非主角追焦框,还是常规对焦框,均会在用户选中目标追焦对象后消失,仅显示针对目标追焦对象的第一追焦控件。It should be noted that when the user selects the target focus object, only the first focus control for the target focus object will be displayed in the interface, and other frames will disappear. Other frames include focus frames and/or focus frames. In other words, no matter whether the main character focus frame, non-main character focus frame, or regular focus frame is displayed in the interface before the user selects the target focus object, it will disappear after the user selects the target focus object, and only the first focus control for the target focus object will be displayed.

可以理解,目标对焦对象可为人或物,或者某个区域的画面,本申请实施例对此不作具体限定。It can be understood that the target focus object can be a person or an object, or a picture of a certain area, and the embodiments of the present application do not specifically limit this.

可选地,第二操作可以是点击操作,也可以是长按操作。Optionally, the second operation may be a click operation or a long press operation.

可选地,在接收到用户的第二操作后,所述方法还包括:判断目标追焦对象是否为可识别目标。也就是说,当接收到用户的第二操作后,电子设备可先判断用户选择追焦的对象是否是可识别目标。如果是可识别目标,则在界面中显示第一追焦控件,即采用第一追焦控件对可识别目标进行锁定;如果是不可识别目标,则在界面中显示第二追焦控件。Optionally, after receiving the second operation of the user, the method further includes: determining whether the target focus object is a recognizable target. That is, after receiving the second operation of the user, the electronic device may first determine whether the object selected by the user to focus is a recognizable target. If it is a recognizable target, the first focus control is displayed in the interface, that is, the recognizable target is locked using the first focus control; if it is an unrecognizable target, the second focus control is displayed in the interface.

进一步地,在所述目标追焦对象为不可识别目标时,或者说在界面显示第二追焦控件时,所述方法还包括:接收到用户的第三操作;响应于用户的第三操作,不显示所述第二追焦控件并继续进行追焦。Furthermore, when the target focus object is an unrecognizable target, or when the second focus control is displayed on the interface, the method also includes: receiving a third operation of the user; in response to the third operation of the user, not displaying the second focus control and continuing focus tracking.

可选地,第一追焦控件与第二追焦控件的颜色不同。Optionally, the first focus control and the second focus control have different colors.

示例性地,所述目标对焦对象可以是用户选择的人脸。Exemplarily, the target focus object may be a face selected by a user.

示例性地,第一图标为小太阳图标。可以理解,小太阳图标仅为示例描述,事实上可以替换为其他标识曝光量的图标,本申请实施例不限于此。Exemplarily, the first icon is a small sun icon. It can be understood that the small sun icon is only an example description, and in fact it can be replaced by other icons indicating the exposure amount, and the embodiments of the present application are not limited thereto.

上述关于“界面是否存在无人为干预”的实施例不仅适用于拍照场景,也适用于录像场景。The above-mentioned embodiment regarding "whether there is no human intervention in the interface" is applicable not only to the photo-taking scene, but also to the video-recording scene.

以下结合图14至图16中的界面示例说明拍照场景下存在人为干预的实施例。The following describes an embodiment in which human intervention exists in a photo-taking scene in conjunction with the interface examples in FIG. 14 to FIG. 16 .

图14中示出了单人拍照场景下存在人为干预的界面示例图。如图14中(1)所示,在单人拍照场景的预览界面中,对非注册人脸A采用常规对焦框901进行对焦。用户可主动点击人脸A,将人脸A作为目标追焦对象。FIG14 shows an example of an interface with human intervention in a single-person photo scene. As shown in FIG14 (1), in the preview interface of the single-person photo scene, a conventional focus frame 901 is used to focus on the unregistered face A. The user can actively click on face A to set face A as the target focus object.

比如,当用户点击人脸A后,界面显示为如图14中(2)。如图14中(2)所示,在拍照预览界面中,针对人脸A显示高亮追焦框904(对应第三追焦框)和小太阳图标905(对应第一图标)。其中,高亮追焦框904与小太阳图标组成前文提到的第一追焦控件。For example, when the user clicks on face A, the interface is displayed as shown in (2) in Figure 14. As shown in (2) in Figure 14, in the photo preview interface, a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are displayed for face A. The highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above.

图15中示出了多人拍照场景下且无注册人脸时存在人为干预的界面示例图。如图15中(1)所示,在多人拍照场景的预览界面中,对非注册人脸A采用常规对焦框901进行对焦,对非注册人脸B采用常规对焦框901进行对焦。用户可主动点击人脸A,将人脸A作为目标追焦对象。FIG15 shows an example of an interface diagram of human intervention in a multi-person photo scene when there is no registered face. As shown in FIG15 (1), in the preview interface of the multi-person photo scene, the conventional focus frame 901 is used to focus on the unregistered face A, and the conventional focus frame 901 is used to focus on the unregistered face B. The user can actively click on face A to set face A as the target focus object.

比如,手机响应于用户点击人脸A的操作,界面显示如图15中(2)所示。如图15中(2)所示,在拍照预览界面中,针对人脸A显示高亮追焦框904(对应第三追焦框)和小太阳图标905(对应第一图标)。其中,高亮追焦框904与小太阳图标组成前文提到的第一追焦控件,并且,人脸B的常规对焦框901消失。For example, in response to the user clicking on face A, the mobile phone displays the interface as shown in FIG15 (2). As shown in FIG15 (2), in the photo preview interface, a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are displayed for face A. The highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above, and the regular focus frame 901 of face B disappears.

图16中示出了多人拍照场景下且识别到注册人脸时存在人为干预界面示例图。如图16中(1)所示,在多人拍照场景的预览界面中,对非注册人脸A采用常规对焦框901进行对焦,对注册人脸B采用主角对焦框902进行追焦,对注册人脸C采用非主角追焦框903进行 追焦。用户可主动点击人脸C,将人脸C作为目标追焦对象。FIG16 shows an example of a human intervention interface in a multi-person photo scene when a registered face is recognized. As shown in FIG16 (1), in the preview interface of the multi-person photo scene, the non-registered face A is focused using the conventional focus frame 901, the registered face B is focused using the main focus frame 902, and the registered face C is focused using the non-main focus frame 903. Focus tracking. The user can actively click on face C to set face C as the target focus tracking object.

比如,当用户点击人脸C后,界面显示如图16中(2)所示。如图16中(2)所示,在拍照预览界面中,针对人脸C显示高亮追焦框904(对应第三追焦框)和小太阳图标905(对应第一图标)。其中,高亮追焦框904与小太阳图标组成前文提到的第一追焦控件,并且,人脸A的常规对焦框901与人脸B的主角对焦框902均消失。For example, when the user clicks on face C, the interface is shown in (2) of FIG16. As shown in (2) of FIG16, in the photo preview interface, a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are displayed for face C. The highlight focus frame 904 and the small sun icon constitute the first focus control mentioned above, and the regular focus frame 901 of face A and the main focus frame 902 of face B both disappear.

图17是录像模式下存在人为干预的一个界面示例图。图17中(1)示出的是录像预览界面中包括非注册人脸A和注册人脸B,对非注册人脸A采用常规对焦框901进行对焦,对注册人脸B采用主角追焦框902进行追焦。手机响应于用户手动点击非注册人脸A的操作,将对非注册人脸A进行追焦,即人脸A为目标追焦对象,比如,界面显示如图17中(2)所示,录像预览界面中仅显示了非注册人脸A的高亮追焦框904(对应第三追焦框)和小太阳图标905(对应第一图标),其他追焦框消失,即注册人脸B的主角追焦框902消失。FIG. 17 is an example of an interface diagram in which human intervention exists in the video recording mode. FIG. 17 (1) shows that the video recording preview interface includes an unregistered face A and a registered face B. The unregistered face A is focused using a conventional focus frame 901, and the registered face B is focused using a main character tracking focus frame 902. In response to the user manually clicking on the unregistered face A, the mobile phone will focus on the unregistered face A, that is, face A is the target tracking object. For example, the interface display is as shown in FIG. 17 (2). Only the highlighted tracking focus frame 904 (corresponding to the third tracking focus frame) and the small sun icon 905 (corresponding to the first icon) of the unregistered face A are displayed in the video recording preview interface, and other tracking focus frames disappear, that is, the main character tracking focus frame 902 of the registered face B disappears.

如图17中(2)所示的录像预览界面,界面中还包括开始录像的控件1601。手机响应于用户点击开始录像的控件1601的操作,显示如图17中(3)所示的录制界面,比如,第5秒的画面,此时仅显示非注册人脸A的追焦框904,小太阳图标905也消失。非注册人脸A作为追焦锁定目标。As shown in FIG. 17 (2), the video preview interface also includes a control 1601 for starting video recording. In response to the user clicking the control 1601 for starting video recording, the mobile phone displays a recording interface as shown in FIG. 17 (3). For example, in the 5th second screen, only the focus frame 904 of the non-registered face A is displayed, and the small sun icon 905 disappears. The non-registered face A is the focus lock target.

在一些可能的实现方式中,对于用户手动点击目标追焦对象的场景,在目标追焦对象是可识别目标且采用追焦框(比如第三追焦框)对所述可识别目标进行追焦时,所述方法还包括:显示第二提示框,所述第二提示框用于向用户提示已锁定追焦目标。In some possible implementations, for a scenario in which a user manually clicks on a target focus object, when the target focus object is a identifiable target and a focus frame (such as a third focus frame) is used to focus on the identifiable target, the method further includes: displaying a second prompt frame, wherein the second prompt frame is used to prompt the user that the focus target has been locked.

可选地,上述第二提示框可在预设时长后自动消失。比如,上述第二提示框可在3秒后自动消失。Optionally, the second prompt box may automatically disappear after a preset time, for example, the second prompt box may automatically disappear after 3 seconds.

需要说明的是,不论是拍照场景,还是录像场景,当用户手动点击目标追焦对象后,均可通过上述第二提示框向用户进行提示。It should be noted that, whether it is a photo-taking scene or a video-recording scene, when the user manually clicks on the target focus object, the user can be prompted through the above-mentioned second prompt box.

图18示出了录像模式下存在人为干预的另一界面示例图。图18中(1)示出的是录像预览界面中包括非注册人脸A和注册人脸B,对非注册人脸A采用常规对焦框901进行对焦,对注册人脸B采用主角追焦框902进行追焦。Figure 18 shows another example of an interface with human intervention in the video recording mode. Figure 18 (1) shows that the video recording preview interface includes an unregistered face A and a registered face B. The unregistered face A is focused using a conventional focus frame 901, and the registered face B is focused using a main character tracking focus frame 902.

手机响应于用户调整拍摄视角的操作,显示如图18中(2)所示的录像预览界面。如图18中(2)所示,调整拍摄视角后的录像预览界面包括非注册人脸C,其中,针对非注册人脸C采用常规对焦框901进行对焦。手机响应于用户手动点击非注册人脸C的操作,将对非注册人脸C进行追焦,此时非注册人脸C为目标追焦对象。In response to the user's operation of adjusting the shooting angle, the mobile phone displays a video preview interface as shown in FIG18 (2). As shown in FIG18 (2), the video preview interface after adjusting the shooting angle includes an unregistered face C, wherein the unregistered face C is focused using a conventional focus frame 901. In response to the user's operation of manually clicking on the unregistered face C, the mobile phone will focus on the unregistered face C, and the unregistered face C is now the target focus object.

比如,界面显示如图18中(3)所示,录像预览界面中显示了目标追焦对象C的高亮追焦框904(对应第三追焦框),以及提示框920(对应上述第二提示框)。其中,提示框920中的内容为“追焦已锁定”。提示框920可在3秒后自动消失。如图18中(3)所示,当用户点击录像控件1601后,界面显示如图18中(4)所示。For example, the interface is shown in (3) of FIG. 18 , where the video preview interface displays a highlighted focus frame 904 (corresponding to the third focus frame) of the target focus object C, and a prompt frame 920 (corresponding to the second prompt frame). The content in prompt frame 920 is “Focus locked”. Prompt frame 920 may automatically disappear after 3 seconds. As shown in (3) of FIG. 18 , when the user clicks the video control 1601, the interface is shown in (4) of FIG. 18 .

如图18中(4)所示的界面,在第1秒的录制画面中,假设此时距离提示框920在界面中显示的时长已超过3秒,提示框920在界面已消失,高亮追焦框904会持续跟随目标追焦对象C移动。As shown in the interface (4) of FIG. 18 , in the recording screen at the first second, assuming that the distance prompt box 920 has been displayed in the interface for more than 3 seconds, the prompt box 920 has disappeared from the interface, and the highlight tracking frame 904 will continue to follow the target tracking object C.

可选地,如图18中(4)所示的界面,即便图18中(4)所示的界面中还出现了人脸B,此时高亮追焦框904仍会持续跟随目标追焦对象C移动。Optionally, as shown in the interface (4) of FIG. 18 , even if a face B appears in the interface (4) of FIG. 18 , the highlight tracking frame 904 will continue to move with the target tracking object C.

可选地,当用户手动点击非注册人脸C时,在显示高亮追焦框904时也可以同时显示小太阳图标(图中未示出),小太阳图标可在一段时间后自动消失。 Optionally, when the user manually clicks on the non-registered face C, a small sun icon (not shown in the figure) may also be displayed simultaneously with the display of the highlight focus frame 904, and the small sun icon may automatically disappear after a period of time.

应理解,图18中的界面是以录像模式下为例说明,本申请实施例并不限于此。比如,在拍照预览界面中,也可通过第二提示框进行提示。It should be understood that the interface in Figure 18 is described in the video recording mode as an example, and the embodiment of the present application is not limited thereto. For example, in the photo preview interface, a prompt can also be given through the second prompt box.

图19示出了在目标追焦对象(或者说锁定目标)消失后的界面示例图。如图19中(1)所示,界面显示的是录制视频时第5秒的画面,画面中显示的是用户锁定的目标人脸A(比如,图17中(3)所示的目标追焦对象A),且采用追焦框904对锁定目标A进行追焦。FIG19 shows an example of an interface after the target focus object (or locked target) disappears. As shown in FIG19 (1), the interface shows the 5th second of the video recording, and the target face A locked by the user is shown in the screen (for example, the target focus object A shown in FIG17 (3)), and the locked target A is focused using the focus frame 904.

在锁定目标消失后,界面显示中的追焦框也相应消失。比如,图19中(2)示出的是录制视频时第12秒的画面,锁定目标A丢失,界面中针对锁定目标A的追焦框也相应消失。After the locked target disappears, the focus tracking frame in the interface display also disappears accordingly. For example, FIG. 19 (2) shows the picture at the 12th second of the video recording, when the locked target A is lost, and the focus tracking frame for the locked target A in the interface also disappears accordingly.

进一步地,在锁定目标丢失后,如果在预设时长(比如,该预设时长可以为30秒)内,锁定目标恢复,重新出现在镜头画面中,那么仍然采用追焦框对注册人脸B进行锁定追焦;如果超出了预设时长,那么在锁定目标恢复时,不会对锁定目标进行主角追焦。比如,图19中(3)示出的是录制视频时第20秒的画面,锁定目标A再次出现,界面中再次出现追焦框904对锁定目标A进行追焦。Furthermore, after the target is lost, if the target is restored and reappears in the camera image within a preset time (for example, the preset time can be 30 seconds), the focus tracking frame is still used to lock and focus the registered face B; if the preset time is exceeded, the target will not be focused on when the target is restored. For example, FIG19 (3) shows the image at the 20th second of the video recording, and the target A appears again. The focus tracking frame 904 appears again in the interface to focus on the target A.

对于用户选择锁定目标或者说目标追焦对象时,用户可能点击的是可识别目标,也可能是不可识别目标。以下将结合界面进行说明。When a user chooses to lock a target or track a target, the user may click on a recognizable target or an unrecognizable target. The following will explain this in conjunction with the interface.

图20是在录像场景中点击可识别目标的界面示例图。如图20中(1)所示,录像预览界面中包括非注册人脸A和注册人脸B,对非注册人脸A采用常规对焦框901进行对焦,对注册人脸B采用主角追焦框902进行追焦。当用户点击开始录像控件1801后,手机开始录像,比如,界面显示如图20中(2)所示,在第5秒的录制画面中,录像界面中仅显示针对注册人脸B的主角追焦框902。FIG20 is an example of an interface for clicking on a recognizable target in a video recording scene. As shown in FIG20 (1), the video preview interface includes an unregistered face A and a registered face B. The unregistered face A is focused using a conventional focus frame 901, and the registered face B is focused using a main character tracking focus frame 902. When the user clicks the start video recording control 1801, the mobile phone starts recording. For example, the interface is shown in FIG20 (2). In the 5th second recording screen, only the main character tracking focus frame 902 for the registered face B is displayed in the video recording interface.

随着拍摄物体发生变化,录像界面中可能出现其他物体。比如,如图20中(3)所示,在第12秒的录制画面中,画面中出现物体C,用户点击物体C。如果物体C为可识别目标(比如,物体C为球),那么将对物体C作为锁定目标进行追焦,比如,手机响应于用户点击物体C的操作,显示如图20中(4)所示的界面。如图20中(4)所示,针对物体C采用高亮追焦框904(对应第三追焦框)和小太阳图标905(对应第一图标),其他追焦框消失,即注册人脸B的主角追焦框902消失。随着物体C的移动,高亮追焦框也随之移动,比如,界面显示如图20中(5)所示的界面,在第20秒的画面中,此时仅显示物体C的高亮追焦框904,小太阳图标905消失,其他追焦框也消失,即物体C作为追焦锁定目标。As the object being filmed changes, other objects may appear in the video recording interface. For example, as shown in (3) of FIG. 20, in the 12th second recording screen, object C appears in the screen, and the user clicks on object C. If object C is a recognizable target (for example, object C is a ball), object C will be focused on as a locked target. For example, in response to the user clicking on object C, the mobile phone displays an interface as shown in (4) of FIG. 20. As shown in (4) of FIG. 20, a highlight focus frame 904 (corresponding to the third focus frame) and a small sun icon 905 (corresponding to the first icon) are used for object C, and other focus frames disappear, that is, the main focus frame 902 of the registered face B disappears. As object C moves, the highlight focus frame also moves accordingly. For example, the interface is shown in (5) of FIG. 20. In the 20th second screen, only the highlight focus frame 904 of object C is displayed, the small sun icon 905 disappears, and other focus frames also disappear, that is, object C is used as a locked focus target.

图21是在录像场景中点击不可识别目标的界面示例图。如图21中(1)所示,在第12秒的录制画面中,界面中显示注册人脸B,针对注册人脸B采用的是主角追焦框902进行追焦。当用户点击录制画面中的第一区域时,第一区域为画面空白背景(即无可锁定的物体或人物),手机判断第一区域为不可识别目标,那么界面显示为图21中(2)所示。如图21中(2)所示,在第12秒的录制画面中,非高亮追焦框906(对应第四追焦框)和小太阳图标907(对应第二图标),其他追焦框消失,即注册人脸B的主角追焦框902消失。FIG. 21 is an example of the interface for clicking on an unrecognizable target in a video recording scene. As shown in (1) in FIG. 21 , in the 12th second recording screen, the registered face B is displayed in the interface, and the main character tracking focus frame 902 is used to track the registered face B. When the user clicks on the first area in the recording screen, the first area is a blank background of the screen (i.e., there is no object or person to be locked), and the mobile phone determines that the first area is an unrecognizable target, then the interface is displayed as shown in (2) in FIG. 21 . As shown in (2) in FIG. 21 , in the 12th second recording screen, the non-highlighted tracking focus frame 906 (corresponding to the fourth tracking focus frame) and the small sun icon 907 (corresponding to the second icon), and the other tracking focus frames disappear, that is, the main character tracking focus frame 902 of the registered face B disappears.

当用户再次点击目标人物(比如注册人脸B),可继续对人脸B进行追焦,比如界面显示如图21中(3)所示,在第15秒的录制画面中,界面中再次显示注册人脸B,针对注册人脸B采用的是主角追焦框902进行追焦,并且,针对第一区域的非高亮追焦框906和小太阳图标907消失。When the user clicks on the target person (such as registered face B) again, the focus can continue to be tracked on face B. For example, the interface display is shown in (3) of Figure 21. In the recording screen at the 15th second, the registered face B is displayed again in the interface. The main character focus frame 902 is used to track the registered face B, and the non-highlight focus frame 906 and the small sun icon 907 for the first area disappear.

需要说明的是,本申请实施例对调节曝光的方式不作具体限定。一种实现方式,可通过调节小太阳图标907调节曝光。另一种实现方式,也可以通过上下滑动屏幕调节曝光。It should be noted that the embodiment of the present application does not specifically limit the method of adjusting the exposure. In one implementation, the exposure can be adjusted by adjusting the small sun icon 907. In another implementation, the exposure can also be adjusted by sliding the screen up and down.

图22是在录像场景中长按不可识别目标的界面示例图。如图22中(1)所示,在第5秒 的录制画面中,界面中显示注册人脸B,针对注册人脸B采用的是主角追焦框902进行追焦。当用户长按录制画面中的第一区域时,第一区域为画面背景,手机判断第一区域为不可识别目标,那么界面显示为图22中(2)所示。Figure 22 is an example of the interface for long pressing an unrecognizable target in a video recording scene. As shown in (1) in Figure 22, at the 5th second In the recorded screen, the interface displays the registered face B, and the main character tracking focus frame 902 is used to track the registered face B. When the user long presses the first area in the recorded screen, the first area is the screen background, and the mobile phone determines that the first area is an unrecognizable target, then the interface is displayed as shown in (2) in Figure 22.

如图22中(2)所示,在第12秒的录制画面中,在第一区域显示非高亮追焦框906(对应第四追焦框)和小太阳图标907(对应第二图标),其他追焦框消失(即注册人脸B的主角追焦框902消失),并在画面中显示“曝光和对焦已锁定”。As shown in (2) in Figure 22, in the recording screen at the 12th second, a non-highlighted focus frame 906 (corresponding to the fourth focus frame) and a small sun icon 907 (corresponding to the second icon) are displayed in the first area, and other focus frames disappear (that is, the focus frame 902 of the protagonist of the registered face B disappears), and “Exposure and focus are locked” is displayed on the screen.

当用户再次点击其他区域或者目标人物时,可解除对第一区域的追焦锁定状态。比如,如图22中(3)所示的界面,在第13秒的录制画面中,手机响应于用户再次点击画面中的某一区域的操作,对用户再次点击的区域进行追焦。比如,如图22中(4)所示的画面,在第14秒的录制画面中,在用户点击的区域显示高亮追焦框904和小太阳图标905,并且,针对第一区域的非高亮追焦框906和小太阳图标907消失。When the user clicks on another area or the target person again, the focus lock state of the first area can be released. For example, as shown in the interface (3) of Figure 22, in the 13th second recording screen, the mobile phone responds to the user clicking on a certain area in the screen again, and focuses on the area clicked by the user again. For example, as shown in the screen (4) of Figure 22, in the 14th second recording screen, the highlighted focus frame 904 and the small sun icon 905 are displayed in the area clicked by the user, and the non-highlighted focus frame 906 and the small sun icon 907 for the first area disappear.

可选地,如果在一段时间后用户无任何操作,那么将重新恢复自动追焦。比如,如图22中(5)所示的界面,在第15秒的录制画面中,录制画面中重新对注册人脸B进行自动追焦。Optionally, if the user does not perform any operation after a period of time, the automatic focus tracking will be restored. For example, in the interface shown in (5) of FIG. 22 , in the recording screen at the 15th second, the automatic focus tracking is performed again on the registered face B in the recording screen.

可以理解,用户点击或长按的画面区域可能包含物、或人脸,也有可能是画面背景,画面背景不包含可识别的对象。用户点击或长按的画面区域的操作,可以理解为用户期望选择进行追焦的物或人。It can be understood that the area of the screen that the user clicks or long presses may contain an object or a face, or it may be the background of the screen, and the background of the screen does not contain a recognizable object. The operation of the user clicking or long pressing the area of the screen can be understood as the object or person that the user wants to select for focus tracking.

可选地,在对目标追焦对象进行追焦时,所述方法还包括:接收到用户滑动屏幕的操作;响应于所述滑动屏幕的操作,对画面的曝光量进行相应调节。Optionally, when focusing on the target focusing object, the method further includes: receiving an operation of sliding the screen by the user; and adjusting the exposure of the picture accordingly in response to the operation of sliding the screen.

示例性地,用户滑动屏幕包括向上或向下滑动屏幕。当用户向上滑动屏幕时,增加画面的曝光量;当用户向下滑动屏幕时,降低画面的曝光量。Exemplarily, the user sliding the screen includes sliding the screen upward or downward. When the user slides the screen upward, the exposure of the picture is increased; when the user slides the screen downward, the exposure of the picture is reduced.

在本申请实施例中,通过滑动屏幕可对画面的曝光进行调节。这样设置的目的在于,在追焦过程中第一追焦控件(包括第三追焦框和第一图标)是会跟随目标追焦对象移动的,此时不便点击第一图标(比如小太阳图标)调节曝光量,因此通过引入滑动屏幕的操作调节曝光,可以有效提升用户调曝光的操作体验。对于移动的追焦对象而言,相比于调节小太阳图标调节曝光的方式,此种通过滑动屏幕的调节方式体验会更好。In the embodiment of the present application, the exposure of the picture can be adjusted by sliding the screen. The purpose of this setting is that during the focus tracking process, the first focus tracking control (including the third focus tracking frame and the first icon) will move with the target focus tracking object. At this time, it is inconvenient to click the first icon (such as the small sun icon) to adjust the exposure. Therefore, by introducing the operation of sliding the screen to adjust the exposure, the user's exposure adjustment operation experience can be effectively improved. For a moving focus tracking object, this adjustment method by sliding the screen will have a better experience than adjusting the exposure by adjusting the small sun icon.

可选地,在一些实现方式中,在用户锁定目标后,还可提供首次引导,提示用户可滑动屏幕上下调节曝光。比如,在拍照预览时,当用户首次点击追焦目标时,可提示一次,在界面中显示提示内容“上下滑动可调节曝光”。可选地,该提示内容在3秒后可自动消失。Optionally, in some implementations, after the user locks on the target, a first guidance may be provided, prompting the user to slide the screen up and down to adjust the exposure. For example, when previewing a photo, when the user first clicks on the tracking target, a prompt may be provided, and the prompt content "Slide up and down to adjust the exposure" may be displayed in the interface. Optionally, the prompt content may disappear automatically after 3 seconds.

可选地,在首次调节曝光时,还可通过曝光调节提示框引导用户。比如,在用户选中目标追焦对象,画面中出现了小太阳图标后,手机还可以在屏幕中显示曝光调节提示框,告知用户可以上下滑动屏幕调节曝光。Optionally, when adjusting the exposure for the first time, the user can be guided by an exposure adjustment prompt box. For example, after the user selects the target tracking object and a small sun icon appears on the screen, the phone can also display an exposure adjustment prompt box on the screen to inform the user that they can slide the screen up and down to adjust the exposure.

可选地,曝光调节提示框可在一段时间后自动消失,比如,3秒。Optionally, the exposure adjustment prompt box may automatically disappear after a period of time, for example, 3 seconds.

图23示出了拍照预览界面下滑动屏幕调节曝光的界面示意图。如图23中(1)所示,在拍照预览界面中,针对用户选择的物体,采用高亮追焦框904进行追焦,同时还显示有小太阳图标905用于调节曝光。Figure 23 shows a schematic diagram of the interface for adjusting exposure by sliding the screen in the photo preview interface. As shown in (1) of Figure 23, in the photo preview interface, a highlighted focus frame 904 is used to focus on the object selected by the user, and a small sun icon 905 is also displayed for adjusting exposure.

可选地,图23中(2)的界面中虚线框2301中的内容可以用于引导用户如何操作调节曝光。虚线框2301中包括向上或向下的箭头,以及提示文字“上下滑动可调节曝光”。比如,虚线框2301中内容可在3秒后自动消失。Optionally, the content in the dotted box 2301 in the interface of (2) in FIG. 23 can be used to guide the user on how to adjust the exposure. The dotted box 2301 includes an upward or downward arrow and a prompt text "Slide up and down to adjust the exposure". For example, the content in the dotted box 2301 may automatically disappear after 3 seconds.

可选地,虚线框2301中的内容可高亮显示,以便用户查看。Optionally, the content in the dashed box 2301 can be highlighted for user viewing.

如图23中(3)所示,用户可向下滑动屏幕调节曝光。当用户向下滑动屏幕时,界面显 示如图23中(4)所示的界面,界面中出现曝光条908,比如通过向下滑动屏幕调节曝光量为-0.5。在调节完后松手离开屏幕,曝光条908消失,界面显示如图23中(5)所示的界面。如图23中(5)所示的界面,手机继续对物体904进行锁定追焦。As shown in (3) of Figure 23, the user can slide the screen downward to adjust the exposure. The interface shown in FIG. 23 (4) is displayed, and an exposure bar 908 appears in the interface. For example, the exposure is adjusted to -0.5 by sliding the screen downward. After the adjustment is completed, the user releases the screen, the exposure bar 908 disappears, and the interface shown in FIG. 23 (5) is displayed. In the interface shown in FIG. 23 (5), the mobile phone continues to lock and focus on the object 904.

图24示出了录像过程中滑动屏幕调节曝光的界面示意图。FIG. 24 is a schematic diagram showing an interface for adjusting exposure by sliding the screen during video recording.

如图24中(1)所示,在第12秒的录制画面中,针对用户选择的物体(比如图中示出的为球体),采用高亮追焦框904进行追焦,同时还显示有小太阳图标905用于调节曝光。由于选择的球体在录像过程中会发生移动,那么高亮追焦框904与小太阳图标905也会随着运动的球体偏移。因此通过点击小太阳图标905调节曝光不是很方便,为此,本申请实施例可通过上下滑动屏幕实现曝光量的调节。As shown in (1) of FIG. 24 , in the 12th second recording screen, the object selected by the user (such as the sphere shown in the figure) is focused using a highlight focus frame 904, and a small sun icon 905 is also displayed for adjusting the exposure. Since the selected sphere will move during the recording process, the highlight focus frame 904 and the small sun icon 905 will also shift with the moving sphere. Therefore, it is not very convenient to adjust the exposure by clicking the small sun icon 905. For this reason, the embodiment of the present application can adjust the exposure by sliding the screen up and down.

当用户向下滑动屏幕时,界面显示如图24中(2)所示的界面,在第18秒的录制画面中,界面中出现曝光条908,比如通过向下滑动屏幕调节曝光量为-0.5。在调节完后松手离开屏幕,曝光条908消失,界面显示如图24中(3)所示的界面。如图24中(3)所示的界面,手机继续对物体采用高亮追焦框904进行锁定追焦,同时还显示有小太阳图标905用于调节曝光。When the user slides the screen downward, the interface is shown as shown in FIG24 (2). In the 18th second recording screen, an exposure bar 908 appears in the interface. For example, the exposure is adjusted to -0.5 by sliding the screen downward. After the adjustment, the user lets go of the screen, the exposure bar 908 disappears, and the interface is shown as shown in FIG24 (3). In the interface shown in FIG24 (3), the mobile phone continues to lock the object with a highlighted focus frame 904, and a small sun icon 905 is also displayed for adjusting the exposure.

应理解,图24中示出的界面仅是示例描述,本申请实施例并不限于此。It should be understood that the interface shown in FIG. 24 is merely an example description and the embodiments of the present application are not limited thereto.

对于用户主动选择的追焦对象,可能会存在移动的情形。在一些可能的实现方式中,对于目标追焦对象为人物的情况,在对用户选择的目标对象的持续追焦的过程中,若无法识别到所述目标追焦对象的面部,则将人脸框(或者说面部框)转换为人体框;在重新识别到所述目标追焦对象的面部时,仍然显示人体框。The focus object actively selected by the user may move. In some possible implementations, when the target focus object is a person, if the face of the target focus object cannot be recognized during the continuous focus tracking of the target object selected by the user, the face frame (or face frame) is converted to a human frame; when the face of the target focus object is re-recognized, the human frame is still displayed.

在重新识别到目标对象的面部时,仍然采用人体框对目标对象进行追焦,能够避免人脸框与人体框来回切换的问题。When the face of the target object is re-identified, the human body frame is still used to track the target object, which can avoid the problem of switching back and forth between the face frame and the human body frame.

图25示出了在目标追焦对象的面部消失时追焦框变化的界面示例图。如图25中(1)所示的录像预览界面,针对注册人脸B采用主角追焦框902进行追焦,针对非注册人脸A采用常规追焦框901进行对焦。Figure 25 shows an example of an interface showing the focus frame changes when the face of the target focus object disappears. In the video preview interface shown in (1) of Figure 25, the main focus frame 902 is used for focus tracking on the registered face B, and the conventional focus frame 901 is used for focus tracking on the non-registered face A.

当用户点击人脸A后,界面显示如图25中(2)所示,手机采用高亮对焦框2302对人脸A进行追焦,即将人脸A作为目标追焦对象或锁定目标。在图25中(2)中,高亮对焦框2302为人脸追焦框(简称人脸框)。When the user clicks on face A, the interface is displayed as shown in FIG25 (2), and the mobile phone uses a highlight focus frame 2302 to track face A, that is, face A is taken as the target tracking object or locked target. In FIG25 (2), the highlight focus frame 2302 is a face tracking focus frame (referred to as face frame).

图25中(2)还包括录像控件2301,在用户点击开始录像控件2301后,手机开始进行录像,界面显示如图25中(3)所示的界面,比如,第1秒的录制画面,采用高亮对焦框2302对人脸A进行持续追焦。(2) in FIG. 25 also includes a video recording control 2301. After the user clicks the start video recording control 2301, the mobile phone starts recording, and the interface is displayed as shown in (3) in FIG. 25. For example, in the recording screen of the first second, a highlight focus frame 2302 is used to continuously focus on face A.

随着锁定目标的移动或转身,手机可能无法识别到锁定目标的面部,能识别到人体,此时可将人脸框转换为人体框继续追焦。比如,如图25中(4)所示的界面,在锁定目标转身时,针对人脸A的面部追焦框2302将会转为人体追焦框2303(简称人体框)。并且,即使在人脸A的面部重新恢复或者说重新识别到人脸A的面部后,依然继续追踪人体,不再切换为人脸框。比如,如图25中(5)所示的画面,当人脸A的面部能识别到时,仍采用人体框2303进行追踪。这样做的好处在于能够避免人脸框和人体框来回切换的问题,从而减少对用户的干扰,提升拍摄体验。As the locked target moves or turns around, the mobile phone may not be able to recognize the face of the locked target, but can recognize the human body. At this time, the face frame can be converted to the human body frame to continue tracking. For example, as shown in the interface (4) in Figure 25, when the locked target turns around, the face tracking focus frame 2302 for face A will be converted to the human body tracking focus frame 2303 (referred to as the human body frame). Moreover, even after the face of face A is restored or re-recognized, the human body continues to be tracked and is no longer switched to the face frame. For example, as shown in the picture (5) in Figure 25, when the face of face A can be recognized, the human body frame 2303 is still used for tracking. The advantage of this is that it can avoid the problem of switching back and forth between the face frame and the human body frame, thereby reducing interference to the user and improving the shooting experience.

在一些可能的实现方式中,在对追焦目标(追焦目标可以指第一注册对象,或者说主角)进行持续追焦的过程中,如果识别到追焦目标的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;如果识别到追焦目标的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。 In some possible implementations, during continuous focusing on a focus target (the focus target may refer to the first registered object, or the protagonist), if it is recognized that the face of the focus target occupies a smaller proportion than a first threshold on the screen, the first focus frame is switched from a face frame to a body frame; if it is recognized that the face of the focus target occupies a greater proportion than or equal to the first threshold on the screen, the first focus frame is switched from a body frame to a face frame.

本申请实施例对第一阈值的取值不作具体限定,第一阈值可以基于实际需求设置。The embodiment of the present application does not specifically limit the value of the first threshold, and the first threshold can be set based on actual needs.

本申请实施例对识别人体或人脸的算法不作具体限定。比如,可通过面部识别算法精确识别用户的五官。又比如,可通过骨骼算法精确识别用户的躯干。The embodiments of the present application do not specifically limit the algorithm for identifying a human body or a human face. For example, a facial recognition algorithm can be used to accurately identify the user's facial features. For another example, a skeleton algorithm can be used to accurately identify the user's torso.

可选地,人脸框与人体框之间的切换可增加动画效果,以便框的切换更平滑,提升用户的视觉体验。Optionally, the switching between the face frame and the body frame may be enhanced with an animation effect so that the frame switching is smoother and the user's visual experience is enhanced.

参考图26,图26示出了在追焦目标远近切换时追焦框变化的界面示例。如图26中(1)所示的界面,在录制过程中,对识别到的注册人脸B采用主角追焦框2401(或称作人脸追焦框,简称人脸框)进行自动追焦。Referring to Figure 26, Figure 26 shows an example of an interface in which the focus frame changes when the focus target switches between near and far. In the interface shown in (1) of Figure 26, during the recording process, the main character focus frame 2401 (or face focus frame, abbreviated as face frame) is used to automatically focus on the registered face B identified.

如图26中(2)所示的界面,当追焦目标(或者说注册人脸B)跑远无法识别到人脸B的面部时,采用人体框2402对人物进行自动追焦。As shown in the interface (2) of FIG. 26 , when the focus target (or registered face B) moves too far to be recognized, the human body frame 2402 is used to automatically focus on the person.

如图26中(3)所示的界面,随着目标由远及近移动,当人物向镜头靠近足够近的距离时,从人体框2402切换至人脸框2401对人脸B进行追焦。As shown in the interface (3) of FIG. 26 , as the target moves from far to near, when the person approaches the camera sufficiently close to the camera, the focus is switched from the human body frame 2402 to the face frame 2401 to track the face B.

本申请实施例对追焦框的框体大小不作具体限定。此处做统一说明,此处提及的追焦框可以是本申请实施例的各种类型的追焦框。比如,第一追焦框,第二追焦框,第三追焦框,第四追焦框,主角追焦框,非主角追焦框,人脸追焦框等等。部分追焦框在不同的场景下可有互换使用,比如,图26中(1)提及的主角追焦框2401也可称作人脸追焦框。The embodiment of the present application does not specifically limit the size of the focus tracking frame. Here is a unified explanation, and the focus tracking frame mentioned here can be various types of focus tracking frames in the embodiment of the present application. For example, the first focus tracking frame, the second focus tracking frame, the third focus tracking frame, the fourth focus tracking frame, the protagonist focus tracking frame, the non-protagonist focus tracking frame, the face focus tracking frame, etc. Some focus tracking frames can be used interchangeably in different scenarios. For example, the protagonist focus tracking frame 2401 mentioned in (1) of Figure 26 can also be called a face focus tracking frame.

可选地,追焦框的框体大小可取决于拍摄主体在屏幕中的占比、拍摄主体的姿势。示例性地,对于拍摄主体而言,追焦框可能是人脸追焦框,也可能是人体追焦框,也可能是躯干追焦框。Optionally, the size of the tracking focus frame may depend on the proportion of the subject in the screen and the posture of the subject. For example, for the subject, the tracking focus frame may be a face tracking focus frame, a body tracking focus frame, or a torso tracking focus frame.

在一些可能的实现方式中,对于人脸追焦框,人脸追焦框的大小可与人脸在屏幕中的占比相关。In some possible implementations, for a face tracking focus frame, the size of the face tracking focus frame may be related to the proportion of the face in the screen.

图27示出了不同尺寸人脸追焦框的双框的示意图。如图27中(1)所示的人脸追焦框2501和如图27中(2)所示的人脸追焦框2502,在对注册人脸进行追焦时,可基于注册人脸的大小(或者说注册人脸的在屏幕中的占比)实时调整人脸追焦框。可以看到,人脸追焦框2501和人脸追焦框2502为不同尺寸的追焦框。FIG27 shows a schematic diagram of a double frame of face tracking focus frames of different sizes. When tracking the focus of a registered face, the face tracking focus frame 2501 shown in FIG27 (1) and the face tracking focus frame 2502 shown in FIG27 (2) can be adjusted in real time based on the size of the registered face (or the proportion of the registered face in the screen). It can be seen that the face tracking focus frame 2501 and the face tracking focus frame 2502 are tracking focus frames of different sizes.

应理解,图27中示出的界面是录像过程中的界面为例进行说明,本申请实施例并不限于此。It should be understood that the interface shown in FIG. 27 is an example of the interface during the video recording process, and the embodiments of the present application are not limited to this.

还应理解,图27中示出的人脸追焦框是以双框为例进行说明,本申请实施例并不限于此。事实上,对于人脸追焦框是单框的情况,人脸追焦框的大小也可与人脸在屏幕中的占比相关。可选地,人脸追焦框是单框的情况,包括:对用户选择的目标追焦对象进行追焦时采用的追焦框。比如,前文第三追焦框。It should also be understood that the face tracking focus frame shown in FIG. 27 is illustrated by taking a double frame as an example, and the embodiments of the present application are not limited to this. In fact, in the case where the face tracking focus frame is a single frame, the size of the face tracking focus frame may also be related to the proportion of the face in the screen. Optionally, the face tracking focus frame is a single frame, including: a tracking focus frame used when tracking the target tracking object selected by the user. For example, the third tracking focus frame mentioned above.

图28示出了不同尺寸人脸追焦框的单框示意图。如图28中(1)所示的人脸追焦框2503和如图28中(2)所示的人脸追焦框2504,在对注册人脸进行追焦时,可基于注册人脸的大小(或者说注册人脸的在屏幕中的占比)实时调整人脸追焦框。可以看到,人脸追焦框2503和人脸追焦框2504为不同尺寸的追焦框。FIG28 shows a schematic diagram of a single frame of face tracking focus frames of different sizes. When tracking the focus of a registered face, the face tracking focus frame 2503 shown in FIG28 (1) and the face tracking focus frame 2504 shown in FIG28 (2) can be adjusted in real time based on the size of the registered face (or the proportion of the registered face in the screen). It can be seen that the face tracking focus frame 2503 and the face tracking focus frame 2504 are tracking focus frames of different sizes.

在一些可能的实现方式中,对于人体追焦框,人体追焦框的大小可与人体(或者人体的躯干)在屏幕中的占比或人体的姿态相关。对于人体的不同状态,人体追焦框均可对人体(或者人体的躯干)进行识别追焦。比如,用户在瑜伽、运动、站立等姿态下,手机可以采用合适尺寸的追焦框对人体(或者人体的躯干)进行识别追焦。In some possible implementations, for the human body tracking focus frame, the size of the human body tracking focus frame may be related to the proportion of the human body (or the human body's torso) in the screen or the human body's posture. For different states of the human body, the human body tracking focus frame can identify and track the human body (or the human body's torso). For example, when the user is in postures such as yoga, exercise, and standing, the mobile phone can use a tracking focus frame of a suitable size to identify and track the human body (or the human body's torso).

图29示出了不同尺寸的人体追焦框的示意图。如图29中(1)所示的人体追焦框2601、 如图29中(2)所示的人体追焦框2602、如图29中(3)所示的人体追焦框2603以及如图29中(4)所示的人体追焦框2604,在对人体进行追焦时,可识别人体并基于识别到的人体(或者说躯干在屏幕中的占比)实时调整人体追焦框。可以看到,人体追焦框2601、人体追焦框2602、人体追焦框2603以及人体追焦框2604为不同尺寸的追焦框。FIG29 shows a schematic diagram of human body tracking focus frames of different sizes. As shown in FIG29 (1), human body tracking focus frame 2601, As shown in Figure 29 (2) human body tracking focus frame 2602, as shown in Figure 29 (3) human body tracking focus frame 2603, and as shown in Figure 29 (4) human body tracking focus frame 2604, when tracking the focus on the human body, the human body can be identified and the human body tracking focus frame can be adjusted in real time based on the identified human body (or the proportion of the torso in the screen). It can be seen that human body tracking focus frame 2601, human body tracking focus frame 2602, human body tracking focus frame 2603, and human body tracking focus frame 2604 are tracking focus frames of different sizes.

请参考图30,为本申请实施例提供的拍摄方法的示意性流程图。如图30所示,该方法包括:Please refer to Figure 30, which is a schematic flow chart of a shooting method provided in an embodiment of the present application. As shown in Figure 30, the method includes:

步骤1101,响应于用户的第一操作,进入拍照模式或录像模式。Step 1101, in response to a first operation of the user, entering a photo taking mode or a video recording mode.

比如,如图3中(1)所示,第一操作是用户点击相机401的操作。For example, as shown in ( 1 ) of FIG. 3 , the first operation is an operation in which the user clicks the camera 401 .

又比如,如图13中(1)所示,第一操作是用户点击录像模式的操作。For another example, as shown in (1) in FIG. 13 , the first operation is an operation in which the user clicks on the recording mode.

步骤1102,在识别到单个注册对象或多个注册对象时,显示第一界面,所述第一界面包括第一注册对象以及第一追焦框(比如,主角追焦框),所述第一追焦框用于对所述第一注册对象进行主角追焦,且,所述第一追焦框在预设时长后不消失,其中,所述第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。Step 1102, when a single registered object or multiple registered objects are identified, a first interface is displayed, wherein the first interface includes the first registered object and a first focus tracking frame (for example, a protagonist focus tracking frame), wherein the first focus tracking frame is used to perform protagonist focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to perform protagonist focus on the first registered object means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object.

在本申请实施例中,当识别到单个注册对象或多个注册对象时,可通过第一追焦框对第一追焦对象进行主角追焦(或者说持续追焦)。并且,在持续追焦的过程中,相比于常规对焦框在预设时长后自动消失,所述第一追焦框在预设时长后不消失。当然,所述第一追焦框在预设时长后不消失的前提是能够识别到第一注册对象,或者说第一注册对象一直在画面中。另外,第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。通过引入第一追焦框,能够实现对拍摄对象进行智能追焦,提升拍摄体验。In an embodiment of the present application, when a single registered object or multiple registered objects are identified, the first focusing frame can be used to perform protagonist tracking (or continuous focusing) on the first focusing object. Moreover, in the process of continuous focusing, compared to the conventional focusing frame that automatically disappears after a preset time period, the first focusing frame does not disappear after the preset time period. Of course, the premise that the first focusing frame does not disappear after the preset time period is that the first registered object can be identified, or the first registered object is always in the picture. In addition, the first focusing frame is used to perform protagonist tracking on the first registered object, which means that when the first registered object moves in the picture, the first focusing frame moves with the first registered object. By introducing the first focusing frame, intelligent focusing of the photographed object can be achieved, improving the shooting experience.

比如,第一追焦框是前文图10中示出的主角追焦框902,第一注册对象是图10中的人脸B。For example, the first focus frame is the protagonist focus frame 902 shown in FIG. 10 above, and the first registered object is the face B in FIG. 10 .

可选地,作为一种可能的实现方式,对于识别到单个注册对象的情况,所述第一注册对象是所述单个注册对象。比如,图10中示出的拍摄场景为单个注册对象的情况。Optionally, as a possible implementation, in the case where a single registered object is identified, the first registered object is the single registered object. For example, the shooting scene shown in FIG10 is a case where a single registered object is identified.

可选地,作为一种可能的实现方式,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中满足预设条件的目标对象。Optionally, as a possible implementation manner, in the case where multiple registered objects are identified, the first registered object is a target object that meets a preset condition among the multiple registered objects.

可选地,作为一种可能的实现方式,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中在所述第一界面的人脸占比最高的对象。比如,图11中示出的拍摄场景为多个注册对象的情况,此时,第一注册对象为人脸B,即最靠近镜头的人脸。Optionally, as a possible implementation, in the case where multiple registered objects are identified, the first registered object is the object with the highest proportion of faces in the first interface among the multiple registered objects. For example, in the case where the shooting scene shown in FIG11 is multiple registered objects, the first registered object is face B, that is, the face closest to the camera.

可选地,作为一种可能的实现方式,对于识别到多个注册对象的情况,所述第一界面还包括多个第二追焦框,所述多个第二追焦框用于对所述多个注册对象中除去所述第一注册对象外的注册对象进行追焦,其中,所述第二追焦框与所述第一追焦框的颜色不同。比如,第二追焦框是前文图11中(1)所示的非主角追焦框903。Optionally, as a possible implementation, in the case where multiple registered objects are identified, the first interface further includes multiple second focus tracking frames, and the multiple second focus tracking frames are used to focus on registered objects other than the first registered object among the multiple registered objects, wherein the second focus tracking frame has a different color from the first focus tracking frame. For example, the second focus tracking frame is the non-protagonist focus tracking frame 903 shown in (1) of FIG. 11 above.

可选地,作为一种可能的实现方式,在识别到非注册对象时,所述第一界面中还包括常规对焦框,所述常规对焦框用于对所述非注册对象进行对焦,所述常规对焦框在所述预设时长后自动消失;其中,所述第一追焦框与所述常规对焦框的不同体现在以下一项或多项因素:颜色、框型、线条、显示时长。比如,非注册对象为图11中的人脸A,常规对焦框为图11中的常规对焦框901。因此,本申请实施例的第一追焦框与常规对焦框存在明显不同,通过第一追焦框能够实现对主角进行持续追焦。 Optionally, as a possible implementation method, when an unregistered object is identified, the first interface also includes a conventional focus frame, and the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after the preset time period; wherein, the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration. For example, the unregistered object is face A in Figure 11, and the conventional focus frame is conventional focus frame 901 in Figure 11. Therefore, the first tracking focus frame of the embodiment of the present application is significantly different from the conventional focus frame, and the first tracking focus frame can be used to achieve continuous tracking of the protagonist.

可选地,作为一种可能的实现方式,所述第一追焦框为双框。Optionally, as a possible implementation manner, the first focus tracking frame is a double frame.

可选地,作为一种可能的实现方式,对于拍照模式,所述第一界面是拍照预览界面,其中,所述第一操作是启动相机应用的操作。比如,图10或图11示出的界面为拍照模式下的界面。Optionally, as a possible implementation, for the photo mode, the first interface is a photo preview interface, wherein the first operation is an operation of starting a camera application. For example, the interface shown in FIG10 or FIG11 is an interface in the photo mode.

可选地,作为一种可能的实现方式,对于录像模式,所述第一界面是录像预览界面,其中,所述第一操作是切换到录像模式的操作。比如,图13示出的界面为录像模式下的界面。Optionally, as a possible implementation, for the video recording mode, the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode. For example, the interface shown in FIG13 is an interface in the video recording mode.

可选地,作为一种可能的实现方式,所述方法还包括:Optionally, as a possible implementation manner, the method further includes:

响应于用户点击录制控件的操作,显示视频录制界面,所述视频录制界面包括所述第一注册对象以及所述第一追焦框。In response to the user clicking the recording control, a video recording interface is displayed, and the video recording interface includes the first registered object and the first focus frame.

可选地,作为一种实施例,在录制视频过程中,所述方法还包括:在对所述第一注册对象的持续追焦过程中,如果识别到所述第一注册对象的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;如果识别到所述第一注册对象的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。比如,第一追焦框的变化可参考图26示出的界面,第一注册对象为图26中的人脸B。Optionally, as an embodiment, during the video recording process, the method further includes: during the continuous tracking of the first registered object, if it is recognized that the proportion of the face of the first registered object in the screen is less than a first threshold, the first tracking frame is switched from the face frame to the human frame; if it is recognized that the proportion of the face of the first registered object in the screen is greater than or equal to the first threshold, the first tracking frame is switched from the human frame to the face frame. For example, the change of the first tracking frame can refer to the interface shown in Figure 26, and the first registered object is the face B in Figure 26.

可选地,作为一种实施例,在录制视频过程中,所述方法还包括:在对所述第一注册对象的持续追焦过程中,如果无法识别到所述第一注册对象时,在所述视频录制界面中所述第一追焦框也消失,并对实际识别到的人脸进行追焦或对焦;如果识别到所述第一注册对象恢复时,在所述视频录制界面中继续显示所述第一追焦框。比如,图13中(5)与图13中(6)示出了注册人脸B消失以及恢复的界面示例。Optionally, as an embodiment, during the video recording process, the method further includes: during the continuous tracking of the first registered object, if the first registered object cannot be recognized, the first tracking frame disappears in the video recording interface, and the actually recognized face is tracked or focused; if the first registered object is recognized and restored, the first tracking frame continues to be displayed in the video recording interface. For example, Figure 13 (5) and Figure 13 (6) show examples of interfaces where registered face B disappears and is restored.

可选地,在显示所述第一界面之前,所述方法还包括:开启“主角追焦”功能。Optionally, before displaying the first interface, the method further includes: turning on a “protagonist tracking focus” function.

可选地,作为一种实施例,开启“主角追焦”功能,包括:响应于用户点击相机设置界面中的“主角追焦”选项的操作,开启所述“主角追焦”功能,其中,在检测到图库中的人像数据已生成时,所述“主角追焦”选项为可用状态。比如,如图7中(2)所示,用户点击“主角追焦”的选项405,开启“主角追焦”功能。Optionally, as an embodiment, enabling the "main character tracking focus" function includes: in response to a user clicking on the "main character tracking focus" option in the camera setting interface, enabling the "main character tracking focus" function, wherein when it is detected that the portrait data in the gallery has been generated, the "main character tracking focus" option is in an available state. For example, as shown in FIG7 (2), the user clicks on the "main character tracking focus" option 405 to enable the "main character tracking focus" function.

可选地,作为一种实施例,在打开相机应用时,如果检测到图库中的人像数据已生成时,在相机预览界面显示第一弹窗(比如,图8中(3)示出的窗口801),所述第一弹窗包括开启或关闭“主角追焦”功能的选项;其中,所述开启“主角追焦”功能,包括:响应于用户点击所述第一弹窗中的开启选项的操作,开启所述“主角追焦”功能。比如,如图8中(3)所示,当用户点击窗口801中的开启选项后,“主角追焦”功能开启。Optionally, as an embodiment, when the camera application is opened, if it is detected that the portrait data in the gallery has been generated, a first pop-up window (for example, window 801 shown in (3) of FIG8 ) is displayed in the camera preview interface, and the first pop-up window includes an option to turn on or off the “main character tracking focus” function; wherein, turning on the “main character tracking focus” function includes: in response to the user clicking the turn-on option in the first pop-up window, turning on the “main character tracking focus” function. For example, as shown in (3) of FIG8 , when the user clicks the turn-on option in window 801, the “main character tracking focus” function is turned on.

可选地,作为一种实施例,对于首次开启“主角追焦”功能的情况,所述方法还包括:在所述第一界面中显示第一提示框,所述第一提示框用于向用户提示已经识别到主角追焦。比如,第一提示框是图9中(4)示出的提示框802。Optionally, as an embodiment, when the "main character tracking focus" function is turned on for the first time, the method further includes: displaying a first prompt box in the first interface, the first prompt box being used to prompt the user that the main character tracking focus has been identified. For example, the first prompt box is prompt box 802 shown in (4) of FIG. 9 .

可选地,作为一种实施例,所述方法还包括:Optionally, as an embodiment, the method further includes:

接收到用户的第二操作,所述第二操作用于选择目标追焦对象;receiving a second operation of the user, where the second operation is used to select a target focus tracking object;

显示第二界面;当所述目标追焦对象为可识别目标时,所述第二界面包括第一追焦控件,所述第一追焦控件包括第三追焦框以及第一图标,所述第一图标用于调节曝光,所述第三追焦框用于对所述目标追焦对象进行追焦;Displaying a second interface; when the target focus object is a recognizable target, the second interface includes a first focus control, the first focus control includes a third focus frame and a first icon, the first icon is used to adjust exposure, and the third focus frame is used to focus on the target focus object;

当所述目标追焦对象为不可识别目标时,所述第二界面包括第二追焦控件,所述第二追焦控件包括第四追焦框以及第二图标;所述第二图标用于调节曝光,所述第四追焦框用于对所述目标追焦对象进行追焦,其中,所述第四追焦框与所述第三追焦框的颜色不同,所述第 一图标与所述第二图标的颜色不同。When the target focus object is an unrecognizable target, the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the fourth focus frame is different in color from the third focus frame. The first icon has a different color from the second icon.

需要说明的是,无论是拍照模式还是录像模式,均可存在人为干预选择目标追焦对象的情况。比如,前文图14至图16示出了在拍照模式下存在人为干预的场景;图17和图18示出了在录像模式下存在人为干预的场景。It should be noted that, whether in photo mode or video mode, there may be human intervention in selecting the target focus object. For example, Figures 14 to 16 above show scenes with human intervention in photo mode; Figures 17 and 18 show scenes with human intervention in video mode.

可选地,作为一种实施例,在对目标追焦对象进行追焦时,所述方法还包括:Optionally, as an embodiment, when performing focus tracking on the target focus tracking object, the method further includes:

接收到用户滑动屏幕的操作;Receive the user's screen sliding operation;

响应于所述滑动屏幕的操作,对画面的曝光量进行相应调节。比如,图23中示出了调节曝光的界面。In response to the operation of sliding the screen, the exposure of the picture is adjusted accordingly. For example, FIG23 shows an interface for adjusting exposure.

可选地,作为一种实施例,在所述目标追焦对象是可识别目标且采用所述第三追焦框对所述目标追焦对象进行追焦时,所述方法还包括:显示第二提示框,所述第二提示框用于向用户提示已锁定追焦目标。比如,第二提示框为图18中(3)示出的提示框920。Optionally, as an embodiment, when the target focus object is a recognizable target and the target focus object is focused using the third focus frame, the method further includes: displaying a second prompt frame, the second prompt frame being used to prompt the user that the focus target has been locked. For example, the second prompt frame is the prompt frame 920 shown in (3) of FIG. 18 .

可选地,作为一种实施例,所述目标追焦对象为人物,在对目标追焦对象进行持续追焦的过程中,所述方法还包括:若无法识别到所述目标追焦对象的面部,则将人脸框转换为人体框;在重新识别到所述目标追焦对象的面部时,仍然显示人体框。比如,图25示出了目标追焦对象的面部消失时追焦框变化的界面。Optionally, as an embodiment, the target focus tracking object is a person, and in the process of continuously tracking the target focus tracking object, the method further includes: if the face of the target focus tracking object cannot be recognized, converting the face frame into a human frame; when the face of the target focus tracking object is re-recognized, still displaying the human frame. For example, FIG25 shows an interface of the focus tracking frame change when the face of the target focus tracking object disappears.

下面结合图31描述电子设备100的软件系统。The software system of the electronic device 100 is described below in conjunction with Figure 31.

图31是本申请实施例应用的架构(包括软件系统和部分硬件)的一个示意图。如图31所示,应用架构分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,应用架构可以分为五层,从上至下分别为应用层、应用框架层、硬件抽象层HAL、内核驱动层(kernel)以及硬件层。Figure 31 is a schematic diagram of the architecture (including software system and some hardware) of the application of the embodiment of the present application. As shown in Figure 31, the application architecture is divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the application architecture can be divided into five layers, from top to bottom, respectively, the application layer, the application framework layer, the hardware abstraction layer HAL, the kernel driver layer (kernel) and the hardware layer.

如图31所示,应用层包括相机。可以理解,图31中示出的是部分应用程序,事实上应用层还可以包括其他应用程序(包括系统应用程序和/或第三方应用程序),本申请对此不作限定。比如应用层还包括图库、信息、闹钟、天气、秒表、指南针、计时器、手电筒、日历、支付宝等应用程序。As shown in FIG31 , the application layer includes a camera. It is understood that FIG31 shows some applications. In fact, the application layer may also include other applications (including system applications and/or third-party applications), which is not limited in this application. For example, the application layer also includes applications such as gallery, information, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, and Alipay.

图31是本申请实施例应用的架构(包括软件系统和部分硬件)的一个示意图。如图31所示,应用架构分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,应用架构可以分为五层,从上至下分别为应用层、应用框架层、硬件抽象层HAL、驱动层(driver)以及硬件层。FIG31 is a schematic diagram of the architecture (including software system and some hardware) of the application of the embodiment of the present application. As shown in FIG31, the application architecture is divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the application architecture can be divided into five layers, from top to bottom, respectively, the application layer, the application framework layer, the hardware abstraction layer HAL, the driver layer (driver) and the hardware layer.

如图31所示,应用层包括相机APP和图库APP。在一些实施例中,图库可将图像的数据传输给相机应用。在一些实施例中,本申请实施例的注册人脸可以通过APP中的图像数据确定。As shown in Figure 31, the application layer includes a camera APP and a gallery APP. In some embodiments, the gallery can transmit the image data to the camera application. In some embodiments, the registered face of the embodiment of the present application can be determined by the image data in the APP.

可选地,根据图库的人像数据,选取相册中出镜频率最高的预设数量的人脸,作为注册人脸。Optionally, based on the portrait data in the gallery, a preset number of faces with the highest appearance frequency in the album are selected as registered faces.

可以理解,图31中示出的是部分应用程序,事实上应用层还可以包括其他应用程序,本申请对此不作限定。比如应用层还包括信息、闹钟、天气、秒表、指南针、计时器、手电筒、日历、支付宝等应用程序。It is understandable that what is shown in FIG31 are some applications. In fact, the application layer may also include other applications, which is not limited in this application. For example, the application layer also includes information, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, Alipay and other applications.

如图31所示,应用框架层包括相机访问接口。相机访问接口中包括相机管理和相机设备。硬件抽象层包括相机硬件抽象层和相机算法库。其中,相机硬件抽象层中包括多个相机设备。相机算法库中包括算法处理模块。As shown in FIG. 31 , the application framework layer includes a camera access interface. The camera access interface includes camera management and camera devices. The hardware abstraction layer includes a camera hardware abstraction layer and a camera algorithm library. The camera hardware abstraction layer includes multiple camera devices. The camera algorithm library includes an algorithm processing module.

驱动层用于驱动硬件资源。驱动层中可以包括多个驱动模块。如图31所示,驱动层包括 相机设备驱动、数字信号处理器驱动和图形处理器驱动等。The driver layer is used to drive hardware resources. The driver layer can include multiple driver modules. As shown in Figure 31, the driver layer includes Camera device drivers, digital signal processor drivers, and graphics processor drivers, etc.

硬件层包括传感器、图像信号处理器、数字信号处理器和图形处理器。其中,传感器中包括多个传感器、TOF摄像头以及多光谱传感器。The hardware layer includes sensors, image signal processors, digital signal processors, and graphics processors. The sensors include multiple sensors, TOF cameras, and multi-spectral sensors.

举例来说,用户可以点击相机应用程序。在用户点击相机进行拍照时,拍照指令可以通过相机访问接口下发到相机硬件抽象层。相机硬件抽象层调用相机设备驱动,并调用相机算法库。相机算法库可将相关的处理参数发送给相机硬件抽象层。相机硬件抽象层将参数下发到相机设备驱动。相机设备驱动将相机硬件抽象层下发的参数发送到硬件层。传感器基于senor出图方式进行出图。图像信号处理器基于各个ISP模块的参数配置进行相应的处理。相机算法库还用于向驱动层中的数字信号处理器驱动下发数字信号,以便数字信号处理器驱动调用硬件层中的数字信号处理器进行数字信号处理。数字信号处理器可以将处理好的数字信号通过数字信号处理器驱动返回到相机算法库。相机算法库还用于向驱动层中的图形信号处理器驱动下发数字信号,以便图形信号处理器驱动调用硬件层中的图形处理器进行数字信号处理。图形处理器可以将处理好的图形数据通过图形处理器驱动返回到相机算法库。For example, a user may click on a camera application. When the user clicks on the camera to take a photo, the photo taking instruction may be sent to the camera hardware abstraction layer through the camera access interface. The camera hardware abstraction layer calls the camera device driver and calls the camera algorithm library. The camera algorithm library may send relevant processing parameters to the camera hardware abstraction layer. The camera hardware abstraction layer sends the parameters to the camera device driver. The camera device driver sends the parameters sent by the camera hardware abstraction layer to the hardware layer. The sensor outputs the image based on the sensor output mode. The image signal processor performs corresponding processing based on the parameter configuration of each ISP module. The camera algorithm library is also used to send digital signals to the digital signal processor driver in the driver layer so that the digital signal processor driver calls the digital signal processor in the hardware layer for digital signal processing. The digital signal processor may return the processed digital signal to the camera algorithm library through the digital signal processor driver. The camera algorithm library is also used to send digital signals to the graphics signal processor driver in the driver layer so that the graphics signal processor driver calls the graphics processor in the hardware layer for digital signal processing. The graphics processor may return the processed graphics data to the camera algorithm library through the graphics processor driver.

另外,图像信号处理器输出的图像可以发送给相机设备驱动。相机设备驱动可以将图像信号处理器输出的图像发送给相机硬件抽象层。相机硬件抽象层可以将图像送入后处理算法模块作进一步处理,也可以将图像送入相机访问接口。相机访问接口可以将相机硬件抽象层返回的图像发送至相机。In addition, the image output by the image signal processor can be sent to the camera device driver. The camera device driver can send the image output by the image signal processor to the camera hardware abstraction layer. The camera hardware abstraction layer can send the image to the post-processing algorithm module for further processing, or send the image to the camera access interface. The camera access interface can send the image returned by the camera hardware abstraction layer to the camera.

上文结合图1至图31,详细描述了本申请实施例提供的拍摄方法。下面将结合图32描述本申请的装置实施例。应理解,本申请实施例的拍摄装置可以执行前述本申请实施例的拍摄方法,即以下各种产品的具体工作过程,可以参考前述方法实施例中的对应过程。The above text describes in detail the shooting method provided by the embodiment of the present application in conjunction with Figures 1 to 31. The following will describe the device embodiment of the present application in conjunction with Figure 32. It should be understood that the shooting device of the embodiment of the present application can execute the shooting method of the aforementioned embodiment of the present application, that is, the specific working process of the following various products can refer to the corresponding process in the aforementioned method embodiment.

图32是本申请实施例的拍摄装置3200的示意性框图。应理解,装置3200可以执行前文所示的拍摄方法。Fig. 32 is a schematic block diagram of a photographing device 3200 according to an embodiment of the present application. It should be understood that the device 3200 can execute the photographing method shown above.

如图32所示,所述装置3200包括:输入单元3210、处理单元3220和显示单元3230。所述装置3200可以是电子设备。As shown in Fig. 32, the apparatus 3200 includes: an input unit 3210, a processing unit 3220, and a display unit 3230. The apparatus 3200 may be an electronic device.

可选地,所述输入单元3210用于接收用户的第一操作;Optionally, the input unit 3210 is used to receive a first operation of a user;

所述处理单元3220用于响应于用户的第一操作,进入拍照模式或录像模式;The processing unit 3220 is used to enter a photo taking mode or a video recording mode in response to a first operation of the user;

所述显示单元3230用于在识别到单个注册对象或多个注册对象时,显示第一界面,所述第一界面包括第一注册对象以及第一追焦框,所述第一追焦框用于对所述第一注册对象进行主角追焦,且,所述第一追焦框在预设时长后不消失。The display unit 3230 is used to display a first interface when a single registered object or multiple registered objects are identified. The first interface includes a first registered object and a first focus frame. The first focus frame is used to focus on the first registered object, and the first focus frame does not disappear after a preset time.

可选地,作为一个可能的实施例,对于识别到单个注册对象的情况,所述第一注册对象是所述单个注册对象;或者,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中满足预设条件的目标对象。Optionally, as a possible embodiment, in the case where a single registered object is identified, the first registered object is the single registered object; or, in the case where multiple registered objects are identified, the first registered object is a target object among the multiple registered objects that meets a preset condition.

可选地,作为一个可能的实施例,对于识别到多个注册对象的情况,所述第一界面还包括多个第二追焦框,所述多个第二追焦框用于对所述多个注册对象中除去所述第一注册对象外的注册对象进行追焦,其中,所述第二追焦框与所述第一追焦框的颜色不同。Optionally, as a possible embodiment, in the case where multiple registered objects are identified, the first interface also includes multiple second focus frames, and the multiple second focus frames are used to focus on the multiple registered objects except the first registered object, wherein the second focus frame is different in color from the first focus frame.

可选地,作为一个可能的实施例,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中在所述第一界面的人脸占比最高的对象。Optionally, as a possible embodiment, in the case where multiple registered objects are identified, the first registered object is the object with the highest face ratio in the first interface among the multiple registered objects.

可选地,作为一个可能的实施例,以注册对象是注册人脸为例,注册人脸可通过图库APP中的图像数据确定。Optionally, as a possible embodiment, taking the registration object as a registered face as an example, the registered face can be determined through image data in the gallery APP.

可选地,作为一个可能的实施例,根据图库的人像数据,自动选取相册中出镜频率最高 的预设数量的人脸,作为注册人脸。Optionally, as a possible embodiment, based on the portrait data of the gallery, the person who appears most frequently in the album is automatically selected. A preset number of faces are selected as registered faces.

可选地,作为一个可能的实施例,根据用户的自主选择,将相册中预设数量的人脸,添加为注册人脸。Optionally, as a possible embodiment, according to the user's own choice, a preset number of faces in the album are added as registered faces.

可选地,作为一个可能的实施例,在识别到非注册对象时,所述第一界面中还包括显示常规对焦框,所述常规对焦框用于对所述非注册对象进行对焦,所述常规对焦框在预设时长后自动消失;Optionally, as a possible embodiment, when an unregistered object is identified, the first interface further includes displaying a conventional focus frame, the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after a preset time period;

其中,所述第一追焦框与所述常规对焦框的不同体现在以下一项或多项因素:颜色、框型、线条、显示时长。Among them, the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration.

可选地,作为一个可能的实施例,所述第一追焦框为双框,所述常规对焦框为单框。Optionally, as a possible embodiment, the first tracking focus frame is a double frame, and the conventional focus frame is a single frame.

可选地,作为一个可能的实施例,对于拍照模式,所述第一界面是拍照预览界面,其中,所述第一操作是启动相机应用的操作。Optionally, as a possible embodiment, for a photo taking mode, the first interface is a photo taking preview interface, wherein the first operation is an operation of starting a camera application.

可选地,作为一个可能的实施例,对于录像模式,所述第一界面是录像预览界面,其中,所述第一操作是切换到录像模式的操作。Optionally, as a possible embodiment, for the video recording mode, the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode.

可选地,作为一个可能的实施例,所述显示单元3230还用于响应于用户点击录制控件的操作,显示视频录制界面,所述视频录制界面包括所述第一注册对象以及所述第一追焦框。Optionally, as a possible embodiment, the display unit 3230 is also used to display a video recording interface in response to a user clicking a recording control, where the video recording interface includes the first registered object and the first focus frame.

可选地,作为一个可能的实施例,在录制视频过程中,在对所述第一注册对象的持续追焦过程中,如果识别到所述第一注册对象的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;Optionally, as a possible embodiment, during the video recording process, during the continuous tracking focus process of the first registered object, if it is recognized that the proportion of the face of the first registered object in the screen is less than a first threshold, the first tracking focus frame is switched from the face frame to the body frame;

如果识别到所述第一注册对象的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。If it is recognized that the proportion of the face of the first registered object in the screen is greater than or equal to a first threshold, the first focus frame is switched from a human body frame to a face frame.

可选地,作为一个可能的实施例,在录制视频过程中,在对所述第一注册对象的持续追焦过程中,如果无法识别到所述第一注册对象时,在所述视频录制界面中所述第一追焦框也消失,并对实际识别到的人脸进行追焦或对焦;Optionally, as a possible embodiment, during the video recording process, during the continuous tracking focus process of the first registered object, if the first registered object cannot be recognized, the first tracking focus frame also disappears in the video recording interface, and the actually recognized face is tracked or focused;

如果识别到所述第一注册对象恢复时,在所述视频录制界面中继续显示所述第一追焦框。If it is recognized that the first registered object is restored, the first focus frame continues to be displayed in the video recording interface.

可选地,作为一个可能的实施例,在显示所述第一界面之前,所述处理单元3220还用于开启“主角追焦”功能。Optionally, as a possible embodiment, before displaying the first interface, the processing unit 3220 is also used to enable a “protagonist tracking focus” function.

可选地,作为一个可能的实施例,所述处理单元3220用于开启“主角追焦”功能,包括:Optionally, as a possible embodiment, the processing unit 3220 is used to enable the “main character tracking focus” function, including:

响应于用户点击相机设置界面中的“主角追焦”选项的操作,开启所述“主角追焦”功能,其中,在检测到图库中的人像数据已生成时,所述“主角追焦”选项为可用状态。In response to a user clicking on a "main character tracking focus" option in a camera setting interface, the "main character tracking focus" function is turned on, wherein when it is detected that portrait data in a gallery has been generated, the "main character tracking focus" option is in an available state.

可选地,作为一个可能的实施例,所述显示单元3230还用于在打开相机应用时,如果检测到图库中的人像数据已生成时,在相机预览界面显示第一弹窗,所述第一弹窗包括开启或关闭“主角追焦”功能的选项;Optionally, as a possible embodiment, the display unit 3230 is further configured to display a first pop-up window on the camera preview interface when the camera application is opened and if it is detected that the portrait data in the gallery has been generated, the first pop-up window includes an option to turn on or off the "main character tracking focus" function;

其中,所述处理单元3220用于开启“主角追焦”功能,包括:The processing unit 3220 is used to enable the “main character tracking focus” function, including:

响应于用户点击所述第一弹窗中的开启选项的操作,开启所述“主角追焦”功能。In response to the user clicking on the enable option in the first pop-up window, the "main character tracking" function is enabled.

可选地,作为一个可能的实施例,对于首次开启“主角追焦”功能的情况,所述方法还包括: Optionally, as a possible embodiment, when the “main character tracking focus” function is enabled for the first time, the method further includes:

所述显示单元3230还用于在所述第一界面中显示第一提示框,所述第一提示框用于向用户提示已经识别到主角追焦。The display unit 3230 is further configured to display a first prompt box in the first interface, wherein the first prompt box is configured to prompt the user that the focus on the protagonist has been identified.

可选地,作为一个可能的实施例,所述输入单元3210还用于接收到用户的第二操作,所述第二操作用于选择目标追焦对象;Optionally, as a possible embodiment, the input unit 3210 is further used to receive a second operation of the user, where the second operation is used to select a target focus tracking object;

所述显示单元3230还用于显示第二界面;当所述目标追焦对象为可识别目标时,所述第二界面包括第一追焦控件,所述第一追焦控件包括第三追焦框以及第一图标,所述第一图标用于调节曝光,所述第三追焦框用于对所述目标追焦对象进行追焦;当所述目标追焦对象为不可识别目标时,所述第二界面包括第二追焦控件,所述第二追焦控件包括第四追焦框以及第二图标;所述第二图标用于调节曝光,所述第四追焦框用于对所述目标追焦对象进行追焦,其中,所述第四追焦框与所述第三追焦框的颜色不同,所述第一图标与所述第二图标的颜色不同。The display unit 3230 is also used to display a second interface; when the target focus object is a recognizable target, the second interface includes a first focus control, the first focus control includes a third focus frame and a first icon, the first icon is used to adjust the exposure, and the third focus frame is used to focus on the target focus object; when the target focus object is an unrecognizable target, the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon.

可选地,作为一个可能的实施例,在对目标追焦对象进行追焦时,所述输入单元3210还用于接收到用户滑动屏幕的操作;Optionally, as a possible embodiment, when focusing on the target focusing object, the input unit 3210 is further used to receive an operation of sliding the screen by the user;

所述处理单元3220还用于响应于所述滑动屏幕的操作,对画面的曝光量进行相应调节。The processing unit 3220 is further configured to adjust the exposure of the picture accordingly in response to the operation of sliding the screen.

可选地,作为一个可能的实施例,在所述目标追焦对象是可识别目标且采用所述第三追焦框对所述目标追焦对象进行追焦时,所述显示单元3230还用于显示第二提示框,所述第二提示框用于向用户提示已锁定追焦目标。Optionally, as a possible embodiment, when the target focus object is a identifiable target and the third focus frame is used to focus on the target focus object, the display unit 3230 is also used to display a second prompt frame, and the second prompt frame is used to prompt the user that the focus target has been locked.

可选地,作为一个可能的实施例,所述目标追焦对象为人物,在对目标追焦对象进行持续追焦的过程中,所述处理单元3220还用于:Optionally, as a possible embodiment, the target focus tracking object is a person, and in the process of continuously tracking the target focus tracking object, the processing unit 3220 is further configured to:

若无法识别到所述目标追焦对象的面部,则将人脸框转换为人体框;If the face of the target focus object cannot be recognized, the face frame is converted into a body frame;

在重新识别到所述目标追焦对象的面部时,仍然显示人体框。When the face of the target focus object is re-identified, the human body frame is still displayed.

可选地,作为一个可能的实施例,所述处理单元3220还用于:Optionally, as a possible embodiment, the processing unit 3220 is further configured to:

在对所第一注册对象的持续追焦过程中,如果识别到追焦目标的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;During the continuous tracking of the focus on the first registered object, if it is recognized that the face of the tracking target occupies less than a first threshold in the screen, the first tracking frame is switched from the face frame to the body frame;

如果识别到追焦目标的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。If it is recognized that the face of the focus target occupies a proportion greater than or equal to a first threshold in the screen, the first focus frame is switched from a human body frame to a face frame.

在一种可能的示例中,所述输入单元3210和所述处理单元3220可以通过处理器或处理单元实现,所述显示单元3230可通过显示屏实现。应理解,上述装置3200以功能单元的形式体现。这里的术语“单元”可以通过软件和/或硬件的形式实现,本申请实施例对此不作具体限定。In a possible example, the input unit 3210 and the processing unit 3220 may be implemented by a processor or a processing unit, and the display unit 3230 may be implemented by a display screen. It should be understood that the above-mentioned device 3200 is embodied in the form of a functional unit. The term "unit" here may be implemented in the form of software and/or hardware, and this embodiment of the application does not specifically limit this.

例如,“单元”可以是实现上述功能的软件程序、硬件电路或者二者结合。所述硬件电路可能包括(application specific integrated circuit,ASIC)应用特定集成电路、电子电路、执行一个或多个软件或固件程序的处理器(例如共享处理器、专有处理器或组处理器等)和存储器、集成逻辑电路,和/或其他可以提供上述功能的合适器件。在一个简单的实施例中,本领域的技术人员可以想到装置3200可以采用图2所示的形式。For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory that executes one or more software or firmware programs, an integrated logic circuit, and/or other suitable devices that can provide the above functions. In a simple embodiment, those skilled in the art can imagine that the device 3200 can take the form shown in Figure 2.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。 Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

本申请还提供了一种计算机程序产品,该计算机程序产品被处理器执行时实现本申请中任一方法实施例所述的方法。The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.

该计算机程序产品可以存储在存储器中,经过预处理、编译、汇编和链接等处理过程最终被转换为能够被处理器执行的可执行目标文件。The computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.

本申请还提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被计算机执行时实现本申请中任一方法实施例所述的方法。该计算机程序可以是高级语言程序,也可以是可执行目标程序。The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.

该计算机可读存储介质可以是易失性存储器或非易失性存储器,或者,可以同时包括易失性存储器和非易失性存储器。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The computer readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

本领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和设备的具体工作过程以及产生的技术效果,可以参考前述方法实施例中对应的过程和技术效果,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.

在本申请所提供的几个实施例中,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的方法实施例的一些特征可以忽略,或不执行。以上所描述的装置实施例仅仅是示意性的,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,多个单元或组件可以结合或者可以集成到另一个系统。另外,各单元之间的耦合或各个组件之间的耦合可以是直接耦合,也可以是间接耦合,上述耦合包括电的、机械的或其它形式的连接。In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not executed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.

应理解,在本申请的各种实施例中,各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请的实施例的实施过程构成任何限定。It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

另外,本文中术语“系统”和“网络”在本文中常被可互换使用。本文中的术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。In addition, the terms "system" and "network" are often used interchangeably in this article. The term "and/or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character "/" in this article generally indicates that the associated objects before and after are in an "or" relationship.

本申请实施例中出现的术语(或者说编号)“第一”、“第二”、…等,仅用于描述目的,即只是为了区分不同的对象,比如,不同的“操作”等,并不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”、…等的特征可以明示或者隐含地包括一个或者更多个特征。在本申请实施例的描述中,“至少一个(项)”是指一个或多个。“多个”的含义是两个或两个以上。“以下至少一个(项)”或其类似表达,是指这些项中的任意组合,包括单个(项)或复数个(项)的任意组合。 The terms (or numbers) "first", "second", ..., etc. that appear in the embodiments of the present application are only used for descriptive purposes, that is, only to distinguish different objects, such as different "operations", etc., and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first", "second", ..., etc. may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, "at least one (item)" refers to one or more. "Multiple" means two or more. "At least one of the following (items)" or similar expressions thereof refers to any combination of these items, including any combination of a single (item) or a plurality of (items).

例如,本申请实施例中出现的类似于“项目包括如下中至少一种:A,B,以及C”表述的含义,如无特别说明,通常是指该项目可以为如下中任一个:A;B;C;A和B;A和C;B和C;A,B和C;A和A;A,A和A;A,A和B;A,A和C,A,B和B;A,C和C;B和B,B,B和B,B,B和C,C和C;C,C和C,以及其他A,B和C的组合。以上是以A,B和C共3个元素进行举例来说明该项目的可选用条目,当表达为“项目包括如下中至少一种:A,B,……,以及X”时,即表达中具有更多元素时,那么该项目可以适用的条目也可以按照前述规则获得。For example, the meaning of the expression similar to "the item includes at least one of the following: A, B, and C" in the embodiments of the present application, unless otherwise specified, generally means that the item can be any one of the following: A; B; C; A and B; A and C; B and C; A, B and C; A and A; A, A and A; A, A and B; A, A and C, A, B and B; A, C and C; B and B, B, B and B, B and C, C and C; C, C and C, and other combinations of A, B and C. The above is an example of three elements, A, B and C, to illustrate the optional items of the item. When it is expressed as "the item includes at least one of the following: A, B, ..., and X", that is, when there are more elements in the expression, the items that can be applied to the item can also be obtained according to the above rules.

总之,以上所述仅为本申请技术方案的较佳实施例而已,并非用于限定本申请的保护范围。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。 In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.

Claims (22)

一种拍摄方法,其特征在于,所述方法应用于电子设备,所述方法包括:A shooting method, characterized in that the method is applied to an electronic device, and the method comprises: 响应于用户的第一操作,进入拍照模式或录像模式;In response to a first operation by the user, entering a photo taking mode or a video recording mode; 在识别到单个注册对象或多个注册对象时,显示第一界面,所述第一界面包括第一注册对象以及第一追焦框,所述第一追焦框用于对所述第一注册对象进行主角追焦,且,所述第一追焦框在预设时长后不消失,其中,所述第一追焦框用于对所述第一注册对象进行主角追焦是指:在所述第一注册对象在画面中发生移动时,所述第一追焦框跟随所述第一注册对象移动。When a single registered object or multiple registered objects are identified, a first interface is displayed, wherein the first interface includes a first registered object and a first focus tracking frame, wherein the first focus tracking frame is used to focus on the first registered object, and the first focus tracking frame does not disappear after a preset time period, wherein the first focus tracking frame is used to focus on the first registered object, which means that when the first registered object moves in the picture, the first focus tracking frame moves with the first registered object. 根据权利要求1所述的方法,其特征在于,对于识别到单个注册对象的情况,所述第一注册对象是所述单个注册对象;或者,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中满足预设条件的目标对象。The method according to claim 1 is characterized in that, in the case where a single registered object is identified, the first registered object is the single registered object; or, in the case where multiple registered objects are identified, the first registered object is a target object among the multiple registered objects that meets a preset condition. 根据权利要求1或2所述的方法,其特征在于,对于识别到多个注册对象的情况,所述第一界面还包括多个第二追焦框,所述多个第二追焦框用于对所述多个注册对象中除去所述第一注册对象外的注册对象进行追焦,其中,所述第二追焦框与所述第一追焦框的颜色不同。The method according to claim 1 or 2 is characterized in that, in the case where multiple registered objects are identified, the first interface also includes multiple second focus frames, and the multiple second focus frames are used to focus on the registered objects among the multiple registered objects except the first registered object, wherein the second focus frame has a different color from the first focus frame. 根据权利要求1至3中任一项所述的方法,其特征在于,对于识别到多个注册对象的情况,所述第一注册对象是所述多个注册对象中在所述第一界面的人脸占比最高的对象。The method according to any one of claims 1 to 3 is characterized in that, in the case where multiple registered objects are identified, the first registered object is the object with the highest face ratio in the first interface among the multiple registered objects. 根据权利要求1至4中任一项所述的方法,其特征在于,在识别到非注册对象时,所述第一界面中还包括常规对焦框,所述常规对焦框用于对所述非注册对象进行对焦,所述常规对焦框在所述预设时长后自动消失;The method according to any one of claims 1 to 4, characterized in that when an unregistered object is identified, the first interface further includes a conventional focus frame, the conventional focus frame is used to focus on the unregistered object, and the conventional focus frame automatically disappears after the preset time period; 其中,所述第一追焦框与所述常规对焦框的不同体现在以下一项或多项因素:颜色、框型、线条、显示时长。Among them, the difference between the first tracking focus frame and the conventional focus frame is reflected in one or more of the following factors: color, frame type, lines, and display duration. 根据权利要求1至5中任一项所述的方法,其特征在于,所述第一追焦框为双框。The method according to any one of claims 1 to 5 is characterized in that the first tracking focus frame is a double frame. 根据权利要求1至6中任一项所述的方法,其特征在于,对于拍照模式,所述第一界面是拍照预览界面,其中,所述第一操作是启动相机应用的操作。The method according to any one of claims 1 to 6 is characterized in that, for a photo taking mode, the first interface is a photo taking preview interface, wherein the first operation is an operation of starting a camera application. 根据权利要求1至6中任一项所述的方法,其特征在于,对于录像模式,所述第一界面是录像预览界面,其中,所述第一操作是切换到录像模式的操作。The method according to any one of claims 1 to 6 is characterized in that, for the video recording mode, the first interface is a video recording preview interface, wherein the first operation is an operation of switching to the video recording mode. 根据权利要求8所述的方法,其特征在于,所述方法还包括:The method according to claim 8, characterized in that the method further comprises: 响应于用户点击录制控件的操作,显示视频录制界面,所述视频录制界面包括所述第一注册对象以及所述第一追焦框。In response to the user clicking the recording control, a video recording interface is displayed, and the video recording interface includes the first registered object and the first focus frame. 根据权利要求9所述的方法,其特征在于,在录制视频过程中,所述方法还包括:The method according to claim 9, characterized in that, during the video recording process, the method further comprises: 在对所述第一注册对象的持续追焦过程中,如果识别到所述第一注册对象的面部在屏幕中的占比小于第一阈值时,所述第一追焦框从人脸框切换为人体框;During the continuous tracking focus process of the first registered object, if it is recognized that the proportion of the face of the first registered object in the screen is less than a first threshold, the first tracking focus frame is switched from the face frame to the body frame; 如果识别到所述第一注册对象的面部在屏幕中的占比大于或等于第一阈值时,所述第一追焦框从人体框切换为人脸框。If it is recognized that the proportion of the face of the first registered object in the screen is greater than or equal to a first threshold, the first focus frame is switched from a human body frame to a face frame. 根据权利要求9所述的方法,其特征在于,在录制视频过程中,所述方法还包括:The method according to claim 9, characterized in that, during the video recording process, the method further comprises: 在对所述第一注册对象的持续追焦过程中,如果无法识别到所述第一注册对象时,在所述视频录制界面中所述第一追焦框也消失,并对实际识别到的人脸进行追焦或对焦; During the continuous tracking focus process of the first registered object, if the first registered object cannot be recognized, the first tracking focus frame also disappears in the video recording interface, and the actually recognized face is tracked or focused; 如果识别到所述第一注册对象恢复时,在所述视频录制界面中继续显示所述第一追焦框。If it is recognized that the first registered object is restored, the first focus frame continues to be displayed in the video recording interface. 根据权利要求1至11中任一项所述的方法,其特征在于,在所述显示第一界面之前,所述方法还包括:The method according to any one of claims 1 to 11, characterized in that before displaying the first interface, the method further comprises: 开启“主角追焦”功能。Turn on the "Protagonist Focus" function. 根据权利要求12所述的方法,其特征在于,所述开启“主角追焦”功能,包括:The method according to claim 12, characterized in that the enabling of the "main character tracking focus" function comprises: 响应于用户点击相机设置界面中的“主角追焦”选项的操作,开启所述“主角追焦”功能,其中,在检测到图库中的人像数据已生成时,所述“主角追焦”选项为可用状态。In response to a user clicking on a "main character tracking focus" option in a camera setting interface, the "main character tracking focus" function is turned on, wherein when it is detected that portrait data in a gallery has been generated, the "main character tracking focus" option is in an available state. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method according to claim 12, characterized in that the method further comprises: 在打开相机应用时,如果检测到图库中的人像数据已生成时,在相机预览界面显示第一弹窗,所述第一弹窗包括开启或关闭“主角追焦”功能的选项;When the camera application is opened, if it is detected that the portrait data in the gallery has been generated, a first pop-up window is displayed on the camera preview interface, and the first pop-up window includes an option to turn on or off the "main character tracking focus" function; 其中,所述开启“主角追焦”功能,包括:The enabling of the “main character tracking focus” function includes: 响应于用户点击所述第一弹窗中的开启选项的操作,开启所述“主角追焦”功能。In response to the user clicking on the enable option in the first pop-up window, the "main character tracking" function is enabled. 根据权利要求12至14中任一项所述的方法,其特征在于,对于首次开启“主角追焦”功能的情况,所述方法还包括:The method according to any one of claims 12 to 14, characterized in that, when the "main character tracking focus" function is turned on for the first time, the method further comprises: 在所述第一界面中显示第一提示框,所述第一提示框用于向用户提示已经识别到主角追焦。A first prompt box is displayed in the first interface, and the first prompt box is used to prompt the user that the main character has been identified and the focus is tracked. 根据权利要求1至15中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 15, characterized in that the method further comprises: 接收到用户的第二操作,所述第二操作用于选择目标追焦对象;receiving a second operation of the user, where the second operation is used to select a target focus tracking object; 显示第二界面;当所述目标追焦对象为可识别目标时,所述第二界面包括第一追焦控件,所述第一追焦控件包括第三追焦框以及第一图标,所述第一图标用于调节曝光,所述第三追焦框用于对所述目标追焦对象进行追焦;Displaying a second interface; when the target focus object is a recognizable target, the second interface includes a first focus control, the first focus control includes a third focus frame and a first icon, the first icon is used to adjust exposure, and the third focus frame is used to focus on the target focus object; 当所述目标追焦对象为不可识别目标时,所述第二界面包括第二追焦控件,所述第二追焦控件包括第四追焦框以及第二图标;所述第二图标用于调节曝光,所述第四追焦框用于对所述目标追焦对象进行追焦,其中,所述第四追焦框与所述第三追焦框的颜色不同,所述第一图标与所述第二图标的颜色不同。When the target focus object is an unrecognizable target, the second interface includes a second focus control, the second focus control includes a fourth focus frame and a second icon; the second icon is used to adjust the exposure, and the fourth focus frame is used to focus on the target focus object, wherein the fourth focus frame is different in color from the third focus frame, and the first icon is different in color from the second icon. 根据权利要求16所述的方法,其特征在于,在对目标追焦对象进行追焦时,所述方法还包括:The method according to claim 16, characterized in that when performing focus tracking on the target focus tracking object, the method further comprises: 接收到用户滑动屏幕的操作;Receive the user's screen sliding operation; 响应于所述滑动屏幕的操作,对画面的曝光量进行相应调节。In response to the operation of sliding the screen, the exposure of the picture is adjusted accordingly. 根据权利要求16或17所述的方法,其特征在于,在所述目标追焦对象是可识别目标且采用所述第三追焦框对所述目标追焦对象进行追焦时,所述方法还包括:The method according to claim 16 or 17, characterized in that, when the target focus tracking object is a recognizable target and the target focus tracking object is focused using the third focus tracking frame, the method further comprises: 显示第二提示框,所述第二提示框用于向用户提示已锁定追焦目标。A second prompt box is displayed, where the second prompt box is used to prompt the user that the focus target has been locked. 根据权利要求16至18中任一项所述的方法,其特征在于,所述目标追焦对象为人物;在对所述目标追焦对象进行持续追焦的过程中,所述方法还包括:The method according to any one of claims 16 to 18, characterized in that the target focus tracking object is a person; and in the process of continuously focusing on the target focus tracking object, the method further comprises: 若无法识别到所述目标追焦对象的面部,则将人脸框转换为人体框;If the face of the target focus object cannot be recognized, the face frame is converted into a body frame; 在重新识别到所述目标追焦对象的面部时,仍然显示人体框。When the face of the target focus object is re-identified, the human body frame is still displayed. 一种电子设备,其特征在于,包括处理器和存储器,所述处理器和所述存储器耦合,所述存储器用于存储计算机程序,当所述计算机程序被所述处理器执行时,使得所述电子设备执行权利要求1至19中任一项所述的方法。An electronic device, characterized in that it comprises a processor and a memory, wherein the processor and the memory are coupled, and the memory is used to store a computer program, and when the computer program is executed by the processor, the electronic device executes the method described in any one of claims 1 to 19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机程 序,当所述计算机程序被处理器执行时,使得所述处理器执行权利要求1至19中任一项所述的方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program The computer program, when executed by a processor, causes the processor to perform the method according to any one of claims 1 to 19. 一种芯片,其特征在于,包括处理器,当所述处理器执行指令时,所述处理器执行如权利要求1至19中任一项所述的方法。 A chip, characterized in that it comprises a processor, and when the processor executes instructions, the processor executes the method as described in any one of claims 1 to 19.
PCT/CN2023/136287 2023-02-16 2023-12-05 Photographing method and electronic device Ceased WO2024169338A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310153109.8 2023-02-16
CN202310153109.8A CN118509697A (en) 2023-02-16 2023-02-16 Shooting method and electronic equipment

Publications (2)

Publication Number Publication Date
WO2024169338A1 true WO2024169338A1 (en) 2024-08-22
WO2024169338A9 WO2024169338A9 (en) 2024-10-10

Family

ID=92242248

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/136287 Ceased WO2024169338A1 (en) 2023-02-16 2023-12-05 Photographing method and electronic device

Country Status (2)

Country Link
CN (1) CN118509697A (en)
WO (1) WO2024169338A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009229571A (en) * 2008-03-19 2009-10-08 Fujinon Corp Autofocus system
JP2010230871A (en) * 2009-03-26 2010-10-14 Fujifilm Corp Auto focus system
CN108733280A (en) * 2018-03-21 2018-11-02 北京猎户星空科技有限公司 Focus follower method, device, smart machine and the storage medium of smart machine
CN112714253A (en) * 2020-12-28 2021-04-27 维沃移动通信有限公司 Video recording method and device, electronic equipment and readable storage medium
CN113302907A (en) * 2020-08-24 2021-08-24 深圳市大疆创新科技有限公司 Photographing method, photographing device, photographing apparatus, and computer-readable storage medium
CN113873166A (en) * 2021-10-26 2021-12-31 维沃移动通信有限公司 Video shooting method and device, electronic equipment and readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140102443A (en) * 2013-02-14 2014-08-22 삼성전자주식회사 Object tracking method using camera and camera system for object tracking

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009229571A (en) * 2008-03-19 2009-10-08 Fujinon Corp Autofocus system
JP2010230871A (en) * 2009-03-26 2010-10-14 Fujifilm Corp Auto focus system
CN108733280A (en) * 2018-03-21 2018-11-02 北京猎户星空科技有限公司 Focus follower method, device, smart machine and the storage medium of smart machine
CN113302907A (en) * 2020-08-24 2021-08-24 深圳市大疆创新科技有限公司 Photographing method, photographing device, photographing apparatus, and computer-readable storage medium
CN112714253A (en) * 2020-12-28 2021-04-27 维沃移动通信有限公司 Video recording method and device, electronic equipment and readable storage medium
CN113873166A (en) * 2021-10-26 2021-12-31 维沃移动通信有限公司 Video shooting method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN118509697A (en) 2024-08-16
WO2024169338A9 (en) 2024-10-10

Similar Documents

Publication Publication Date Title
US12443824B2 (en) Systems and methods for providing feedback for artificial intelligence-based image capture devices
CN113727015B (en) Video shooting method and electronic equipment
EP4642040A1 (en) Photographing method
WO2020259655A1 (en) Image photographing method and electronic device
WO2022206605A1 (en) Method for determining target object, and photographing method and device
WO2022228010A1 (en) Method for generating cover, and electronic device
WO2022083325A1 (en) Photographic preview method, electronic device, and storage medium
WO2021185374A1 (en) Image capturing method and electronic device
CN115604572A (en) Image acquisition method and device
CN117119285B (en) A method of shooting
US20240406536A1 (en) Shooting method and electronic device
WO2024169338A1 (en) Photographing method and electronic device
CN117135443B (en) Image snapshot method and electronic equipment
CN117692771A (en) Focusing method and related device
CN117201714A (en) Audio processing method and electronic equipment
CN118555478B (en) Shooting method and electronic equipment
CN117201713A (en) Audio processing method and electronic equipment
WO2024169363A1 (en) Focus tracking method, focusing method, photographing method, and electronic device
CN117202081A (en) Audio processing method and electronic equipment
WO2024109225A1 (en) Photographic mode switching method and related apparatus
WO2024179083A1 (en) Image snapshot method, electronic device, and storage medium
WO2025148654A1 (en) Photographing method and electronic device
WO2024055817A1 (en) Code scanning method and electronic device

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE