Camera configuration switching method and device, chip, electronic equipment and medium
Patent Information
- Application Number
- CN202410628548.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-20
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2044-05-20
AI Technical Summary
[0003]现有的相机配置切换逻辑对相机使用场景的适配性较低,图像处理效果较差
[0030] The technical effects of the aforementioned aspects can be referenced from each other, and will not be elaborated further here.
Smart Images

Figure CN121037674B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of electronic equipment technology, and in particular to a camera configuration switching method, device, chip, electronic equipment and medium. Background Technology
[0002] As the demands for camera image quality (such as photos and videos) increase, the complexity of camera image processing also rises. To optimize image processing results, the camera configuration of electronic devices can be switched.
[0003] The existing camera configuration switching logic has low adaptability to camera usage scenarios and poor image processing performance. Summary of the Invention
[0004] This application provides a camera configuration switching method, device, chip, electronic device, and medium, which helps to improve the adaptability of camera configuration to camera usage scenarios and improve image processing effects.
[0005] In a first aspect, embodiments of this application provide a camera configuration switching method applied to an electronic device. The electronic device includes a first file containing camera configuration information corresponding to different usage scenarios of the camera in the electronic device. The method includes: receiving a camera usage request for the electronic device; determining a first usage scenario based on the camera usage request; obtaining first camera configuration information corresponding to the first usage scenario from the first file; and switching the camera configuration of the electronic device based on the first camera configuration information.
[0006] This application stores camera configuration information corresponding to the camera's usage scenario in the form of a file within the electronic device. Based on the file content, the electronic device's camera configuration can be switched to the configuration information corresponding to the current usage scenario. Based on this technology, camera configuration information adapted to different usage scenarios can be preset or updated as needed. For example, the types and contents of configuration items in the camera configuration information can be added, deleted, or modified as required, ensuring the camera configuration is compatible with the usage scenario. Furthermore, modifying the camera configuration information can be achieved simply by updating the file, making the operation straightforward.
[0007] Optionally, the first file includes a first sub-file and a second sub-file; the first sub-file records first camera configuration information and a first identifier of the first camera configuration information; the second sub-file records the correspondence between the first identifier of the first camera configuration information and a second identifier of the first usage scenario. Based on this, the step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file includes: obtaining the first identifier corresponding to the second identifier from the second sub-file; and obtaining the first camera configuration information corresponding to the first identifier from the first sub-file.
[0008] Camera configuration information and the mapping between camera configuration information and usage scenarios can be stored in two separate files. This makes it easy to find the appropriate camera configuration information based on the usage scenario and also makes it easier to maintain the file content.
[0009] Optionally, usage scenarios can be categorized based on camera usage modes, combined with information about the electronic device's environment and / or the camera's usage characteristics. This allows for fine-grained and precise segmentation of usage scenarios, resulting in better adaptation between camera configuration and usage scenarios, thereby contributing to improved image processing performance.
[0010] Optionally, the camera configuration information corresponding to the usage scenario is related to the internal hardware and software structure of the electronic device. Based on the differences in the internal hardware and software structure of different types of devices, the corresponding first file can be set differently for different types of electronic devices, so that the camera configuration is adapted to the specific usage scenario of the device.
[0011] Optionally, the camera configuration information for each usage scenario includes: configuration information of the camera sensor required for that usage scenario, configuration information of the image processor required for that usage scenario, and / or configuration information of the image processing algorithm required for that usage scenario. Based on the specific content of the camera configuration information, the configuration switching of camera image processing-related devices can be achieved to adapt to the usage scenario, thereby helping to improve image processing performance.
[0012] Optionally, according to the first camera configuration information, the camera configuration of the electronic device is switched, including: the Usecase layer of the electronic device obtains the first Usecase required for the first use scenario, and instructs the first Usecase to update the configuration of the first Usecase according to the configuration information of the first Usecase in the first camera configuration information.
[0013] The Usecase layer can determine the Usecase required for the current use case and instruct the Usecase to switch configurations, thus enabling the configuration switching of the Usecase used in the current use case.
[0014] Optionally, according to the first camera configuration information, the camera configuration of the electronic device is switched, including: the graph layer of the electronic device obtains the first graph required for the first use scenario, and instructs the first graph to update the configuration of the first graph according to the configuration information of the first graph in the first camera configuration information.
[0015] The Graph layer can determine the Graph required for the current use case and instruct the Graph to switch configurations, thus enabling the switching of the configuration of the Graph used in the current use case.
[0016] Optionally, according to the first camera configuration information, switching the camera configuration of the electronic device includes: the feature layer of the electronic device obtaining the first feature required for the first usage scenario, and instructing the first feature to update the configuration of the first feature according to the configuration information of the first feature in the first camera configuration information.
[0017] The Feature layer can determine the Feature required for the current use scenario and instruct the Feature to switch configurations, thus enabling configuration switching of the Feature used in the current use scenario.
[0018] Optionally, the first camera configuration information is cached in memory; the camera configuration switching method further includes: the first Usecase retrieves the configuration information of the first Usecase from memory and updates the configuration of the first Usecase.
[0019] Optionally, the first camera configuration information is cached in memory; the camera configuration switching method further includes: the first graph retrieves the configuration information of the first graph from memory and updates the configuration of the first graph.
[0020] Optionally, the first camera configuration information is cached in memory; the camera configuration switching method further includes: the first feature retrieves the configuration information of the first feature from memory and updates the configuration of the first feature.
[0021] By caching the camera configuration information of the current use case in memory, each layer that needs to switch configurations, such as the Usecase layer, Graph layer, and Feature layer, can read the cached camera configuration information from memory to switch configurations, without having to pass the camera configuration information layer by layer.
[0022] Optionally, the step of obtaining the first camera configuration information corresponding to the first use scenario from the first file is performed by a service provided by the Usecase layer of the electronic device or the HAL layer of the electronic device. By obtaining the camera configuration information of the current use scenario from the Usecase layer or the HAL layer, the lower layer can switch configurations as needed based on the camera configuration information.
[0023] Optionally, the camera configuration switching method further includes: receiving an update request for an electronic device; obtaining update information for the electronic device based on the update request, the update information including information for updating a first file; and updating the first file based on the update information.
[0024] When it is necessary to optimize the camera configuration information to suit the usage scenario, the content of the first file in the electronic device can be updated through the device update process to achieve on-demand modification of the camera configuration information. When switching camera configurations using the updated file, the adaptability of the camera configuration to the usage scenario can be better.
[0025] Secondly, embodiments of this application provide a camera configuration switching device applied to an electronic device. The electronic device includes a first file containing camera configuration information corresponding to different usage scenarios of the camera in the electronic device. The device includes: a receiving module for receiving a camera usage request for the electronic device; a determining module for determining a first usage scenario based on the camera usage request; an obtaining module for obtaining first camera configuration information corresponding to the first usage scenario from the first file; and a processing module for switching the camera configuration of the electronic device based on the first camera configuration information.
[0026] Thirdly, embodiments of this application provide a chip, including: a processor, which is configured to execute computer program instructions stored in a memory, wherein when the computer program instructions are executed by the processor, the chip is triggered to execute the method as described in any of the first aspects.
[0027] Fourthly, embodiments of this application provide an electronic device, which includes one or more memories for storing computer program instructions and one or more processors, wherein when the computer program instructions are executed by one or more processors, the electronic device is triggered to perform the method as described in any of the first aspects.
[0028] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the method as described in any of the first aspects.
[0029] In a sixth aspect, embodiments of this application provide a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the method as described in any of the first aspects.
[0030] The technical effects of the aforementioned aspects can be referenced from each other, and will not be elaborated further here. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly described below.
[0032] Figure 1 A schematic diagram illustrating an example of camera configuration switching;
[0033] Figure 2A schematic diagram of the display interface of the camera application provided in an embodiment of this application;
[0034] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0035] Figure 4 A system structure block diagram of an electronic device provided in an embodiment of this application;
[0036] Figure 5 A schematic diagram illustrating a camera configuration switching logic provided in an embodiment of this application;
[0037] Figure 6 A timing diagram illustrating a camera configuration switching process provided in an embodiment of this application;
[0038] Figure 7 A schematic diagram illustrating a multi-camera, multi-configuration application scenario provided in an embodiment of this application;
[0039] Figure 8 A flowchart illustrating a camera configuration switching method provided in an embodiment of this application;
[0040] Figure 9 This is a schematic diagram illustrating a request for a device system update, provided as an embodiment of this application. Detailed Implementation
[0041] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0042] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0043] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0044] It should be understood that the term "at least one" as used in this document refers to one or more, and "more than one" refers to two or more. The term "and / or" as used in this document 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 alone, A and B simultaneously, and B alone. A and B can be singular or plural. Additionally, the character " / " in this document generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0045] It should be understood that although the terms "first," "second," etc., may be used to describe the set thresholds in the embodiments of this application, these set thresholds should not be limited to these terms. These terms are only used to distinguish the set thresholds from each other. For example, without departing from the scope of the embodiments of this application, the first set threshold may also be referred to as the second set threshold, and similarly, the second set threshold may also be referred to as the first set threshold.
[0046] As the demands for camera image quality (such as photos and videos) increase, the complexity of camera image processing also rises. To optimize image processing, the camera configuration of electronic devices can be switched depending on the camera's usage environment. For example, when a user is recording video with their mobile phone, the camera configuration of the electronic device can be switched as the user moves from indoors to outdoors. Exemplarily, the configuration items involved in switching camera configurations can include hardware and software configuration items involved in the process from image acquisition to display to the user, such as use case and feature configuration items.
[0047] See Figure 1 The image shows an example of camera configuration switching. The software architecture of a chip includes use case layers, graph layers, and feature layers, and this software architecture can reside in the operating system of the electronic device (e.g., The system's hardware abstraction layer (HAL) provides two binary code programs (e.g., ...) for switching camera configurations. Figure 4 The binary code program 1 and binary code program 2 are shown. This binary code program can be stored in the code program storage area of the electronic device's memory.
[0048] like Figure 1As shown, since the electronic device has a camera application installed, the Usecase layer can include Module 1 and the camera application's Usecase, i.e., the camera Usecase. The Graph layer can include Module 2 and the preview Graph, photo Graph, video Graph, etc., under the camera Usecase. Taking the preview Graph as an example, the preview Graph can have camera preview functionality. The Feature layer can include Module 3 and some Features under the Graph, such as... Figure 1 The graph shows Realtime Feature, Preview Feature, Snapshot Feature, and Video Feature. Combinations of different features can support different camera functions; for example, Realtime Feature and Preview Feature can be linked to support the Preview Graph function.
[0049] In one example, the HAL layer of an electronic device can be configured with a control policy to receive instructions from the upper layer (e.g., an application), such as a user's request to use the camera. Responding to the user's request, the control policy determines the camera usage mode of the electronic device (e.g., photo mode, video recording mode, video call mode, etc.) and sends the determined camera mode information to the Usecase layer. Module 1 of the Usecase layer can call binary code program 1. Binary code program 1 calculates the configuration information of the Usecase layer in real time based on the camera usage mode and information about the camera's environment, thus enabling configuration switching for the Usecase layer. The Usecase layer sends the configuration switching result to the Feature layer through the Graph layer. Module 3 of the Feature layer calls binary code program 2. Binary code program 2 calculates the configuration information of the Feature layer in real time based on the configuration switching result of the Usecase layer and information about the camera's environment, thus enabling configuration switching for the Feature layer.
[0050] The above example uses code to determine camera configuration information and then switch camera configurations. However, the code is not easy to modify. For example, modifying the binary code involves changes to the software architecture, requiring a complete rebuild of the architecture for the changes to take effect. Therefore, it is not convenient to modify the specific content of the configuration information that can be calculated based on the camera usage mode (such as adding or deleting configuration items, or modifying the configuration content of configuration items) as needed. This results in low adaptability of the camera configuration to the camera usage scenario, leading to poor image processing performance.
[0051] also, Figure 1 The code used in the example shown to determine the camera configuration in real time is a general-purpose code program that is not specific to electronic devices. This results in low adaptability of the camera configuration to the camera usage scenario and poor image processing performance.
[0052] To improve the adaptability of camera configurations to the camera usage scenarios of electronic devices (such as smartphones, tablets, digital cameras, etc.), thereby enhancing image processing performance, this application provides a camera configuration switching method. This method stores camera configuration information corresponding to the camera usage scenario in the electronic device in the form of a file. When a camera configuration switch is required, the electronic device's camera configuration can be switched to the camera configuration information corresponding to the current usage scenario based on the file content. For example, the aforementioned file can be an Extensible Markup Language (XML) file. Alternatively, the file can be encrypted. The aforementioned camera usage scenario may also be referred to as the device usage scenario in some embodiments or related technologies.
[0053] Based on this technology, camera configuration information adapted to different usage scenarios can be preset or updated as needed by updating files. For example, the types and contents of configuration items in the camera configuration information can be added, deleted, or modified as required, ensuring the camera configuration matches the usage scenario. Furthermore, modifying camera configuration information is achieved simply by updating the file, making the operation straightforward. After the file is updated, the electronic device switches camera configurations based on the updated file.
[0054] Unlike the examples above, which calculate camera configuration information in real time based on camera usage mode and environmental data to achieve camera configuration switching, this application embodiment can finely divide camera usage scenarios, so that the configuration information required for different specific usage scenarios (such as the configuration information required for configuration switching of Usecase layer, Graph layer, Feature layer, hardware layer, etc.) can be preset. In this way, the correspondence between camera usage scenarios and camera configuration information can be recorded in a file and stored in an electronic device, so that the electronic device can find the camera configuration information corresponding to the camera usage scenario based on the file content and achieve camera configuration switching.
[0055] For example, the camera usage scenarios of an electronic device can be categorized based on its camera usage modes (such as photo mode, video mode, video call mode, etc.), combined with at least one of the following: the environmental conditions of the electronic device (such as bright light environment, low light environment, rainy weather environment, etc.) and the camera usage characteristics of the electronic device (such as the subject being the moon, the shooting distance, etc.). The degree of categorization of the camera usage scenarios can be related to the image processing effect. Given that the requirements for the image processing effect of the camera in the electronic device are known, the degree of categorization of usage scenarios can ensure that each usage scenario corresponds to pre-set camera configuration information, enabling the electronic device to obtain images that meet the image processing effect requirements in that usage scenario.
[0056] by Figure 2 Taking the camera application 201 on the shown phone as an example, the camera application 201 can work in photo mode, video mode, portrait mode, etc. See also... Figure 2 Users can click on the camera application 201 installed on their mobile phones to request the use of the device's camera. In response to the user's click on the camera application 201, the mobile phone can display the camera application 201's photo-taking interface. The camera application 201 works in photo-taking mode by default and uses "1×", i.e., the main camera, to capture images by default. Each frame of the image captured by the main camera is displayed on the photo-taking interface after image processing, specifically displaying one frame of the photo preview video.
[0057] Taking the classification of camera usage scenarios based on the camera usage patterns and environmental conditions of electronic devices as an example, in one feasible implementation, the camera usage scenarios recorded in the aforementioned file may include at least:
[0058] Camera usage scenario 1: The camera app is running in the main camera mode of the photo mode, and the electronic device is in a bright light environment;
[0059] Camera usage scenario 2: The camera app is running in the main camera mode of the photo mode, and the electronic device is in a low-light environment;
[0060] Camera usage scenario 3: The camera app is running in wide-angle mode of photo mode, and the electronic device is in a bright light environment;
[0061] Camera usage scenario 4: The camera app is running in wide-angle mode under photo mode, and the electronic device is in a low-light environment.
[0062] The preset file in this application embodiment can store the camera configuration information corresponding to each of the above camera usage scenarios 1 to 4. The above camera usage scenarios 1 to 4 are exemplary descriptions. This application embodiment may also include other camera usage scenarios, which will not be described one by one.
[0063] In the phone's camera app Figure 2 When taking photos in the shooting mode shown, the camera configuration can be switched according to the camera usage scenario based on the switching of the camera used by the camera application, user operation and / or the brightness of the ambient light, so that the camera configuration is adapted to the above scenario and the image effect in the photo preview video displayed to the user is better.
[0064] For example, if the camera is used in scenario one, the phone can obtain the camera configuration information corresponding to scenario one from the file and switch to the camera configuration corresponding to scenario one. If the camera is used in scenario two, the phone can obtain the camera configuration information corresponding to scenario two from the file and switch to the camera configuration corresponding to scenario two.
[0065] During a user's use of an electronic device, switching between photo and video modes in a camera app will change the camera's usage scenario. (See also...) Figure 2 If the user clicks the icon of camera application 201, the phone can open camera application 201. After opening camera application 201, it can be in the default shooting mode. The control strategy can determine the current camera usage scenario (e.g., Scenario 1), and thus find the camera configuration information corresponding to Scenario 1 from the file. If the user then clicks the recording control 202 of the camera application, camera application 201 will switch to recording mode and display the recording function interface of camera application 201. At this time, the control strategy can determine the current camera usage scenario (e.g., Scenario 2), and thus find the camera configuration information corresponding to Scenario 2 from the file. Scenario 1 is different from Scenario 2; that is, the user's operation of clicking the recording control 202 can cause a change in the camera usage scenario, thereby causing a change in the camera configuration. For example, the parameters of the image processing algorithm used before the change may be different.
[0066] See Figure 2 If the user clicks control 203 in photo mode, the camera application 201 will switch to using the "2×" camera sensor to capture images. At this time, the control strategy can determine the current camera usage scenario (e.g., Scenario 3), and thus find the camera configuration information corresponding to Scenario 3 in the file. Scenario 1 is different from Scenario 3; that is, the user's click on control 203 can cause a change in the camera usage scenario, and the camera configuration information used before and after the change is different, such as the camera sensor used before the change.
[0067] For example, the camera configuration information referred to in the embodiments of this application refers to the hardware and software configuration information involved in the current use scenario of the camera when performing image acquisition and image processing. For example, it may include the configuration information of the camera sensor required by the camera use scenario, the configuration information of the image processor required by the camera use scenario for processing the images acquired by the camera, and / or the configuration information of the image processing algorithm required by the camera use scenario for processing the images acquired by the camera, etc.
[0068] For example, the configuration information of the camera sensor may include: the identifier of the camera sensor used, the camera output image size, the field of view of the camera output image, etc.; the configuration information of the graphics processor may include the hardware algorithm configuration of the ISP, etc.; and the configuration information of the image processing algorithm may include the identifier and parameter configuration of the image processing algorithm used, etc.
[0069] For example, see Figure 5 File 501 contains camera configuration information for a specific camera usage scenario (identified as "wide_default_algo0"), which includes the following details: the identifier of the camera sensor used is "0", the output image size (wh) is "4000*3000", the frame rate (fps) is "30", the field of view (fov_ratio) is "1", and the identifier of the image processing algorithm (algo) is "×××", etc.
[0070] Different camera usage scenarios may require different hardware and / or software configuration information. For example, in camera usage scenario 1, where image acquisition uses camera sensor 1, the required camera sensor configuration information for this scenario may include: the identifier of camera sensor 1 and its configuration items. In camera usage scenario 2, where image acquisition uses camera sensor 2, the required camera sensor configuration information for this scenario may include: the identifier of camera sensor 2 and its configuration items. Similarly, if the image processing algorithm used in camera usage scenario 1 is Algorithm 1, the image processing algorithm configuration information includes the identifier of Algorithm 1 and its configuration items. However, if the image processing algorithm used in camera usage scenario 2 is Algorithm 2, the image processing algorithm configuration information includes the identifier of Algorithm 2 and its configuration items.
[0071] Based on the camera-related configuration after real-time switching, the electronic device can acquire and process images in real time, and send the processed images to the display to be displayed as a frame of an image (such as a preview image or a frame of a recorded video).
[0072] In one embodiment, the electronic device may include multiple cameras (i.e. multiple camera sensors), and each camera may have multiple configurations. In this case, the camera configuration switching method can be applied to camera configuration switching scenarios with multiple cameras and multiple configurations.
[0073] See Figure 7 The logical camera of an electronic device can consist of multiple physical cameras (i.e., camera sensors), and each physical camera can have multiple sets of configuration information.
[0074] A logical camera can represent what the user perceives as the device's camera. For example, an electronic device may include two camera sensors: a main camera and a wide-angle camera. In one usage scenario, the main camera is suitable for capturing images, while in another, the wide-angle camera is suitable. Thus, if the usage scenario changes during the use of the electronic device, the camera sensor used can change; for example, it can switch from using the main camera to using the wide-angle camera. The user may be unaware of this camera sensor switch and believe that the same camera is always being used to capture images.
[0075] It is feasible to use different cameras for different usage scenarios. For example, one usage scenario may be suitable for using... Figure 7 The physical camera 0 shown acquires images, while another use case is suitable for using... Figure 7 The physical camera 1 shown captures images. Therefore, the camera configuration information recorded in the aforementioned file may include an identifier of the camera sensor used.
[0076] It is feasible to use the same camera for different usage scenarios, but the configuration information of the camera can be different. For example, one usage scenario is suitable for using... Figure 7 The physical camera 0 shown acquires images, and the configuration information for physical camera 0 is configuration information 0. Another use case is applicable to using... Figure 7 The physical camera 0 shown acquires images, and the configuration information of physical camera 0 is configuration information 1. Thus, the camera configuration information recorded in the aforementioned file may include the identifier of the camera sensor used and the configuration information of that camera sensor. For example, the camera sensor configuration information may include the camera sensor's parameters and algorithm (Config, Algo).
[0077] In another embodiment, the electronic device may include a single camera (i.e., a single camera sensor), and the single camera may have multiple configurations. In this case, the camera configuration switching method can be applied to camera configuration switching scenarios with multiple configurations for a single camera.
[0078] In this embodiment, the file stored in the electronic device records the correspondence between camera usage scenarios and camera configuration information. Unlike the previous example where camera configuration information is calculated in real time based on camera mode information and environmental data to achieve camera configuration switching, in this embodiment, because the file records the correspondence between camera usage scenarios and camera configuration information, the electronic device can determine the current camera usage scenario in real time while the user is using the camera, and then look up the corresponding camera configuration information from the file to achieve camera configuration switching. Changes in factors such as the camera usage mode, the device's environment, and camera usage characteristics can all lead to changes in the camera usage scenario. For example, when the camera application 201 is working in photo mode and using the main camera to capture images, the user's clicking of the recording control 202 or control 203 can cause a switch in the camera usage scenario (i.e., from scenario 1 to scenario 2 or scenario 3).
[0079] For example, camera configuration information corresponding to camera usage scenarios can be stored in two files, then one file ( Figure 5 The document 502 shown may contain identifiers for multiple camera usage scenarios, as well as identifiers for camera configuration information corresponding to each camera usage scenario. Another document ( Figure 5 The document 501 shown may contain identifiers for multiple camera configuration information, as well as the specific content of each camera configuration information.
[0080] Taking the switch from scenario 1 to scenario 3 as an example, the electronic device responds to the user's click on the control 203 and can determine that the current camera usage scenario is scenario 3 (at least reflected in the camera application 201 running in the 2× mode of the shooting mode). The camera configuration information corresponding to scenario 3 can be obtained by searching the file. The camera configuration information may include the identifier of the 2× camera sensor and the configuration information of the 2× camera sensor.
[0081] After determining the current camera usage scenario, you can search for a file to obtain the identifier of the camera configuration information corresponding to the current usage scenario, and search for another file to obtain the specific content of the camera configuration information based on the identifier of the camera configuration information, and then switch the camera configuration based on the specific content.
[0082] The camera configuration switching method provided in this application supports setting corresponding camera configuration information differently for different usage scenarios based on the differences in different usage scenarios, so that the camera configuration is adapted to the specific usage scenario of the electronic device.
[0083] Furthermore, the aforementioned camera configuration switching method supports different settings for different types of electronic devices (such as different models of electronic devices produced by the same manufacturer) based on differences in their internal hardware and software structures, ensuring that the camera configuration is adapted to the specific usage scenario of the device.
[0084] The camera configuration switching method provided in any embodiment of this application can be applied to electronic devices such as mobile phones, tablets, digital cameras, personal digital assistants (PDAs), desktops, laptops, notebook computers, ultra-mobile personal computers (UMPCs), handheld computers, netbooks, and wearable devices. This application does not impose any special restrictions on the specific form of the above-mentioned electronic devices.
[0085] The camera configuration switching method provided in any embodiment of this application can be applied to... Figure 3 In the electronic device 100 shown. Figure 3 A schematic diagram of the electronic device 100 is shown. The electronic device 100 may include a processor 110, internal memory 121, audio module 170, microphone 170C, sensor module 180, camera 193, display screen 194, etc. The sensor module 180 may include a gyroscope sensor, barometric pressure sensor, magnetic sensor, accelerometer, distance sensor, proximity sensor, temperature sensor, touch sensor, ambient light sensor, etc.
[0086] 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.
[0087] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0088] In some embodiments, the processor 110 may be a system-on-chip (SoC), which may include a central processing unit (CPU), and may further include other types of processors. In some embodiments, the processor 110 may be a PWM control chip.
[0089] The processor 110 may also include necessary hardware accelerators or logic processing hardware circuitry, such as an ASIC, or one or more integrated circuits for controlling the execution of the program. Furthermore, the processor 110 may have the capability to operate one or more software programs, which may be stored in a storage medium.
[0090] 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.
[0091] In some embodiments, the memory of the electronic device 100 may be a read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), or other types of dynamic storage devices capable of storing information and instructions. It may also be an electrically erasable programmable read-only memory (EEPROM), or any computer-readable medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer.
[0092] In some embodiments, the processor 110 and the memory can be combined into a single processing device, or they can be separate components. The processor 110 can be used to execute program code stored in the memory. In specific implementations, the memory can be integrated into the processor 110, or it can be independent of the processor 110.
[0093] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0094] In one embodiment, the internal memory 121 contains multiple regions, such as a code storage region and a file storage region. The above-mentioned... Figure 1 The binary code program 1 and binary code program 2 in the example shown can be stored in the code program storage area, while the above-mentioned files provided in the embodiments of this application can be stored in the file storage area.
[0095] 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.
[0096] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 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.
[0097] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0098] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0099] The ISP is used to process data fed back by camera 193. Camera 193 is used to capture still images or videos. An object passes through the lens to generate an optical image that is projected onto the photosensitive element.
[0100] 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.
[0101] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0102] Microphone 170C, 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 170C, inputting the sound signal into microphone 170C. Electronic devices can have at least one microphone 170C. In some embodiments, electronic devices can have two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, electronic devices can have three, four, or more microphones 170C, enabling sound signal collection, noise reduction, sound source identification, and directional recording, among other functions.
[0103] In one embodiment, the camera 193 contains an image processing module. The image processing module can perform preliminary processing on the images captured by the camera 193. The images obtained from the preliminary processing can be further processed by hardware (such as ISP, GPU, etc.) algorithms, software algorithms, etc. The images obtained from the further processing can be displayed on the display screen 194. The displayed images can be a preview image, a photo, or a video image, etc.
[0104] A gyroscope sensor can be used to determine the motion attitude of the electronic device 100. A barometric pressure sensor is used to measure air pressure. In some embodiments, the electronic device 100 calculates altitude using the air pressure value measured by the barometric pressure sensor to assist in positioning and navigation. A magnetic sensor includes a Hall sensor. An accelerometer can detect the magnitude of acceleration of the electronic device 100 in various directions (typically three axes). A distance sensor is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor to measure distance for rapid focusing. A proximity sensor can include, for example, a light-emitting diode (LED) and a photosensor, such as a photodiode. An ambient light sensor is used to sense ambient light intensity. A temperature sensor is used to detect temperature.
[0105] A touch sensor, also known as a "touch device," can be located on the display screen 194. The touch sensor and the display screen 194 together form a touchscreen, also known as a "touchscreen." The touch sensor detects touch operations applied to or near it. The touch sensor can then 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 the display screen 194. In some embodiments, the touch sensor may also be located on the surface of the electronic device 100, in a different position than the display screen 194.
[0106] In one embodiment, the electronic device can determine the camera usage scenario based on data collected by sensors. For example, it can determine whether the electronic device is in a close-up shooting scenario based on distance data collected by a distance sensor, whether it is in a shooting scenario for a specific object such as the moon based on image data collected by a camera, and whether it is in a bright light usage scenario based on ambient light brightness collected by an ambient light sensor.
[0107] In addition, the electronic device runs an operating system on top of the aforementioned components. For example... operating system, operating system, Operating systems, etc. Applications, such as camera apps, can be installed and run on the operating system.
[0108] 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.
[0109] Figure 4 This is a system architecture block diagram of an electronic device 100 according to an embodiment of this application. 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 multiple layers, from top to bottom: the application layer (APP), the application framework layer (Framework, FWK), the system library and runtime layer, the hardware abstraction layer (HAL), and the driver layer. The layer below the driver layer can be the hardware layer (HW).
[0110] The application layer can include a series of application packages, which can be divided into system applications and third-party applications. System applications include applications such as camera, gallery, calendar, call, and SMS, while third-party applications include applications such as instant messaging, shopping, and payment. Among them, applications such as camera, instant messaging, shopping, and payment can all have one or more functions that require the use of the camera sensor, such as photo taking, video recording, and video calling.
[0111] For example, a camera application may include multiple controls, such as controls for taking a photo, portrait mode, video recording, and panorama. Taking the photo control as an example, the photo control can provide photo-taking functionality, allowing the user to open the camera application and trigger the photo control to request the use of the camera to take a photo.
[0112] For example, an instant messaging application may include multiple controls, such as controls for taking photos, recording videos, and making video calls. Taking a video call control as an example, a video call control can provide video call functionality, allowing a user to open the instant messaging application and trigger the video call control to request to use the camera for a video call.
[0113] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example... Figure 4 As shown, the application framework layer can include a view system, notification manager, resource manager, window manager, content provider, etc.
[0114] 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.
[0115] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0116] The resource manager provides applications with various resources, such as localized strings, icons, images, layout files, video files, and so on. The window manager manages windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0117] The system library and runtime layer includes the system library and the Android Runtime.
[0118] System libraries can include multiple functional modules. For example: 3D graphics processing libraries (e.g., OpenGL ES), surface managers, 2D graphics engines (e.g., SGL), media libraries, etc.
[0119] The 3D graphics processing library is used for 3D graphics drawing, image rendering, compositing, and layer processing. The surface manager manages the display subsystem and provides fusion of 2D and 3D layers for multiple applications, such as OpenGL ES. The 2D graphics engine is a drawing engine for 2D graphics, such as SGL. The media library supports playback and recording of various common audio and video formats, as well as still image files. The media library supports various audio and video encoding formats, such as: Moving Picture Experts Group (MPEG4), High-Compression Digital Video Codec Standard (H.264), Moving Picture Experts Compression Standard Audio Layer 3 (MP3), Advanced Audio Coding (AAC), Adaptive Multi-Rate Codec (AMR), Joint Picture Experts Group (JPG), Portable Web Graphics (PNG), etc.
[0120] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java calls, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0121] The Hardware Abstraction Layer (HAL) acts as a bridge between software and hardware. It encapsulates the underlying hardware driver, providing a generic interface for the application framework layer to call the driver. The HAL is an abstract interface for the device kernel driver, providing application programming interfaces for accessing the underlying device to higher-level Java API frameworks. The HAL contains multiple library modules, each implementing an interface for a specific type of hardware component.
[0122] See Figure 4 The hardware abstraction layer can include control strategies, image processing algorithms, and may also include... The chip's software architecture is a multi-layered architecture including a Usecase layer, a Graph layer, and a Feature layer. This multi-layered architecture is an inner layer of the Hardware Abstraction Layer (HAL), serving as the internal control flow of the HAL. This control strategy can be a piece of code.
[0123] For example, in response to a user's request to use the device's camera (such as in response to a user opening the camera app), the control policy can determine the current camera usage scenario in real time.
[0124] In this embodiment, the camera usage scenario can be determined by the camera application or other applications that call the camera application based on the camera usage mode, environmental information, camera usage characteristics, etc. Alternatively, the camera usage scenario can be determined by other services provided in the mobile phone, such as services located in the framework layer, and the determined camera usage scenario can be sent to the control policy of the HAL layer. Alternatively, the above control policy can also determine the camera usage scenario based on the camera usage mode sent by the upper layer (e.g., the camera application or other applications that call the camera application), combined with environmental information, camera usage characteristics, etc. This embodiment does not impose any limitations.
[0125] The determination of the camera usage scenarios mentioned above is related to the criteria for classifying camera usage scenarios. This application does not impose specific restrictions on how to determine the camera usage scenarios.
[0126] In one embodiment, the control strategy can be based on a file (i.e., after determining the current camera usage scenario in real time) Figure 4 The correspondence between camera usage scenarios and camera configuration information recorded in Document 1 and Document 2 shown in the figure is used to obtain the camera configuration information adapted to the current usage scenario, and then the camera configuration information is processed... The chip's software architecture passes the acquired camera configuration information down layer by layer. Specifically, the camera configuration information can be passed to the hardware layer in sequence through the Usecase layer, Graph layer, Feature layer, and Driver layer, so that the image processing hardware such as the camera sensor and image processor can switch configurations according to the camera configuration information.
[0127] After the image processing components (such as camera sensors, image processors, and image processing algorithms) have completed their configuration switching, image acquisition and processing can be performed based on the switched configuration. For example, when multiple camera sensors exist, a specific camera sensor (such as the main camera) can be switched to be used. After this camera sensor acquires an image, its internal image processing module can process the acquired image based on the switched module configuration. The processed image can then be passed to the image processor. The image processor processes the received image based on the switched hardware configuration and passes the processed image to the image processing algorithm. The image processing algorithm processes the received image based on the switched software configuration and displays the processed image.
[0128] By placing image processing algorithms in the hardware abstraction layer, it is easier for the image processing algorithms to call some hardware (such as GPUs) in the hardware layer to perform some time-consuming image processing, so as to balance software processing performance and hardware processing speed.
[0129] In practice, the type, number, and processing order of the image processing components involved in image processing can be set as needed, and this embodiment does not limit this.
[0130] In other embodiments of this application, the hardware abstraction layer may not include... The software architecture of the chip, and the software architecture of other chips, can then transmit camera configuration information adapted to the current usage scenario of the electronic device to the hardware layer through the software architecture of those other chips.
[0131] The driver layer is the layer between hardware and software. It includes at least sensor drivers, display drivers, Bluetooth drivers, audio drivers, and touchscreen drivers. The driver layer is fundamental to the Android system, enabling the system's final functionalities.
[0132] The hardware layer can include various sensors such as camera sensors and ambient light sensors, as well as image processors, displays, and memory. The memory can include file storage areas and code / program storage areas, where the file storage area stores file one and file two (e.g., file one, file two). Figure 5 As shown in files 501 and 502, the code program storage area stores the aforementioned binary code program 1 and binary code program 2.
[0133] As can be seen, unlike the aforementioned examples where binary code program 1 and binary code program 2 are called to calculate camera configuration information in real time, this application embodiment records camera configuration information corresponding to the camera usage scenario through file 1 and file 2.
[0134] It should be noted that the use of electronic devices The chip's software architecture enables information transmission at the hardware abstraction layer. These two code segments can be stored in the electronic device. However, the method in this application embodiment does not require the use of these two code segments to switch camera configurations. Instead, File 1 and File 2 are used to switch camera configurations.
[0135] In one embodiment, file one is used to store the specific content of camera configuration information corresponding to the camera usage scenario, and file two is used to store the correspondence between camera configuration information and camera usage scenario. Then, after determining the current usage scenario, the above control strategy can find the camera configuration information adapted to the current usage scenario by searching file one and file two.
[0136] In other embodiments, camera configuration information corresponding to camera usage scenarios can be stored in one or more files. For example, if a single file is used, it can record the identifiers of multiple camera usage scenarios and the specific content of the camera configuration information corresponding to each camera usage scenario. If three files are used, one file can record the identifiers of multiple camera usage scenarios and the identifier of the camera configuration information corresponding to each camera usage scenario; another file can record the identifiers of multiple camera configuration information and the specific content of each camera configuration information; and a third file can record the hierarchical relationship between the multiple camera usage scenarios. This application does not limit this approach.
[0137] For example, document 2 may record identifiers of multiple camera usage scenarios, as well as identifiers of camera configuration information corresponding to each camera usage scenario.
[0138] Feasibly, when there is a hierarchical relationship between multiple camera usage scenarios, document two can also record this hierarchical relationship and store the identifier of the camera usage scenario based on this hierarchical relationship. This makes it easy to quickly find the identifier of the current usage scenario from document two.
[0139] For example, file one can record the identifiers of multiple camera configuration information, as well as the multiple configuration items contained in each camera configuration information and the configuration content of each configuration item. By using two files to store the camera configuration information and the correspondence between the camera configuration information and the camera usage scenarios respectively, it is convenient to manage and maintain the camera configuration information and the correspondence, such as adding, deleting or modifying camera configuration information or only adding, deleting or modifying the correspondence as needed.
[0140] It is feasible that both File 1 and File 2 can be XML files.
[0141] For example, file one can be as follows: Figure 5 The document shown, file 501, and file 2 can be as follows: Figure 5The document 502 is shown. By recording the one-to-one correspondence between the identifiers of camera usage scenarios and the identifiers of camera configuration information in document 502, it is helpful to accurately find the camera configuration information that is suitable for the current usage scenario.
[0142] See Figure 5 File 502 records an identifier for a certain camera usage scenario (as shown in label 5022) and an identifier for the camera configuration information corresponding to that camera usage scenario (as shown in label 5023). File 501 records an identifier for the camera configuration information corresponding to that camera usage scenario (as shown in label 5011) and records multiple configuration items included in the camera configuration information and the configuration content of each configuration item (as shown in label 5012).
[0143] See Figure 5 File 501 can record first-level scenes, with corresponding identifiers such as Scene 0 (as shown in label 5021), Scene 1, etc. Taking a camera application as an example, Scene 0 can indicate that the camera application is running in photo mode, and Scene 1 can indicate that the camera application is running in video mode.
[0144] A primary scene can also include multiple secondary scenes, which can be labeled as configuration0 to configuration3. Taking a camera application as an example, configuration0 to configuration3 can respectively represent the camera application running in main camera mode under photo mode and the electronic device is in a bright light environment; the camera application running in main camera mode under photo mode and the electronic device is in a low light environment; the camera application running in wide-angle mode under photo mode and the electronic device is in a bright light environment; and the camera application running in wide-angle mode under photo mode and the electronic device is in a low light environment.
[0145] Figure 5 In the illustrated embodiment, there may be only two levels of scenes, and each level-two scene is a specific camera usage scenario. In other embodiments, there may be only one level of scenes, or there may be two or more levels of scenes, and each lowest-level scene is a specific camera usage scenario. This application does not limit this.
[0146] Each camera usage scenario corresponds to a specific camera configuration information, which can be adapted to the corresponding scenario. Based on the current camera usage mode of the electronic device, the surrounding environment, camera usage characteristics, and the inclusion relationship between higher and lower-level scenarios, the current camera usage scenario can be quickly determined, thereby obtaining the corresponding camera configuration information.
[0147] See Figure 5 Based on the identifier of the current usage scenario, the identifier of the corresponding camera configuration information can be found in file 502, and then the specific content of the corresponding camera configuration information can be found in file 501. For example, if the identifier of the current usage scenario is "configuration 0" (as shown in label 5022), then the identifier of the corresponding camera configuration information "wide_default_algo0" (as shown in label 5023) can be found in file 502, and then the specific content of the corresponding camera configuration information (as shown in label 5012) can be found in file 501: the identifier of the camera sensor used (sensor) is "0", the camera output image size (wh) is "4000*3000", the frame rate (fps) is "30", the field of view (fov_ratio) is "1", and the identifier of the image processing algorithm (algo) is "×××", etc.
[0148] For example, if an electronic device includes more than one camera sensor, and the camera configuration information includes an identifier for the camera sensor, and the identifier is "0", then the camera driver can activate the camera sensor with the identifier "0" to acquire image light signals through the camera sensor with the identifier "0".
[0149] For example, if the camera sensor identified as "0" is Figure 7 The physical camera 0 shown, then the specific content of the camera configuration information shown by label 5012 may include: Figure 7 The configuration information shown is one of the configuration information 0 to configuration information 2, so that the physical camera 0 can acquire images based on one of the configuration information 0 to configuration information 2, and perform internal processing of the acquired images by the camera sensor.
[0150] See Figure 5 In some embodiments, when a user requests to use the camera, the control strategy can receive the camera usage request and, based on the request, determine the current camera usage scenario in real time. Furthermore, by sequentially searching files 502 and 501, it can obtain camera configuration information corresponding to the current usage scenario. Since the file content can be edited as needed, the obtained camera configuration information can be adapted to the current usage scenario. Therefore, after switching the camera configuration based on this information, the electronic device uses the switched camera configuration to acquire and process images, resulting in images with good image processing quality.
[0151] To enable camera configuration switching, the control strategy can, in practice, send the acquired camera configuration information to the Usecase layer, which in turn sends the received camera configuration information to the Graph layer. The Graph layer then sends the received camera configuration information to the Feature layer, which continues to pass the received camera configuration information to its lower layers until the camera configuration information is passed to the driver layer and the hardware layer in sequence.
[0152] In addition to receiving camera configuration information and passing it down to the next layer, each layer that transmits camera configuration information can also perform configuration switching based on the configuration content of that layer if the camera configuration information includes configuration items involved in that layer.
[0153] For example, Module 3 of the Feature layer can instruct the Features within the Feature layer to switch their internal configurations based on camera configuration information. For instance, a real-time Feature can be used to switch the camera sensor used, switch the ISP's hardware algorithm configuration, etc. (switch sensor, isp config…). Preview Features, photo-taking Features, and video-recording Features can all be used to switch their own configurations and algorithms, etc. (switch config, algigos…). For example, a photo-taking Feature can switch its algorithm based on the algigo in the camera configuration information (such as the algigo shown in document 501). Another example is that the ISP can switch algorithms based on the remosaic type in the camera configuration information. The REMOSAIC interpolation algorithm can be divided into hardware and software types. Furthermore, the camera sensor can switch configurations based on values such as the output image size and frame rate in the camera configuration information; for example, it can select a suitable sensor mode and activate it.
[0154] The following section uses the video recording mode of a user's electronic device's camera application as an example to explain the process of transmitting camera configuration information.
[0155] See Figures 4-5If a user opens the camera application on their electronic device and clicks the recording control, the camera application enters recording preview mode. While the camera application is in recording preview mode, the control strategy can determine the camera usage scenario in real time and, based on files 501 and 502, find the camera configuration information corresponding to the current usage scenario (for example, if the current usage scenario is identified as scene identifier 5022 in file 502, then the camera configuration information indicated by identifier 5012 can be found in file 501). In other feasible implementations, the control strategy can determine the camera usage scenario in real time and provide the determined current usage scenario to module one, allowing module one to find the corresponding camera configuration information from the files.
[0156] In one feasible implementation, the control strategy can pass the found camera configuration information to Module 1 of the Usecase layer. Module 1 can then continue to pass the camera configuration information down to the next layer, and so on, until the camera configuration information is passed down to the hardware layer.
[0157] If module one determines that there is no need to switch the configuration of the Usecase layer, then the camera configuration information can be sent to module two of the Graph layer.
[0158] If module 2 determines that there is no need to switch the configuration of the Graph layer, then the camera configuration information can be sent to module 3 of the Feature layer.
[0159] Assuming Module 3 determines that a configuration switch is needed for the Feature layer, it can instruct the Features in the Feature layer to switch configurations based on the camera configuration information. Since the camera application has not yet started recording, the Feature instructed by Module 3 can be a Feature under the Preview Graph (such as a Real-time Feature or Preview Feature), rather than a Feature under other Graphs (such as a Photo Feature or a Video Feature). Furthermore, this Preview Graph belongs to the Camera Usecase, not the Usecase of other applications that also have camera usage functionality (such as instant messaging applications or shopping applications).
[0160] After that, Module 3 continues to send camera configuration information until it is sent to the hardware layer.
[0161] After each layer is configured and switched as needed, the electronic device uses the switched camera configuration to capture and process a frame of image. The processed image is then sent to the display for display, which is a frame of video preview.
[0162] In another feasible implementation, the control strategy can store camera configuration information in a fixed location (such as memory) so that lower layers (Usecase layer, Graph layer, Feature layer, hardware layer, etc.) can read the camera configuration information from memory. For example, if the Usecase layer determines that the camera Usecase needs to switch configurations, it can instruct the camera Usecase to read the corresponding configuration information from memory to perform the configuration switch.
[0163] See Figure 6 The timing diagram shown illustrates the camera configuration switching process. Taking the camera application in video preview mode as an example, one implementation process for an electronic device to switch camera configurations may include the following steps:
[0164] 6.1) The control strategy determines the camera usage scenario. Specifically, when the camera application is in video preview mode, the camera usage scenario determined by the control strategy can at least be reflected in the camera application working in video preview mode.
[0165] 6.2) The control strategy reads camera configuration information corresponding to the determined camera usage scenarios from a file. This file can be stored in the memory of the electronic device, and can record camera configuration information corresponding to multiple camera usage scenarios.
[0166] 6.3) The control strategy stores the read camera configuration information into memory.
[0167] 6.4) The control strategy sends a configuration switching instruction 1 to the module in the Usecase layer.
[0168] 6.5) In response to configuration switching instruction 1, if module 1 determines that the camera Usecase in the Usecase layer needs to switch configurations, it sends configuration switching instruction 2 to the camera Usecase to instruct the camera Usecase to switch configurations according to the configuration information of the camera Usecase stored in memory.
[0169] 6.6) Module 1 sends a configuration switching instruction 3 to Module 2 in the Graph layer.
[0170] 6.7) In response to configuration switching instruction 3, if module 2 determines that the preview Graph of the Graph layer needs to be configured, it sends configuration switching instruction 4 to the preview Graph to instruct the preview Graph to perform configuration switching based on the configuration information of the preview Graph stored in memory.
[0171] 6.8) Module 2 sends configuration switching instructions to Module 3 of the Feature layer.
[0172] 6.9) In response to configuration switching instruction 5, if module 3 determines that the preview feature of the Feature layer needs to be configured, it sends configuration switching instruction 6 to the preview feature to instruct the preview feature to perform configuration switching based on the configuration information of the preview feature stored in memory.
[0173] Practically, the above-mentioned camera configuration switching process may also include, in addition to Figure 6 Other steps besides those shown, such as Module 3 sending configuration switching instructions to its lower layer, and the hardware layer switching configurations as needed based on the configuration switching instructions sent from its upper layer, are not described in detail in this embodiment.
[0174] If the user clicks the start recording control in the camera application while it is in recording preview mode, the camera application will then enter recording mode. During recording mode, the control strategy, based on files 501 and 502, can obtain the camera configuration information corresponding to the current usage scenario. In one example, the control strategy can send the obtained camera configuration information to Module 1, which in turn will pass the information to Module 2 and then Module 3.
[0175] Assuming Module 3 determines that a configuration switch for the Feature layer is required, it can instruct the Features within the Feature layer to switch configurations based on the camera configuration information. Since the camera application has already started recording, the Feature indicated by Module 3 can be a Feature belonging to the Recording Graph (such as a Real-time Feature or Recording Feature), rather than a Feature belonging to another Graph (such as a Photo Feature or Preview Feature). Furthermore, this Recording Graph belongs to the Camera Usecase, not the Usecase of other applications that also have camera usage functionality (such as instant messaging applications or shopping applications).
[0176] After that, Module 3 continues to send camera configuration information until it is sent to the hardware layer.
[0177] After each layer is configured and switched as needed, the electronic device uses the switched camera configuration to capture and process a frame of image. The processed image is then sent to the display for display, which is a frame of recorded video.
[0178] Feasibly, the camera usage scenarios in video preview mode and video recording mode can be set as different modes of the same camera usage scenario as needed. Therefore, if other factors, such as the environmental conditions of the electronic device, remain unchanged, the camera configuration information obtained by the control strategy can be the same. Based on this, the camera configuration information obtained by the control strategy can include not only the configuration content involved in the video preview function but also the configuration information involved in the video recording function. In one feasible implementation, in video preview mode, the camera configuration information issued by the module may not include the configuration information involved in the video recording function, and in video recording mode, the camera configuration information issued by the module may not include the configuration information involved in the video preview function.
[0179] In other embodiments, the camera usage scenarios in the video preview mode and the video recording mode can also be set to different camera usage scenarios as needed.
[0180] Understandable, Figure 4 The layers in the illustrated software structure and the components contained in each layer 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 layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0181] Figure 4 The camera configuration switching method provided in the illustrated embodiment is simple and easy to use. It can be achieved by configuring an XML file (taking an XML file as an example). The content of the XML file can be added, deleted, or modified to meet the required camera configuration switching needs.
[0182] Figure 4 The camera configuration switching method provided in the illustrated embodiment is stable and reliable, with one-stop control (i.e., management of XML files) and multiple uses (i.e., the configuration content in the XML file can be used to switch configurations at various stages in the image processing workflow), making the device operation more stable.
[0183] Figure 4 The camera configuration switching method provided in the illustrated embodiment is divided into projects (i.e., different types of electronic devices) and scenarios, with clear decoupling and easy maintenance.
[0184] like Figure 8 As shown, this application embodiment provides a camera configuration switching method, applied to an electronic device. The electronic device includes a first file, which records camera configuration information corresponding to different usage scenarios of the camera in the electronic device. The method may include steps 801 to 804.
[0185] In one embodiment of this application, the usage scenario is categorized based on the camera usage mode, combined with information about the environment in which the electronic device is located and / or the camera's usage characteristics. This allows for fine-grained and precise categorization of usage scenarios, resulting in better adaptability between camera configuration and usage scenarios, thereby contributing to improved image processing performance.
[0186] Feasibly, based on the specific differences in different camera usage scenarios (such as different ambient brightness levels), for the same electronic device, the camera configuration information corresponding to different usage scenarios of the electronic device can be different. Each camera configuration information is adapted to the corresponding camera usage scenario. When using the adapted camera configuration to acquire and process images, the image processing effect is better.
[0187] For example, the first file may record camera configuration information corresponding to the above-mentioned camera usage scenarios 1 to 4 respectively.
[0188] In one embodiment of this application, the camera configuration information corresponding to each usage scenario includes: the configuration information of the camera sensor to be used in the usage scenario, and the image processor to be used in the usage scenario (e.g., it can be...). Figure 4 The configuration information of the image processor in the image, and / or the image processing algorithm required for this use case (e.g., it can be...). Figure 4 Configuration information for the image processing algorithm in the image processing algorithm.
[0189] Based on the specific details of the camera configuration information, the configuration of camera image processing components can be switched to adapt to the usage scenario, thereby helping to improve image processing performance. Feasibly, the camera sensor can acquire images and process them. The images processed and output by the camera sensor are then further processed by an image processor and image processing algorithms, and the further processed images can be displayed on a monitor.
[0190] For example, an image processor may include an ISP.
[0191] For example, the configuration information of the first camera sensor may include the format of the image acquired by the first camera sensor, whether specific processing (such as mosaic processing) is performed in the internal image processing module of the first camera sensor, and the field of view of the output image.
[0192] Taking the field of view as an example, the camera sensor can configure the field of view of the acquired image based on the field of view of the output image, so that the two are the same or close. If the two are close, a cropping amount can be calculated based on the field of view of the output image, and the image acquired by the camera sensor can be cropped according to the calculated cropping amount so that the displayed image conforms to the field of view of the output image. For example, the cropping processing can be performed in the Usecase layer or the Feature layer.
[0193] Step 801: Receive a request to use the camera of the electronic device.
[0194] Conveniently, electronic devices can be equipped with applications such as camera apps, instant messaging software, shopping apps, and payment apps. These applications can include controls for functions such as taking photos, recording videos, and making video calls. When the control is triggered, the electronic device can activate the camera sensor and acquire image light signals through the camera sensor. After a series of image processing steps, including image processing algorithms, the image light signals can be output to the display screen for image display.
[0195] In practice, users can trigger the aforementioned photo and video recording controls to request the use of the device's camera for taking photos, recording videos, etc., and the corresponding electronic device can receive the user's request to use the electronic device's camera.
[0196] The first file stored in an electronic device can exist as an external interface, allowing device developers to set or update the file content as needed, and it is simple and easy to use.
[0197] Practically, the first file can be an XML file. For example, the first file may include... Figure 5 Files 501 and 502 are shown in the diagram. Other possible implementations include merging the contents of files 501 and 502 into a single file, or splitting them into more than two files.
[0198] This application embodiment can record camera configuration information adapted to the camera's usage scenario through text files or configuration files, and the files can be updated based on changes in camera configuration requirements. Compared to Figure 1 The binary code program in the example shown makes the file easier to maintain and manage. For instance, configuration items in the file can be added, deleted, or modified, as can scene identifiers for camera usage scenarios. After the file is updated, camera configuration information matching the camera usage scenario is found based on the updated file content.
[0199] Step 802: Determine the first usage scenario based on the camera usage request.
[0200] For example, it can be done by Figure 4 or Figure 5 The control strategy within the system determines the camera's usage scenario in real time.
[0201] Step 803: Obtain the first camera configuration information corresponding to the first usage scenario from the first file.
[0202] Step 804: Based on the first camera configuration information, switch the camera configuration (or camera-related configuration) of the electronic device. By switching the camera configuration of the electronic device, the configuration update of the device's camera configuration can be achieved.
[0203] In practice, the switched camera configuration may include not only the configuration of the camera sensor and the internal image processing module of the camera sensor, but also the configuration of other hardware or software algorithms for camera image processing.
[0204] For details on how to obtain camera configuration information and how to switch the camera configuration of electronic devices based on the camera configuration information, please refer to the relevant technical descriptions in other embodiments of this application, which will not be repeated here.
[0205] Figure 8 The illustrated embodiment stores camera configuration information corresponding to the camera's usage scenario in the electronic device in the form of a file. Based on the file content, the electronic device's camera configuration can be switched to the configuration information corresponding to the current usage scenario. Based on this technology, camera configuration information adapted to different usage scenarios can be preset or updated as needed. For example, the types and contents of configuration items in the camera configuration information can be added, deleted, or modified as required, ensuring the camera configuration matches the usage scenario. Furthermore, modifying the camera configuration information can be achieved simply by updating the file, making the operation straightforward.
[0206] In one embodiment of this application, the camera configuration information corresponding to the usage scenario is related to the internal hardware and software structure of the electronic device. Based on the differences in the internal hardware and software structures of different types of devices, the corresponding first file can be set differently for different types of electronic devices, so that the camera configuration is adapted to the specific usage scenario of the device.
[0207] Feasibly, given the differences in the internal hardware and software structures of different devices, such as the number of cameras or the different internal functional structures of the cameras, the camera configuration information corresponding to the same usage scenario for different electronic devices may differ. Each camera configuration information is adapted to its corresponding electronic device, resulting in better image processing performance when images are acquired and processed using the adapted camera configuration. Thus, in one embodiment of this application, the first camera configuration information differs from the camera configuration information corresponding to the first usage scenario of another electronic device.
[0208] By differentiating between different electronic devices and setting a first file that is adapted to each device, the first file stored in the electronic device becomes a dedicated file for the device rather than a universal file. This helps improve the adaptability of the camera configuration to the camera's usage scenarios.
[0209] In one embodiment of this application, the camera configuration switching method further includes: receiving an update request for an electronic device; obtaining update information for the electronic device according to the update request, the update information including information for updating a first file; and updating the first file according to the update information.
[0210] In one example, when a new version of an electronic device's software system is available, the device's settings application, a system application, could contain a corresponding control to remind users of the system upgrade. See also... Figure 9 The phone can have a settings app (901) installed. If the user taps the settings app (901), the phone will display its interface. If a new version of the phone's system is available for upgrade, a control (902) can be displayed in the settings app (901) interface to remind the user. If the user taps control (902), the phone will redirect to the new version's interface, which will display control (903) allowing the user to submit an update request. Control (903) will also display information about the new system version (such as version name, version identifier, and file size). If the user triggers control (903) to request a system update, the phone can download the update information and update the device's system accordingly.
[0211] Conveniently, a new version of the device system may contain a new first file, or updated information about the original first file. Therefore, a device system update can update the stored first file. Thus, the system update process performed by the phone can include the step of updating the first file.
[0212] For example, if a new version of the device system contains a new first file, the electronic device (such as a processor that may be a specific electronic device) can delete the original first file and update and replace it with the new first file.
[0213] For example, if a new version of the device system contains updated information about the original first file (such as the addition, deletion, or modification of configuration items, or the addition, deletion, or modification of the configuration content of configuration items), the electronic device can modify the corresponding part of the stored first file according to the updated information about the original first file, so as to update the first file.
[0214] In other examples, when a new version of the first file exists, the electronic device's settings application can have a corresponding control to remind the user to upgrade the file. If the user triggers this control to request an upgrade, the electronic device can receive the user's update request. Then, through file update processing, the stored first file can be updated.
[0215] In one embodiment of this application, the first file includes a first sub-file and a second sub-file; the first sub-file records first camera configuration information and a first identifier of the first camera configuration information; the second sub-file records the correspondence between the first identifier of the first camera configuration information and a second identifier of a first usage scenario. Based on this, the step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file includes: obtaining the first identifier corresponding to the second identifier from the second sub-file; and obtaining the first camera configuration information corresponding to the first identifier from the first sub-file.
[0216] For example, the first sub-file and the second sub-file can be Figure 4 The documents shown are File 1 and File 2.
[0217] For example, the first sub-file can be Figure 5 The second sub-file of file 501 shown can be... Figure 5 The document shown is 502.
[0218] Camera configuration information and the mapping between camera configuration information and usage scenarios can be stored in two separate files. This makes it easy to find the appropriate camera configuration information based on the usage scenario and also makes it easier to maintain the file content.
[0219] In one embodiment of this application, the electronic device includes a first camera sensor; the first camera configuration information includes: first configuration information; or, an identifier of the first camera sensor and first configuration information; wherein, the first configuration information is used to process images acquired by the first camera sensor.
[0220] In single-camera, multi-configuration application scenarios, the electronic device includes only one camera sensor, and camera configuration switching may not involve switching the camera sensor used. In this case, the first camera configuration information may include first configuration information. In multi-camera, multi-configuration application scenarios, the electronic device includes more than one camera sensor, and camera configuration switching may involve switching the camera sensor used. In this case, the first camera configuration information may include the identifier of the first camera sensor and first configuration information.
[0221] For example, if the scene identifier for the first camera's usage scenario is "configuration 0", then by searching files 501 and 502, the first camera configuration information, namely the camera configuration information identified as "wide_default_algo0", can be obtained. Referring to the specific configuration content of this camera configuration information shown in file 501, the sensor identifier for the first camera sensor is "0", and the first configuration information can be other configuration content in this camera configuration information.
[0222] In one embodiment of this application, the electronic device includes a HAL (Hybrid Access Array). The HAL is used to obtain first camera configuration information according to a first usage scenario. Then, step 804 above may include: the HAL transmitting the first camera configuration information to at least one of a first camera sensor, an image processor, and an image processing algorithm; wherein, the first camera sensor is used to switch configurations according to the configuration information of the first camera sensor; the image processor is used to switch configurations according to the configuration information of the image processor; and the image processing algorithm is used to switch configurations according to the configuration information of the image processing algorithm.
[0223] For example, see Figure 4 The control strategy can be located in the HAL, specifically in a layer above the Usecase layer (e.g., ...). Figure 5 (As shown) or located in the Usecase layer. The control policy can obtain the camera configuration information of the current use case and pass the camera configuration information to the Usecase layer, and then the Usecase layer passes the camera configuration information down layer by layer.
[0224] In one embodiment of this application, the step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file is performed by a service provided by the Usecase layer of the electronic device or the HAL layer of the electronic device. By obtaining the camera configuration information of the current usage scenario from the Usecase layer or the HAL layer, the lower layer can switch configurations as needed based on the camera configuration information.
[0225] In one embodiment of this application, step 804 includes: the Usecase layer of the electronic device obtaining a first Usecase required for the first use scenario, and instructing the first Usecase to update its configuration according to the configuration information of the first Usecase in the first camera configuration information. The Graph layer of the electronic device obtaining a first Graph required for the first use scenario, and instructing the first Graph to update its configuration according to the configuration information of the first Graph in the first camera configuration information. The Feature layer of the electronic device obtaining a first Feature required for the first use scenario, and instructing the first Feature to update its configuration according to the configuration information of the first Feature in the first camera configuration information.
[0226] For example, when the camera application of an electronic device is in recording mode, the first usecase can be the camera usecase, the first graph can be the recording graph under the camera usecase, and the first feature can include the real-time feature and the recording feature under the recording graph.
[0227] It is feasible to pass the first camera configuration information down layer by layer in the electronic device, or to cache the first camera configuration information in memory so that each software layer can read the configuration information from memory and switch configurations.
[0228] In one embodiment of this application, the first camera configuration information is cached in memory; the camera configuration switching method may further include: a first Usecase retrieving its configuration information from memory and updating its configuration; a first Graph retrieving its configuration information from memory and updating its configuration; and a first Feature retrieving its configuration information from memory and updating its configuration.
[0229] By caching the camera configuration information of the current use case in memory, each layer that needs to switch configurations, such as the Usecase layer, Graph layer, and Feature layer, can read the cached camera configuration information from memory to switch configurations, without having to pass the camera configuration information layer by layer.
[0230] In one embodiment of this application, the HAL of the electronic device includes a Usecase layer, a Graph layer, and a Feature layer; wherein, the Feature layer includes a first Feature, and the first configuration information includes the configuration information of the first Feature; then the above step 804 may include: the Usecase layer passing the first camera configuration information to the Graph layer; the Graph layer passing the first camera configuration information to the Feature layer; the Feature layer switching the configuration of the first Feature according to the configuration information of the first Feature in the first camera configuration information, and passing the first camera configuration information to the first camera sensor.
[0231] In one feasible implementation, see [link to relevant documentation]. Figure 5 The control strategy can pass the first camera configuration information to Module 1 in the Usecase layer. Module 1 can then pass the first camera configuration information to Module 2 in the Graph layer. Module 2 can then pass the first camera configuration information to Module 3 in the Feature layer. Module 3 can determine if the configuration of the first Feature needs to be switched, and can then instruct the first Feature to switch its configuration according to the configuration information of the first Feature in the first camera configuration information. In addition, Module 3 can continue to pass the first camera configuration information down to the next layer, until it reaches the first camera sensor.
[0232] Feasibly, the configuration information of the first camera may include the configuration information of the first camera sensor, and the first camera sensor switches its configuration according to the configuration information of the first camera sensor.
[0233] For example, see Figure 5 Taking the camera application of an electronic device in shooting mode as an example, the first feature can be the real-time feature, shooting feature, etc. belonging to the shooting graph, while the shooting graph belongs to the camera use case.
[0234] This application embodiment also provides a camera configuration switching device applied to an electronic device. The electronic device includes a first file recording camera configuration information corresponding to different usage scenarios of the camera in the electronic device. The device includes: a receiving module for receiving a camera usage request for the electronic device; a determining module for determining a first usage scenario based on the camera usage request; an obtaining module for obtaining the first camera configuration information corresponding to the first usage scenario from the first file; and a processing module for switching the camera configuration of the electronic device based on the first camera configuration information.
[0235] This application also provides a chip, which is installed in an electronic device. The chip includes a processor for executing computer program instructions stored in a memory, wherein when the computer program instructions are executed by the processor, the chip is triggered to execute the method steps provided in any method embodiment of this application.
[0236] This application also proposes a terminal device, which includes a communication module, a memory for storing computer program instructions, and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the terminal device is triggered to execute the method steps provided in any method embodiment of this application.
[0237] This application also proposes a server device, which includes a communication module, a memory for storing computer program instructions, and a processor for executing the program instructions. When the computer program instructions are executed by the processor, the server device is triggered to execute the method steps provided in any method embodiment of this application.
[0238] This application also provides an electronic device, which includes multiple antennas, a memory for storing computer program instructions, a processor for executing the computer program instructions, and a communication device (such as a communication module that can implement 5G communication based on the NR protocol). When the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps provided in any method embodiment of this application.
[0239] Specifically, in the embodiments of this application, one or more computer programs are stored in the aforementioned memory, and the one or more computer programs include instructions that, when executed by the aforementioned device, cause the aforementioned device to perform the method steps described in the embodiments of this application.
[0240] Furthermore, the devices, apparatuses, and modules described in the embodiments of this application may be implemented by computer chips or physical entities, or by products with certain functions.
[0241] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0242] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.
[0243] Specifically, this application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to execute the method steps provided in this application.
[0244] This application also provides a computer program product, which includes a computer program that, when run on a computer, causes the computer to perform the method steps provided in this application.
[0245] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, apparatuses, or units, and may be electrical, mechanical, or other forms.
[0246] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0247] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.
[0248] An integrated unit implemented as a software functional unit can be stored in a computer-readable storage medium. This software functional unit, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory, random access memory, magnetic disk, or optical disk.
[0249] In this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0250] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0251] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments of this application can be implemented using electronic hardware, computer software, or a combination of electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0252] Those skilled in the art will readily understand that, for the sake of convenience and brevity, the same or similar parts between the various embodiments of this application can be referred to mutually. For example, the specific working processes of the systems, devices, and units described in the embodiments of this application can be referred to the corresponding processes in the method embodiments of this application, and will not be repeated here.
[0253] The above description is merely a specific embodiment of this application and is not intended to limit this application. The scope of protection of this application shall be determined by the claims.
Claims
1. A camera configuration switching method, characterized in that, The method is applied to an electronic device, wherein the electronic device includes a first file, a second sub-file of the first file recording the correspondence between each usage scenario of the camera in the electronic device and the corresponding camera configuration information, and the first sub-file of the first file recording the camera configuration information corresponding to different usage scenarios of the camera in the electronic device; the method includes: Receive requests to use the camera on electronic devices; Based on the camera usage request, the current first usage scenario of the camera in the electronic device is determined in real time during the user's use of the camera; Obtain the first camera configuration information corresponding to the first usage scenario from the first file; Based on the first camera configuration information, switch the camera configuration of the electronic device; The first sub-file records the configuration information of the first camera and the first identifier of the configuration information of the first camera; The second sub-file records the correspondence between the first identifier of the first camera configuration information and the second identifier of the first usage scenario; The step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file includes: Obtain the first identifier corresponding to the second identifier from the second sub-file; Obtain the first camera configuration information corresponding to the first identifier from the first sub-file.
2. The method according to claim 1, characterized in that, The usage scenarios are categorized based on the camera usage mode, combined with information about the environment in which the electronic device is located and / or the usage characteristics of the camera.
3. The method according to claim 1, characterized in that, The camera configuration information corresponding to the usage scenario is related to the internal hardware and software structure of the electronic device.
4. The method according to claim 1, characterized in that, The camera configuration information for each usage scenario includes: the configuration information of the camera sensor to be used in the usage scenario, the configuration information of the image processor to be used in the usage scenario, and / or the configuration information of the image processing algorithm to be used in the usage scenario.
5. The method according to any one of claims 1-4, characterized in that, The step of switching the camera configuration of the electronic device according to the first camera configuration information includes: The Usecase layer of the electronic device obtains the first Usecase required for the first use scenario and instructs the first Usecase to update its configuration according to the configuration information of the first Usecase in the first camera configuration information; And / or, The Graph layer of the electronic device obtains the first Graph required for the first use scenario and instructs the first Graph to update its configuration according to the configuration information of the first Graph in the first camera configuration information; And / or, The Feature layer of the electronic device obtains the first Feature required for the first usage scenario and instructs the first Feature to update its configuration according to the configuration information of the first Feature in the first camera configuration information.
6. The method according to claim 5, characterized in that, The first camera configuration information is cached in memory; the method further includes: The first Usecase retrieves its configuration information from the memory and updates its configuration; and / or, The first Graph retrieves its configuration information from the memory and updates its configuration; and / or, The first Feature retrieves its configuration information from the memory and updates its configuration.
7. The method according to claim 5, characterized in that, The step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file is performed by a service provided by the Usecase layer of the electronic device or the HAL layer in the electronic device.
8. The method according to any one of claims 1-4, characterized in that, The method further includes: Receive update requests for the electronic device; According to the update request, update information for the electronic device is obtained, the update information including information for updating the first file; Update the first file according to the update information.
9. A camera configuration switching device, characterized in that, An application to an electronic device, the electronic device including a first file, a second sub-file including the first file recording the correspondence between each usage scenario of the camera in the electronic device and the corresponding camera configuration information, and the first sub-file including the first file recording the camera configuration information corresponding to different usage scenarios of the camera in the electronic device; the device includes: The receiving module is used to receive requests for camera use from electronic devices; The determination module is used to determine the current first usage scenario of the camera in the electronic device in real time during the user's use of the camera, based on the camera usage request. The acquisition module is used to acquire the first camera configuration information corresponding to the first usage scenario from the first file; The processing module is used to switch the camera configuration of the electronic device according to the first camera configuration information; The first sub-file records the configuration information of the first camera and the first identifier of the configuration information of the first camera; The second sub-file records the correspondence between the first identifier of the first camera configuration information and the second identifier of the first usage scenario; The step of obtaining the first camera configuration information corresponding to the first usage scenario from the first file includes: Obtain the first identifier corresponding to the second identifier from the second sub-file; Obtain the first camera configuration information corresponding to the first identifier from the first sub-file.
10. A chip, characterized in that, include: A processor for executing computer program instructions stored in memory, wherein when the computer program instructions are executed by the processor, the chip is triggered to perform the method of any one of claims 1-8.
11. An electronic device, characterized in that, The electronic device includes one or more memories for storing computer program instructions and one or more processors, wherein when the computer program instructions are executed by the one or more processors, the electronic device is triggered to perform the method as described in any one of claims 1-8.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-8.
13. A computer program product, characterized in that, The computer program product includes a computer program that, when run on a computer, causes the computer to perform the method as described in any one of claims 1-8.
Citation Information
Patent Citations
Method of configuring camera
CN114374778A
Scene packet processing method, co-processing chip, main processing chip and electronic equipment
CN114827431A