Video recording method, electronic device, and storage medium
By combining image processing with hardware abstraction layer and application framework layer in electronic devices, high-quality video recording from native cameras is achieved, solving the problem of poor recording quality, saving system resources and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-08-02
- Publication Date
- 2026-06-23
AI Technical Summary
The video quality and effects recorded by the native cameras of existing electronic devices are poor and cannot meet user needs. Furthermore, additional editing is required using third-party tools, which makes the operation cumbersome and consumes system resources.
During recording, the hardware abstraction layer performs basic image quality optimization and adds lightweight algorithm effects in combination with the application framework layer to achieve high-quality video recording, avoid frequent destruction and reconstruction of algorithm links, and save system resources.
It improves recording quality and user experience, reduces system resource consumption, simplifies operation processes, and improves image processing efficiency.
Smart Images

Figure CN120769007B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of terminal, and in particular, to a video recording method, an electronic device and a storage medium. BACKGROUND
[0002] With the rapid progress of science and technology, various electronic devices (such as mobile phones, tablet computers, etc.) have brought a lot of convenience to people's life. For example, electronic devices can be used to record videos to help people record various scenes in life.
[0003] Nowadays, if the video recording only provides a recording function, it cannot meet the needs of some users. Users want to use electronic devices to directly record higher quality videos. Therefore, how to improve the video recording quality is a problem to be solved. SUMMARY
[0004] Embodiments of the present application provide a video recording method, an electronic device and a storage medium, which can improve the video recording quality and thus improve the user experience.
[0005] To achieve the above-mentioned purpose, embodiments of the present application adopt the following technical solutions:
[0006] In a first aspect, the present application provides a video recording method applied to an electronic device, wherein the electronic device comprises a hardware abstraction layer and an application framework layer; the hardware abstraction layer is used for image basic quality optimization; at least one lightweight algorithm is set in the application framework layer; the lightweight algorithm is a lightweight algorithm for adding additional effects to an image.
[0007] In the method, after starting video recording, the original camera application of the electronic device continuously issues a video recording request, each video recording request is used to collect an image and is also used to indicate an image processing algorithm to be used for the image, wherein the image processing algorithm indicated by a first video recording request comprises a basic quality optimization algorithm but does not comprise a first lightweight algorithm. The hardware abstraction layer can process a first image collected by the first video recording request based on the indicated image processing algorithm to obtain an image corresponding to the first video recording request for video encoding. The process of processing the first image based on the indicated image processing algorithm comprises but is not limited to performing basic quality optimization on the first image by using a first algorithm link.
[0008] Subsequently, the hardware abstraction layer continues to receive a second video recording request issued in the video recording process; wherein the image processing algorithm indicated by the second video recording request comprises the first lightweight algorithm. The hardware abstraction layer can reuse the first algorithm link to perform basic quality optimization on a second image collected for the second video recording request to obtain a third image. Then, the application framework layer calls the first lightweight algorithm to process the third image to obtain an image corresponding to the second video recording request for video encoding.
[0009] It should be understood that each image processing algorithm indicated by the video recording request is used to obtain an image corresponding to the video recording request for video encoding. Further, the application framework layer can encode multiple images obtained during the video recording for video encoding to obtain a video recording video.
[0010] In the above scheme, in the video recording scenario, the HAL layer can be used to perform basic image quality optimization on the collected original image, and the Framework layer can be used to further add image effects, so as to achieve the purpose of recording a higher quality video using a native camera and improve user experience. Moreover, no third-party tool needs to be installed, and system resources can be saved and efficiency can be improved.
[0011] Moreover, after starting the video recording, even if the second video recording request and the first video recording request do not indicate the same lightweight algorithm (that is, the lightweight algorithm indicated by the video recording request changes), the algorithm link of the HAL layer (that is, the hardware abstraction layer) cannot be reused, the change of the lightweight algorithm avoids the need for the HAL layer to frequently destroy and rebuild the algorithm link, thereby reducing the frequency of destroying and rebuilding the algorithm link of the HAL layer, reducing the loss of system resources caused by destroying and rebuilding the algorithm link to some extent, and improving the image processing efficiency.
[0012] In addition, the lightweight algorithm can be decoupled from the HAL layer and set in the Framework layer, so as to decouple the upper-layer algorithm from the bottom layer and reduce the coupling degree of the system.
[0013] In a possible implementation manner of the first aspect, the hardware abstraction layer receives the first video recording request and acquires the first image collected for the first video recording request; the hardware abstraction layer creates the first algorithm link and performs basic image quality optimization on the first image based on the first algorithm link to obtain a fourth image; the hardware abstraction layer reports the fourth image to the application framework layer; and the application framework layer determines the image corresponding to the first video recording request for video encoding based on the fourth image.
[0014] In the above scheme, when the first video recording request is received, the HAL layer can be used to perform basic image quality optimization on the collected original image, and the Framework layer can be used to further add image effects, so as to achieve the purpose of recording a higher quality video using a native camera and improve user experience. Moreover, no third-party tool needs to be installed, and system resources can be saved and efficiency can be improved.
[0015] In one possible implementation of the first aspect, the electronic device further includes an application layer; the application layer includes a camera application; the application framework layer includes a camera service; the first recording request carries first control information, the first control information instructing the camera to capture the first image using shooting parameters; the camera application receives the first recording request and sends the first recording request to the hardware abstraction layer through the camera service in the application framework layer; after receiving the first recording request sent by the camera service, the hardware abstraction layer instructs the camera to capture the first image according to the first control information and obtains the first image returned by the camera.
[0016] In the above scheme, each recording request carries control information, which can accurately and adaptively instruct the camera to capture images. This can improve the accuracy of image capture to a certain extent, thereby improving image quality and ultimately improving the quality of video recording.
[0017] In one possible implementation of the first aspect, the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, specifically: the image processing algorithm indicated by the first recording request does not include any lightweight algorithm.
[0018] The above scheme, where the first recording request does not indicate the lightweight algorithm but the second recording request indicates the first lightweight algorithm, is applicable to scenarios where the lightweight algorithm is enabled or disabled. In this scenario, the algorithm link can be reused, saving system resources and improving the image acquisition quality.
[0019] In one possible implementation of the first aspect, the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, specifically: the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, but includes the second lightweight algorithm; the first image processing further includes: calling the second lightweight algorithm to process the first image.
[0020] The above scheme, where the first recording request and the second recording request indicate different lightweight algorithms, is suitable for switching scenarios of lightweight algorithms. In this scenario, the algorithm link can be reused, saving system resources and improving the image acquisition quality.
[0021] In one possible implementation of the first aspect, the first recording request carries a closing tag for the first lightweight algorithm, and the second recording request carries an opening tag for the first lightweight algorithm; or, the first recording request does not carry the algorithm identifier of the first lightweight algorithm, and the second recording request carries the algorithm identifier of the first lightweight algorithm.
[0022] In the above scheme, by carrying an on / off tag for the lightweight algorithm or an algorithm identifier in the recording request, it is possible to accurately indicate whether the lightweight algorithm is used, thereby improving the accuracy of subsequent image processing.
[0023] In one possible implementation of the first aspect, the first lightweight algorithm is a filter algorithm.
[0024] The above solution enables the enabling, disabling, or switching of filter algorithms during recording without destroying and rebuilding the HAL layer algorithm chain. This allows for the reuse of the algorithm chain, enriching the recording capabilities of the native camera and saving system resources while improving recording efficiency, enabling the recording of high-quality videos with filter effects using the native camera.
[0025] In one possible implementation of the first aspect, the first algorithm chain includes a denoising algorithm and / or an image enhancement algorithm; the first image is subjected to denoising processing and / or image enhancement processing according to the denoising algorithm and / or image enhancement algorithm.
[0026] The above solution can perform noise reduction and image enhancement processing in recording scenarios, thereby improving the quality of video recording.
[0027] In one possible implementation of the first aspect, the at least one lightweight algorithm includes at least one of a filter algorithm, a texture algorithm, a watermarking algorithm, or a stylization algorithm.
[0028] The above solution applies various lightweight algorithms that can add effects to images to the video recording process, enabling users to record professional and diverse videos using only the original camera, thus improving the user experience. Users no longer need to install dedicated editing software for each lightweight algorithm on their electronic devices, reducing the consumption of storage resources.
[0029] Secondly, this application provides an electronic device comprising at least: a camera, a display screen, a memory, and one or more processors. The camera is used to capture images; the display screen is used to display images. The memory is used to store computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method described in any of the first aspects above.
[0030] Thirdly, this application provides a chip system applied to an electronic device, the chip system including one or more processors, the processors being configured to invoke computer instructions to cause the electronic device to perform any of the methods described in the first aspect above.
[0031] Fourthly, this application provides a computer storage medium including computer instructions that, when executed on an electronic device, cause the electronic device to perform the method described in any of the first aspects above.
[0032] Fifthly, this application provides a computer program product that, when run on a computer, causes the computer to perform any of the methods described in the first aspect. Attached Figure Description
[0033] Figure 1A A hardware structure block diagram of an electronic device provided in an embodiment of this application;
[0034] Figure 1A A software structure block diagram of an electronic device provided in an embodiment of this application;
[0035] Figure 2 A schematic diagram of the video recording preview interface of a mobile phone provided in an embodiment of this application;
[0036] Figure 3 A schematic diagram of the recording interface of a mobile phone provided in an embodiment of this application;
[0037] Figure 4 A schematic diagram of the processing steps when the filter algorithm is enabled in Scheme 1 provided in the embodiments of this application;
[0038] Figure 5 A schematic diagram of the processing steps in Scheme 1 provided in this application embodiment, indicating the use of a lightweight filter algorithm;
[0039] Figure 6 A schematic diagram illustrating the algorithm link destruction and reconstruction in Scheme 1 provided in this application embodiment;
[0040] Figure 7 This is a timing diagram of the processing of the filter algorithm in Scheme 1 provided in the embodiments of this application when it is switched from enabled to disabled;
[0041] Figure 8 This is a schematic diagram of the video recording process under Scheme 2 provided in the embodiments of this application;
[0042] Figure 9 A schematic diagram illustrating the processing steps in Scheme 2 provided in this application embodiment, indicating the use of a lightweight filter algorithm;
[0043] Figure 10 A schematic diagram illustrating the processing steps in Scheme 2 provided in this application embodiment, indicating the use of a lightweight filter algorithm;
[0044] Figure 11The timing diagram shows the processing of the filter algorithm in Scheme 2 provided in this application when it is switched from enabled to disabled. Detailed Implementation
[0045] The technical solutions of the embodiments of this application are described below with reference to the accompanying drawings. In the description of the embodiments of this application, the terminology used in the following embodiments is for the purpose of describing specific embodiments only and is not intended to limit the application. As used in the specification and appended claims of this application, the singular expressions "a," "the," "the," "the," and "this" are intended to also include expressions such as "one or more," unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of this application, "at least one" and "one or more" refer to one or more (including two). The term "and / or" is used to describe 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, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. In the description of the embodiments, unless otherwise stated, "multiple" means two or more.
[0046] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized. The term "connection" includes direct connections and indirect connections, unless otherwise stated. The terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature.
[0047] In the embodiments of this application, the words "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the words "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a specific manner.
[0048] In related technologies, in video recording scenarios, the native camera built into electronic devices can only perform simple, basic video recording. The recorded video footage is directly encoded from the captured raw images, resulting in poor quality and effects that fail to meet user needs. Generally, third-party tools (i.e., tools not included with the electronic device and requiring additional download and installation) are needed for advanced editing of the native camera's recordings to meet user requirements. For example, video editing software is required to add filter effects to the recorded videos, making the process cumbersome and inefficient. Furthermore, the need to install these third-party tools on the electronic device consumes system resources, such as storage.
[0049] To address the aforementioned issues, this application provides a video recording method applied to an electronic device, aiming to improve video recording quality in scenarios using a native camera. Specifically, during recording, the electronic device has the ability to perform basic image quality optimization and / or change image effects (or add additional effects) on the captured (raw) images, thus eliminating the need for additional third-party tools. Higher quality video can be recorded using the electronic device's built-in native camera, achieving the goal of improving video recording quality. It should be understood that compared to installing additional third-party tools, the solution of this application can improve video recording quality while saving system resources and increasing efficiency.
[0050] To facilitate understanding, before formally introducing the specific solutions of this application, the following will first introduce some concepts involved in the various embodiments of this application, as well as the hardware and software structure of the above-mentioned electronic devices:
[0051] (I) Introduction to Concepts:
[0052] Camera app: This refers to the native camera app that comes with the electronic device, rather than a third-party app that is installed.
[0053] Basic image quality optimization algorithms are algorithms used to optimize the basic image quality. The basic image quality is mainly affected by factors such as resolution, bit rate, and encoding method.
[0054] For example, basic image quality optimization algorithms may include at least one algorithm such as noise reduction, image enhancement, multi-frame synthesis (analyzing the features and texture information of multiple low-quality images to generate a high-quality synthetic image), or image sharpening. Basic image quality optimization algorithms rely on hardware such as ISPs and GPUs during execution; that is, they require the capabilities of hardware such as ISPs and GPUs, and the initialization / deinitialization process is relatively time-consuming.
[0055] Lightweight algorithms are algorithms that modify the visual effects of images, or in other words, lightweight algorithms that add additional effects (visual effects) to images. For the sake of brevity, they will be referred to as "lightweight algorithms" below.
[0056] It's important to note that lightweight algorithms do not alter the fundamental image quality; that is, they do not affect the original data quality of the image, such as its sharpness or resolution. For example, lightweight algorithms can include at least one of filter algorithms, texture algorithms, watermarking algorithms, or stylization algorithms. Taking filter algorithms as an example, filters are primarily used to impart specific visual effects to images. By adjusting filter parameters, one can change the image's color, contrast, and brightness, but these adjustments are made while maintaining the basic elements of the image unchanged, so they do not directly affect the image's fundamental quality.
[0057] It should be understood that, compared to basic image quality optimization algorithms, lightweight algorithms do not require the capabilities of ISP and GPU, and can be implemented using only the CPU. Furthermore, the initialization / deinitialization time of lightweight algorithms is relatively shorter, and the memory and CPU usage is lower. They are generally maintained by the upper layer and belong to the upper-layer algorithms.
[0058] For example, the basic image quality optimization algorithm does not require user selection; instead, it is determined by the electronic device itself based on the current shooting scene or environment to improve image quality. However, the "lightweight algorithm" in this application embodiment, since it adds additional effects to the image, is selectable by the user to achieve personalized shooting effects. For example, filter algorithms or texture algorithms can be selected by the user to achieve personalized filter or texture effects.
[0059] Algorithm chain: Also known as algorithm path, it is a link formed by sequentially connecting different algorithms used for image processing (or image quality improvement) as nodes. In the scheme of this application, during recording, the acquired images are processed sequentially according to each algorithm in the algorithm chain, thereby improving image quality.
[0060] It should be understood that the algorithms in an algorithm chain have an execution order, with the output of one algorithm serving as the input for the next. Furthermore, different algorithms in the chain may have different requirements for image formats. Therefore, image format conversion is involved when an image is processed by adjacent algorithms in the chain. For example, in an algorithm chain including Algorithm A -> Algorithm B -> Algorithm C, the acquired image will first be processed by Algorithm A. Then, the image processed by Algorithm A will be converted to the appropriate format before being input to Algorithm B. Finally, the image processed by Algorithm B will be converted to the appropriate format before being input to Algorithm C for further processing.
[0061] (II) Hardware Structure Introduction:
[0062] The aforementioned electronic devices can be mobile phones, tablets, desktop computers, laptops, handheld computers, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) / virtual reality (VR) devices, and other electronic devices that can provide native camera video recording. This application does not impose any special limitations on the specific form of the electronic devices. Figure 1A Using a mobile phone as an example, we can illustrate the hardware structure.
[0063] See Figure 1A The mobile phone may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor 180, buttons 190, a motor 191, an indicator 192, cameras 193 (1 to N), a display screen 194 (1 to N), and a subscriber identification module (SIM) card interface 195, etc.
[0064] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the mobile phone. In other embodiments of this application, the mobile phone 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.
[0065] Processor 110 may include one or more processing units, such as: application processor (AP), modem processor, graphics processing unit (GPU), image signal processor (ISP), controller, memory, video codec, digital signal processor (DSP), baseband processor, and / or neural network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0066] In some embodiments, the mobile phone can use the processor 110 to complete the recording method, enabling the recording of higher quality videos that better meet the user's needs using the native camera.
[0067] The wireless communication function of a mobile phone can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0068] The mobile phone implements its display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0069] The display screen 194 is used to display images, videos, etc. In some embodiments, the mobile phone can display a real-time preview interface of a recorded video, etc., through the display screen 194.
[0070] Mobile phones can achieve shooting functions through IP address, camera 193, video codec, GPU, display 194 and application processor.
[0071] The mobile phone can implement audio functions, such as music playback and recording, through the audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor. The sensor module 180 can include pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, proximity sensors, proximity light sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, and bone conduction sensors. It should be understood that the image sensor integrated in the camera 193 is not included in the sensor module 180; the image sensor is a core component of the camera 193.
[0072] Button 190 may include a power button, volume buttons, etc. Button 190 may be a mechanical button or a touch button. The mobile phone can receive button input and generate key signal inputs related to the phone's user settings and function control. Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. Indicator 192 may be an indicator light, used to indicate charging status, battery level changes, or messages, missed calls, notifications, etc. SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the mobile phone.
[0073] (III) Software Structure Introduction:
[0074] The software system of the aforementioned electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture software system as an example to exemplify the software structure of the electronic device. It should be noted that this application embodiment is not limited to the software structure of the electronic device.
[0075] Figure 1B This is a software structure block diagram of the electronic device provided in the embodiments of this application.
[0076] As we can understand, a layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. For example... Figure 1B As shown, a software system may include an application layer (APP layer), an application framework layer (Framework layer), and a hardware abstraction layer (HAL layer).
[0077] The application layer can include a series of application packages. For example... Figure 1B As shown, the application package can include applications such as camera apps and gallery apps.
[0078] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions.
[0079] In some embodiments of this application, the application framework layer may include a camera service (CameraService), a video encoding module (VideoEncode), etc. It should be understood that the application framework layer may also include other modules, and is not limited to these. Figure 1B The illustration is shown in the image.
[0080] The hardware abstraction layer is an interface layer located between the application framework layer and the kernel layer, providing a virtual hardware platform for the operating system.
[0081] In some embodiments of this application, the hardware abstraction layer may include a camera HAL (i.e., a camera hardware abstraction module). For example, as... Figure 1B As shown, the camera HAL may include an OEM HAL and an image processing module. The image processing module is used to process the raw images captured by the camera to improve image quality. The image processing module may include multiple sub-modules, such as a path management module, etc., without limitation.
[0082] Figure 1B The diagram also illustrates the hardware layer to facilitate understanding the interaction between the HAL layer and the hardware. The hardware layer may include a camera and the chip capabilities provided by the supporting chips. The camera may include the one used for image acquisition in this case. The supporting chips may include image signal processors (ISPs), graphics processing units (GPUs), etc. It should be noted that supporting chips may also include NPUs, CPUs, etc., not shown in the diagram, and this is not a limitation.
[0083] It should be understood that Figure 1B To more intuitively illustrate the interaction between the HAL layer and the hardware layer, the kernel layer is not shown in the diagram. However, this does not mean that the software system of an electronic device does not contain a kernel layer. It should be understood that, in reality, the HAL layer and the hardware layer need to interact through the kernel layer. The kernel layer is the layer between hardware and software. The kernel layer, also called the driver layer, contains a series of drivers that can drive the hardware to work after receiving instructions from the HAL layer. For example, a camera driver in the kernel layer can drive a camera to capture images. Another example is a display driver in the kernel layer, which can drive a display screen to display video. Yet another example is a processor driver in the kernel layer, which drives processor chips such as ISPs or GPUs to provide hardware support for software layer algorithms.
[0084] It should be noted that the software architecture is not limited toFigure 1B The above-mentioned hierarchical structure.
[0085] Next, the application scenarios of the recording method provided in the embodiments of this application will be described.
[0086] As described above, the recording method of this application is mainly applied to recording scenarios using a native camera. The following example uses a mobile phone to illustrate the relevant interface in the recording scenario covered by this application.
[0087] Once the phone's built-in camera app (native camera) is launched, it displays a video recording preview interface with a recording button. In response to the user's triggering of the recording button, the camera app starts recording and displays the recording interface (i.e., the video recording screen). After starting recording, the camera app continuously sends recording requests at a preset frame rate to instruct the camera to continuously capture images.
[0088] In some examples, before starting recording, a trigger entry for the lightweight algorithm can be displayed in the recording preview interface, allowing the user to select and activate the lightweight algorithm. Please refer to [link / reference]. Figure 2 , Figure 2 The screen displays the phone's video preview interface before recording begins, including multiple function options (e.g., Option 1, Option 2, Option 3, etc.) and a record button 202. Option 3, marked 201, is the trigger entry point for the lightweight algorithm. Before recording begins, the phone responds to the user's trigger operation at 201 by displaying filter options (i.e., Filter 1, Filter 2, etc.) marked 203 for the user to choose from. For example, the user can select "Filter 2" (i.e., select filter algorithm 2). Further, the user can trigger the record button 202 to start recording. During the subsequent recording process, the filter algorithm will be used. Therefore, the recording request will carry control information indicating the use of the filter algorithm, thus recording a video with a filter effect.
[0089] In some examples, after recording begins, the trigger entry or options for the lightweight algorithm can also be displayed in the recording interface, allowing users to select, disable, or toggle the lightweight algorithm. Please refer to [link / reference]. Figure 3 , Figure 3 (a) shows the recording interface after video recording is started (it should be understood that the real-time view displayed in the viewfinder during video recording is not shown). The recording interface includes option 4 (marked with 204), which is the trigger entry point for the lightweight algorithm. Taking the example of starting video recording without filters enabled, after starting recording, the phone can respond to the user's trigger operation at 204 and display the filter options marked 205, allowing the user to select the desired filter, such as... Figure 3As shown in (b), filter 3 (i.e., filter algorithm 3) can be selected. This allows for flexible selection and addition of filters during video recording, which can then be used in subsequent recording sessions. It should be noted that the camera application also supports switching or deleting filters during the filtering process (i.e., switching or deselecting filter algorithms), as well as switching / selecting other lightweight algorithms (such as texture algorithms and watermarking algorithms).
[0090] The recording method in the embodiments of this application will be described in detail below with reference to the above-described hardware and software structure of the electronic device and the accompanying drawings.
[0091] It should be noted that the electronic equipment mainly uses either Solution 1 or Solution 2 to improve video recording quality:
[0092] Option 1: The HAL layer performs image processing uniformly.
[0093] In Scheme 1, the algorithm for improving image quality (i.e., the related processing logic of the algorithm) is uniformly embedded in the HAL layer (hardware abstraction layer) of the electronic device.
[0094] After starting recording with the native camera, if the image processing algorithm indicated by the recording request changes during the recording process, the HAL layer will destroy the previously created algorithm link and recreate an appropriate algorithm link for the recording request using at least one of the embedded algorithms. In this way, the image quality will be optimized through the algorithm in the algorithm link, thereby improving the recording quality.
[0095] Among them, algorithms for improving image quality include two categories: basic image quality optimization algorithms and lightweight algorithms that change image effects.
[0096] The beneficial effects that can be achieved by Scheme 1 above are as follows:
[0097] Effect 1: In scenarios where recording is done using the native camera, Solution 1 enables basic image quality optimization and advanced image effects addition to the captured raw images based on the HAL layer. This allows for higher-quality video recording using the electronic device's built-in camera, improving the user experience. Furthermore, it eliminates the need for third-party tools, saving system resources and increasing efficiency.
[0098] Effect 2: During recording, each recording request is designed to closely reflect the actual situation or needs at the time of request. The HAL layer can adaptively create algorithmic links that match each recording request. Compared to the default algorithm, Solution 1 performs more accurate image processing for each recording request, resulting in images that better meet user requirements.
[0099] Option 2: The HAL layer and the Framework layer each perform part of the image processing.
[0100] In Scheme 2, the basic image quality optimization algorithm and the lightweight algorithm that changes the image effect are set separately or decoupled. That is, the basic image quality optimization algorithm is set in the HAL layer of the electronic device, while the lightweight algorithm is set in the Framework layer (application framework layer) of the electronic device.
[0101] After starting recording using the native camera, the HAL layer creates an algorithm chain based on a basic image quality optimization algorithm to handle the continuous recording requests. This algorithm chain only performs basic image quality optimization processing and reports the optimized image to the Framework layer. In other words, the HAL layer focuses solely on basic image quality optimization and no longer considers whether lightweight algorithms are involved, making its processing more efficient. If the recording request indicates the use of a lightweight algorithm, the Framework layer calls the corresponding lightweight algorithm for advanced image effect processing and performs video encoding on the processed image. If the image processing algorithm indicated by the recording request does not include a lightweight algorithm, the Framework layer can directly perform video encoding on the image reported by the HAL layer.
[0102] The beneficial effects that can be achieved by Scheme 2 above are as follows:
[0103] Effect 1: In scenarios where recording is done using the native camera, Solution 2 enables basic image quality optimization of the captured raw images based on the HAL layer, and further image effects are added in conjunction with the Framework layer. This achieves the goal of recording higher-quality video using the native camera, improving the user experience. Moreover, it eliminates the need for third-party tools, saving system resources and increasing efficiency.
[0104] Effect 2: Through the collaboration of the HAL layer and the Framework layer, regardless of whether the recording request indicates a lightweight algorithm, it can be processed specifically, achieving the same effect B as Solution 1. That is, it can also perform more accurate image processing for each recording request during the process of recording video using the native camera, so that the final image can better meet the user's needs.
[0105] Effect 3: In Scheme 2, the HAL layer is only responsible for creating algorithm links for basic image quality optimization. Lightweight algorithms that are prone to change during recording and have low dependence on the underlying hardware are placed in the Framework layer. This avoids the need for the HAL layer to frequently destroy and rebuild algorithm links due to changes in lightweight algorithms, thereby reducing the frequency of HAL layer destroying and rebuilding algorithm links. This reduces the loss of system resources caused by destroying and rebuilding algorithm links to a certain extent, and improves image processing efficiency.
[0106] Effect 4: By decoupling the lightweight algorithm from the HAL layer and setting it in the Framework layer, the upper-layer algorithm is decoupled from the lower layer, reducing the coupling of the system.
[0107] The following sections will describe Scheme 1 and Scheme 2 in turn, with reference to the accompanying drawings.
[0108] I. A detailed description of Option 1 is as follows:
[0109] In Solution 1, the processing flow or logic of the basic image quality optimization algorithm and the aforementioned lightweight algorithms that alter image effects are embedded in the underlying layer—the HAL layer. Specifically, this includes the following steps:
[0110] (1) Send a recording request to the HAL layer.
[0111] Specifically, as mentioned above Figure 2 As shown, after the built-in camera app on the phone is launched, a video recording preview interface will be displayed on the phone. This preview interface includes a recording button. When the user triggers the recording button, the camera app responds by continuously sending recording requests at a preset frame rate. These recording requests are then passed through the application framework layer to the HAL layer. It should be understood that each recording request indicates the acquisition of one frame. Multiple frames acquired based on these requests are used to form the recorded video. For example, sending recording requests at a frame rate of 32 pfs means that 32 recording requests will be continuously sent within 1 second to indicate the acquisition of 32 images within 1 second.
[0112] (2) The HAL layer creates the algorithm link and instructs the camera to capture images.
[0113] Specifically, after receiving a recording request, the HAL layer determines the algorithm required to process the request from the algorithms embedded in the HAL layer. This algorithm can be referred to as the target algorithm, and there can be one or more target algorithms. The HAL layer can then create a suitable algorithm chain based on the target algorithms embedded in the HAL layer (or the algorithms set in the HAL layer).
[0114] It should be noted that in Scheme 1, although the processing logic of both the basic image quality optimization algorithm and the lightweight algorithm for changing image effects is embedded in the HAL layer, it is not required that each created algorithm chain must include all algorithms embedded in the HAL layer. Because different recording requests may have different image requirements, each time an algorithm chain is created, only the algorithms relevant to the current recording request need to be used. That is, the algorithm chains created for different recording requests may also differ.
[0115] In some examples, such as in Scheme 1, the algorithm chain created may only include basic image quality optimization algorithms. In other examples, the algorithm chain may include lightweight algorithms that modify image effects in addition to basic image quality optimization algorithms.
[0116] It should be understood that if different recording requests require different algorithms, then the algorithms in the algorithm chain, the connections between algorithms, and the format conversions performed on the images will all change, resulting in the destruction and reconstruction of the algorithm chain. That is, when processing a new recording request, if the algorithm required by the new recording request is different from the algorithm used by the previous recording request, then the algorithm chain created for the previous recording request needs to be destroyed, and a new algorithm chain matching the new recording request needs to be recreated.
[0117] In some embodiments, different recording requests require different algorithms, which may include at least one of the following three scenarios: algorithm on / off, addition, and switching. For ease of understanding, the destruction and reconstruction of the algorithm link in the above three scenarios are explained below.
[0118] Case 1 (Algorithm on / off):
[0119] It should be noted that Case 1 can be divided into sub-case 1.1 and sub-case 1.2.
[0120] Sub-case 1.1: The algorithm is changed from off to on. For example, the image processing algorithm indicated in the first recording request 1 does not include the filter algorithm, while the second recording request 2 indicates that the filter is used (i.e., the image processing algorithm used includes the filter algorithm).
[0121] To better understand sub-case 1.1, an example is given below. Suppose that if the image processing algorithm indicated in recording request 1 does not include a filter algorithm (i.e., the filter algorithm is off or not enabled), then algorithm link 1 created for recording request 1 can only include the basic image quality optimization algorithm. If recording request 2 is subsequently received, and recording request 2 indicates the use of a filter (i.e., the filter algorithm is on), then algorithm link 1 is no longer suitable for processing recording request 2. Therefore, the HAL layer needs to destroy algorithm link 1 and recreate algorithm link 2 that matches recording request 2. Algorithm link 2 can then include the basic image quality optimization algorithm plus the filter algorithm.
[0122] Sub-case 1.2: Algorithm switched from on to off. For example, the first recording request 1 indicates the use of a filter, but the image processing algorithm indicated in the second recording request 2 does not include the filter algorithm.
[0123] It should be understood that this case does not limit whether the algorithm is switched on or off. As long as the switch of the algorithm is changed, the algorithm link will be destroyed and rebuilt in Scheme 1.
[0124] Case 2 (Addition to the algorithm):
[0125] Suppose that recording request 1 indicates the use of a filter. Then, algorithm link 1 created for recording request 1 could include a basic image quality optimization algorithm plus a filter algorithm. If a subsequent recording request 2 is received, and recording request 2 indicates the use of both filters and textures (i.e., a texture mapping algorithm is added), then algorithm link 1 is no longer suitable for processing recording request 2. Therefore, the HAL layer needs to destroy algorithm link 1 and recreate algorithm link 2, which could include a basic image quality optimization algorithm, a filter algorithm, and a texture mapping algorithm.
[0126] Case 3 (Algorithm Switching):
[0127] Suppose that recording request 1 indicates the use of a filter. Then, algorithm link 1 created for recording request 1 could include a basic image quality optimization algorithm plus a filter algorithm. If a subsequent recording request 2 is received, and the image processing algorithm indicated in recording request 2 does not include a filter algorithm but instead uses texture mapping (i.e., switching from a filter to texture mapping), then algorithm link 1 is no longer suitable for processing recording request 2. Therefore, the HAL layer needs to destroy algorithm link 1 and recreate algorithm link 2, which could include a basic image quality optimization algorithm plus a texture mapping algorithm.
[0128] In some embodiments, the HAL layer can create an algorithm chain corresponding to a recording request based on the control information carried in the recording request. Specifically, each recording request contains control information for this recording (i.e., the control information required to capture images for this recording request). This control information is used to control the parameters of this recording, such as the image processing algorithm to be used when this recording request is made. Therefore, for each request, the HAL layer can create a suitable algorithm chain based on the control information in that request.
[0129] Furthermore, besides controlling the algorithm used during this recording request, the control information also instructs the camera on the shooting parameters for acquiring the first image. Therefore, in addition to creating the algorithm chain, the HAL layer, upon receiving a recording request, can instruct the camera to acquire images according to the control information in the recording request. More specifically, the Hardware Abstraction Layer can determine the specific shooting parameters, i.e., the output frame information, based on the control information. It should be understood that the output frame information refers to the shooting parameters used by the camera when acquiring an image (i.e., a frame). For example, the output frame information may include parameters such as ISO (sensitivity), focal length, exposure time, and EV (Exposure Value). The HAL layer can control the camera to acquire images based on the output frame information. After acquiring images based on the output frame information, the camera can return the acquired images to the HAL layer.
[0130] (3) The HAL layer processes the images captured by the camera according to the algorithm in the algorithm link.
[0131] Specifically, after receiving the image returned by the camera, the HAL layer processes the image sequentially according to the order of the algorithms in the algorithm chain. For example, in the algorithm chain: denoising algorithm -> filter algorithm, the denoising algorithm is executed on the image first, and then the filter algorithm is executed on the denoised image.
[0132] For example, in an algorithm chain that includes both a basic image quality optimization algorithm and a lightweight algorithm, the basic image quality optimization algorithm is placed before the lightweight algorithm that changes the image effect. That is, the image can be optimized in terms of basic image quality first, and then the lightweight algorithm can be used to add the corresponding effect to the image after the basic image quality optimization.
[0133] In some embodiments, the recording request also includes memory information, which indicates memory used to store image data. Specifically, after the camera captures an image, it can cache the image based on the memory indicated by the memory information. The camera can return the cache address (i.e., the image buffer) to the HAL layer, which can then retrieve and process the captured image based on this cache address.
[0134] (4) The HAL layer uploads the processed image to the Framework layer.
[0135] (5) The Framework layer performs video encoding based on the images reported by the HAL layer to obtain the recorded video.
[0136] It should be understood that in Scheme 1, since the algorithms used to improve image quality are all embedded in the HAL layer and image processing is concentrated in the HAL layer, the Framework layer does not need to perform any further image quality improvement processing after receiving the image reported by the HAL layer. It can directly perform video encoding based on the image reported by the HAL layer.
[0137] Furthermore, the Framework layer can return recorded video to the gallery in the application layer. It should be understood that since the Framework layer has already performed video encoding, the application layer does not need to do any further processing; it only needs to save the recorded video in the gallery. This avoids occupying the application layer with video encoding, relieving some of the pressure on the application layer and allowing for better allocation and utilization of system resources.
[0138] To better understand Scheme 1 above, the following explanation, in conjunction with the structure of the software system, further clarifies Scheme 1. In this example, taking the lightweight filter algorithm as an example, the HAL layer integrates basic image quality optimization algorithms such as denoising and image enhancement algorithms, as well as the lightweight filter algorithm.
[0139] Please see Figure 4 This illustrates the processing when the filter algorithm is turned on (i.e., the filter algorithm is enabled), specifically including the following steps:
[0140] 1. The camera application sends a recording request to the camera service, and the recording request carries control information indicating the use of filters.
[0141] like Figure 4 As shown, the application layer (APP layer) includes the camera application, and the application framework layer (Framework layer) includes the camera service (CameraService). After the user triggers the recording, the camera application can send a recording request to the camera service in the application framework layer (Framework layer).
[0142] It should be understood that the control information carried in the recording request is not only used to instruct the use of filters, but also to determine other image processing algorithms (e.g., to determine the basic image quality optimization algorithm and / or other lightweight algorithms) and to instruct the shooting parameters of the camera to capture images (e.g., frame information).
[0143] 2. The camera service continues to send the recording request to OEM HAL.
[0144] Please continue reading. Figure 4 The hardware abstraction layer contains a camera hardware abstraction module, also known as the camera HAL. The camera HAL can include the OEM (Original Equipment Manufacturer) HAL and an image processing module. The OEM HAL is provided by the chip manufacturer and is used to shield the differences between different camera hardware. That is, different camera hardware must support the external interfaces provided by the OEM HAL so that the upper Interface layer can make unified calls.
[0145] OEMHAL is responsible for implementing specific hardware operations, such as turning on the camera, setting parameters, and capturing images. Therefore, the camera service can send recording requests to OEMHAL.
[0146] 3. The OEM HAL can send recording requests to the image processing module to determine the algorithm link.
[0147] It should be understood that the OEM HAL can pass recording requests to the image processing module, enabling the image processing module to determine the algorithm path based on the recording request. It should be understood that the decision algorithm path refers to the algorithm used to create the algorithm path based on the analysis of the recording request.
[0148] For details, please continue reading Figure 4 The image processing module includes a path management module. The OEM HAL can pass recording requests to this path management module, enabling the path management module to make decision-making algorithms linked.
[0149] 4. The path management module in the image processing module creates the algorithm link.
[0150] It should be understood that after receiving a recording request from the OEM HAL, the path management module can make decisions and create algorithmic links based on the control information in the recording request. For example... Figure 4 As shown, the pathway management module can create algorithm chains, which include denoising algorithms, image enhancement algorithms, and filter algorithms.
[0151] 5. The OEM HAL can send the output frame information indicated by the recording request to the camera.
[0152] Specifically, after receiving a recording request, the OEM HAL can send the outgoing frame information to the camera, enabling the camera to capture images based on the outgoing frame information.
[0153] 6. The camera can return image acquisition results to the OEM HAL.
[0154] 7. OEM HAL can send the image acquisition results to the algorithm link in the image processing module.
[0155] Specifically, the image acquisition result refers to the result of image acquisition, which can be the cache address of the acquired image (image buffer).
[0156] For example, after the camera returns the image cache address to the OEM HAL, the OEM HAL can pass this cache address to the algorithm chain in the image processing module. Then, the image processing module can call the algorithms in the algorithm chain to process the image indicated by the cache address sequentially: denoising the image using a denoising algorithm -> enhancing the denoised image using an image enhancement algorithm -> adding a filter to the enhanced image using a filter algorithm.
[0157] 8. The HAL layer returns the processed image to the video encoding module in the Framework layer for encoding.
[0158] 9. The Framework layer performs video encoding to generate a recorded video and returns the generated video to the gallery in the application layer.
[0159] It should be noted that Scheme 1 of this application does not limit the lightweight algorithm to only a filter algorithm; it can also be one or more of a texture algorithm, watermarking algorithm, or stylization algorithm. Furthermore, a recording request can indicate one or more lightweight algorithms. Figure 4 This example uses a filter algorithm as an illustration. Similarly, it doesn't limit high-quality basic algorithms to only... Figure 4 The denoising and image enhancement algorithms in the recording can also include one or more algorithms such as multi-frame synthesis and image sharpening. The basic image quality optimization algorithm indicated by a recording request can also be one or more. See details in [link to relevant documentation]. Figure 5 Using scheme 1, the algorithm chain created in the HAL layer includes the indicated basic image quality optimization algorithm 1 and basic image quality optimization algorithm 2, as well as lightweight algorithm 1. Basic image quality optimization algorithm 1 and basic image quality optimization algorithm 2 can be any two of the basic image quality optimization algorithms listed above, and lightweight algorithm 1 can also be any one of the lightweight algorithms listed above. Because... Figure 5 The processing logic and Figure 4 The same applies, so I will not repeat it here.
[0160] It should be understood that Figure 4 This illustration shows the processing performed using Scheme 1 when the filter algorithm is enabled. During recording, if the filter algorithm switches from enabled to disabled, the algorithm chain will be destroyed and rebuilt. See [link to documentation] for details. Figure 6If the reissued recording request indicates that the filter algorithm be turned off, then algorithm link 1 (i.e., denoising algorithm -> image enhancement algorithm -> filter algorithm) will be destroyed and algorithm link 2 (i.e., denoising algorithm -> image enhancement algorithm) will be recreated.
[0161] It should be noted that when the recording request indicates that the filter algorithm is turned off, the control information carried in the recording request (which can be denoted as Control Information 2) differs from the control information indicating that the filter algorithm is turned on (which can be denoted as Control Information 1). For example, Control Information 1 indicates that a filter algorithm is used (i.e., the indicated image processing algorithm includes a filter algorithm), and may specifically carry a filter algorithm identifier or a filter algorithm on label. Control Information 2 indicates that the image processing algorithm does not include a filter algorithm, and may specifically carry a filter algorithm off label or not carry a filter algorithm identifier.
[0162] To more clearly illustrate the destruction and reconstruction of the algorithm links involved in different recording requests in Scheme 1, the following section combines... Figure 7 Taking the scenario of not opening the filter -> opening the filter as an example, a sequence diagram will be used to illustrate the process. It should be understood that in... Figure 7 The process consists of two stages: Stage 1 and Stage 2. Stage 1 refers to the processing before the filter is enabled, specifically for recording requests where the image processing algorithm does not include a filter (referred to as "Recording Request 1"). This includes steps 1-1 to 1-12. Stage 2 refers to the processing after the filter is enabled, specifically for subsequent recording requests that indicate the use of a filter algorithm (referred to as "Recording Request 2"). This includes steps 1-13 to 1-29. The following will describe these steps in detail:
[0163] Phase 1: Processing without filters enabled:
[0164] 1-1. The user instructed to start recording but did not turn on the filter.
[0165] 1-2. The camera application transmits a recording request to the camera service in the Framework layer.
[0166] It should be understood that, since the filter was not turned on, the recording request 1 did not carry any information indicating the use of the filter.
[0167] 1-3. The camera service sends a recording request to the OEM HAL in the camera HAL.
[0168] 1-4. The OEM HAL sends a recording request to the path management module in the camera HAL.
[0169] It should be understood that steps 1-1 to 1-4 above describe the processing steps of sending recording request 1 to the path management module in the HAL layer when the user turns on recording but does not turn on the filter.
[0170] 1-5. The Path Management Module instructs the Algorithm Link Module to create Algorithm Link 1.
[0171] 1-6. The algorithm link module can initialize the denoising algorithm module.
[0172] 1-7. The algorithm link module can initialize the image enhancement algorithm module.
[0173] It should be understood that steps 1-5 to 1-7 above are used to describe the relevant steps of the path management module in creating algorithm link 1 according to the scenario of filter being closed, and initializing the denoising algorithm and image enhancement algorithm.
[0174] 1-8. OEM HAL sends frame information to the camera.
[0175] 1-9. The camera can return video frames (image buffers) based on the outgoing frame information to the algorithm link module.
[0176] It should be understood that a video frame is an image captured during the recording process.
[0177] 1-10. The algorithm link module can call the denoising algorithm module in algorithm link 1 to process the video frame.
[0178] 1-11. The denoising algorithm module calls the image enhancement algorithm module to process the denoised image.
[0179] It should be understood that steps 1-9 to 1-11 above are used to describe the relevant steps of sending the camera's output frames (i.e., captured images) to the two algorithms in the algorithm link for processing.
[0180] 1-12. The image enhancement algorithm module can return the enhanced image to the video encoding module in the Framework layer for video encoding.
[0181] It should be understood that if the user turns on the filter during the recording process (i.e., triggers the operation of turning on the filter), the subsequent recording request 2 will be a request to use the filter. For the specific processing of the recording request 2 that indicates the use of the filter, please refer to the description of the second stage below.
[0182] Phase Two: Processing with Filters On.
[0183] 1-13. The user opens the filter.
[0184] 1-14. The camera application transmits a recording request to the camera service in the Framework layer.
[0185] It should be understood that, because the filter is enabled, the recording request 2 carries information indicating the use of the filter.
[0186] 1-15. The camera service sends a recording request to the OEM HAL in the camera HAL.
[0187] 1-16. The OEM HAL sends a recording request to the path management module in the camera HAL.
[0188] It should be understood that steps 1-13 to 1-16 above describe the steps related to the user opening the filter and sending recording request 2 to the HAL's path management module.
[0189] 1-17. The pathway management module notifies the algorithm link module to add a filter algorithm and destroy algorithm link 1.
[0190] 1-18. The algorithm link module initializes the denoising algorithm module.
[0191] 1-19. The algorithm link module initializes the image enhancement algorithm module.
[0192] It should be understood that steps 1-17 to 1-19 above are used to describe the steps related to HAL sensing that the filter is turned on, needing to destroy the original filterless algorithm link 1, and deinitializing the two algorithms in algorithm link 1.
[0193] 1-20. The Path Management Module instructs the Algorithm Link Module to create Algorithm Link 2.
[0194] 1-21. The algorithm link module reinitializes the denoising algorithm module.
[0195] 1-22. The algorithm link module reinitializes the image enhancement algorithm module.
[0196] 1-23. Initialize the filter algorithm module in the algorithm link module.
[0197] It should be understood that steps 1-20 to 1-23 above are used to describe the creation of algorithm link 2 and to complete the relevant steps for initializing the denoising algorithm, image enhancement algorithm and filter algorithm therein.
[0198] 1-24. OEM HAL sends frame information to the camera.
[0199] 1-25. The camera can return video frames (image buffers) based on the outgoing frame information to the algorithm link module.
[0200] 1-26. The algorithm link module can call the denoising algorithm module to process video frames.
[0201] 1-27. The denoising algorithm module calls the image enhancement algorithm module to process the denoised image.
[0202] 1-28. The image enhancement algorithm module can call the filter algorithm module to process the enhanced image.
[0203] 1-29. The filter algorithm module can return the filtered image to the video encoding module in the Framework layer for video encoding.
[0204] The inventors of this application have discovered through research that although Solution 1 can enrich the video recording function and record videos with high image quality and rich image effects, Solution 1 has the following problems:
[0205] Question 1: Algorithms related to improving image quality are all integrated into the HAL layer. Once the scene changes, these algorithms will also change, for example... Figure 6 As shown, switching from a filter-off algorithm to a filter-on algorithm requires destroying the currently created algorithm link 1 and recreating algorithm link 2, causing unnecessary time consumption. Moreover, destroying and recreating algorithm links involves deinitializing and reinitializing the algorithm, which also causes some system resource consumption.
[0206] Question 2: Integrating all algorithms related to improving image quality into the HAL layer will also increase the coupling of the system.
[0207] In response to the problems of Solution 1, the inventors of this application have proposed Solution 2.
[0208] II. The detailed description of Option 2 is as follows:
[0209] In Option 2, basic image quality optimization algorithms are set or integrated only at the HAL layer of the electronic device, while lightweight algorithms are set at the Framework layer (application framework layer) of the electronic device. For example... Figure 8 As shown, Scheme 2 specifically includes the following steps:
[0210] Step 801: After the electronic device starts recording, the hardware abstraction layer performs first image processing on the first image acquired in response to the first recording request based on the image processing algorithm indicated by the first recording request, to obtain a frame of image for video encoding corresponding to the first recording request; wherein, the first image processing includes basic image quality optimization of the first image based on the first algorithm link; the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm.
[0211] It should be noted that the first recording request can be the first recording request sent after recording is started, or it can be a subsequent recording request, as long as it is sent before the second recording request and processed by the HAL layer. After acquiring the first image captured by the camera (i.e., the camera) in response to the first recording request, the HAL layer can perform first image processing on the first image, which may include basic image quality optimization processing of the first image based on the first algorithm link.
[0212] For example, the creation timing of the first algorithm link used by the HAL layer when processing the first recording request includes timing 1 or timing 2, as follows:
[0213] Timing 1:
[0214] The first algorithm link can be created after receiving the first recording request. For example, if the first recording request is the first recording request issued, then the first algorithm link for basic image quality optimization needs to be created at the HAL layer for the first time.
[0215] Timing 2:
[0216] The first algorithm chain can also be created by the HAL layer when processing a previous recording request. For example, if the HAL layer has already processed a recording request and created an algorithm chain for that request before the first recording request, then the algorithm chain for basic image quality optimization created during the previous recording request can be reused when processing the first recording request. Furthermore, this algorithm chain can be reused again when processing the second recording request. In other words, the algorithm chain for basic image quality optimization created by the HAL layer can be reused multiple times and cyclically during the recording process, improving resource utilization.
[0217] Taking timing 1 as an example, step 801 will be described in more detail, including the following steps: The hardware abstraction layer receives the first recording request and acquires the first image captured in response to the first recording request; the hardware abstraction layer creates a first algorithm link and performs basic image quality optimization on the first image based on the first algorithm link to obtain a fourth image; the hardware abstraction layer reports the fourth image to the application framework layer; the application framework layer determines the image for video encoding corresponding to the first recording request based on the fourth image.
[0218] It should be understood that the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm. Specifically, the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, but includes the second lightweight algorithm; or, the image processing algorithm indicated by the first recording request does not include any lightweight algorithm.
[0219] In cases where the image processing algorithm indicated by the first recording request may not include the first lightweight algorithm but may include a second lightweight algorithm different from the first lightweight algorithm, the first image processing may also include other processing and is not limited to basic image quality optimization. For example, the second lightweight algorithm can be used to perform advanced processing on the image after basic image quality optimization. Therefore, the image frame used for video encoding corresponding to the first recording request can be an image after advanced processing using the second lightweight algorithm. That is, after receiving the fourth image reported by the HAL layer, the application framework layer can call the second lightweight algorithm in the application framework layer to perform advanced processing on the fourth image to obtain the image used for video encoding corresponding to the first recording request.
[0220] If the image processing algorithm indicated by the first recording request does not include any lightweight algorithm, then the first image processing only includes basic image quality optimization. Therefore, the image used for video encoding corresponding to the first recording request is the image after basic image quality optimization. That is, after receiving the fourth image reported by the HAL layer, the application framework layer can directly identify the fourth image as the image used for video encoding corresponding to the first recording request without performing any further processing.
[0221] In some embodiments, the fact that the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm can be specifically manifested as follows: the first recording request carries a closing tag for the first lightweight algorithm, and the second recording request carries an opening tag for the first lightweight algorithm; or, the first recording request does not carry the algorithm identifier of the first lightweight algorithm, and the second recording request carries the algorithm identifier of the first lightweight algorithm.
[0222] Step 802: The hardware abstraction layer receives a second recording request sent during the recording process. The image processing algorithm indicated by the second recording request includes the first lightweight algorithm.
[0223] As described above, after receiving the second recording request, the HAL layer will also analyze and determine the output frame information indicated by the second recording request, so as to instruct the camera to capture images according to the output frame information and obtain the second image captured in response to the second recording request. The specific interaction process between the HAL layer and the camera is described above and will not be repeated here.
[0224] Step 803: The hardware abstraction layer acquires the second image captured in response to the second recording request, and reuses the algorithm link to perform basic image quality optimization on the second image to obtain the third image.
[0225] It should be understood that since the HAL layer is only responsible for creating the algorithm links for basic image quality optimization processing, it does not concern itself with whether the recording request carries control information indicating the use of a lightweight algorithm. Furthermore, it does not need to destroy the already created algorithm links; instead, it can directly reuse the first created algorithm link for basic image quality optimization processing and execute step 804 to report the image after basic image quality optimization to the application framework layer. This avoids the destruction and reconstruction of HAL layer algorithm links caused by changes to the lightweight algorithm, saving system resources and improving image processing efficiency during recording.
[0226] Step 804: The hardware abstraction layer reports the third image to the application framework layer.
[0227] Step 805: The application framework layer calls the first lightweight algorithm to process the third image and obtains a frame of image corresponding to the second recording request for video encoding.
[0228] Specifically, the Framework layer (application framework layer) can initialize the set first lightweight algorithm, such as performing initialization processes like initializing the algorithm library and allocating the memory required for the first lightweight algorithm. After the first lightweight algorithm is initialized, the Framework layer can use the first lightweight algorithm to process the third image reported by the HAL layer after basic image quality optimization.
[0229] Step 806: The application frame layer encodes the multiple frames of images obtained during the recording process to obtain the recorded video.
[0230] It should be understood that each recording request generates one frame for video encoding. Therefore, as recording requests are continuously sent during the recording process, multiple frames for video encoding are generated. The Framework layer then encodes these multiple frames obtained during recording to produce the recorded video. Furthermore, the Framework layer can return the recorded video to a gallery in the application layer to save it there.
[0231] It should be noted that, Figure 8 The example shown is a lightweight algorithm carried in the second recording request that was not indicated in the first recording request. This illustrates that even if the lightweight algorithm indicated in the recording request changes, the algorithm link created by the HAL layer does not need to be destroyed and rebuilt, but can be directly reused. However, this does not limit Scheme 2 of this application to only illustrative purposes. Figure 8 In one scenario, even if the second recording request and the first recording request indicate the use of the same lightweight algorithm, the algorithm link created by the HAL layer can still be reused. This is because Scheme 2 decouples the upper-layer lightweight algorithm from the HAL layer. The HAL layer only focuses on basic image quality optimization processing and is not affected by whether or not a lightweight algorithm is selected.
[0232] Similarly, to better understand Scheme 2 above, through Figure 9 Scheme 2 will be further explained in conjunction with the structure of the software system. In this example, taking the lightweight filter algorithm as an example, the HAL layer integrates basic image quality optimization algorithms such as denoising and image enhancement algorithms. Specifically, the camera hardware abstraction module in the HAL layer may include OEM HAL, path management module, etc. The lightweight filter algorithm is set in the Framework layer. Specifically, the Framework layer includes filter algorithm module and video encoding module.
[0233] Please see Figure 9 This illustrates the processing when the filter algorithm is turned on (i.e., the filter algorithm is enabled), specifically including the following steps:
[0234] 1. The camera application sends a recording request to the camera service.
[0235] Similarly, the recording request carries control information, which may include information for determining frame information and information for determining the image processing algorithm. The information for determining the image processing algorithm includes control information indicating the use of a filter (hereinafter referred to as "filter instruction information"). If the recording request carries filter instruction information, it means that the recording request indicates the use of a filter algorithm.
[0236] In some examples, the filter indication information may include an enabled label for the filter algorithm or a filter algorithm identifier. It should be understood that, similarly, if the image processing algorithm indicated by the recording request does not include a filter algorithm, then the recording request may carry an disabled label for the filter algorithm or may not carry a filter algorithm identifier.
[0237] 2. The camera service continues to send the recording request to OEM HAL.
[0238] In some examples, unlike Solution 1, Solution 2 does not require the camera service to include filter indication information in the recording request sent to the OEM HAL. That is, compared to Solution 1, the Framework layer is improved, enabling it to parse the recording request, identify and extract the filter indication information, and generate a new request based on the control information (excluding the filter indication information) carried in the original recording request, before sending it to the OEM HAL. The Framework layer can record the filter indication information itself, and then proceed with further processing based on the recorded filter indication information after the HAL layer returns the image.
[0239] In other examples, in Scheme 2, the camera service can also carry filter indication information in the recording request sent to the OEM HAL. However, the HAL layer does not respond to or process this filter indication information; it only performs basic image quality optimization. This is not a limitation.
[0240] 3. OEM HAL can pass recording requests to the image processing module for decision-making algorithm links.
[0241] 4. The path management module in the image processing module creates the algorithm link.
[0242] It should be understood that Figure 9 The algorithm link created in the HAL layer and Figure 4 The algorithmic links are different, that is, in Figure 9 The algorithm chain created in the middle is used to implement basic image quality optimization, and only includes basic image quality optimization algorithms, such as denoising algorithms and image enhancement algorithms.
[0243] 5. The OEM HAL can send the output frame information indicated by the recording request to the camera.
[0244] 6. The camera can return image acquisition results to the OEM HAL.
[0245] 7. OEM HAL can send the image acquisition results to the algorithm link in the image processing module.
[0246] Specifically, the images captured by the camera are processed sequentially through denoising and image enhancement algorithms in the algorithm chain. The difference from Solution 1 is that the algorithm chain does not require additional filter algorithms to process the images.
[0247] 8. The HAL layer sends the image processed by the algorithm link to the upper-layer algorithm for further processing.
[0248] Specifically, the HAL layer returns the processed image to the Framework layer, which then calls the filter algorithm module to process the image returned by the HAL layer.
[0249] It should be understood that in Scheme 1, with the filter algorithm enabled, the algorithm chain generated by the HAL layer includes the filter algorithm. Therefore, after processing the image using the basic image quality optimization algorithm in the algorithm chain, the HAL layer still needs to perform format conversion on the image to adapt it to the filter algorithm, and then use the filter algorithm to process the format-converted image. This results in significant system resource consumption for format conversion within the underlying HAL layer. However, in Scheme 2, after performing basic image quality optimization, the HAL layer can directly return the optimized image to the Framework layer via the interaction interface, eliminating the need for format conversion. This reduces the consumption or occupation of underlying system resources, freeing up more resources for subsequent basic image quality optimization. This improves the image processing efficiency of the HAL layer, thereby increasing the overall video generation efficiency of the recording scene. Furthermore, the lightweight algorithm in the Framework layer relies on CPU execution, resulting in faster processing speeds and further improving processing efficiency.
[0250] 9. The Framework layer returns the filtered image to the video encoding module for video encoding.
[0251] Specifically, after receiving the image returned by the HAL layer, the Framework layer can determine the desired filter algorithm based on the filter indication information extracted or perceived from the recording request, and initialize the filter algorithm. After initialization, the filter algorithm can be used to add filter effects to the image returned by the HAL layer. Further, the image with the added filter effects is transmitted to the video encoding module for video encoding.
[0252] 10. The video encoding module returns the encoded video to the image library in the application layer.
[0253] from Figure 9 It can be seen that, compared to Figure 4 As shown in Scheme 1, the lightweight filter algorithm in Scheme 2 is set in the Framework layer, which achieves decoupling from the underlying HAL layer.
[0254] Figure 9 This only illustrates the processing performed using Scheme 2 when the filter algorithm is enabled. From the above... Figure 6 It can be seen that if the filter algorithm switches from on to off during the recording process, if Scheme 1 is used, it involves the destruction and reconstruction of the algorithm link.
[0255] In Scheme 2, if the filter algorithm changes from on to off during recording, the algorithm link will not be destroyed as in Scheme 1. Instead, the algorithm link that has been created for basic image quality optimization can be reused.
[0256] It should be noted that Scheme 2 of this application does not limit the lightweight algorithm to only a filter algorithm; it can also be one or more of a texture algorithm, watermarking algorithm, or stylization algorithm. Furthermore, a recording request can indicate one or more lightweight algorithms. Figure 9 This example uses a filter algorithm as an illustration. Similarly, it doesn't limit high-quality basic algorithms to only... Figure 9 The denoising and image enhancement algorithms in the recording can also include one or more algorithms such as multi-frame synthesis (analyzing the features and texture information of multiple low-quality images to generate a high-quality synthetic image) and image sharpening. The basic image quality optimization algorithm indicated by a recording request can also be one or more. See details in [link to relevant documentation]. Figure 10 Using scheme 2, the algorithm chain created in the HAL layer includes the indicated basic image quality optimization algorithm 1 and basic image quality optimization algorithm 2, while lightweight algorithm 1 is set in the Framework layer. Similarly, basic image quality optimization algorithm 1 and basic image quality optimization algorithm 2 can be any two of the basic image quality optimization algorithms listed above, and lightweight algorithm 1 can also be any one of the lightweight algorithms listed above. Because... Figure 10 The processing logic and Figure 9 The same applies, so I will not repeat it here.
[0257] To more clearly illustrate the algorithm links created in the HAL layer for reusing different recording requests in Scheme 2, the following section combines... Figure 11 The following example, using a timing diagram, illustrates the scenario of turning the filter on without it being applied. Figure 11 The process also includes two stages: the first stage and the second stage. The first stage refers to the processing of recording requests where the filter is not enabled (referred to as "Recording Request 1"). Figure 11 The first stage specifically includes steps 2-1 to 2-12. The second stage refers to the processing of opening the filter, specifically the processing of subsequent recording requests that open the filter (which can be referred to as "recording request 2"). Figure 11 The second stage can specifically include steps 2-13 to 2-22. These will be described in detail below:
[0258] Phase 1: Processing without filters enabled:
[0259] 2-1. The user instructed to start recording but did not turn on the filter.
[0260] 2-2. The camera application transmits a recording request to the camera service in the Framework layer.
[0261] Similarly, since the filter was not turned on, the recording request 1 did not carry any information indicating the use of the filter; that is, it did not carry any filter instruction information.
[0262] 2-3. The camera service sends a recording request to the OEM HAL in the camera HAL.
[0263] 2-4. The OEM HAL sends a recording request to the path management module in the camera HAL.
[0264] It should be understood that steps 2-1 to 2-4 above describe the processing steps of sending recording request 1 to the path management module in the HAL layer when the user turns on recording but does not turn on the filter.
[0265] 2-5. The Path Management Module instructs the Algorithm Link Module to create Algorithm Link 1.
[0266] 2-6. The algorithm link module can initialize the denoising algorithm module.
[0267] 2-7. The algorithm link module can initialize the image enhancement algorithm module.
[0268] It should be understood that steps 2-5 to 2-7 above are used to describe the relevant steps of the path management module in creating algorithm link 1 according to the scenario of filter being closed, and initializing the denoising algorithm and image enhancement algorithm.
[0269] 2-8. OEM HAL sends frame information to the camera.
[0270] 2-9. The camera can return video frames (image buffers) based on the outgoing frame information to the algorithm link module.
[0271] It should be understood that a video frame is an image captured during the recording process.
[0272] 2-10. The algorithm link module can call the denoising algorithm module in algorithm link 1 to process the video frame.
[0273] 2-11. The denoising algorithm module calls the image enhancement algorithm module to process the denoised image.
[0274] It should be understood that steps 2-9 to 2-11 above are used to describe the relevant steps of sending the camera's output frames (i.e., captured images) to the two algorithms in the algorithm link for processing.
[0275] 2-12. The image enhancement algorithm module can return the enhanced image to the video encoding module in the Framework layer for subsequent video encoding.
[0276] It should be understood that if the user turns on the filter during the recording process (i.e., triggers the operation of turning on the filter), the subsequent recording request 2 will be a request to use the filter. For the specific processing of the recording request 2 that indicates the use of the filter, please refer to the description of the second stage below.
[0277] Phase Two: Processing with Filters On.
[0278] 2-13. The user opens the filter.
[0279] 2-14. The camera application transmits a recording request to the camera service in the Framework layer.
[0280] Similarly, since the filter is enabled, the recording request 2 carries information indicating the use of the filter, i.e., it carries filter instruction information.
[0281] 2-15. The camera service sends a recording request 2 to the OEM HAL in the camera HAL.
[0282] As mentioned above, because the HAL layer is decoupled from the lightweight algorithm of the upper layer, the HAL layer does not contain any filter algorithm; the filter algorithm resides in the Framework layer. Therefore, the HAL layer does not need to be aware of or concerned with filter-related information. Thus, the Framework layer can parse the recording request to identify and extract the filter indication information, and generate a new request based on the control information carried in the original recording request, excluding the filter indication information, and send it to the OEM HAL. In other words, the recording request 2 sent to the OEM HAL is a newly generated request after removing the filter indication information; therefore, it differs from the recording request 2 in steps 1-15 in terms of specific parameters.
[0283] It should be understood that the Framework layer can record filter instruction information itself, and then perform further processing based on the recorded filter instruction information after the HAL layer returns the image.
[0284] 2-16. OEM HAL sends frame information to the camera.
[0285] 2-17. The camera can return video frames (image buffers) based on the outgoing frame information.
[0286] 2-18. The algorithm link module can call the denoising algorithm module to process video frames.
[0287] 2-19. The denoising algorithm module calls the image enhancement algorithm module to process the denoised image.
[0288] 2-20. The image enhancement algorithm module can return the enhanced image to the Framework layer and instruct the filter algorithm module to initialize.
[0289] 2-21. The Framework layer calls the initialized filter algorithm module to process the image returned by the HAL layer.
[0290] 2-22. The filter algorithm module can send the filtered image to the video encoding module in the Framework layer for video encoding.
[0291] This application also provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to perform the functions or steps described in the above method embodiments.
[0292] This application also provides a computer-readable storage medium including computer instructions that, when executed on the electronic device, cause the electronic device to perform the various functions or steps described in the method embodiments.
[0293] This application also provides a computer program product that, when run on a computer, causes the computer to perform the functions or steps described in the above method embodiments.
[0294] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0295] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or 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 apparatus, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0296] The units described as separate components may or may not be physically separate. A component shown as a unit can be one or more physical units; that is, it can be located in one place or distributed in multiple different locations. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0297] 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 as a software functional unit.
[0298] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0299] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A video recording method, characterized in that, This technology is applied to electronic devices, which include a camera application, a hardware abstraction layer, and an application framework layer; the hardware abstraction layer is used for basic image quality optimization; and the application framework layer contains at least one lightweight algorithm. The lightweight algorithm is a lightweight algorithm for adding additional effects to images; the method includes: After the electronic device starts recording, the camera application sends multiple recording requests sequentially to the hardware abstraction layer via the application framework layer; each recording request is used to capture one frame of image and also to indicate the image processing algorithm to be used for the one frame of image; the multiple recording requests include a first recording request; The hardware abstraction layer performs first image processing on the first image acquired in response to the first recording request to obtain a frame of image for video encoding corresponding to the first recording request; wherein, the first image processing includes basic image quality optimization of the first image based on the first algorithm link; the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm; The hardware abstraction layer receives a second recording request; wherein the image processing algorithm indicated by the second recording request includes the first lightweight algorithm; the second recording request is a recording request issued by the camera application after the first recording request is issued; The hardware abstraction layer reuses the already created first algorithm link to perform basic image quality optimization on the second image acquired in response to the second recording request, thereby obtaining a third image. The application framework layer calls the first lightweight algorithm to process the third image and obtains a frame of image for video encoding corresponding to the second recording request. The application framework layer encodes multiple frames of images used for video encoding to obtain a recorded video; the multiple frames of images used for video encoding are the images used for video encoding corresponding to multiple recording requests issued during the recording process.
2. The method according to claim 1, characterized in that, The hardware abstraction layer performs first image processing on the first image captured by the first recording request to obtain a frame of image corresponding to the first recording request for video encoding, including: The hardware abstraction layer receives the first recording request and acquires the first image captured in response to the first recording request; The hardware abstraction layer creates the first algorithm link and performs basic image quality optimization on the first image based on the first algorithm link to obtain the fourth image; The hardware abstraction layer reports the fourth image to the application framework layer; The application framework layer determines the image for video encoding corresponding to the first recording request based on the fourth image.
3. The method according to claim 2, characterized in that, The electronic device further includes an application layer; the application layer includes a camera application; the application framework layer includes a camera service; the first recording request carries first control information, the first control information instructing the camera to capture the shooting parameters of the first image; Before the hardware abstraction layer receives the first recording request and acquires the first image captured in response to the first recording request, the method further includes: The camera application receives the first recording request and sends the first recording request to the hardware abstraction layer through the camera service in the application framework layer; The hardware abstraction layer receives the first recording request and acquires the first image captured in response to the first recording request, including: After receiving the first recording request from the camera service, the hardware abstraction layer instructs the camera to capture the first image according to the first control information and obtains the first image returned by the camera.
4. The method according to any one of claims 1-3, characterized in that, The image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, specifically: the image processing algorithm indicated by the first recording request does not include any lightweight algorithm.
5. The method according to any one of claims 1-3, characterized in that, The image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, specifically: the image processing algorithm indicated by the first recording request does not include the first lightweight algorithm, but includes the second lightweight algorithm; The first image processing further includes: invoking the second lightweight algorithm to process the first image.
6. The method according to claim 4, characterized in that, The first recording request carries a closing tag for the first lightweight algorithm, and the second recording request carries an opening tag for the first lightweight algorithm; or, The first recording request does not carry the algorithm identifier of the first lightweight algorithm, while the second recording request carries the algorithm identifier of the first lightweight algorithm.
7. The method according to any one of claims 1-3, characterized in that, The first lightweight algorithm is a filter algorithm.
8. The method according to any one of claims 1-3, characterized in that, The first algorithm chain includes a denoising algorithm and / or an image enhancement algorithm; The basic image quality optimization of the first image based on the first algorithm link includes: The first image is subjected to denoising processing and / or image enhancement processing according to the denoising algorithm and / or image enhancement algorithm.
9. The method according to any one of claims 1-3, characterized in that, The at least one lightweight algorithm includes at least one of filter algorithms, texture algorithms, watermarking algorithms, or stylization algorithms.
10. An electronic device, characterized in that, The electronic device includes at least: a camera, a display screen, a memory, and one or more processors; the camera is used to capture images; the display screen is used to display images; the memory is used to store computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the method as described in any one of claims 1-9.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes computer instructions that, when executed on an electronic device, cause the electronic device to perform the method as described in any one of claims 1-9.
12. A computer program product, characterized in that, When the computer program product is run on a computer, it causes the computer to perform the method as described in any one of claims 1-9.