A photographing method, a graphical interface and an electronic device

By recognizing macro scenes in the camera application and capturing images using a wide-angle camera, the problem of insufficient shooting functions under limited hardware conditions is solved, achieving a clear macro video recording experience and personalized services.

CN118075609BActive Publication Date: 2026-07-31HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2022-11-22
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Given limited hardware capabilities, how can we improve the shooting functions of camera applications, especially in capturing more distinctive and clearer images in specific scenarios?

Method used

By identifying scene categories and capturing images at an initial focal length using a wide-angle camera when a macro scene is detected, and outputting a preview image in the preview interface, the system records video in the macro scene after recording, switches to a smaller focal length camera for shooting, and automatically turns the macro scene on or off based on user operating habits.

Benefits of technology

It enables macro shooting services under hardware limitations, improves user experience, outputs clear macro video footage, and enhances the diversity and personalization of shooting functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118075609B_ABST
    Figure CN118075609B_ABST
Patent Text Reader

Abstract

This application provides a shooting method, a graphical interface, and an electronic device. The method includes: while the electronic device is running a camera application and displaying a preview screen in video recording mode, the electronic device identifies the scene category based on collected scene data. If a macro scene is identified, the electronic device can activate the macro scene, specifically by using a wide-angle camera and capturing an image at an initial focal length (e.g., the focal length corresponding to a zoom ratio of 0.99), and outputting a preview screen in the preview interface. Upon receiving a recording request, the electronic device can record video in the macro scene. This improves the shooting functionality of the camera application and provides users with a better shooting experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a shooting method, a graphical interface, and an electronic device. Background Technology

[0002] Today, with the development of terminal technology, people have higher requirements for the shooting functions provided by camera applications. For example, people strive to capture clearer and better images that are more characteristic of specific shooting scenarios. This is especially true when hardware capabilities, such as the number of cameras, are limited, yet still able to meet these needs.

[0003] Therefore, improving the shooting capabilities of camera applications is an urgent problem to be solved. Summary of the Invention

[0004] This application provides a shooting method, a graphical interface, and an electronic device. While the electronic device is running a camera application and displaying a preview screen in video recording mode, the electronic device identifies the scene category by collecting scene data. If a macro scene is identified, the electronic device can activate the macro scene, specifically by using a wide-angle camera to capture images at an initial focal length and outputting a preview screen in the preview interface. Upon receiving a recording request, the electronic device can record video in the macro scene. This improves the shooting capabilities of the camera application and provides users with a better shooting experience.

[0005] In a first aspect, this application provides a shooting method applied to an electronic device. The method includes: the electronic device activating a camera application and displaying a preview interface; capturing an image through a first camera of the electronic device and displaying a first image in the preview interface; detecting that the distance between the electronic device and the object being photographed has decreased, switching to capturing an image through a second camera of the electronic device and displaying a second image in the preview interface; wherein the focal length of the first camera is greater than the focal length of the second camera.

[0006] After implementing the method provided in the first aspect, when the electronic device detects that the distance between itself and the object being photographed has decreased, it can switch to a camera with a smaller focal length to photograph the object at a short distance, thereby providing macro photography services and improving the user's shooting experience.

[0007] In conjunction with the method provided in the first aspect, the size of the object in the second frame is greater than the size of the object in the first frame.

[0008] This allows for a magnified effect when shooting objects at close range, improving the user's shooting experience.

[0009] In conjunction with the method provided in the first aspect, after detecting that the distance between the electronic device and the object being photographed has decreased, the method switches to capturing images through the second camera of the electronic device and displays a second image in the preview interface. Specifically, this includes: after detecting that the distance between the electronic device and the object being photographed has decreased to a first value, switching to capturing images through the second camera of the electronic device and displaying a second image in the preview interface; the method further includes: before detecting that the distance between the electronic device and the object being photographed has decreased to the first value, continuing to capture images through the first camera and displaying a third image in the preview interface.

[0010] In this way, as the distance between the electronic device and the subject is reduced, the first camera with a larger focal length continues to capture the object until the distance is reduced to a preset first value. Once the distance is reduced to the preset first value, the camera switches to a second camera with a smaller focal length. This precise distance value allows for a more accurate determination of the user's desired macro shooting experience, providing more precise macro shooting services and improving the user experience.

[0011] Combining the method provided in the first aspect, the clarity of the second image is higher than that of the third image.

[0012] In this way, when shooting objects in macro scenes (i.e., when using a second camera for close-up shooting), the captured images can be clearer, highlighting the main details of the subject and bringing a better macro shooting experience.

[0013] In conjunction with the method provided in the first aspect, after displaying the second screen in the preview interface, the method further includes: receiving an operation to start recording video, continuously capturing images through the second camera, displaying the recording interface, and displaying the fourth screen in the recording interface; receiving an operation to end recording video; and saving the fourth screen as a video file.

[0014] In this way, when shooting objects in macro scenes (i.e., when using a second camera for close-up shooting), in addition to previewing the image, you can also record and save the video.

[0015] In conjunction with the method provided in the first aspect, after switching to capturing images through the second camera of the electronic device and displaying the second screen in the preview interface, the method further includes: receiving the first operation, switching to capturing images through the first camera, and displaying the fifth screen in the preview interface.

[0016] Thus, when shooting an object in a macro scene (i.e., when using a second camera for close-up shooting), the electronic device can also close the macro scene according to a first operation received, such as the operation on the macro scene identifier 123A in the preview interface as described in the detailed embodiments below.

[0017] In conjunction with the method provided in the first aspect, after switching to capturing images through the first camera and displaying the fifth screen in the preview interface, the method further includes: detecting that the distance between the electronic device and the photographed object has increased, continuing to capture images through the first camera, and displaying the sixth screen in the preview interface.

[0018] In this way, if the electronic device detects that the distance to the subject has increased after the user turns off the macro scene, it means that the macro scene has not been recognized at this time, so the first camera will continue to be used for shooting.

[0019] In conjunction with the method provided in the first aspect, after continuing to acquire images through the first camera and displaying the sixth screen in the preview interface, the method further includes: detecting that the distance between the electronic device and the photographed object has decreased, continuing to acquire images through the first camera, and displaying the seventh screen in the preview interface.

[0020] In this way, when the electronic device recognizes the macro scene again by getting closer to the subject, it will not automatically turn on the macro scene or switch to the second camera to capture images. Instead, it will continue to use the first camera to capture images. This is because when the macro scene was recognized last time, the electronic device received the first operation input by the user and turned off the macro scene. Therefore, when the macro scene is recognized again, it will determine whether to turn on the macro scene based on the user's operating habits.

[0021] In conjunction with the method provided in the first aspect, after detecting that the distance between the electronic device and the photographed object has decreased, the method includes: identifying a macro scene, wherein the macro scene is the scene after the distance between the electronic device and the photographed object has decreased; determining whether the macro scene is being identified for the first time after the camera application is cold-started by the electronic device; if so, switching to capturing an image through the second camera and displaying the corresponding image in the preview interface; otherwise, determining whether to capture an image through the second camera based on the last operation entered by the user when the macro scene was most recently identified, and displaying the corresponding image in the preview interface.

[0022] In this way, the default condition for enabling the macro scene is that the electronic device first recognizes the macro scene after each cold start of the camera application. This allows for proactive recommendations of the macro scene to users, guiding them to experience different recording styles. The decision to enable the macro scene based on user operating habits provides a more personalized macro recording service.

[0023] In conjunction with the method provided in the first aspect, after switching to capturing images through the second camera of the electronic device and displaying the second image in the preview interface, the method further includes: receiving an operation to adjust the zoom ratio to a first zoom ratio, and continuing to use the second camera to capture images; or, receiving an operation to adjust the zoom ratio to a second zoom ratio, and switching to using the first camera to capture images, wherein the second zoom ratio is greater than the first zoom ratio.

[0024] In this way, when the electronic device activates macro mode (i.e., after capturing images through its second camera), the zoom level can be adjusted based on user input. If the adjusted first zoom level is less than or equal to the preset zoom level (0.99), the electronic device will consistently use the wide-angle camera for display. If the adjusted second zoom level is greater than the preset zoom level (0.99), the electronic device will consistently use a camera other than the wide-angle camera, such as the main camera, for display. Because different cameras have different suitable focal length ranges, in macro recording mode, the appropriate camera can be determined based on the user-selected zoom level, resulting in higher image clarity and better performance.

[0025] In conjunction with the method provided in the first aspect, after detecting that the distance between the electronic device and the object being photographed has decreased, and after switching to capturing an image through the second camera of the electronic device, the method further includes: displaying a first identifier in the preview interface.

[0026] Thus, when the electronic device recognizes the macro scene and activates the macro scene, it will display a first identifier, such as the macro scene identifier 123A described in the specific implementation below, to prompt the user that the macro scene has been recognized and activated.

[0027] In conjunction with the method provided in the first aspect, after receiving the first operation and switching to acquiring images through the first camera, the method further includes: displaying a second identifier in the preview interface.

[0028] In conjunction with the method provided in the first aspect, after detecting that the distance between the electronic device and the object being photographed has decreased and continuing to acquire images through the first camera, the method further includes: displaying a second identifier in the preview interface.

[0029] Thus, when the electronic device recognizes the macro scene and closes the macro scene, a second identifier will be displayed. This second identifier, such as the macro scene identifier 123B described in the specific embodiments below, is used to prompt the user that the macro scene has been recognized and closed.

[0030] In a second aspect, this application provides an electronic device comprising one or more processors, one or more memories, and at least two cameras; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method described in any of the first aspects.

[0031] Thirdly, this application provides a chip system applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform the methods described in any of the first aspects.

[0032] Fourthly, this application provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to perform the method described in any of the first aspects.

[0033] Fifthly, this application provides a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the method described in any of the first aspects. Attached Figure Description

[0034] Figures 1A-1E A set of schematic diagrams of a shooting interface with macro scene enabled by default, provided for embodiments of this application;

[0035] Figures 2A-2E A set of schematic diagrams of a shooting interface for turning macro scenes on / off according to user operation, provided for embodiments of this application;

[0036] Figures 3A-3D A set of schematic diagrams of an operation interface for adjusting zoom magnification in macro scenes provided for embodiments of this application;

[0037] Figure 4 A flowchart illustrating a shooting method provided in an embodiment of this application;

[0038] Figure 5 A flowchart illustrating another shooting method provided in this application embodiment;

[0039] Figure 6A flowchart illustrating another shooting method provided in this application embodiment;

[0040] Figure 7 A schematic diagram of an electronic device system architecture provided in this application embodiment;

[0041] Figure 8 This is a schematic diagram of an electronic device hardware architecture provided in an embodiment of this application. Detailed Implementation

[0042] The technical solutions in the embodiments of this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; the word "and / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.

[0043] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0044] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0045] The term "user interface (UI)" used in the following embodiments of this application refers to the medium interface through which an application or operating system interacts and exchanges information with the user. It realizes the conversion between the internal form of information and the form that the user can accept. The user interface is source code written in a specific computer language such as Java or Extensible Markup Language (XML). The interface source code is parsed and rendered on the electronic device, ultimately presenting content that the user can recognize. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be visible interface elements such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets displayed on the screen of an electronic device.

[0046] This application provides a shooting method. While an electronic device is running a camera application and displaying a preview screen in recording mode, the electronic device identifies the scene category based on collected scene data. If a macro scene is identified, the electronic device can activate the macro scene mode. Specifically, this involves using a wide-angle camera to capture an image at an initial focal length (e.g., the focal length corresponding to a zoom ratio of 0.99) and outputting a preview screen in the preview interface. Upon receiving a recording request, the electronic device can record video in the macro scene.

[0047] After implementing the shooting method provided in this application, the following technical effects can be achieved: First, intelligent recognition of macro scenes, automatically activating the macro scene upon detection, simplifying user operation through automation. Second, by employing a wide-angle camera suitable for short-distance shooting to provide users with a macro recording mode, the output image becomes clearer, highlighting the details of the subject, thus providing users with a richer recording experience. Finally, even when electronic devices have limited hardware capabilities (no macro camera configured), macro recording functionality can still be achieved using other existing cameras, ensuring the production cost of electronic devices while adding more shooting functions, improving the shooting capabilities of camera applications, and providing users with a superior shooting experience.

[0048] In one possible implementation of this application, before activating the macro scene, the electronic device typically uses a camera other than a wide-angle camera, such as a main camera, and usually uses the main camera to capture images at a default focal length (the focal length corresponding to a zoom ratio of 1). Since cameras with different focal lengths capture images at different sizes, i.e., different viewing angles, the electronic device further processes the image by scaling and cropping it after activating the macro scene. This ensures that the size of the preview image output in the preview interface after activating the macro scene is the same as the size of the image output in the preview interface before activating the macro scene, presenting the same viewing angle and thus guaranteeing relative consistency between the preview images before and after activating macro.

[0049] In this embodiment, the main camera can also be referred to as the first camera, and the wide-angle camera can also be referred to as the second camera. The second camera can also be any camera other than the wide-angle camera, such as an ultra-wide-angle camera or a macro camera. This embodiment does not limit the type of the second camera, but the focal length of the second camera is shorter than that of the first camera. This means that the second camera is more suitable for close-up shooting (i.e., it captures clearer images at close range). Furthermore, the image acquired by the second camera can achieve a more prominent foreground compared to the first camera, thus highlighting the main details of the subject.

[0050] In one possible implementation of this application, the electronic device enables the macro scene by default when it detects a macro scene, or determines whether to enable the macro scene based on the user's operating habits.

[0051] The default condition for enabling the macro scene is that the electronic device first recognizes the macro scene after each cold start of the camera application. This allows the system to proactively recommend macro scenes to users, guiding them through different recording styles.

[0052] The method of determining whether to automatically activate the macro scene based on user operating habits includes: when the electronic device detects a macro scene, it stores the user's last input to turn the macro scene on or off. Each time the electronic device detects a macro scene, it can determine whether to automatically activate the macro scene based on the user's last input during the previous macro scene detection. If the input was "off," automatic activation of the macro scene is disabled; if the input was "on," the macro scene is automatically activated. This allows for determining whether to activate the macro scene upon detection based on user operating habits, thus providing users with a more personalized macro video recording service.

[0053] In one possible implementation of this application, after the electronic device activates the macro scene, it can adjust the zoom ratio according to user operation. When the adjusted zoom ratio is less than or equal to a preset zoom ratio (0.99), the electronic device consistently uses the wide-angle camera for display. When the adjusted zoom ratio is greater than the preset zoom ratio (0.99), the electronic device consistently uses a camera other than the wide-angle camera, such as the main camera, for display. Thus, since different cameras have different suitable focal length ranges, in macro recording mode, the corresponding camera can be determined based on the zoom ratio selected by the user, resulting in higher image clarity and better performance.

[0054] In one possible implementation of this application, when the electronic device detects and activates a macro scene, it can display a prompt indicating that a macro scene has been detected and activated. When the electronic device detects and deactivates a macro scene, it can display a prompt indicating that a macro scene has been detected but not activated. The electronic device can also display corresponding prompts when it detects other scenes. This provides users with richer prompts and improves the user's shooting experience.

[0055] Before introducing the specific implementation process of the shooting method of this application, let's first introduce the terms and concepts involved in this application.

[0056] A shooting scene, also known as a shooting mode, refers to a set of shooting parameters and / or image processing methods developed by developers based on the characteristics of common shooting scenes in life and user needs, in order to capture more distinctive images. These shooting parameters and / or image processing methods are then integrated into a set of shooting scenes and preset in electronic devices. Typically, different shooting scenes employ different shooting parameters and / or image processing methods.

[0057] In the embodiments of this application, the shooting scene may include commonly used automatic scenes (also known as default scenes), macro scenes, night scenes, high dynamic range scenes, portrait scenes, etc.

[0058] Automatic scene mode refers to the default mode applied when the camera app is opened, hence it can also be called the default scene mode. While images captured with automatic scene mode enabled may not be more distinctive than the scene itself, they are relatively clear and natural. Therefore, automatic scene mode is suitable for shooting in most situations.

[0059] Macro mode refers to the mode used when shooting details of objects. Enabling macro mode makes the subject stand out more, showcasing its details and creating a better background blur effect.

[0060] Night mode refers to the shooting mode used at night or in low-light environments. Enabling night mode restores detail in dark areas, enhances overall brightness, controls noise, and reveals more image detail.

[0061] High dynamic range (HDR) refers to a mode used when shooting in environments with significant changes in brightness, ensuring that the captured images are not overexposed or underexposed.

[0062] Portrait mode refers to the mode used when shooting portraits. Enabling portrait mode results in clearer images.

[0063] Zoom ratio is a parameter in the camera application of electronic devices. Specifically, it refers to the multiple of the camera application's default standard focal length, which can be the focal length supported by the main camera.

[0064] Typically, camera applications on electronic devices support zoom ratios ranging from 0.5x (X) to 6x. Camera applications can adjust the zoom ratio within this range using optical zoom, digital zoom, or hybrid zoom (a combination of digital and optical zoom). However, the method used to adjust the zoom ratio differs depending on the zoom ratio range. For example, hybrid zoom is used when the zoom ratio is greater than a specific value, such as 3x (3X), while optical zoom is used when the zoom ratio is less than 3x.

[0065] Regardless of the method used to adjust the zoom level, the effect is the same: when the zoom level decreases, the preview or shooting interface on the electronic device will show a larger shooting angle, a smaller image, and more content in the image; when the zoom level increases, the preview or shooting interface on the electronic device will show a smaller shooting angle, a larger image, and more content in the image.

[0066] Optical zoom includes two methods. The first method involves using multiple cameras with different focal lengths or focal lengths in an electronic device. This is achieved by switching between cameras with different focal lengths to capture and display video streams, resulting in a wider or narrower viewpoint and more content in the image, or vice versa. The second method, when a telephoto camera is used, involves moving it closer or further away. This allows the telephoto camera to capture and display video streams at different positions (with different focal lengths), resulting in a narrower or wider viewpoint and more content in the image, or vice versa. Because the first method involves switching cameras, the displayed video stream can be interrupted. The second method, by controlling a fixed camera to move closer or further away to change the focal length, allows for a smooth and continuous zoom process without interruption.

[0067] Digital zoom refers to changing the focal length of a camera by increasing the area of ​​each pixel in the image captured by the camera, without altering the camera's focal length. Specifically, digital zoom is equivalent to enlarging an image captured by a camera and then cropping the enlarged image to its original aspect ratio. Thus, compared to the image displayed before digital zoom, each pixel in the digitally zoomed image is larger, while the width and height remain the same. This results in a change in the viewing angle (object size) displayed in the preview or shooting interface, achieving an effect similar to optical zoom.

[0068] Because different electronic devices may have different default standard focal lengths, the angles of view corresponding to different zoom ratios on different electronic devices are not the same.

[0069] Next, we will introduce the shooting method provided in this application through a UI example.

[0070] refer to Figures 1A-1E , Figures 1A-1EThis example illustrates a set of screenshot interfaces with macro mode enabled by default. Specifically, when an electronic device opens its camera app and outputs a preview in video mode, the camera app typically uses the main camera to capture and display images. If the distance between the electronic device and the subject is increased, the AI ​​recognition function in the camera app can identify that a macro scene is currently in effect based on the distance. This automatically activates the macro scene, including switching from the main camera to a wide-angle camera to acquire and display the image. Furthermore, since the main camera and wide-angle camera use different focal lengths, the camera app will also perform cropping and other processing on the image captured by the wide-angle camera to maintain the same aspect ratio in the preview interface when using both cameras. This results in a clearer image that highlights the details of the subject while maintaining a consistent preview aspect ratio.

[0071] Figure 1A An example is shown of the main interface of an electronic device.

[0072] like Figure 1A As shown, the main interface displays application icons installed on the electronic device, such as the camera application icon 111.

[0073] Responding to user actions Figure 1A Actions performed on the camera app icon (e.g., clicking) on ​​the electronic device open the camera app and display something like... Figure 1B The image shows a preview interface in the camera app's photo-taking mode.

[0074] Figure 1B An example is shown of the preview interface in the photo-taking mode provided by the camera application.

[0075] like Figure 1B As shown, the preview interface in this shooting mode can also be called the main interface or default interface of the camera application, specifically including the menu bar 121, shooting controls 122, preview frame 123, zoom operation bar (also called ZoomBar) 124, and settings bar 125.

[0076] The menu bar 121 displays multiple shooting mode options, such as "Night Scene," "Portrait," "Photo," and "Video." The "Photo" option corresponds to the mode for taking photos. The "Video" option corresponds to the mode for recording videos. The "Night Scene" option corresponds to night scene mode, suitable for shooting in low-light conditions, such as at night. The "Portrait" option corresponds to portrait mode, suitable for shooting people. The camera app also offers more shooting modes, such as a high dynamic range mode for overexposed / underexposed scenes and a macro mode for close-up shooting. Users can access more shooting modes through the "More" control in the menu bar 121 to meet their personalized shooting needs. Each time the camera app is cold-launched, it can default to a certain shooting mode, such as the photo mode corresponding to the "Photo" option. Figure 1B The camera application shown in the example is currently using the shooting mode corresponding to the "Take Photo" option. Furthermore, when the camera application is warm-started on an electronic device, the shooting mode used when it was last exited can also be selected. This application embodiment does not impose any limitations on this.

[0077] The shooting control 122 is used to take photos and start / stop recording based on user operations. The display form of the shooting control 122 may be the same or different in shooting mode and recording mode, and the display form of the shooting control 122 in recording state or preview state may also be the same or different in recording mode. This application embodiment does not limit this.

[0078] Preview boxes 123 can be used to display images sent from the camera in real time. When an electronic device is equipped with multiple cameras, the camera used for display may be the same or different in different modes. Typically, in photo or video mode, the electronic device uses the camera sent for display as the main camera (referred to as the main camera) by default. When the user reduces the zoom level or enables wide-angle shooting, the camera application can switch the camera sent for display from the default main camera to the wide-angle camera.

[0079] from Figure 1B As can be seen, the image displayed in preview box 123 at this time is captured and displayed by the main camera used by the camera application by default.

[0080] The zoom operation bar 124 can be used to zoom according to user operation, including optical zoom and / or digital zoom. In this embodiment, the zoom operation bar 124 displays three indicators, namely "0.5X", "1X", and "2X", which respectively indicate three commonly used zoom ratios, namely 0.5x zoom ratio, 1x zoom ratio, and 2x zoom ratio. Users can directly adjust the zoom ratio to the corresponding value by clicking any indicator in the zoom operation bar 124, or users can also long-press any part of the zoom operation bar 124 to make the zoom operation bar 124 unfold into a handle with continuous and fine scales, supporting sliding adjustment of the zoom ratio, as detailed below. Figures 3A-3D The description will not be repeated here.

[0081] from Figure 1B As can be seen, the selected zoom ratio displayed in the zoom operation bar 124 is "1X", which means that the electronic device is using its main camera at this time, and is capturing and displaying images at the default standard focal length. Since the specifications of the cameras configured in different models of electronic devices are different, the default standard focal length may be different. Therefore, the focal length corresponding to different zoom ratios on different models of electronic devices may be different, and the size of the field of view presented in the preview interface or shooting interface may also be different.

[0082] The settings panel 125 may include multiple settings options for users to enable corresponding functions. For example, the settings panel 125 may include: Subject Mode 125a, AI Scene Recognition 125b, Flash 125c, Filter 125d, and Settings 125e. Subject Mode 125a can be used to turn Subject Mode on / off according to user operation to capture and save two videos: a panoramic video based on the panoramic image displayed in the preview frame 123 and a subject video obtained by cropping the subject from the panoramic image in the preview frame 123. AI Scene Recognition 125b can be used to turn the scene recognition function on / off according to user operation. This scene recognition function can be used to identify the scene type of the image captured by the camera currently used for display, such as macro scene, night scene, high dynamic range scene, portrait scene, etc. Flash 125c can be used to turn the flash on / off, thereby changing the illumination of the shooting scene and increasing or decreasing the image illumination. Filter 125d can be used to select a filter. The camera application can render the image displayed by the camera according to the selected filter type, thereby providing the user with photos or videos with specific image effects. Setting 125e is used to provide users with more configuration options.

[0083] Responding to user actions Figure 1B The operation on the video recording option in the middle menu bar (121) (such as clicking the action) will switch the camera application from taking a photo to recording a video, and display something like this. Figure 1C An example preview interface in recording mode is shown.

[0084] Figure 1C An example is shown of the preview interface in the normal recording mode provided by the camera application.

[0085] like Figure 1C As shown, the preview interface in recording mode (also known as normal recording mode) is the same as described above. Figure 1B The preview interface in the shooting mode shown is similar, and the images displayed in preview frames 123 (also known as the first image) are captured and displayed by the main camera. The difference lies in the selected option in menu bar 121. Figure 1B The "Take Photo" option has been changed to "Record Video," and the display format of the shooting control 122 has also changed. Figure 1B The shutter button shown for taking a photo has been changed to the record button for recording video.

[0086] Displayed in the camera app Figure 1C During the process, the camera app is capturing images using the main camera. Since the main camera typically uses a moderate focal length, such as around 26mm, it produces optimal results when shooting objects at a moderate distance, such as 20-30cm. However, when the distance between the electronic device and the subject is increased beyond the main camera's optimal shooting range, continuing to use the main camera to shoot closer objects will result in a blurry image in preview frames 123, with the image appearing larger and the field of view narrowing. For details, please refer to [reference needed]. Figure 1D The description.

[0087] Figure 1D An example is shown of the preview interface provided by the camera application in normal recording mode after zooming in on the object.

[0088] like Figure 1D As shown, the image displayed in preview frame 123 (also known as the third image) in the recording mode (also known as normal recording mode) is still captured and displayed by the main camera. At this time, the third image in preview frame 123 is magnified compared to the aforementioned first image (specifically, the subject in the image is magnified), resulting in a smaller viewing angle. Furthermore, the third image is blurry compared to the first image.

[0089] As the electronic device continuously zooms in on the subject, the scene recognition function, which was previously enabled by default in the camera app, can detect that a macro scene is in progress once the distance between the device and the subject exceeds the optimal shooting range of the main camera (e.g., after the distance between the device and the subject shrinks to the first value). Simultaneously, after a cold start, the camera app can automatically activate the macro scene upon first detection. Since wide-angle cameras typically use focal lengths within a relatively small range, such as around 17mm, they produce optimal results when shooting objects at relatively short distances, such as within 15cm. Therefore, after activating the macro scene, the camera app uses the wide-angle camera to capture small objects at close range, making the image displayed in preview frames 123 more detailed. Furthermore, since different cameras use different focal lengths to capture images, the resulting images have different screen sizes (angles of view). To ensure a consistent user experience in the preview interface, the screen size (angle of view) must be the same. Therefore, the electronic device processes the image captured by the wide-angle camera after switching to ensure that the processed image has the same screen size (angle of view) in the preview interface as the image captured by the main camera before switching. This achieves a clearer output that highlights details while maintaining a consistent preview screen size / angle of view. See [link / reference] for details. Figure 1E The description.

[0090] Figure 1E An example is shown of the preview interface provided by the camera application in macro recording mode after a macro scene has been identified and enabled.

[0091] like Figure 1E As shown, the image displayed in the preview frame 123 (also known as the second image) in the recording mode (also known as macro recording mode) is captured and displayed after the main camera is switched to the wide-angle camera (referred to as wide-angle). The second image in the preview frame 123 has the same aspect ratio as the aforementioned third image and is clearer than the third image. In addition, a macro scene indicator 123A is displayed in the preview frame. The macro scene indicator 123A is used to indicate to the user that a macro scene has been identified and activated. Optionally, the macro scene indicator 123A may include text or an icon, where the text may be, for example, "Macro Scene," and the icon may be a highlighted flower shape representing the selected element. Optionally, the text in the macro scene indicator 123A may be hidden after being displayed for a certain period of time.

[0092] In one embodiment, since the main camera and the wide-angle camera are installed in different locations on the electronic device, when the two cameras are used to capture the same location, the positions of the captured images in the preview frame 123 are different; that is, the third image and the second image are displayed in different positions in the preview frame. In another embodiment, the camera application can also process the images captured by the main camera and the wide-angle camera respectively, so that the positions of the captured images in the preview frame 123 are the same; that is, the third image and the second image are displayed in the same position in the preview frame.

[0093] Optionally, since electronic devices require a certain amount of time to recognize macro scenes, after the distance between the electronic device and the subject is reduced, the electronic device will first display... Figure 1D The preview shown is a blurry image without macro mode enabled. However, once the macro scene is recognized and enabled, the electronic device will display something like this: Figure 1E The preview interface shown has a clear image. When the electronic device requires a short time to recognize the macro scene, it may not display this preview. Figure 1D The interface shown in this application embodiment is not limited thereto.

[0094] Optionally, on the electronic device display such as Figure 1E When the preview interface of the macro recording mode is shown, the electronic device can also receive the operation for recording, and then control the camera application to display the shooting interface of the macro recording mode, that is, to use the wide-angle camera to capture images, display the corresponding recording interface, and display the fourth frame obtained based on the image captured by the wide-angle camera in the recording interface. After the recording ends, the fourth frame is saved as the corresponding video file.

[0095] Understandable Figures 1A-1E This illustration is merely an example of an application scenario for recognizing macro scenes and automatically activating them, and should not be construed as limiting the scope of this application.

[0096] Next, refer to Figures 2A-2E , Figures 2A-2EThis example illustrates a shooting interface diagram showing how the macro scene is turned on / off based on user actions. Specifically, when the electronic device recognizes and turns on the macro scene, it can also turn off the macro scene and enter normal recording mode based on the operation performed on the macro scene identifier 123A. After turning off the macro scene, if the scene recognition function can still recognize the macro scene, it will display a corresponding identifier to indicate to the user that the macro scene has been recognized but is currently turned off, until the macro scene is no longer recognized, at which point the corresponding identifier will stop being displayed. Subsequently, if the scene recognition function recognizes the macro scene again, it will continue to display the identifier indicating that the macro scene has been recognized but is currently turned off, meaning the camera application will turn off the macro scene by default based on the user's previous operation habit of turning off the macro scene.

[0097] Figure 2A An example is shown of the preview interface provided by the camera application in the recording mode after the macro scene is identified and enabled.

[0098] like Figure 2A As shown, the preview interface in recording mode (also known as macro recording mode) is the same as described above. Figure 1E The preview interface shown is similar, except that the text prompts in the macro scene identifier 123A are hidden, and only flower-shaped icons are included. This avoids affecting the display of the image in the preview frame 123.

[0099] Response to action Figure 2A When the macro scene indicator 123A is executed, the camera application will disable the macro scene, switching back from macro recording mode to the original normal recording mode. See the documentation for details. Figure 2B The description.

[0100] In this embodiment of the application, the operation of turning off the macro scene on the macro scene identifier 123A can also be referred to as the first operation.

[0101] Figure 2B An example is shown of the preview interface provided by the camera application in normal recording mode after a macro scene has been identified but not enabled.

[0102] like Figure 2B As shown, the image displayed in preview frame 123 in recording mode (also known as normal recording mode) (which can also be called the fifth image) is captured and displayed by the wide-angle camera after switching to the main camera. The display effect of the image in preview frame 123 at this time is the same as that described above. Figure 1DThe display effect is the same as before, i.e., blurry. Furthermore, because the distance between the electronic device and the subject is relatively close at this time, the scene recognition function can still identify the macro scene, and therefore will display the corresponding macro scene identifier 123B. The macro scene identifier 123B is used to inform the user that a macro scene has been identified but is not currently enabled / disabled. Optionally, the macro scene identifier 123B may include text or an icon, where the text could be, for example, "Click to enter this mode," and the icon could be a non-highlighted flower shape representing an unselected element. Optionally, the text in the macro scene identifier 123B can be hidden after being displayed for a certain period of time.

[0103] Displayed in the camera app Figure 2B During the process, the electronic device is relatively close to the subject. However, when the distance between the electronic device and the subject is increased, bringing them into the optimal shooting range of the main camera, the image displayed in preview frames 1, 2, and 3 (which can also be called the sixth frame) will become clearer and smaller, presenting an effect of a wider field of view. For details, please refer to... Figure 2C The description.

[0104] Figure 2C An example is shown of the preview interface provided by the camera application in normal recording mode after the macro scene is not recognized.

[0105] like Figure 2C As shown, the preview interface in recording mode (also known as normal recording mode) is the same as described above. Figure 1C The preview interface shown is similar, so I won't go into too much detail here. However, compared to... Figure 2B As shown in the preview interface, the macro scene marker 123B is no longer displayed, and the image in the preview frame 123 becomes smaller and clearer, containing more content and presenting an effect of a larger viewing angle.

[0106] Displayed in the camera app Figure 2C During the process, the distance between the electronic device and the subject is relatively far. However, when the distance is reduced to the point where the electronic device is out of the optimal shooting range of the main camera, and the main camera is then used to shoot closer objects, the image shown in preview frames 123 will become blurry and larger, resulting in a narrowed field of view. For details, please refer to... Figure 2D The description.

[0107] Figure 2D An example is shown of the preview interface provided by the camera application in normal recording mode after zooming in on the object.

[0108] like Figure 2D As shown, the preview interface in recording mode (also known as normal recording mode) is the same as described above. Figure 1DThe preview interface shown is similar, so I won't go into too much detail here. However, compared to... Figure 2C As shown in the preview interface, the image in preview frame 123 (which can also be called the seventh image) is larger and blurrier, contains less content, and presents a smaller viewing angle.

[0109] Displayed in the camera app Figure 2D During the process, because the camera app has scene recognition enabled by default, when the distance between the electronic device and the subject is increased beyond the optimal shooting range of the main camera, the scene recognition function can identify that a macro scene is in progress based on the close proximity of the electronic device and the subject. Simultaneously, the camera app stores the last user input to disable the macro scene when it was last detected (i.e., the operation performed on the aforementioned...). Figure 2B The macro scene indicator (123A) allows the camera app to disable the macro scene by default based on the user's operating habits, but it will still display the corresponding macro scene indicator to notify the user that the macro scene has been detected but not enabled. For details, please refer to [link / reference]. Figure 2E The description.

[0110] Figure 2E An example is shown of the preview interface provided by the camera application in normal recording mode after a macro scene has been identified but not enabled.

[0111] like Figure 2E As shown, the preview interface in recording mode (also known as normal recording mode) is the same as described above. Figure 2B The preview interface shown is similar, so I won't go into too much detail here.

[0112] Next, refer to Figures 3A-3D , Figures 3A-3DThe following is an example of a set of schematic diagrams illustrating the operation interface for adjusting zoom magnification in macro scenes. Specifically, when the electronic device recognizes and activates the macro scene, the zoom magnification value can be adjusted according to the operation performed on the zoom operation bar 124. When the zoom level is adjusted to different ranges, the camera application will use the corresponding camera to capture images. Specifically, when the electronic device is equipped with only a main camera and a wide-angle camera, since the wide-angle camera is more suitable for shooting at shorter focal lengths, and the main camera is more suitable for shooting at longer focal lengths, even if the camera application is in macro shooting mode, as long as it receives an operation to adjust the zoom level to the first zoom level, it will continue to use the wide-angle camera to capture images; or, if it receives an operation to adjust the zoom level to the second zoom level, it will switch to using the main camera to capture images. The first zoom level is less than or equal to a preset value (e.g., 0.99X), and the second zoom level is greater than a preset value (e.g., 0.99X). This will maintain the use of the wide-angle camera to capture images, so as to display a clearer image in the preview frame 123 and ensure the user's shooting experience.

[0113] Figure 3A An example is shown of the preview interface provided by the camera application in the recording mode after the macro scene is identified and enabled.

[0114] like Figure 3A As shown, the preview interface in recording mode (also known as macro recording mode) is the same as described above. Figure 1E , 2A The preview interface shown is similar, so I won't go into details here.

[0115] Response to action Figure 3A Operations in the mid-zoom control bar (124) (such as long press) will cause the camera app to expand and display a handle with continuous and finer scales, supporting sliding adjustments of the zoom ratio. See details. Figure 3B .

[0116] like Figure 3B As shown, the preview interface in video recording mode (also known as macro video recording mode) displays a zoom handle 124A. This zoom handle has scale markings, with a range of, for example, from 0.5X to 6X. The 1X scale is selected, indicating to the user that the camera application is currently using a 1X zoom ratio. Typically, different electronic device models may support different zoom ratio ranges; this application does not impose any limitations on this.

[0117] In response to a right / left sliding operation on the zoom handle 124A, the zoom magnification bar can be adjusted to be smaller or larger. For example, in response to an operation on... Figure 3B The right-sliding operation on the 124A zoom grip allows the camera app to adjust the zoom level to a smaller value, for example... Figure 3C The value shown is 0.8X.

[0118] like Figure 3C As shown, the preview interface in video recording mode (also known as macro video recording mode) still displays the zoom handle 124A, and the selected scale on the zoom handle is... Figure 3B The zoom level changes from 1X to 0.8X. Since 0.8X is less than the preset value of 0.99X, the camera application still uses the wide-angle lens to capture the image. Furthermore, even though the distance between the electronic device and the subject remains unchanged, the zoom ratio decreases, resulting in... Figure 3C The image in the preview frame 123 is relative to Figure 3B The image in the preview frame 123 has become smaller.

[0119] For example, in response to the action on Figure 3C The left-slide operation on the 124A zoom grip allows the camera app to adjust the zoom level to a larger value, for example... Figure 3D The value shown is 1.5X.

[0120] like Figure 3D As shown, the preview interface in video recording mode (also known as macro video recording mode) still displays the zoom handle 124A, and the selected scale on the zoom handle is... Figure 3C The zoom level changes from 0.8X to 1.5X. Since 1.5X is greater than the preset value of 0.99X, the camera application switches from the wide-angle camera to the main camera to capture images. Furthermore, even without changing the distance between the electronic device and the subject, the increased zoom ratio results in... Figure 3D The image in the preview frame 123 is relative to Figure 3C The image in the preview frame 123 becomes larger.

[0121] Based on the three UI implementation examples introduced above, the following will combine... Figure 4 The method flow and the first group of UI implementations shown ( Figures 1A-1E ), combined Figure 5 The method flow shown is the second group of UI implementations. Figures 2A-2E ), combined Figure 6 The method flow and the third group of UI implementations shown ( Figures 3A-3D This application will further introduce the shooting method provided in this application.

[0122] The electronic device involved in the following process flow includes the camera application and Camera HAL. The camera application further includes various sub-functional modules, such as a recording module, a scene recognition module, a zoom control module (also known as a zoom control module), and a UI control module. For a detailed description of the modules included in the electronic device, please refer to the system architecture description of the electronic device later in the text; it will not be elaborated upon here.

[0123] like Figure 4 As shown, the method includes the following steps.

[0124] Phase 1 (S401-S402): The electronic device opens the video recording mode in the camera application and displays the preview interface in normal video recording mode.

[0125] S401, the recording module of the electronic device receives an operation to enter recording mode.

[0126] Specifically, the recording module receives input to recording mode via touch operations on the display screen of the electronic device.

[0127] The touch operation can be described in detail as described above. Figure 1B The method described above involves clicking the "Record" option in the menu bar of the camera application. Alternatively, the touch operation can occur when the electronic device receives an operation to open the camera application again while the camera application is already in recording mode and running in the background.

[0128] Specifically, voice commands can be user-defined statements or default statements.

[0129] This application does not impose specific restrictions on the operation of entering recording mode received by the recording module in the electronic device.

[0130] S402, the recording module of the electronic device displays a preview interface according to the default recording mode (using the main camera, zoom=1).

[0131] Specifically, in a camera application installed on an electronic device, the recording module of the camera application stores a pre-set strategy corresponding to the default recording mode. After receiving the operation to enter the recording mode, the recording module will take pictures according to the strategy corresponding to the default recording mode to display the preview screen in the preview interface.

[0132] The default recording mode strategies include using a zoom ratio of 1X (denoted as Zoom=1), or enabling scene recognition, turning off the flash, turning off filters, etc.

[0133] In one possible implementation, the module used to control the camera's operation, such as CameraHAL mentioned later, stores a mapping between camera types and zoom values. For example, a zoom value in the range of 0.5-0.99 corresponds to a wide-angle camera, while a zoom value in the range of 1-6 corresponds to a main camera. Therefore, the strategy corresponding to the default recording mode can only include the zoom control strategy with Zoom=1, without needing to include the use of the main camera.

[0134] In one feasible approach, the recording module captures images according to the strategy corresponding to the default recording mode, specifically by: the recording module sending a Zoom control strategy to the Zoom control module, such as sending an indication message of Zoom=1; then, the Zoom control module sending the control message of Zoom=1 to the Camera HAL; and the Camera HAL determining, based on the control message of Zoom=1 and the stored correspondence between camera type and Zoom value, to use the main camera to capture images and to use the focal length corresponding to Zoom=1.

[0135] In this embodiment, the default recording mode refers to a recording mode that is applicable to most scenarios but lacks distinctive features compared to the recording modes that the user can customize or that the camera application can automatically switch to after recognizing the scene (such as macro recording mode). Therefore, in this embodiment, the default recording mode is also referred to as the normal recording mode.

[0136] Phase 2 (S403-S412): The camera application of the electronic device enables the scene recognition function, and automatically opens the macro scene after the macro scene is first recognized, switching from the normal recording mode to the preview interface of the macro recording mode.

[0137] S403, the recording module of the electronic device sends a command to the scene recognition module to enable the scene recognition function.

[0138] Specifically, after the camera application of the electronic device enters the recording mode, since the default recording mode strategy includes enabling scene recognition, the recording module will also send an instruction to the scene recognition module to enable the scene recognition function. The specific form of this instruction is not limited in this embodiment.

[0139] There are no restrictions on the execution order of S402 and S403. S403 can occur during the execution of S402, or after the execution of S402, or before the execution. This application embodiment does not impose any restrictions on this.

[0140] S404, the scene recognition module of the electronic device sends a command to the Camera HAL to perform scene recognition.

[0141] Specifically, in response to the received command to start scene recognition, the scene recognition module controls the Camera HAL to perform scene recognition by sending a command to the Camera HAL to perform scene recognition.

[0142] S405, the Camera HAL of the electronic device continuously collects scene data to identify the corresponding scene type.

[0143] The Camera HAL pre-stores conditions that scene data for one or more scene types must meet. Scene types can include macro scenes, night scenes, high dynamic range scenes, portrait scenes, etc. Scene data can include object distance, or ambient light intensity, etc., and the types of scene data differ depending on the scene type. For example, the condition for scene data to meet the requirements of a macro scene is that the object distance must be less than or equal to a preset value (e.g., 12cm).

[0144] In S405, in response to the received instruction to perform scene recognition, the Camera HAL controls the corresponding sensors in the driver layer to collect scene data, including distance sensors (e.g., TOF sensors) to collect object distances. Then, the Camera HAL calculates the corresponding scene type based on the object distances collected by the sensors.

[0145] Taking the example of recognizing a macro scene, after the Camera HAL controls the Time-of-Flight (TOF) sensor to collect the distance to an object, the TOF sensor can periodically report the collected object distances to the Camera HAL. Then, the Camera HAL will determine whether it belongs to a macro scene based on the continuously received object distances. For example, if the received object distances meet the conditions corresponding to a macro scene, then a macro scene is considered to have been recognized. Specifically, meeting the conditions for a macro scene may include that the object distances collected within a continuous time period (e.g., 0.5 seconds) are all less than 12cm.

[0146] The implementation method for Camera HAL to identify other scene types is similar to that for identifying macro scenes. The difference lies in the different types of scene data to be collected and the different conditions for judging scene types, which will not be elaborated on here.

[0147] S406, the Camera HAL of the electronic device reports the scene recognition results to the scene recognition module, such as recognizing a macro scene.

[0148] Specifically, the Camera HAL of the electronic device reports the scene recognition result to the scene recognition module after each scene recognition is completed. Alternatively, the Camera HAL of the electronic device only reports the scene recognition result to the scene recognition module after each scene recognition is completed if the scene recognition result changes.

[0149] The following examples will only be used as an example of scene recognition results that identify macro scenes.

[0150] During the execution of S405-S406 by the electronic device, the user may be zooming in on the subject, allowing the Camera HAL to recognize the macro scene. For details regarding zooming in and the electronic device's display interface during this stage, please refer to the previous section. Figures 1C-1D describe.

[0151] S407, the scene recognition module of the electronic device determines the strategy corresponding to the macro recording mode based on the recognized macro scene.

[0152] Specifically, the scene recognition module of the electronic device pre-stores strategies for one or more scene types corresponding to the recording mode, including but not limited to Zoom control strategies and UI control strategies. The Zoom control strategy specifically controls which camera and focal length are used for shooting, while the UI control strategy specifically controls the display of scene type identifiers and the display of scene status (on / off / hidden) prompts.

[0153] Taking the macro recording mode corresponding to a macro scene as an example, the zoom control strategy in macro recording mode could be "Set Zoom = 0.99". Since 0.5-0.99 corresponds to using a wide-angle camera, Zoom = 0.99 indicates that a wide-angle camera is used, and the shooting is performed using the focal length corresponding to 0.99X. The UI control strategy in macro recording mode could be "Set (micro Mode, 2)". Micro Mode represents the macro scene, and 2 indicates that the macro scene is enabled. In addition, the macro scene can be disabled by using 1, and the macro scene can be hidden by using 0 when no macro scene is detected.

[0154] S408, the scene recognition module of the electronic device sends the Zoom control strategy in macro recording mode to the Zoom control module.

[0155] Specifically, after the scene recognition module of the electronic device determines the Zoom control strategy in the macro recording mode corresponding to the macro scene, it will send the Zoom control strategy to the Zoom control module. The Zoom control strategy can be, for example, "set Zoom=0.99" as described in the previous steps.

[0156] S409, the Zoom control module of the electronic device sends control information of Zoom=0.99 to the Camera HAL.

[0157] Specifically, after receiving the Zoom control strategy in macro recording mode sent by the scene recognition module, the Zoom control module of the electronic device analyzes the Zoom control strategy and then continues to control the Camera HAL to perform shooting work according to the Zoom control strategy, that is, sends control information of Zoom=0.99 to the Camera HAL.

[0158] The S410 electronic device's Camera HAL uses a wide-angle camera and captures images at a focal length corresponding to Zoom=0.99 and then displays them.

[0159] Specifically, as previously explained, Camera HAL pre-stores the correspondence between camera types and zoom values. For example, a zoom value between 0.5 and 0.99 corresponds to a wide-angle camera, while a zoom value between 1 and 6 corresponds to a main camera. Therefore, when Camera HAL receives control information for Zoom = 0.99, it can switch the default main camera to the wide-angle camera and change the focal length from the previously used Zoom = 1 to the focal length corresponding to Zoom = 0.99. This controls the wide-angle camera to capture and display images, resulting in a clearer preview in the macro recording mode preview interface.

[0160] It's worth noting that before switching the main camera to the wide-angle camera, the focal length used is the default focal length corresponding to Zoom=1. After switching the main camera to the wide-angle camera, the focal length used is the focal length corresponding to Zoom=0.99. Since the image size (i.e., the field of view) of the captured image differs depending on the focal length, Camera HAL will process the image captured by the wide-angle camera to ensure that the preview image displayed in the preview interface provides a consistent experience for the user and that the image size (i.e., the field of view) is the same as that captured and displayed using the wide-angle camera before switching the camera.

[0161] After the electronic device completes S410, the preview interface in the camera application outputs the preview image of macro video recording mode. The preview image is clearer and highlights the details of the subject. For details, please refer to the previous section... Figure 1E Description of the preview screen.

[0162] S411, the scene recognition module of the electronic device sends the UI control strategy in macro recording mode to the UI control module.

[0163] Specifically, after the scene recognition module of the electronic device determines the UI control strategy in the macro recording mode corresponding to the macro scene, it will send the UI control strategy to the UI control module. The UI control strategy can be, for example, "Settings (micro Mode, 2)" as described in the previous steps.

[0164] Specifically, since the scene recognition module receives the structure for recognizing macro scenes for the first time after the camera application is launched, the macro scene is enabled by default, and the UI control strategy is set to "Settings (micro Mode, 2)".

[0165] In the embodiments of this application, S411-S412 may occur before S408, or S411-S412 may occur after S410, or S411-S412 may occur between S408-S410. This application does not restrict the execution order of S411-S412 and S408-S410.

[0166] S412, the UI control module of the electronic device controls the display module to display a prompt message indicating that a macro scene has been recognized and that the macro scene has been activated.

[0167] Specifically, the UI control module pre-stores the correspondence between UI control strategies and UI display content. For example, the correspondence between "Settings (micro Mode, 2)" and specific display content could be: display the preceding text... Figure 1E The macro scene identifier 123A (also referred to as the first identifier) ​​is used to indicate that a macro scene has been detected and is enabled. For details, please refer to the previous section. Figure 1E Description of the preview screen.

[0168] above Figure 4 The method flow shown only introduces a part of the implementation of the shooting method provided in this application, that is, the electronic device automatically opens the macro scene after the first recognition of the macro scene in the video recording mode, that is, the shooting method used in the macro video recording mode.

[0169] Next, in Figure 4Based on the method and flow shown, combined with Figure 5 The method flow shown and the previously introduced Figures 2A-2E The following section introduces the shooting methods for electronic devices that, when recognizing a macro scene for the first time in video recording mode, pull up the button to turn the macro scene on or off based on the user's operating habits.

[0170] like Figure 5 As shown, the method includes the following steps:

[0171] Phase 3 (S501-S505): When the electronic device detects a macro scene, it turns the macro scene on or off according to the user's operation, that is, it determines whether to enter macro recording mode or normal recording mode according to the user's operation.

[0172] S501, the UI control module of the electronic device receives an operation to turn off the macro scene.

[0173] Specifically, after the UI control module of the electronic device executes S312 as described above, i.e., displays a prompt indicating that a macro scene has been recognized and has been enabled, the electronic device can also receive user input for disabling the macro scene. This operation, for example, acts on the macro scene as described above. Figure 2A The macro scene identifier 123A operation, or the operation can also be the corresponding voice command, etc.

[0174] S502, the UI control module of the electronic device controls the display module to display a prompt message indicating that the macro scene has been recognized but the macro scene has been turned off, and stores the operation habit of turning off the macro scene.

[0175] Specifically, after receiving the operation to turn off the macro scene, the electronic device will control the display module to display a prompt message indicating that the macro scene has been recognized but has been turned off. The display format of this prompt message can be, for example, as described in the UI embodiment above. Figure 2B The macro scene identifier shown is 123B (which can also be called the second identifier).

[0176] In addition, the UI control module will also store the user's current input operation habits for turning off the macro scene, and will refresh the operation habits later. In other words, the UI control module will store the user's last input operation for turning the macro scene off / on.

[0177] S503, the UI control module of the electronic device sends a command to the Zoom control module to switch from macro recording mode to normal recording mode.

[0178] In the embodiments of this application, S503 may occur before or after S502. The implementation of this application does not impose specific restrictions on the order of execution of S503 in S502.

[0179] S504, the Zoom control module of the electronic device sends the control information Zoom=1 to the Camera HAL.

[0180] Specifically, after receiving the instruction from the UI control module to switch from macro recording mode to normal recording mode, the Zoom control module of the electronic device can determine the Zoom control strategy corresponding to the normal recording mode. Then, it controls the Camera HAL to perform the shooting work according to the Zoom control strategy, that is, it sends the control information Zoom=1 to the Camera HAL.

[0181] Furthermore, since the instruction received by the Zoom control module was sent by the UI module, meaning that the operation of controlling the Zoom value change was triggered by the user, the Zoom control module will also store the user's input operation habit for turning off the macro scene. Moreover, the operation habit will be refreshed later. In other words, the Zoom control module will store the user's last input operation for turning off / on the macro scene.

[0182] The S505 electronic device's Camera HAL uses a main camera to capture images at a focal length corresponding to Zoom=1 and then displays them.

[0183] Specifically, as previously explained, Camera HAL pre-stores the correspondence between camera types and zoom values. For example, a zoom value between 0.5 and 0.99 corresponds to a wide-angle camera, while a zoom value between 1 and 6 corresponds to a main camera. Therefore, when Camera HAL receives control information that zoom = 1, it can switch the camera from a wide-angle mode to a main camera and change the focal length from the zoom value of 0.99 to the focal length of zoom = 1. This controls the main camera to capture and display images, causing the electronic device's camera application to exit macro recording mode and enter normal recording mode, thus outputting the previously mentioned... Figure 2B The preview interface shown.

[0184] Phase 4 (S506-S512): If the electronic device does not recognize the macro scene, it exits the macro recording mode and enters the normal recording mode.

[0185] S506, the Camera HAL of the electronic device continues to report the scene recognition results to the scene recognition module, such as no macro scene was recognized.

[0186] In conjunction with the preceding text Figure 4As shown in steps S403-S405 of the method flow, the camera application has enabled scene recognition. Therefore, the Camera HAL of the electronic device will continuously collect scene data to identify the corresponding scene type and continue to report the identified results to the scene recognition module.

[0187] The following examples will be presented using the case where no macro scene was identified as the scene recognition result.

[0188] Before the electronic device executes S506, the user may be increasing the distance between the electronic device and the subject, causing the Camera HAL to fail to recognize the macro scene. For details regarding increasing the distance between objects and the electronic device's display interface during this stage, please refer to the previous section. Figures 2B-2C describe.

[0189] S507, the scene recognition module of the electronic device determines the strategy corresponding to the normal recording mode based on the absence of a macro scene.

[0190] As described in S407 above, the scene recognition module of the electronic device pre-stores strategies for one or more scene types corresponding to the recording mode, specifically including but not limited to zoom control strategies and UI control strategies. Therefore, when the scene recognition module receives a result indicating that no macro scene has been identified, it can be assumed that the electronic device is in a normal scene, and thus the strategy corresponding to the normal recording mode in a normal scene can be determined.

[0191] The zoom control strategy in normal recording mode could be, for example, "Set Zoom=1". Since 1-6 correspond to using the main camera, Zoom=1 indicates that the main camera is used and the shooting is done at the focal length corresponding to 1X. The UI control strategy in normal recording mode could be, for example, "Set (micro Mode, 0)". Micro Mode represents the macro scene, and 0 means that the macro scene is hidden, which means that the macro scene is not recognized at this time.

[0192] S508, the scene recognition module of the electronic device sends the Zoom control strategy in normal recording mode to the Zoom control module.

[0193] Specifically, after the scene recognition module of the electronic device determines the Zoom control strategy in the normal recording mode corresponding to the normal scene, it will send the Zoom control strategy to the Zoom control module. The Zoom control strategy can be, for example, "set Zoom=1" as described in the previous steps.

[0194] S509, the Zoom control module of the electronic device sends control information Zoom=1 to the Camera HAL.

[0195] Specifically, after receiving the Zoom control strategy in normal recording mode sent by the scene recognition module, the Zoom control module of the electronic device analyzes the Zoom control strategy and then continues to control the Camera HAL to perform shooting work according to the Zoom control strategy, that is, it sends the control information Zoom=1 to the Camera HAL.

[0196] In the S510, the Camera HAL of the electronic device continues to use the main camera and capture images at the focal length corresponding to Zoom=1 and send them to the display.

[0197] Specifically, as described earlier in the S505, the Camera HAL, based on the user's input to disable macro mode, has already switched the previously used wide-angle camera to the main camera and changed the focal length from Zoom=0.99 to Zoom=1 to control the main camera's image acquisition and display. Therefore, upon receiving the Zoom=1 control information, the Camera HAL continues to use the main camera and acquires and displays images at the focal length corresponding to Zoom=1.

[0198] After the electronic device completes the S510 process, the preview screen in the camera application will display the preview screen of the normal video recording mode. For details, please refer to the previous section. Figure 2C Description of the preview screen.

[0199] S511, the scene recognition module of the electronic device sends the UI control strategy in normal recording mode to the UI control module.

[0200] Specifically, after the scene recognition module of the electronic device determines the UI control strategy in the normal recording mode corresponding to the normal scene, it will send the UI control strategy to the UI control module. The UI control strategy can be, for example, "Settings (micro Mode, 0)" as described in the previous steps.

[0201] S512, the UI control module of the electronic device controls the display module to stop displaying prompts related to macro scenes.

[0202] Specifically, the UI control module pre-stores the correspondence between UI control strategies and UI display content. For example, the correspondence between "Settings (micro Mode, 1)" and specific display content could be: display the preceding text... Figure 2C The description mentions that no macro scene prompts are displayed; please refer to the previous text for details. Figure 2C Description of the preview screen.

[0203] In the embodiments of this application, S511-S512 may occur before S508, or S511 may occur after S510, or S511 may occur between S508 and S510. This application does not restrict the execution order of S511-S512 and S508-S510.

[0204] Phase 5 (S513-S518): When the electronic device recognizes the macro scene again after exiting the macro recording mode, it determines whether to enter the macro recording mode based on the user's operating habits of turning the macro scene on / off.

[0205] S513, the Camera HAL of the electronic device continues to report scene recognition results to the scene recognition module, such as recognizing a macro scene.

[0206] In conjunction with the preceding text Figure 4 As shown in steps S403-S405 of the method flow, the camera application has enabled scene recognition. Therefore, the Camera HAL of the electronic device will continuously collect scene data to identify the corresponding scene type and continue to report the identified results to the scene recognition module.

[0207] The following examples will only be used as an example of scene recognition results that identify macro scenes.

[0208] Before the electronic device executes S513, the user may be closing the distance between the electronic device and the subject, causing the Camera HAL to fail to recognize the macro scene. For details on closing the distance between objects and the electronic device's display interface during this stage, please refer to the previous section. Figures 2C-2D describe.

[0209] S514, the scene recognition module of the electronic device determines the strategy corresponding to the macro recording mode based on the recognized macro scene.

[0210] For details on the specific implementation method of S514 by the electronic device, please refer to the description of S407 above, which will not be repeated here.

[0211] S515, the scene recognition module of the electronic device sends the Zoom control strategy in macro recording mode to the Zoom control module.

[0212] For details on the specific implementation method of S515 by electronic devices, please refer to the description of S407 above, which will not be repeated here.

[0213] S516, the Zoom control module of the electronic device determines to continue using the normal recording mode based on the stored operating habits of turning off macro scenes.

[0214] Specifically, after the electronic device executes the aforementioned S503, that is, after the Zoom control module of the electronic device receives the instruction to turn off the macro scene sent by the UI module, the Zoom control module will store the user's last input operation habit for turning off the macro scene. Therefore, in S516, the Zoom control module will determine to continue using the normal recording mode based on the stored operation habit for turning off the macro scene, that is, it will no longer control the Camera HAL to switch the camera and focus.

[0215] S517, the scene recognition module of the electronic device sends the UI control strategy in macro recording mode to the UI control module.

[0216] For details on the specific implementation method of S517 by the electronic device, please refer to the description of S411 above, which will not be repeated here.

[0217] S518, the UI control module of the electronic device controls the display module to display a prompt message indicating that the macro scene has been recognized but not turned on, based on the stored operation habits of turning off the macro scene.

[0218] Specifically, during the execution of S502 by the electronic device, the UI control module stores the user's last input operation habit for disabling the macro scene. Therefore, the UI control module will maintain the macro scene disabled based on this stored operation habit. However, because the UI control module receives a control strategy from the scene recognition module that includes information indicating the macro scene has been recognized, the UI control module will control the display module to display a prompt indicating that the macro scene has been recognized but not enabled. This prompt can be displayed in, for example, the form described in the UI embodiment above. Figure 2E The macro scene shown is labeled 123B.

[0219] above Figure 5 The method flow shown only introduces a part of the implementation of the shooting method provided in this application, namely, the shooting method adopted by the electronic device to determine whether to enable the macro scene based on the user's previous operating habits after recognizing the macro scene again in video recording mode.

[0220] Next, in Figure 4 Based on the method and flow shown, combined with Figure 6 The method flow shown and the previously introduced Figures 3A-3D We will continue to introduce the shooting method performed by electronic devices in macro video recording mode based on user-input zoom operations.

[0221] like Figure 6 As shown, the method includes the following steps:

[0222] S601, the UI control module of the electronic device receives an operation to adjust the zoom ratio.

[0223] Specifically, after executing S312 as described above, i.e., in macro recording mode, the electronic device can also receive user input for adjusting the zoom level. This operation may include, for example, the operation described above that affects... Figure 3A The operation and function of zoom control bar 124 in the middle. Figure 3B The rightward sliding operation in the 124A medium zoom handle.

[0224] S602, the UI control module of the electronic device controls the display module to display the adjusted zoom ratio (e.g., Zoom = 0.8).

[0225] Specifically, in response to a received operation to adjust the zoom level, the UI module of an electronic device can display the corresponding adjusted zoom level, as mentioned above. Figure 3B The selected zoom ratio, Zoom = 0.8, is shown in the zoom handle 124A.

[0226] S603, the UI control module of the electronic device sends the adjusted zoom ratio (e.g., Zoom = 0.8) to the Zoom control module.

[0227] Specifically, after receiving an operation to adjust the zoom level, the UI module of the electronic device will also send the adjusted zoom level (e.g., Zoom = 0.8) to the Zoom control module.

[0228] S604, the Zoom control module of the electronic device sends control information of Zoom=0.8 to the Camera HAL.

[0229] The S605 continues to use a wide-angle camera in its Camera HAL, capturing images at a focal length corresponding to Zoom=0.8 and displaying them.

[0230] Specifically, as explained earlier, Camera HAL pre-stores the correspondence between camera types and zoom values. For example, a zoom value between 0.5 and 0.99 corresponds to a wide-angle camera, while a zoom value between 1 and 6 corresponds to a main camera. Therefore, after receiving control information for Zoom = 0.8, Camera HAL can continue to use the wide-angle camera, but it will switch the focal length corresponding to Zoom = 0.99 to that corresponding to Zoom = 0.8 to control the wide-angle camera to capture and display images. This results in a smaller but wider field of view in the preview output of the macro recording mode preview interface. For details, please refer to the previous section... Figure 3C The description.

[0231] S606, the UI control module of the electronic device receives an operation to adjust the zoom ratio.

[0232] Specifically, after executing S312 as described above, i.e., in macro recording mode, the electronic device can also receive user input for adjusting the zoom level. This operation can be, for example, the operation described above that applies to... Figure 3C The leftward sliding operation of the zoom handle 124A.

[0233] S607, the UI control module of the electronic device controls the display module to display the adjusted zoom ratio (e.g., Zoom = 1.5).

[0234] Specifically, in response to a received operation to adjust the zoom level, the UI module of an electronic device can display the corresponding adjusted zoom level, as mentioned above. Figure 3D The selected zoom ratio, Zoom = 1.5, is shown in the zoom handle 124A.

[0235] S608, the UI control module of the electronic device sends the adjusted zoom ratio (e.g., Zoom = 1.5) to the Zoom control module.

[0236] Specifically, after receiving an operation to adjust the zoom level, the UI module of the electronic device will also send the adjusted zoom level (e.g., Zoom = 1.5) to the Zoom control module.

[0237] S609, the Zoom control module of the electronic device sends control information of Zoom=1.5 to Camera HAL.

[0238] S610, the Camera HAL of the electronic device is switched to use the main camera and captures images at a focal length corresponding to Zoom=1.5 and then displays them.

[0239] Specifically, as previously explained, Camera HAL pre-stores the correspondence between camera types and zoom values. For example, a zoom value between 0.5 and 0.99 corresponds to a wide-angle camera, while a zoom value between 1 and 6 corresponds to a main camera. Therefore, after receiving control information for Zoom = 1.5, Camera HAL can switch the wide-angle camera to the main camera and use the focal length corresponding to Zoom = 1.5 to control the main camera to capture and display images. This results in a wider field of view and a narrower angle of view in the preview output of the macro recording mode preview interface. For details, please refer to the previous section... Figure 3D The description.

[0240] Next, the software and hardware architecture, i.e., the device form factor, of the electronic device involved in this application will be introduced.

[0241] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0242] refer to Figure 7 , Figure 7 This is a schematic diagram of the system architecture of the electronic device 100 according to an embodiment of this application.

[0243] like Figure 7 As shown, the layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: the application layer, the application framework layer, the hardware abstraction layer, the kernel layer, and the hardware layer.

[0244] The application layer can include a series of application packages. For example, an application package can include applications such as a camera and a gallery.

[0245] The camera applications include, but are not limited to: video recording module, scene recognition module, zoom control module, and UI control module, etc.

[0246] The video recording module is used to perform video recording functions of the camera application, including outputting a preview interface in video recording mode and outputting a shooting interface after recording starts.

[0247] The scene recognition module is used to control the Camera HAL to collect scene data, perform scene recognition, and determine the corresponding strategy based on the scene recognition results reported by the Camera HAL, such as the Zoom control strategy and the UI control strategy. Then, the corresponding control strategies are sent to the Zoom control module and the UI control module respectively.

[0248] The Zoom control module is used to control CameraHAL to acquire images according to the corresponding zoom level based on the Zoom control strategy sent by the scene recognition module.

[0249] The UI control module is used to control the display module, i.e. the display screen 140, to output macro scene identifiers according to the corresponding UI control strategy sent by the scene recognition module.

[0250] The functions of each module in the aforementioned camera application can be found in the preceding description of the method flow, which will not be repeated here.

[0251] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications within the application layer. The application framework layer includes predefined functions. For example, it may include camera services, camera devices, view systems, and so on.

[0252] Camera services, also known as camera access interfaces, are used to provide application programming interfaces and programming frameworks for camera applications.

[0253] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0254] The Hardware Abstraction Layer (HAL) is an interface layer located between the application framework layer and the kernel layer, providing a virtual hardware platform for the operating system.

[0255] The hardware layer mainly includes components in the camera module, such as Sensor 1, Sensor 2, TOF, multispectral sensor, image signal processor, digital signal processor, and image processor, etc. Among them, Sensor 1 and Sensor 2 refer to the photosensitive elements in the camera.

[0256] In this embodiment of the application, the hardware abstraction layer may include a camera hardware abstraction layer and a camera algorithm library.

[0257] The Camera Hardware Abstraction Layer (Camera HAL) provides virtual hardware for Camera Device 1 (the first camera, also known as the main camera) and Camera Device 2 (the second camera, also known as the wide-angle camera). It can also acquire pose data and transmit it to the camera algorithm library. The Camera HAL can also be used to calculate the number N of images to be stitched together and to retrieve information from the camera algorithm library. The Camera HAL is primarily used to control the corresponding sensors to acquire scene data, such as controlling the TOF sensor to acquire object distance for macro scene recognition. The Camera HAL is also used to control the corresponding cameras to acquire images based on received Zoom control information.

[0258] The camera algorithm library can include algorithm modules and runtime detection modules.

[0259] The algorithm module includes several algorithms for processing images, which can be used to implement shooting scene recommendation algorithms, such as macro, night scene, high dynamic range, and portrait scenes.

[0260] The kernel layer is the layer between hardware and software. It includes drivers for various hardware components.

[0261] In some embodiments, the kernel layer may include camera device drivers, digital signal processor drivers, and image processor drivers, etc.

[0262] The camera device drives the sensor used to drive the camera to acquire images and drives the image signal processor to preprocess the images.

[0263] A digital signal processor driver is used to drive a digital signal processor to process images.

[0264] The image processor driver is used to drive the graphics processor to process images. The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0265] The following example, using a scene of capturing a photograph, illustrates the workflow of the software and hardware of the electronic device 100.

[0266] When touch sensor 160K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The application framework layer retrieves the raw input event from the kernel layer and identifies the control corresponding to the input event. Taking a single touch operation as an example, where the corresponding control is the camera application icon, the camera application calls the interface of the application framework layer to launch the camera application, and then calls the kernel layer to launch the camera driver, capturing still images or videos through camera 130.

[0267] Electronic devices can be equipped with Or other portable terminal devices with different operating systems, such as mobile phones, tablets, desktop computers, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.

[0268] refer to Figure 8 , Figure 8 A schematic diagram of the structure of the electronic device 100 is shown.

[0269] like Figure 8As shown, the electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 126, a camera 130, a display screen 140, an audio module 150, a speaker 150A, a receiver 150B, a microphone 150C, a headphone jack 150D, and a sensor module 160. The sensor module 160 may include a pressure sensor 160A, a distance sensor 160F, a proximity light sensor 160G, a touch sensor 160K, an ambient light sensor 160L, etc.

[0270] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware. For example, the electronic device 100 may also include buttons, motors, indicators, and a subscriber identification module (SIM) card interface, etc. As another example, the sensor module may also include: a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a fingerprint sensor, a temperature sensor, a bone conduction sensor, etc.

[0271] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0272] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.

[0273] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0274] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0275] In this embodiment, processor 110 can be used to run a camera application, control various modules within the camera application, and execute the aforementioned CameraHAL. Figure 4 , Figure 5 , Figure 6 The method described herein is used to implement the shooting method provided in this application.

[0276] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0277] Internal memory 126 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0278] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.

[0279] Non-volatile memory can include disk storage devices and flash memory.

[0280] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0281] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0282] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0283] The external memory interface 120 can be used to connect to external non-volatile memory, thereby expanding the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to perform data storage functions. For example, music, video, and other files can be stored in the external non-volatile memory.

[0284] In this embodiment of the application, the aforementioned memory can be used to store the operating data of the camera application and user data, including but not limited to: the correspondence between scene type and zoom control strategy, UI control strategy, etc.; user input for turning the macro scene on / off when a macro scene is detected; the correspondence between zoom magnification and camera, etc.

[0285] Electronic device 100 implements display functions through a GPU, display screen 140, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 140 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0286] Display screen 140 is used to display images, videos, etc. Display screen 140 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be manufactured using organic light-emitting diodes (OLEDs), active-matrix organic light-emitting diodes (AMOLEDs), flexible light-emitting diodes (FLEDs), miniled, microLEDs, micro-OLEDs, quantum dot light-emitting diodes (QLEDs), etc. In some embodiments, electronic device 100 may include one or N displays 140, where N is a positive integer greater than 1.

[0287] In this embodiment, the display screen 140 can be used to display the interface provided by the camera application, including but not limited to the preview interface in normal recording mode and the preview interface in macro recording mode, for example, displaying Figures 1A-1E , Figures 2A-2E , Figures 3A-3D In addition to the user interface shown, the display screen 140 can also display the shooting interface in normal video recording mode, the shooting interface in macro video recording mode, and so on.

[0288] Electronic device 100 can perform shooting functions through ISP, camera 130, video codec, GPU, display 140 and application processor.

[0289] The ISP (Image Signal Processor) is used to process data fed back from the camera 130. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, converting it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 130.

[0290] Camera 130 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 130, where N is a positive integer greater than 1.

[0291] In this embodiment, the camera 130 includes at least a main camera and a wide-angle camera. The focal lengths of the main camera and the wide-angle camera are different, therefore, the suitable object distances for shooting are different. For example, if the focal length of the main camera is approximately 26 mm and the focal length of the wide-angle camera is approximately 17 mm, then the main camera is suitable for shooting objects at a moderate distance, such as 20-30 cm, while the wide-angle camera is suitable for shooting objects at a closer distance, such as within 15 cm.

[0292] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.

[0293] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0294] An NPU (Neural Processing Unit) is a computational processor for neural networks (NNs). By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.

[0295] Electronic device 100 can implement audio functions, such as music playback and recording, through audio module 150, speaker 150A, receiver 150B, microphone 150C, headphone jack 150D, and application processor.

[0296] The audio module 150 is used to convert digital audio information into analog audio signal output, and also to convert analog audio input into digital audio signal. The audio module 150 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 150 may be located in the processor 110, or some functional modules of the audio module 150 may be located in the processor 110.

[0297] The speaker 150A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or make hands-free calls through the speaker 150A.

[0298] The receiver 150B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a telephone call or voice message, the receiver 150B can be brought close to the ear to listen to the voice.

[0299] Microphone 150C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 150C, inputting the sound signal into microphone 150C. Electronic device 100 may have at least one microphone 150C. In some embodiments, electronic device 100 may have two microphones 150C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic device 100 may also have three, four, or more microphones 150C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0300] The 150D headphone jack is used to connect wired headphones. The 150D headphone jack can be a USB interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0301] Pressure sensor 160A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 160A can be disposed on display screen 140. There are many types of pressure sensors 160A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 160A, the capacitance between the electrodes changes. Electronic device 100 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 140, electronic device 100 detects the intensity of the touch operation based on pressure sensor 160A. Electronic device 100 can also calculate the touch position based on the detection signal from pressure sensor 160A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0302] A distance sensor 160F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, during scene capture, the electronic device 100 can utilize the distance sensor 160F to measure distance for rapid focusing. In this embodiment, the electronic device can use the distance sensor 160F to collect object distance data from the scene, i.e., the distance between the object being captured and the electronic device, for the electronic device to identify whether it is a macro scene.

[0303] The proximity sensor 160G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. The electronic device 100 emits infrared light outward through the LED. The electronic device 100 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 may use the proximity sensor 160G to detect when a user holds the electronic device 100 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 160G can also be used in holster mode and pocket mode for automatic unlocking and locking of the screen.

[0304] Touch sensor 160K, also known as a "touch panel," can be located on display screen 140. The touch sensor 160K and display screen 140 together form a touchscreen, also known as a "touch screen." Touch sensor 160K detects touch operations applied to or near it. The touch sensor can transmit 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 display screen 140. In other embodiments, touch sensor 160K may also be located on the surface of electronic device 100, in a different position than display screen 140.

[0305] The ambient light sensor 160L is used to sense the brightness of ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 140 according to the sensed ambient light brightness. The ambient light sensor 160L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 160L can also work with the proximity sensor 160G to detect whether the electronic device 100 is in a pocket to prevent accidental touches.

[0306] It should be understood that the steps in the above-described method embodiments provided in this application can be implemented by integrated logic circuits in the processor hardware or by instructions in software form. The method steps disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.

[0307] This application also provides an electronic device that may include a memory and a processor. The memory may be used to store a computer program; the processor may be used to invoke the computer program in the memory to cause the electronic device to perform the method in any of the above embodiments.

[0308] This application also provides a chip system including at least one processor for implementing the functions involved in the methods performed by the electronic device in any of the above embodiments.

[0309] In one possible design, the chip system also includes a memory for storing program instructions and data, which may be located within or outside the processor.

[0310] The chip system can consist of chips or include chips and other discrete components.

[0311] Optionally, the chip system may contain one or more processors. These processors can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, an integrated circuit, etc. When implemented in software, the processor can be a general-purpose processor, implemented by reading software code stored in memory.

[0312] Optionally, the chip system may contain one or more memories. The memory may be integrated with the processor or disposed separately from it; this application embodiment does not limit this. For example, the memory may be a non-transient processor, such as a read-only memory (ROM), which may be integrated with the processor on the same chip or disposed separately on different chips. This application embodiment does not specifically limit the type of memory or the arrangement of the memory and processor.

[0313] For example, the chip system may be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on chip (SoC), a central processor unit (CPU), a network processor (NP), a digital signal processor (DSP), a micro controller unit (MCU), a programmable logic device (PLD), or other integrated chips.

[0314] This application also provides a computer program product comprising: a computer program (also referred to as code or instructions) that, when run, causes a computer to perform the method executed by the electronic device in any of the above embodiments.

[0315] This application also provides a computer-readable storage medium storing a computer program (also referred to as code or instructions). When the computer program is run, it causes the computer to perform the method executed by the electronic device in any of the above embodiments.

[0316] The various embodiments of this application can be combined arbitrarily to achieve different technical effects.

[0317] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0318] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0319] In summary, the above description is merely an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made according to the disclosure of the present invention should be included within the scope of protection of the present invention.

Claims

1. A shooting method, characterized in that, The method is applied to an electronic device, and the method includes: The electronic device launches the camera application and displays a preview interface; Images are captured by the first camera of the electronic device and displayed as a first image in the preview interface; If the distance between the electronic device and the object being photographed meets the first condition corresponding to the macro scene, the Zoom control module switches to the second camera of the electronic device to capture the image, and displays the second screen in the preview interface. The UI control module displays a first indicator indicating that the macro scene has been turned on in the second screen. The focal length of the first camera is greater than that of the second camera. Upon receiving an operation to adjust the zoom level to the first zoom level, the Zoom control module determines to continue using the second camera to capture images. Alternatively, upon receiving an operation to adjust the zoom ratio to a second zoom ratio, the Zoom control module switches to the first camera to capture images, where the second zoom ratio is greater than the first zoom ratio, and the UI control module displays the first identifier indicating that the macro scene has been enabled in the preview interface. Upon detecting a first operation applied to the first identifier, the Zoom control module switches to capturing images through the first camera, stores the corresponding operation habits of the first operation through the UI control module and the Zoom control module, displays a third screen in the preview interface, and displays a second identifier indicating that the macro scene is not enabled in the third screen through the UI control module. If the distance between the electronic device and the object being photographed does not meet the first condition, the Zoom control module determines to continue capturing images through the first camera and displays a fourth screen in the preview interface. The fourth screen does not include any markers indicating the macro scene. It is also detected that the distance between the electronic device and the object being photographed meets the first condition, and it is determined that the UI control module and the Zoom control module have stored the operating habits corresponding to the first operation. The Zoom control module determines to continue capturing images through the first camera and displays the fifth screen in the preview interface. The UI control module displays a third indicator in the fifth screen indicating that the macro scene is not enabled.

2. The method according to claim 1, characterized in that, The size of the object in the second frame is larger than the size of the object in the first frame.

3. The method according to claim 1, characterized in that, If the distance between the electronic device and the object being photographed is detected to meet the first condition corresponding to the macro scene, the system switches to capturing images through the second camera of the electronic device and displays the second image in the preview interface. Specifically, this includes: after detecting that the distance between the electronic device and the object being photographed has been reduced to a first value, the system switches to capturing images through the second camera of the electronic device and displays the second image in the preview interface. The method further includes: before detecting that the distance between the electronic device and the object being photographed has decreased to a first value, continuing to acquire images through the first camera, and displaying a sixth screen in the preview interface.

4. The method according to claim 3, characterized in that, The clarity of the second image is higher than that of the sixth image.

5. The method according to any one of claims 1-4, characterized in that, After displaying the second screen in the preview interface, the method further includes: Received an instruction to start recording video. The system continuously captures images through the second camera, displays the recording interface, and shows the seventh screen within the recording interface. Received an operation to end video recording; Save the seventh screen as a video file.

6. An electronic device, characterized in that, The electronic device includes one or more processors, one or more memories, and at least two cameras; wherein the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-5.

7. A chip system, characterized in that, The chip system is applied to an electronic device, the chip system including one or more processors, the processors being used to invoke computer instructions to cause the electronic device to perform the method as described in any one of claims 1-5.

8. A computer program product containing instructions, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-5.

9. A computer-readable storage medium comprising instructions, characterized in that, When the instructions are executed on an electronic device, the electronic device causes the electronic device to perform the method as described in any one of claims 1-5.