Image data processing method and related device
By adding an adapter to the electronic device to convert the image data output by the camera hardware abstraction layer into the format required by the image processing algorithm, the problems in the existing technology of poor adaptability of the image processing algorithm and screen jumps when switching cameras are solved, achieving Efficient image data processing and smooth zoom effects.
Patent Information
- Application Number
- CN202310897862.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2043-07-20
AI Technical Summary
The image processing algorithms of existing electronic devices are strongly dependent on the on-chip system platform, resulting in poor adaptability of the image processing algorithms. They need to be customized according to different platforms, and it is easy to cause jumps in image content when the camera is switched.
By adding an adapter between the camera hardware abstraction layer and the image processing algorithm module, the fixed format image data output by the camera hardware abstraction layer is converted into the format required by the image algorithm module, thereby realizing the decoupling of the image processing algorithm and the on-chip system platform. And the image flow when switching cameras is processed through a spatial alignment transformation algorithm to achieve a smooth optical zoom effect.
The image processing algorithm is decoupled from the on-chip system platform, so that the image processing algorithm does not need to be customized according to the platform, which improves the efficiency and quality of image data processing and avoids screen content jumps when switching cameras.
Smart Images

Figure CN117692790B
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an image data processing method and related devices. Background Art
[0002] With the development of electronic devices such as mobile phones and tablet computers, the shooting function is becoming more and more important. In order to obtain a better shooting experience, electronic devices can process image streams through some image processing algorithms to improve the picture effect of the captured images.
[0003] At present, image processing algorithms on electronic devices are highly dependent on the system on chip (SOC) platform on the electronic devices. Developers must design image processing algorithms specifically according to the system on chip platform used in the electronic devices, resulting in poor adaptability of image processing algorithms. Summary of the invention
[0004] The present application provides an image data processing method and related devices, which can realize the decoupling of the image processing algorithm from the camera hardware abstraction layer of the system-on-chip platform, so that the image processing algorithm does not need to be customized according to the system-on-chip platform, and image data processing can be realized.
[0005] In a first aspect, the present application provides an image data processing method, which is applied to an electronic device, the electronic device having multiple cameras and an image signal processor; the multiple cameras include a first camera and a second camera, the zoom magnification range of the first camera is different from the zoom magnification range of the second camera, the electronic device runs an operating system, the operating system includes a hardware abstraction layer, the hardware abstraction layer includes a camera hardware abstraction layer, an adapter and a spatial alignment transformation algorithm module; the method includes: converting a first image in a first format output by the camera hardware abstraction layer into a third image in a second format through the adapter, and converting the second image in the first format output by the camera hardware abstraction layer into a fourth image in the second format; wherein the first image is output by the adapter The first camera takes the picture, and the second image is taken by the second camera, and the first format is different from the second format; the spatial transformation algorithm module determines the spatial alignment transformation parameters of the third format based on the third image in the second format and the fourth image in the second format; the adapter converts the spatial alignment transformation parameters of the third format into spatial alignment transformation parameters of a fourth format, and the third format is different from the fourth format; the spatial alignment transformation parameters of the fourth format are sent to the image signal processor through the camera hardware abstraction layer; the image signal processor performs spatial alignment transformation processing on the fifth image taken by the second camera based on the spatial alignment transformation parameters of the fourth format to obtain a sixth image after spatial alignment transformation; and the sixth image is displayed.
[0006] Therefore, an image data processing method is provided in an embodiment of the present application, which can realize adding an adapter between the camera hardware abstraction layer and the image processing algorithm module, and converting the image data in a fixed format output by the camera hardware abstraction layer into data in a format required by the image algorithm module through the adapter. In this way, the image processing algorithm can be decoupled from the system-on-chip platform, so that the image processing algorithm can realize image data processing without being customized according to the system-on-chip platform.
[0007] In a possible implementation, before obtaining the first image captured by the first camera and the second image captured by the second camera through the camera hardware abstraction layer, the method further includes: displaying the image captured by the first camera at a first zoom factor, wherein the first zoom factor is within the zoom factor range of the first camera; and receiving a first operation of the user setting the zoom factor to a second zoom factor, wherein the second zoom factor is within the zoom factor range of the second camera. The obtaining the first image captured by the first camera and the second image captured by the second camera through the camera hardware abstraction layer specifically includes: in response to the first operation, obtaining the first image captured by the first camera and the second image captured by the second camera through the camera hardware abstraction layer.
[0008] In one possible implementation, the first format includes a port number and a node buffer structure, the node buffer structure includes a buffer address of the image data, a width and height of the image data, and a data type of the image data, the data type including YUV data or RAW data; wherein the port number of the first image is different from the port number of the second image.
[0009] In a possible implementation, the second format includes a camera type, a buffer type, and a frame structure; wherein the buffer type is used to indicate a resolution of image data, and the camera type of the third image is different from the camera type of the fourth image.
[0010] In a possible implementation, the third format includes clipping information and an affine transformation matrix.
[0011] In one possible implementation, the fourth format includes image correction adjustment data.
[0012] In a possible implementation, the camera hardware abstraction layer includes a spatial alignment transformation node; the first image in the first format output by the camera hardware abstraction layer is converted into a third image in the second format through the adapter, and the second image in the first format output by the camera hardware abstraction layer is converted into a fourth image in the second format, specifically including: converting the first image in the first format output by the spatial alignment transformation node into the third image in the second format through the adapter, and converting the second image in the first format output by the spatial alignment transformation node into the fourth image in the second format.
[0013] In one possible implementation, before converting the first image in the first format output by the camera hardware abstraction layer into a third image in the second format through the adapter, and converting the second image in the first format output by the camera hardware abstraction layer into a fourth image in the second format, the method also includes: performing front-end processing on the first image and the second image through the image signal processor.
[0014] In a possible implementation, the image signal processor performs spatial alignment transformation processing on the fifth image captured by the second camera based on the spatial alignment transformation parameters of the fourth format to obtain a sixth image after the spatial alignment transformation, specifically including: performing front-end processing on the fifth image captured by the second camera by the image signal processor; performing spatial alignment transformation processing on the fifth image after the front-end processing based on the spatial alignment transformation parameters by the image signal processor to obtain the sixth image after the spatial alignment transformation.
[0015] In a possible implementation, the front-end processing includes one or more of color correction, downsampling, demosaicing, and statistical 3A data.
[0016] In a second aspect, the present application provides an electronic device comprising multiple cameras, one or more processors and one or more memories; wherein the multiple cameras, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer programs, and when the one or more processors execute the computer program, the method in any possible implementation of the above-mentioned first aspect is executed.
[0017] In a third aspect, the present application provides another electronic device, comprising one or more functional modules, wherein the one or more functional modules are used to execute the method in any possible implementation of the first aspect above.
[0018] In a fourth aspect, the present application provides a chip, comprising a processing circuit and an interface circuit, wherein the interface circuit is used to receive instructions and transmit them to the processing circuit, and the processing circuit is used to run the instructions to execute the method in any possible implementation of any of the above aspects.
[0019] In a fifth aspect, the present application provides a computer-readable storage medium storing a computer program, which, when executed on a processor of an electronic device, enables execution of a method in any possible implementation of the first aspect described above.
[0020] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a processor of an electronic device, enables execution of a method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0022] Figure 2 A schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;
[0023] Figure 3A-3D A schematic diagram showing a group of camera switching caused by zoom ratio changes provided in an embodiment of the present application is shown;
[0024] Figure 4 A schematic diagram of a data transmission method between a camera hardware abstraction layer and a super image engine provided in an embodiment of the present application;
[0025] Figure 5 A schematic diagram of the architecture of a hardware abstraction layer provided in an embodiment of the present application;
[0026] Figure 6 A schematic diagram of functional modules of an image data processing method provided in an embodiment of the present application;
[0027] Figure 7 A schematic diagram of a flow chart of an image data processing method provided in an embodiment of the present application;
[0028] Figure 8 This is a schematic diagram of the architecture of a hardware abstraction layer provided in another embodiment of the present application. DETAILED DESCRIPTION
[0029] The technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0030] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0031] The following introduces the hardware structure of an electronic device provided in an embodiment of the present application.
[0032] Figure 1 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application.
[0033] like Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a camera 193, a display screen 194, etc. The sensor module 180 may include a pressure sensor 180A, a distance sensor 180F, a proximity light sensor 180G, a touch sensor 180K, an ambient light sensor 180L, etc.
[0034] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0035] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions.
[0036] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0037] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0038] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), miniled, microled, micro-oled, a quantum dot light emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0039] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0040] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise and illumination of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.
[0041] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0042] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy. The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple coding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0043] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM). The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data. The non-volatile memory can also store executable programs and store user and application data, etc., and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
[0044] The program code corresponding to the shooting mode recommendation method provided in the embodiment of the present application can be stored in a non-volatile memory. In the scenario of running a camera application, the electronic device 100 can load the program code stored in the non-volatile memory into a random access memory, and then send it to the processor 110 for execution, thereby implementing the shooting mode switching method.
[0045] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, a video or other file captured is stored in the external non-volatile memory.
[0046] The electronic device 100 may implement an audio function through the audio module 170 and an application processor, etc.
[0047] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110.
[0048] Specifically, the audio module 170 may include a speaker 170A, a receiver 170B, a microphone 170C, and an earphone interface 170D. The speaker 170A, also known as a "speaker", is used to convert an audio electrical signal into a sound signal. The receiver 170B, also known as a "earpiece", is used to convert an audio electrical signal into a sound signal. In an embodiment of the present application, after starting to record a video, the electronic device 100 may encode the audio electrical signal of the microphone 170C and then obtain a video sound track. The microphone 170C, also known as a "microphone" or a "microphone", is used to convert a sound signal into an electrical signal. The earphone interface 170D is used to connect wired headphones.
[0049] The pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 180A can be set on the display screen 194. When a touch operation is applied to the display screen 194, the electronic device 100 detects the touch operation intensity according to the pressure sensor 180A. The electronic device 100 can also calculate the touch position according to the detection signal of the pressure sensor 180A.
[0050] The distance sensor 180F is used to measure the distance. The electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focus. In an embodiment of the present application, the electronic device 100 can use the distance sensor 180F to determine the object distance of the image.
[0051] The ambient light sensor 180L is used to sense the illuminance of the ambient light. In the embodiment of the present application, the electronic device 100 can use the ambient light sensor 180L to determine the illuminance of the image.
[0052] The touch sensor 180K is also called a "touch control device". The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch control screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 100, which is different from the position of the display screen 194.
[0053] In the embodiment of the present application, the electronic device 100 can detect user operations such as clicking and sliding on the screen through the touch detection capability provided by the touch sensor 180K, thereby controlling the activation and deactivation of applications and controls.
[0054] The electronic device 100 may be a mobile phone with a camera, a digital camera, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) device, a virtual reality (VR) device, an artificial intelligence (AI) device, a wearable device, an in-vehicle device, a smart home device and / or a smart city device. The embodiments of the present application do not impose any special restrictions on the specific type of the electronic device 100.
[0055] Figure 2 A schematic diagram of the software and hardware architecture of an electronic device according to an embodiment of the present application is exemplarily shown.
[0056] like Figure 2 As shown, the layered architecture divides the operating system into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into five layers, from top to bottom, namely, the application layer, the framework layer (framework, FWK), the hardware abstraction layer (hardware layer, HAL), the kernel layer and the hardware layer.
[0057] The application layer may include a series of application packages.
[0058] The application package may include a camera application, etc.
[0059] The framework layer provides an application programming interface (API) and a programming framework for the application packages of the application layer. The application framework layer includes some predefined functions.
[0060] In some embodiments, the application framework layer may include a camera access interface, wherein the camera access interface may include camera management and camera devices. The camera access interface is used to provide an application programming interface and a programming framework for camera applications.
[0061] 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.
[0062] In the embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer (Camera HAL) and a super image turbo (SIT). Among them, the SIT may include a plug-in of multiple image processing algorithms, for example, a plug-in of a spatial alignment transform (SAT) algorithm (referred to as a spatial alignment transform plug-in (SAT plugin)), a plug-in of a background blur algorithm (referred to as a background blur plug-in), etc.
[0063] The Camera HAL may include one or more camera call interfaces and one or more image processing algorithm interfaces. The one or more camera call interfaces include camera interface 1 (e.g., main camera) and camera interface 2 (e.g., wide-angle camera), etc. The electronic device 100 may call each camera through camera interface 1, camera interface 2, etc., and obtain image data of each camera.
[0064] The interfaces of one or more image processing algorithms include a spatial alignment transformation interface, a background blur interface, etc. The interfaces of the image processing algorithms are called differently in different SoC platforms. For example, in the Camx architecture, the nodes of the image processing algorithms can be called nodes, such as SAT nodes, etc. In the Camera HAL architecture of other SoC platforms, the interfaces of the image processing algorithms can also be called sessions, etc.
[0065] The various nodes and modules in the camera hardware abstraction layer are provided by the solution architecture designed by the manufacturer of the SoC platform on the electronic device. For example, the solution architecture may include the CamX architecture, etc.
[0066] The kernel layer is a layer between the hardware layer and the hardware abstraction layer. The kernel layer includes drivers for various hardware. The kernel layer may include camera drivers, digital signal processor drivers, and image processor drivers, etc. Among them, the camera driver is used to drive the image sensors (e.g., image sensor 1, image sensor 2, TOF sensor, etc.) of one or more cameras in the camera module to capture images and drive the image signal processor to pre-process the images. The digital signal processor driver is used to drive the digital signal processor to process images. The graphics processor driver is used to drive the graphics processor to process images.
[0067] The hardware layer may include a camera module, an image signal processing (ISP), a digital signal processing (DSP), and a graphics processing unit (GPU). The camera module may include image sensors of multiple cameras, for example, image sensor 1, image sensor 2, and so on. Optionally, the camera module may also include a time of flight (TOF) sensor, a multi-spectral sensor, and so on.
[0068] Among them, the ISP may include an image frontend (IFE) module and an image processing engine (IPE) module. The IFE module can perform one or more front-end processing tasks such as color correction, downsampling, de-mosaicing, and statistical 3A data on the image data output by the sensor in the camera module for the preview stream or video stream. The IPE module can perform one or more back-end processing tasks such as hardware noise reduction, image cropping, software noise reduction, color processing, and detail enhancement on the image data.
[0069] The node of the image processing algorithm can send the image data processed by IFE and / or IPE to the plug-in of the image processing algorithm in the SIT module for algorithm processing. The plug-in of the image processing algorithm can transmit the processing result to CameraHAL.
[0070] For example, the SAT node can obtain the image data collected by multiple cameras after being processed by the IFE module and send it to the SAT plugin in the SIT. The SAT plugin can determine the spatial alignment transformation parameters (for example, crop matrix, affine transformation (warp) matrix) from the image data collected by multiple cameras after being processed by the IFE module through the spatial alignment switching algorithm model (SAT AIgo), and return the spatial alignment transformation parameters to the SAT node. The SAT node can provide the spatial alignment transformation parameters to the IPE module in the ISP, and the IPE module can perform spatial alignment transformation processing on the image stream collected by the switched camera based on the spatial alignment transformation parameters, so that when the electronic device performs optical zoom by switching the camera, the picture content and size of the image have no obvious jump, and a smooth zoom effect is achieved.
[0071] Figure 3A-3D A schematic diagram of a set of camera switching caused by zoom ratio changes provided in an embodiment of the present application is shown.
[0072] like Figure 3A As shown, the electronic device 100 may display a desktop 310, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a setting application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator 313 is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area 311 is displayed below the page indicator 313. Among them, the tray area 311 includes multiple tray icons, for example, a camera application icon 312, an address book application icon, a phone application icon, and an information application icon. The tray area 311 remains displayed when the page is switched. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator 313, and the page indicator 313 may not be part of the page and exist separately. The above-mentioned tray icon is also optional, and the embodiment of the present application does not limit this.
[0073] The electronic device 100 may receive an input (eg, a single click) from a user on the camera application icon 312. In response to the input operation, the electronic device 100 may display a Figure 3B The shooting interface 320 is shown.
[0074] like Figure 3BAs shown, the shooting interface 320 may include an echo control 325A, a shooting control 325B, a camera conversion control 325C, a preview box 322, a zoom ratio control 323, and controls for one or more shooting modes (for example, a control 324A for a large aperture shooting mode, a control 324B for a night scene shooting mode, a control 324C for a portrait shooting mode, a control 324D for a normal shooting mode, a control 324E for a normal video recording mode, a control 324F for a multi-lens video recording mode, and a control 324G for more modes).
[0075] Among them, Figure 3B As shown, the control 324D of the normal photo mode is selected, and the electronic device 100 is in the normal photo mode. The preview frame 322 displays a preview screen 326 captured by the electronic device 100 through the camera in the normal photo mode. The echo control 325A can be used to trigger the display of the image or video that has been taken. The shooting control 325B is used to trigger the saving of the image captured by the camera. The camera conversion control 325C can be used to switch the camera of the electronic device 100 to capture images (for example, the front camera is switched to the rear camera, or the rear camera is switched to the front camera). The zoom ratio control 323 can be used to set the zoom ratio of the electronic device 100 to take photos or videos. Among them, the zoom ratio control 323 can display the currently used zoom ratio (for example, 1x).
[0076] The electronic device 100 may receive a user input (eg, a single click) for the zoom magnification control 323, and in response to the input, the electronic device 100 may display a Figure 3C A zoom ratio setting control 331 and a current zoom ratio control 332 are shown.
[0077] like Figure 3C As shown, the electronic device 100 can replace the above-mentioned zoom ratio control 323 with a zoom ratio setting control 331 and a current zoom ratio control 332. The zoom ratio setting control 331 can display a zoom ratio range (e.g., 0.5x to 10x) supported by the normal photographing mode. The electronic device 100 can determine the zoom ratio set by the user based on the user's input (e.g., sliding) to the zoom ratio setting control 331. The current zoom ratio control 332 can be used to display the zoom ratio currently selected by the user on the zoom ratio setting control 331.
[0078] like Figure 3DAs shown, the electronic device 100 can receive and respond to the user's input (e.g., sliding) to the zoom ratio setting control 331, adjust the zoom ratio of the normal shooting mode (e.g., adjust the zoom ratio from 1x to 0.9x), and obtain a real-time preview screen 327 based on the zoom ratio set by the user (e.g., 0.9x). The electronic device 100 can display the preview screen 327 in the preview frame 322. Comparing the preview screen 327 with the above-mentioned preview screen 326, since the zoom ratio of the preview screen 327 (e.g., 0.9x) is smaller than the zoom ratio of the above-mentioned preview screen 327 (e.g., 1x), the screen ratio of the subject in the preview screen 327 is smaller than the screen ratio of the same subject in the preview screen 326.
[0079] In the above-mentioned zoom ratio switching process, since different cameras on the electronic device 100 support different zoom ratio ranges, for example, the zoom ratio range supported by the main camera is 1x~10x, and the zoom ratio range supported by the wide-angle camera is 0.5x~1x. When the zoom ratio is enlarged or reduced to a certain value, the electronic device 100 needs to switch to the camera to collect the image stream. For example, when the zoom ratio is greater than or equal to 1x, the electronic device 100 can collect the image stream through the main camera, and when the zoom ratio is adjusted to less than 1x (for example, 0.9x), the electronic device 100 can switch from the main camera to use the wide-angle camera to collect the image stream. However, when the electronic device 100 is collecting the image stream, if the electronic device 100 switches the camera, it is easy to cause the image content in the displayed image screen to jump. Therefore, the electronic device 100 can process the image stream when the camera is switched through the spatial alignment transform (SAT) algorithm to achieve a smooth optical zoom effect and prevent the jump of the content in the image screen.
[0080] Among them, when the SAT algorithm processes the image stream when the camera is switched, it needs to process multiple channels of image data from multiple cameras. During the camera switching process, a large amount of image data (for example, 10 to 20 pieces of image data) needs to be managed at the same time. This makes it difficult to manage the image stream. In addition, compared to the image algorithm using image data in YUV format, the SAT algorithm uses image data in universal bandwidth compression (UBWC) format. The SAT algorithm needs to be different in the design of the image format structure. When configuring the SAT algorithm on the electronic device 100, it is necessary to rely on the interface design provided by the system-on-chip platform in the camera abstraction layer.
[0081] like Figure 4As shown, the SAT node of the camera hardware abstraction layer (Camera HAL) of the system-on-chip platform A directly uses the data in the A format provided by the system-on-chip platform A, and transparently transmits it to the spatial alignment transformation algorithm module (SAT AIgo) of the spatial alignment transformation plug-in (SAT Plugin) in the SIT module. SATAIgo then converts the image data in the fixed format provided by the camera abstraction layer into the data required by SAT AIgo. In this way, SAT AIgo must be customized according to the system-on-chip platform A used in the electronic device 100, and the SAT plug-in cannot be decoupled from the system-on-chip platform A. In addition, the image data in the fixed format provided by the camera abstraction layer contains a lot of useless information for SAT AIgo, resulting in a waste of performance and memory of the electronic device 100.
[0082] Therefore, an image data processing method is provided in an embodiment of the present application, which can realize adding an adapter between the camera hardware abstraction layer and the image processing algorithm module, and converting the image data in a fixed format output by the camera hardware abstraction layer into data in a format required by the image algorithm module through the adapter. In this way, the image processing algorithm can be decoupled from the system-on-chip platform, so that the image processing algorithm can realize image data processing without being customized according to the system-on-chip platform.
[0083] Figure 5 A schematic diagram of the architecture of a hardware abstraction layer provided in an embodiment of the present application is shown.
[0084] like Figure 5 As shown, the hardware abstraction layer of the electronic device 100 may include: a camera hardware abstraction layer (Camera HAL) of a system-on-chip platform A or a camera hardware abstraction layer of a system-on-chip platform B, an adapter (Adapter) 530 , and a super image turbo (superimage turbo, SIT) 540 .
[0085] The Camera HAL of the system-on-chip platform A may include a spatial alignment transform node (SAT node) 510, and the spatial alignment transform node 510 may include a transceiver module 511. The transceiver module 511 in the spatial alignment transform node 510 may be used to collect image data in the Camera HAL of the system-on-chip platform A, and transmit it to the spatial alignment transform plug-in 541 in the super image engine 540 through the adapter 530. The transceiver module 511 may also be used to receive the processing result transmitted by the spatial alignment transform plug-in 541 to the Camera HAL of the system-on-chip platform A through the adapter 530.
[0086] The Camera HAL of the system-on-chip platform B may include a spatial alignment transformation session (SAT session) 520. The spatial alignment transformation session 520 may include a transceiver module 521. The transceiver module 521 in the spatial alignment transformation session 520 may be used to collect image data in the Camera HAL of the system-on-chip platform A, and transmit the image data to the spatial alignment transformation plug-in 541 in the super image engine 540 through the adapter 530. The transceiver module 521 may also be used to receive the processing result transmitted by the spatial alignment transformation plug-in 541 to the Camera HAL of the system-on-chip platform B through the adapter 530.
[0087] The adapter 530 may include a conversion module 531 and a conversion module 532. The conversion module 531 may be used to convert the image data of the platform format A1 sent by the transceiver module 511 of the spatial alignment transformation interface 510 into the image data of the private format C1, and give it to the spatial alignment transformation algorithm module 542 for spatial alignment transformation processing. The conversion module 531 may also be used to convert the processing result of the private format C2 after the spatial alignment transformation algorithm module 542 performs spatial alignment transformation processing on the image data of the private format into the processing result of the platform format A2, and return the processing result of the platform format A2 to the transceiver module 511 of the spatial alignment transformation interface 510. The processing result of the private format C2 may include crop information and an affine transformation (warp) matrix. The processing result of the platform format A2 may be image correction and adjustment (ICA) data.
[0088] The conversion module 532 may be used to convert the image data in the platform format B1 sent by the transceiver module 521 of the spatial alignment transformation session 520 into image data in a private format, and provide the image data to the spatial alignment transformation algorithm module 542 for spatial alignment transformation processing. The conversion module 532 may also be used to convert the processing result in the private format C2 after the spatial alignment transformation algorithm module 542 performs spatial alignment transformation processing on the image data in the private format C1 into the processing result in the platform format B2, and return the processing result in the platform format B2 to the transceiver module 521 of the spatial alignment transformation session 520.
[0089] The super image engine 540 may include a spatial alignment transformation plug-in (SAT Plugin) 541. The spatial alignment transformation plug-in 541 may include a spatial alignment transformation algorithm module (SAT AIgo) 542. The spatial alignment transformation algorithm module 542 may perform spatial alignment transformation processing on the image data of the private format C1 transmitted by the adapter 530 to obtain a processing result of the private format C2. The spatial alignment transformation algorithm module 542 may output the processing result of the private format C2 to the conversion module 531 or the conversion module 532.
[0090] In this way, SIT can be decoupled from the system-on-chip platform, so that when SIT is ported across platforms, SAT Plugin and SAT AIgo do not need to be changed and image data processing can still be achieved.
[0091] In some embodiments, the conversion module 531 may be disposed in the camera hardware abstraction layer of the system-on-chip platform A. The conversion module 532 may also be disposed in the camera hardware abstraction layer of the system-on-chip platform B.
[0092] Figure 6 A functional module diagram of an image data processing method in an embodiment of the present application is shown.
[0093] like Figure 6 As shown, the hardware abstraction layer of the electronic device 100 may include: a camera hardware abstraction layer (Camera HAL), an adapter (Adapter) 530, and a super image engine (SIT) 540. Among them, the Camera HAL may include a spatial alignment transform interface (SAT ndoe) 510, and the spatial alignment transform interface 510 may include a transceiver module 511. The adapter 530 may include a conversion module 531. The conversion module 531 may include a data management module 5311 and an output management module 5312. The super image engine 540 may include a spatial alignment transform plug-in (SAT Plugin) 541. The spatial alignment transform plug-in 541 may include a spatial alignment transform algorithm module (SAT AIgo) 542.
[0094] The text description of the spatial alignment transformation interface 510, the transceiver module 511, the super image engine 540, the spatial alignment transformation plug-in 541, and the spatial alignment transformation algorithm module 542 can refer to the aforementioned Figure 5 The illustrated embodiments will not be described in detail here.
[0095] In Camera HAL, the concept of port can be used to uniquely identify an image data stream. Therefore, the platform format A output by the spatial alignment transformation node 510 to the data management module 5311 can include the port number (Port) and the node buffer (Node buffer) structure of the image data. The image data in the private data format can include the camera type (CamType), buffer type (BufferType) and frame (frame) structure of the image data stream.
[0096] The node buffer structure includes the buffer address of the image data, the width and height of the image data, and the data type of the image data, wherein the data type includes YUV data and RAW data.
[0097] The buffer type (BufferType) may be used to indicate the resolution of the image data. For example, the resolution of the image data may be full resolution, 1 / 4 resolution, 1 / 16 resolution, and so on.
[0098] The data management module 5311 may first convert the port number of the image data into a camera identifier (CamID) and a port type (PortType). Then, the data management module 5311 may convert the camera identifier (CamID) into a camera type (CamType), convert the port type into a buffer type (BufferType), and encapsulate the Nodebuffer structure into a frame structure.
[0099] In a possible implementation, the data management module 5311 can directly convert the port number in the image data of the platform format A into the camera type and buffer type (BufferType), encapsulate the Nodebuffer into a frame structure, and obtain the image data in a private format. The data management module 5311 can send the image data in the private format to the spatial alignment transformation algorithm module 542 in the spatial alignment transformation plug-in 541.
[0100] The spatial alignment transformation algorithm module 542 can perform spatial alignment transformation analysis based on the image data of the private format of the two cameras before and after the switching transmitted by the data management module 5311 to obtain the processing result of the private format. The spatial alignment transformation algorithm module 542 can output the processing result of the private format to the output management module 5312 in the conversion module 531. The processing result of the private format includes crop information and an affine transformation (warp) matrix.
[0101] The output management module 5312 may convert the processing result in the private format into the processing result in the platform format A. Specifically, the output management module 5312 may convert the crop information and the warp matrix in the processing result in the private format into the image correction and adjustment (ICA) data in the processing result in the platform format A, and send the ICA data to the spatial alignment transformation interface 510.
[0102] After receiving the ICA data, the spatial alignment transformation interface 510 can provide the ICA data to the ISP ( Figure 6 The IPE module (not shown) Figure 6 The IPE module can use the ICA data to perform spatial alignment transformation processing on the image stream collected by the camera after switching, and complete the smooth zoom switching of multiple cameras. Among them, the spatial alignment transformation processing includes cropping and affine transformation (warp). The IPE module can pass the image stream after spatial alignment transformation to the camera application through the camera driver, the camera hardware abstraction layer and the framework layer. The camera application can send and display the image stream after cropping (crop) and affine transformation (warp).
[0103] An image data processing method provided in an embodiment of the present application is introduced below.
[0104] Figure 7 A flow chart of an image data processing method provided in an embodiment of the present application is shown.
[0105] like Figure 7 As shown, the method may include the following steps:
[0106] S701. Camera 1 sends image stream 1 captured by camera 1 to the ISP.
[0107] S702. ISP performs front-end processing and back-end processing on image stream 1.
[0108] The ISP may perform front-end processing on the image stream 1 through the IFE module, and perform back-end processing on the image stream 1 through the IPE module. The front-end processing may include one or more of color correction, downsampling, de-mosaicing, statistical 3A data, etc. The back-end processing may include one or more of hardware noise reduction, image cropping, software noise reduction, color processing, detail enhancement, etc.
[0109] S703. The ISP sends the image stream 1 processed by the front-end and the back-end to the camera application.
[0110] Among them, the ISP can sequentially drive the image stream 1 processed by the front-end and the back-end through the camera ( Figure 7Not shown), CameraHAL, Camera Service ( Figure 7 ) is sent to the camera application.
[0111] S704. The camera application sends the image stream 1 that has been processed by the front end and the back end for display.
[0112] The image stream 1 processed by the front-end and the back-end includes an image with a first zoom factor taken by the camera 1 , and the first zoom factor is within the zoom factor range of the first camera.
[0113] For example, as mentioned above Figure 3B As shown, the zoom ratio is 1x. The image stream 1 that has been processed by the front end and the back end and sent to the camera application for display may include a preview image 326 captured by the camera 1 .
[0114] S705. The camera application detects that camera 2 is turned on.
[0115] The camera application detects a first operation in which the user sets the zoom ratio to a second zoom ratio, wherein the second zoom ratio is within the zoom ratio range of camera 2. When the camera application detects that the zoom ratio set by the user is not within the zoom ratio range of camera 1 but within the zoom ratio range of camera 2, camera 2 can be turned on. For example, camera 1 can be a main camera, and camera 2 can be a wide-angle camera. The zoom ratio range of the main camera is [1x, 10x], and the zoom ratio range of the wide-angle camera is [0.5x, 1x). When the user sets the zoom ratio to be less than 1x, the camera application determines to switch from the main camera to the wide-angle camera to obtain the image stream.
[0116] S706. The camera application sends an opening instruction to camera 2.
[0117] Among them, the camera application can be in turn through the camera service ( Figure 7 Not shown), CameraHAL, camera driver ( Figure 7 ), and sending the start instruction to camera 2.
[0118] S707. After receiving the start instruction, camera 2 may send image stream 2 captured by camera 2 to the ISP.
[0119] After receiving the start instruction, the camera 2 may collect the image stream 2 through the image sensor in the camera 2. The camera 2 may send the image stream 2 collected by the camera 2 to the ISP for processing.
[0120] S708. ISP performs front-end processing on image stream 2.
[0121] Among them, the ISP can perform front-end processing on the image stream 2 through the IFE module.
[0122] S709. The ISP sends the image stream 2 processed by the front end to the SAT node.
[0123] S710. The SAT node sends the image stream 2 in the first format to the adapter.
[0124] After receiving the image stream 2 processed by the front end, the SAT node can encapsulate the image stream 2 processed by the front end according to the first format specified by the Camera HAL to obtain the image stream 2 in the first format. The first format includes a port number (Port) and a node buffer (Nodebuffer) structure. The node buffer (Nodebuffer) structure may include one or more of the buffer address of the image data, the width and height of the image data, the data type of the image data, and the like. The data type includes any one of YUV data, RAW data, and the like.
[0125] S711. The adapter converts the image stream 2 in the first format into the image stream 2 in the second format.
[0126] For example, the image stream 2 in the first format may include the second image in the first format, and the adapter may convert the first image in the first format into a fourth image in the second format. Therefore, the image stream 2 in the second format includes the fourth image in the second format.
[0127] The second format may include a camera type, a buffer type (BufferType), and a frame (frame) structure. The camera type includes any one of a main camera, a wide-angle camera, and the like. The buffer type (BufferType) is used to indicate the resolution of the image data. For example, the resolution of the image data may be any one of full resolution, 1 / 4 resolution, 1 / 16 resolution, and the like.
[0128] S712. The adapter sends the image stream 2 in the second format to SAT AIgo.
[0129] S713. Camera 1 sends the image stream 3 captured by camera 1 to the ISP.
[0130] S714. ISP performs front-end processing on image stream 3.
[0131] The ISP can perform one or more front-end processing such as color correction, down-sampling, de-mosaicing, and 3A data statistics on the image stream 1 through the IFE module.
[0132] S715. The ISP sends the image stream 3 processed by the front end to the SAT node.
[0133] S716. The SAT node sends the image stream 3 in the first format to the adapter.
[0134] After receiving the image stream 3 processed by the front end, the SAT node may encapsulate the image stream 3 processed by the front end according to the first format specified by the Camera HAL to obtain the image stream 3 in the first format.
[0135] S717. The adapter converts the image stream 3 in the first format into the image stream 3 in the second format.
[0136] For example, the image stream 3 in the first format may include a first image in the first format, and the adapter may convert the first image in the first format into a third image in the second format. Therefore, the image stream 3 in the second format includes the third image in the second format.
[0137] The second format may include a camera type, a buffer type (BufferType) and a frame (frame) structure.
[0138] S718. The adapter sends the image stream 3 in the second format to SAT AIgo.
[0139] S719. SAT AIgo determines a spatial alignment transformation parameter of a third format based on the image stream 2 of the first format and the image stream 3 of the second format.
[0140] The third format includes crop information (cropinfo) and an affine transformation (warp) matrix. The crop information is used to crop the image in the image stream. The warp matrix is used to perform an affine transformation on the image in the image stream.
[0141] S720.SAT AIgo sends the spatial alignment transformation parameters in the third format to the adapter.
[0142] S721. The adapter converts the spatial alignment transformation parameters in the third format into spatial alignment transformation parameters in the fourth format.
[0143] Among them, the fourth format includes image correction adjustment (ICA) data.
[0144] S722. The adapter sends the spatial alignment transformation parameters in the fourth format to the SAT node.
[0145] S723. The SAT node sends the spatial alignment transformation parameters in the fourth format to the ISP.
[0146] S724. ISP performs spatial alignment transformation processing on the image stream 2 after front-end processing based on the spatial alignment transformation parameters of the fourth format to obtain an image stream after spatial alignment transformation.
[0147] Among them, the ISP can perform cropping and affine transformation on the image stream 2 processed by the front end according to the spatial alignment transformation parameters of the fourth format through the IPE module to obtain the image stream after the spatial alignment transformation.
[0148] For example, the image stream 2 after front-end processing may include a fifth image. The ISP can perform spatial alignment transformation processing on the fifth image according to the spatial alignment transformation parameters of the fourth format through the IPE module to obtain a sixth image, and send the sixth image to the camera application for display.
[0149] S725. The ISP sends the image stream after the spatial alignment transformation to the camera application.
[0150] Among them, ISP can drive the image stream after spatial alignment transformation through the camera ( Figure 7 Not shown), CameraHAL, Camera Service ( Figure 7 ) is sent to the camera application.
[0151] S726. The camera application sends the image stream after the spatial alignment transformation.
[0152] In the embodiment of the present application, camera 1 may be referred to as a first camera, and camera 2 may be referred to as a second camera. In one example, camera 1 may be a main camera, and camera 2 may be a wide-angle camera. In another example, camera 1 may be a wide-angle camera, and camera 2 may be a main camera.
[0153] By providing an image data processing method in the embodiment of the present application, an adapter can be added between the camera hardware abstraction layer and the image processing algorithm module, and the image data in a fixed format output by the camera hardware abstraction layer can be converted into data in a format required by the image processing algorithm through the adapter. In this way, the image processing algorithm can be decoupled from the camera hardware abstraction layer, so that the image processing algorithm can be processed without being customized according to the system-on-chip platform.
[0154] Figure 8 A schematic diagram of the architecture of a hardware abstraction layer provided in another embodiment of the present application is shown.
[0155] like Figure 8As shown, the hardware abstraction layer of the electronic device 100 may include: a camera hardware abstraction layer (Camera HAL) of the system-on-chip platform A, an adapter (Adapter) 530 , and a super image turbo (superimage turbo, SIT) 540 .
[0156] The Camera HAL of the system-on-chip platform A may include a spatial alignment transform node (SAT node) 510 and a background blur node 512, etc. The spatial alignment transform node 510 may include a transceiver module 511. The background blur node 512 may include a transceiver module 513.
[0157] The transceiver module 511 in the spatial alignment transformation interface 510 can be used to collect image data in the Camera HAL of the system-on-chip platform A, and transmit it to the spatial alignment transformation plug-in 541 in the super image engine 540 through the adapter 530. The transceiver module 511 can also be used to receive the processing result transmitted by the super image engine 540 to the Camera HAL of the system-on-chip platform A through the adapter 530.
[0158] The transceiver module 513 in the background blur node 512 can be used to collect image data in the Camera HAL of the system-on-chip platform A, and transmit it to the background blur plug-in 543 in the super image engine 540 through the adapter 530. The transceiver module 513 can also be used to receive the processing result transmitted by the background blur plug-in 543 to the Camera HAL of the system-on-chip platform A through the adapter 530.
[0159] The adapter 530 may include a conversion module 531 and a conversion module 533. The conversion module 531 may be used to convert the image data of the platform format A1 sent by the transceiver module 511 of the spatial alignment transformation interface 510 into the image data of the private format C1, and give it to the spatial alignment transformation algorithm module 542 for spatial alignment transformation processing. The conversion module 533 may also be used to convert the processing result of the private format C2 after the spatial alignment transformation algorithm module 542 performs spatial alignment transformation processing on the image data of the private format into the processing result of the platform format A2, and return the processing result of the platform format A2 to the transceiver module 511 of the spatial alignment transformation interface 510. The processing result of the private format may include crop information and an affine transformation (warp) matrix. The processing result of the platform format A2 may be image correction and adjustment (ICA) data.
[0160] The conversion module 533 may be used to convert the image data in the platform format A1 sent by the transceiver module 513 of the background blur node 512 into the image data in the private format D1, and provide it to the background blur algorithm module 544 for background blur processing. The conversion module 533 may also be used to convert the processing result in the private format D2 after the background blur algorithm module 544 performs spatial alignment transformation processing on the image data in the private format D1 into the processing result in the platform format A3, and return the processing result in the platform format A3 to the transceiver module 513 of the background blur node 512.
[0161] The super image engine 540 may include multiple image processing algorithm plug-ins, wherein the multiple image processing algorithm plug-ins include a spatial alignment transform plug-in (SAT Plugin) 541 and a background blur plug-in 543. The spatial alignment transform plug-in 541 may include a spatial alignment transform algorithm module (SAT AIgo) 542. The background blur plug-in 543 may include a background blur algorithm module 544.
[0162] The spatial alignment transformation algorithm module 542 can perform spatial alignment transformation processing on the image data of the private format C1 transmitted by the conversion module 531 in the adapter 530 to obtain the processing result of the private format C2. The spatial alignment transformation algorithm module 542 can output the processing result of the private format C2 to the conversion module 531.
[0163] The background blur algorithm module 544 can perform background blur processing based on the image data in the private format D1 transmitted by the conversion module 533 in the adapter 530 to obtain the processing result in the private format D2. The background blur algorithm module 544 can output the processing result in the private format D2 to the conversion module 533.
[0164] In some embodiments, the conversion module 531 and the conversion module 533 may also be set in the camera hardware abstraction layer of the system-on-chip platform A.
[0165] By providing an image data processing method in the embodiment of the present application, different conversion modules can be set in the adapter for different image processing algorithms, so as to convert the image data in a fixed format output by the camera hardware abstraction layer into data in the format required by different image processing algorithms. In this way, the image processing algorithm can be decoupled from the camera hardware abstraction layer, so that the image processing algorithm can be customized according to the system-on-chip platform without having to process the image data.
[0166] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0167] The embodiments of the present application also provide a computer program product. When the computer program product is executed on an electronic device, the electronic device can implement the steps in the above-mentioned various method embodiments.
[0168] The embodiment of the present application also provides a chip system, the chip system includes a processor, the processor is coupled to a memory, and the processor executes a computer program stored in the memory to implement the steps of any method embodiment of the present application. The chip system can be a single chip or a chip module composed of multiple chips.
[0169] The term "user interface (UI)" in the specification and drawings of this application refers to the medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on the terminal device, and finally presented as content that the user can recognize, such as pictures, text, buttons and other controls. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scroll bars, pictures and text. The properties and contents of controls in the interface are defined by tags or nodes, such as XML through <textview> 、 <imgview> 、 <videoview>The controls contained in the interface are specified by nodes such as <head> and <body>. A node corresponds to a control or attribute in the interface. After being parsed and rendered, the node is presented as user-visible content. In addition, many applications, such as hybrid applications, usually also contain web pages in their interfaces. A web page, also known as a page, can be understood as a special control embedded in the application interface. A web page is source code written in a specific computer language, such as hypertext markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed as user-recognizable content by a browser or a web page display component with similar functions to a browser. The specific content contained in a web page is also defined by tags or nodes in the web page source code. For example, HTML is defined by <body> tags or nodes in the web page source code. 、 、 <video> 、 <canvas>To define the elements and attributes of a web page.
[0170] The most common form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operation that is displayed in a graphical manner. It can be an icon, window, control or other interface element displayed on the display screen of an electronic device, where a control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
[0171] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk), etc.
[0172] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
[0173] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.< / canvas> < / video> < / videoview> < / imgview> < / textview>
Claims
1. A method for processing image data, It is characterized in that The invention is applied to an electronic device, wherein the electronic device has a plurality of cameras and an image signal processor; the plurality of cameras include a first camera and a second camera, the zoom magnification range of the first camera is different from the zoom magnification range of the second camera, the electronic device runs an operating system, the operating system includes a hardware abstraction layer, the hardware abstraction layer includes a camera hardware abstraction layer, an adapter and a space alignment transformation algorithm module; the method includes: The adapter converts a first image in a first format output by the camera hardware abstraction layer into a third image in a second format, and converts a second image in the first format output by the camera hardware abstraction layer into a fourth image in the second format; wherein the first image is taken by the first camera, the second image is taken by the second camera, and the first format is different from the second format; Determining, by the spatial alignment transformation algorithm module, spatial alignment transformation parameters of a third format based on the third image in the second format and the fourth image in the second format; converting, by the adapter, the spatial alignment transformation parameters in the third format into spatial alignment transformation parameters in a fourth format, the third format being different from the fourth format; Sending the spatial alignment transformation parameters of the fourth format to the image signal processor through the camera hardware abstraction layer; Performing a spatial alignment transformation process on the fifth image captured by the second camera based on the spatial alignment transformation parameters in the fourth format by an image signal processor to obtain a sixth image after the spatial alignment transformation; The sixth image is displayed.
2. The method according to claim 1, It is characterized in that Before acquiring the first image captured by the first camera and the second image captured by the second camera through the camera hardware abstraction layer, the method further includes: Displaying an image captured by the first camera at a first zoom ratio, where the first zoom ratio is within a zoom ratio range of the first camera; receiving a first operation of setting the zoom ratio to a second zoom ratio by a user, wherein the second zoom ratio is within a zoom ratio range of the second camera; The acquiring, through the camera hardware abstraction layer, a first image captured by the first camera and a second image captured by the second camera specifically includes: In response to the first operation, a first image captured by the first camera and a second image captured by the second camera are acquired through the camera hardware abstraction layer.
3. The method according to claim 1 or 2, It is characterized in that The first format includes a port number and a node buffer structure, wherein the node buffer structure includes a buffer address of the image data, a width and height of the image data, and a data type of the image data, wherein the data type includes YUV data or RAW data; wherein the port number of the first image is different from the port number of the second image.
4. The method according to claim 1 or 2, It is characterized in that The second format includes a camera type, a buffer type and a frame structure; wherein the buffer type is used to indicate the resolution of the image data, and the camera type of the third image is different from the camera type of the fourth image.
5. The method according to claim 1 or 2, It is characterized in that The third format includes clipping information and an affine transformation matrix.
6. The method according to claim 1 or 2, It is characterized in that The fourth format includes image correction adjustment data.
7. The method according to claim 1 or 2, It is characterized in that The camera hardware abstraction layer includes a space alignment transformation interface; The step of converting the first image in the first format output by the camera hardware abstraction layer into a third image in the second format, and converting the second image in the first format output by the camera hardware abstraction layer into a fourth image in the second format, specifically includes: The first image in the first format output by the spatial alignment transformation interface is converted into a third image in the second format through the adapter, and the second image in the first format output by the spatial alignment transformation interface is converted into a fourth image in the second format.
8. The method according to claim 1, It is characterized in that Before converting, by the adapter, a first image in a first format output by the camera hardware abstraction layer into a third image in a second format, and converting the second image in the first format output by the camera hardware abstraction layer into a fourth image in the second format, the method further includes: The first image and the second image are front-end processed by the image signal processor.
9. The method according to claim 1, It is characterized in that The performing spatial alignment transformation processing on the fifth image captured by the second camera based on the spatial alignment transformation parameters in the fourth format by an image signal processor to obtain a sixth image after spatial alignment transformation specifically includes: Performing front-end processing on the fifth image captured by the second camera by the image signal processor; The image signal processor performs spatial alignment transformation processing on the fifth image after front-end processing based on the spatial alignment transformation parameters to obtain the sixth image after spatial alignment transformation.
10. The method according to claim 8 or 9, It is characterized in that The front-end processing includes one or more of color correction, down sampling, de-mosaicing, and statistical 3A data.
11. An electronic device, It is characterized in that It comprises a plurality of cameras, one or more processors and one or more memories; wherein the plurality of cameras, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store a computer program, so that when the one or more processors execute the computer program, the method as described in any one of claims 1-10 is executed.
12. An electronic device, It is characterized in that The method comprises one or more functional modules, wherein the one or more functional modules are used to execute the method according to any one of claims 1 to 10.
13. A chip, wherein the chip is applied to an electronic device. It is characterized in that The chip comprises a processing circuit and an interface circuit, wherein the interface circuit is used to receive instructions and transmit the instructions to the processing circuit, and the processing circuit is used to run the instructions to execute the method according to any one of claims 1-10.
14. A computer-readable storage medium storing a computer program, It is characterized in that When the computer program is run on a processor of an electronic device, the method according to any one of claims 1 to 10 is executed.
Citation Information
Patent Citations
Image coding method, storage medium and electronic equipment
CN113554718A
Image processing method and system, electronic equipment and storage medium
CN113727035A
Image processing method, electronic equipment and storage medium
CN114125284A
Image processing circuit, image processing method, electronic device, and readable storage medium
CN114286007A
Camera parameter configuration method and electronic equipment
CN115550541A
