Image generation method, medium and electronic device

By acquiring and analyzing the shooting parameters, the image format output by the image sensor is automatically adjusted, which solves the problem of image quality differences in different scenarios and improves image quality and user experience.

CN118450234BActive Publication Date: 2024-12-20HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311778556.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2024-12-20
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

The quality of images taken by users in different environments and scenes varies greatly, which cannot meet user needs. It is difficult for the existing technology to automatically adjust image parameters to improve image quality.

Method used

By obtaining the shooting parameters of the shooting device, such as shooting mode, zoom ratio and ambient light parameters, determine the corresponding image format and send output instructions to the image sensor to output image data suitable for the current scene, including using the image format configuration table and The status identification bit determines the image data format.

Benefits of technology

Generate the best-effect images in different scenarios, which improves image quality, reduces the time for users to debug parameters, and improves the user's photography experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118450234B_ABST
    Figure CN118450234B_ABST
Patent Text Reader

Abstract

The present application is applied to the field of terminal technology, and provides an image generation method, medium, and electronic device, wherein the method includes: according to the correspondence between preset shooting parameters and image data formats, the image signal of the image sensor is output as image data of different formats under different shooting environments, for example, output as a Bayer image, a pixel merged image, or a four-in-one Bayer image. The shooting parameters may be one or more of the shooting parameters such as shooting mode, zoom factor, ambient light parameters, etc. Furthermore, the terminal device can determine the corresponding shooting environment according to the current shooting parameters to control the camera to output image data of different formats. In this way, the best images are generated in different scenes, the image quality is improved, the user is prevented from spending time debugging the image parameters, and the user's photo-taking experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to an image generating method, medium and electronic device. Background Art

[0002] As the performance of electronic equipment hardware and software continues to improve, the camera function of electronic devices such as mobile phones is becoming increasingly powerful, and users' demand for taking pictures is increasing. However, due to the differences in the environment and scenes in which users use electronic devices to take pictures, for example, the ambient light in different scenes is different, the quality of the captured images also varies greatly, and the image quality often cannot meet the user's requirements. Summary of the invention

[0003] In view of this, the present application provides an image generating method, a medium and an electronic device.

[0004] In a first aspect, an image generation method is provided, the method comprising: first obtaining a first shooting parameter used by an image sensor of a shooting device to collect a first image signal; then determining that the first shooting parameter corresponds to a first image format, and sending a first output instruction to the image sensor, wherein the first output instruction is used to instruct the image sensor to output the collected first image signal as first image data having a first image format. However, corresponding to obtaining a second shooting parameter used by the image sensor of the shooting device to collect a second image signal; determining that the second shooting parameter corresponds to a second image format, and sending a second output instruction to the image sensor, wherein the second output instruction is used to instruct the image sensor to output the collected second image signal as second image data having a second image format.

[0005] In the above scheme, the electronic device can control the camera to output image data of different formats according to the current shooting parameters. For example, the first shooting parameter and the second shooting parameter can be different shooting parameters, and then the corresponding different image formats can be determined in different scenes, and then the best image in the current scene is generated, thereby improving the overall image quality, avoiding the user spending time debugging the image parameters, and improving the user's photo taking experience.

[0006] In combination with the first aspect, in some implementations, the first shooting parameter and the second shooting parameter include one or more of a shooting mode, a zoom factor, and an ambient light parameter.

[0007] In the above scheme, the electronic device can determine the corresponding shooting environment according to the current shooting parameters, such as the shooting mode, and determine the shooting environment's requirements for clarity and / or sensitivity according to the zoom factor and ambient light parameters, and then control the camera to output image data in different formats. The best images can be generated in different scenes, which improves the image quality, avoids users spending time debugging image parameters, and improves the user's photo-taking experience. In some implementations, the shooting parameters may also include the exposure rate set by the user, whether to add a filter, etc.

[0008] In combination with the first aspect, in some implementations, the shooting mode included in the first shooting parameter is the normal mode or the live mode, the shooting mode included in the second shooting parameter is the portrait mode or the large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format; or, the shooting mode included in the first shooting parameter is the video mode, the shooting mode included in the second shooting parameter is the normal mode, the live mode, the portrait mode or the large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format.

[0009] In the above scheme, the electronic device can determine the corresponding image data format according to the shooting mode. For example, corresponding to the shooting mode of "normal" or "live", it can be determined to output an image with high sensitivity and clarity, such as a Bayer image. Furthermore, under the condition of ensuring a certain clarity, it can be ensured that the phenomenon of uneven brightness in the image is reduced. Corresponding to the shooting mode of "portrait" or "large aperture", it can be determined to output an image with higher clarity, such as a four-in-one Bayer image, to ensure that the output image has high clarity.

[0010] In combination with the first aspect, in some implementations, the zoom factor included in the first shooting parameter is smaller than the zoom factor included in the second shooting parameter, and the number of pixels in the first image format is smaller than the number of pixels in the second image format.

[0011] In the above scheme, for scenes with zoom, it is necessary to output a full-size image, such as a four-in-one Bayer image and a Bayer image, so as to complete the digital zoom and ensure a certain clarity after the digital zoom.

[0012] In combination with the first aspect, in some implementations, an ambient light parameter included in the first shooting parameter is smaller than an ambient light parameter included in the second shooting parameter, and a brightness contrast parameter of the first image format is higher than a brightness contrast parameter of the second image format.

[0013] In the above scheme, for a darker brightness environment, an image with better brightness presentation capability, such as a pixel-merged image, can be determined. For a medium-high brightness environment, a Bayer image or a four-in-one Bayer image can be determined to be output. Thus, it is ensured that in a darker scene, the outline of the object can be better presented in the image.

[0014] In combination with the first aspect, in some implementations, corresponding to the first image format being a Bayer image format, the second image format is a four-in-one Bayer image format or a pixel-merged image format; corresponding to the first image format being a four-in-one Bayer image format, the second image format is a Bayer image format or a pixel-merged image format; corresponding to the first image format being a pixel-merged image format, the second image format is a Bayer image format or a four-in-one Bayer image format.

[0015] In the above scheme, both the four-in-one Bayer image and the Bayer image are full-size, with more pixels, and are more suitable for digital zoom scenes, while the clarity of the four-in-one Bayer image is higher than that of the Bayer image. The clarity of the pixel-merged image is also higher, but the number of pixels is small, and it is not suitable for zoom scenes.

[0016] In combination with the first aspect, in some implementations, an image format configuration table is obtained, the image format configuration table including a correspondence between shooting modes, capability values, and image formats; based on the image format configuration table, a first capability value corresponding to the first shooting mode in the first shooting parameter is determined; corresponding to the first capability value being a first preset value, the first image format is determined to be an image format corresponding to the first shooting mode in the image format configuration table; corresponding to the first capability value not being the first preset value, the first image format is determined to be a preset image format.

[0017] In the above scheme, if the corresponding capability value is a preset value, it means that the corresponding image data format needs to be selected according to the image format configuration table. If the corresponding capability value is not a preset value, the image can be output according to the default image data format. For example, the capability values ​​for scenes such as "normal", "live", "portrait", and "large aperture" can be preset values. The electronic device can determine the corresponding shooting environment based on the current shooting parameters, and then control the camera to output image data in different formats. The best images can be generated in different scenes, which improves the image quality, avoids users spending time debugging image parameters, and improves the user's photo-taking experience.

[0018] In combination with the first aspect, in some implementations, based on the first zoom factor and the first ambient light parameter in the first shooting parameter, a first identification bit corresponding to the first shooting parameter is determined, wherein the first identification bit is used to indicate whether the scene corresponding to the first shooting parameter is a zoom scene; based on the first capability value being a first preset value and the first identification bit being a second preset value, the first image format is determined to be an image format corresponding to the first shooting mode in the configuration table; based on the first capability value being a first preset value and the first identification bit being not the second preset value, the first image format is determined to be a preset image format.

[0019] In the above scheme, when the electronic device determines that the state identification bit is a digital zoom scene, it will determine the corresponding image data format according to the settings in the image format configuration table. If not, it means that the scene can output the image in the default image data format. The state identification bit is used to determine whether it is a digital zoom scene, and then the requirements of the shooting environment for clarity and / or sensitivity are determined, and then the camera is controlled to output image data in different formats. The best image can be generated in different scenes, which improves the image quality, avoids users spending time debugging image parameters, and improves the user's photo-taking experience.

[0020] In combination with the first aspect, in some implementations, the electronic device includes a hardware abstraction layer, the hardware abstraction layer includes a camera platform architecture, and the camera hardware interface in the camera platform architecture and the camera development kit chi-cdk include an image format configuration table.

[0021] In combination with the first aspect, in some implementations, the electronic device also includes an application layer, the camera platform architecture also includes a camx interface, and the chi-cdk is used to: obtain a first shooting mode and a first zoom factor of the camera application from the application layer, and obtain a first ambient light parameter from the camx interface, and determine a first image format based on the first shooting mode, the first zoom factor, and the first ambient light parameter, and send a first output instruction to the image sensor through the camx interface.

[0022] In the above solution, chi-cdk determines the format that the image sensor needs to output, and then sends instructions to the image sensor through the camx interface, so that the image sensor can output image data in different formats. It can generate the best images in different scenes, improve image quality, avoid users spending time debugging image parameters, and improve user photography experience.

[0023] In a second aspect, the present application provides an electronic device comprising a processor and an image sensor, wherein the image sensor is used to capture image signals and, based on output instructions sent by the processor, output image data corresponding to the image signals in an image format indicated by the output instructions; the processor is used to obtain shooting parameters used by the image sensor to capture image signals, determine the image format corresponding to the shooting parameters, and send output instructions to the image sensor.

[0024] In combination with the second aspect, in some implementations, the processor determines the image format of image data output by the image sensor in the following manner: corresponding to the shooting parameter matching the first shooting parameter in the image format configuration table, determining that the output format of the image data is the first image format corresponding to the first shooting parameter in the image format configuration table; corresponding to the shooting parameter matching the second shooting parameter in the image format configuration table, determining that the output format of the image data is the second image format corresponding to the second shooting parameter in the image format configuration table.

[0025] In combination with the second aspect, in some implementations, the shooting mode included in the first shooting parameter is normal mode or live mode, the shooting mode included in the second shooting parameter is portrait mode or large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format; or, the shooting mode included in the first shooting parameter is video mode, the shooting mode included in the second shooting parameter is normal mode, live mode, portrait mode or large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format.

[0026] In conjunction with the second aspect, in some implementations, the processor is one or more of an image signal processor, a central processing unit, a digital signal processor, and a graphics processor.

[0027] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on an electronic device, the method described in the first aspect is executed.

[0028] In a fourth aspect, the present application provides a computer program product, which includes computer instructions. When the computer program product is executed by a computing device, the computing device performs the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for describing the embodiments.

[0030] Figure 1 is a schematic diagram of an interface of a camera application provided in an embodiment of the present application;

[0031] Figure 2is a structural schematic diagram of a camera provided in an embodiment of the present application;

[0032] Figure 3A It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0033] Figure 3B It is a schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;

[0034] Figure 4A It is a schematic flow chart of a method for determining an image data format in an image generation method provided in an embodiment of the present application;

[0035] Figure 4B It is a flowchart of an image generation method provided in an embodiment of the present application;

[0036] Figure 5 is a flowchart of another image generation method provided in an embodiment of the present application;

[0037] Figure 6 is a schematic diagram of a configuration table provided in an embodiment of the present application;

[0038] Figure 7 It is a structural schematic diagram of an image generating device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] Illustrative embodiments of the present application include, but are not limited to, image generation methods, media, and electronic devices.

[0040] As mentioned above, users can use electronic devices with cameras such as mobile phones to take photos. The following takes mobile phone 10 as an example to introduce the interface of the camera application of some electronic devices in some embodiments, such as Figure 1 As shown in (A) in FIG. 1 , the camera application interface of the mobile phone 10 may include a preview screen area 11 , a zoom factor area 12 , a shooting mode area 13 , an album button 14 , a shutter button 15 , and a camera switch button 16 .

[0041] The zoom factor area 12 provides a variety of optional zoom factors, including but not limited to 0.6x, 1x, and 2x. For example, based on the user selecting a zoom factor of "1.0x", the preview image area 11 is a picture that can be captured at a zoom factor of 1x. Based on the user selecting other zoom factors, the camera can capture objects at different distances. For example, based on the user adjusting the zoom factor to "2.0x", the preview image area 11 is a picture that can be captured at a zoom factor of 1x. Figure 1 As shown in (B), the preview screen area 12 of the mobile phone 10 is the effect of enlarging the screen to 2 times.

[0042] It should be understood that the camera can achieve the zoom function (zoom) by using technologies such as optical zoom and / or digital zoom. Among them, optical zoom can be achieved by changing the lens type. For example, the mobile phone 10 may include multiple cameras such as a short-focus (wide-angle) camera, a medium-focus camera (main camera) and a telephoto camera. Digital zoom technology can also be called lossless zoom (in sensor zoom, ISZ). ISZ generates a full-size image, then crops the picture, and finally increases the area of ​​the pixels in the cropped picture and / or inserts pixel values ​​in the cropped picture, thereby achieving a zoom effect of enlarging or reducing the captured picture.

[0043] The shooting mode area 13 provides a variety of optional shooting modes, including but not limited to shooting modes such as "large aperture", "night scene", "portrait", "photo", "video" and "multi-lens video". The mobile phone 10 can adopt different setting parameters and image compensation parameters for different shooting modes, such as aperture size, shutter speed, sensitivity (ISO), focus mode, white balance, exposure compensation, etc. It should be understood that in some embodiments, the electronic device can also have other shooting modes, such as "live photo", "slow motion" or "panorama", etc., and this application does not make specific restrictions on this.

[0044] The mobile phone 10 may compensate the captured image by processing it through an image signal processor (ISP) or a digital signal processor (DSP).

[0045] For example, Figure 2 The schematic diagram of the structure of a camera 20 is shown, and the camera 20 can be set in an electronic device, such as a mobile phone 10, or can be independent of the electronic device and connected to the electronic device via Bluetooth or wired connection. The camera 20 can also be called a shooting device.

[0046] The camera 20 includes a lens 21, an image sensor (hereinafter referred to as sensor) 22 and an ISP 23. The sensor 22 is specifically a photosensitive element, which can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.

[0047] In some embodiments, ISP23 may be built into camera 20, or may be a module disposed outside camera 20. ISP23 may also be integrated with sensor22, which is not specifically limited in the present application.

[0048] The process of capturing static images or videos by the camera 20 includes: the object generates an optical image through the lens 21 and is projected onto the sensor 22. The photosensitive element of the sensor 22 converts the light signal into image data, and then transmits the image data to the ISP 23 for processing. The unprocessed digital image signal of the ISP 23 can also be called raw data. The ISP 23 can also output 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.

[0049] In some cases, when the lens 21 focuses light on the sensor 22, light attenuation occurs, especially the light at the edge of the lens 21 is attenuated the most, which is called lens shading. Furthermore, due to the optical characteristics of the lens 21 and the sensor 22, the brightness of the image output by the ISP 23 may be uneven, for example, the center of the image is brighter, while the edge is darker.

[0050] ISP23 or DSP will perform lens shading correction (LSC) on the image data in response to the above-mentioned lens shading phenomenon. For example, first obtain an ideal flat illumination image created by the software, and then use lens 21 and sensor 22 to capture an image under uniform illumination conditions as a reference image for correction. Based on the ideal flat illumination image and the reference image, a correction table is generated, and each element in the table represents the brightness correction coefficient of the corresponding pixel position. Furthermore, during the shooting process, ISP23 or DSP will use this correction table to perform brightness correction on the output image.

[0051] In actual applications, the same manufacturer will use the same correction table for the same type of lens and sensor to overcome the lens shadow problem. However, in the actual production and assembly process of the camera, there may be production differences between the modules in the camera, and there may be differences in the installation angles of the lens 21 and the sensor 22. As a result, the ISP 23 cannot obtain an image with a good brightness correction effect even if it uses the correction table.

[0052] In addition, during the shooting process, the angle of the incident light has different effects on the lens shadow phenomenon. For example, when the light is incident from different angles, the light attenuation at the edge of the lens will be more serious, resulting in a more obvious shadow effect. In particular, when there is movement during the shooting process, the lens shadow phenomenon will be more obvious. For example, when the user holds the mobile phone 10 and moves while shooting, the uneven brightness of the image will be more obvious under light from different angles.

[0053] It should be understood that the above only uses the lens shadow phenomenon as an example to illustrate the correction method of ISP23. In actual applications, there are other phenomena in the lens 21 and the sensor 22, and ISP23 can also perform other corresponding corrections, such as black level correction (BLC), green balance (GB), etc.

[0054] In summary, due to the differences in the calibration parameters and manufacturing processes of each module in the camera, there will be large differences in the quality of the images output by the camera. For example, the image brightness distribution is uneven, and the brightness unevenness is different in different shooting environments.

[0055] In addition, the formats of image data that sensor22 can output include Bayer raw, quad Bayer raw (also called quad raw or quard raw), and images output after pixel binning (binning images). Bayer raw and quad raw are full size images, and quad draw can be reprocessed (remosaic) to restore to a Bayer format image with higher definition (also called remosaic image). The binning image combines the adjacent pixel readout values ​​in the full size image, adds the induced charges of adjacent or same color pixels, and reads out in an analog pixel mode.

[0056] Among them, quad raw and bayer raw are both full size, with more pixels, and are more suitable for ISZ scenes, and the clarity of quad raw is higher than that of bayer raw. Binning also has higher clarity, but has fewer pixels, and is not suitable for ISZ scenes.

[0057] At present, sensor22 usually only outputs one format of image data in different scenarios. For example, in ISZ scenarios, that is, when the zoom factor is "2×" or above, only quad raw or bayer raw images are output. Although quadraw has high clarity, its photosensitivity is poor, that is, the image brightness presentation ability is poor, which makes the uneven brightness caused by the calibration parameters of the module and the manufacturing process more obvious. If only bayer raw images can be output, the image clarity is low and cannot meet scenes with high image clarity requirements. Furthermore, in different shooting scenarios, there are problems of poor image quality such as uneven brightness or low clarity.

[0058] Even in order to achieve a certain degree of shooting effect, some electronic devices also provide the adjustment function of multiple setting parameters such as white balance and exposure compensation. However, this process requires users to manually adjust and combine repeatedly. The whole process is cumbersome, time-consuming, and inaccurate, which reduces the user experience. In addition, the adjustment of setting parameters requires high professionalism, and most users find it difficult to get satisfactory photos by adjusting the setting parameters.

[0059] In order to solve the above-mentioned problem of large differences in image quality, the present application provides an image generation method, in which the processor of the electronic device can control the sensor 22 to output image data of different formats under different shooting environments according to the correspondence between the preset shooting parameters and the image data format, such as outputting bayer raw, binning image or quad raw image, etc. Specifically, the electronic device obtains the shooting parameters of the camera 20 when shooting, such as one or more of the shooting parameters such as shooting mode, zoom factor, ambient light parameters, etc., and then sends an instruction to output the image data of the corresponding format to the sensor 22 according to the shooting parameters, so that the sensor 22 can output the image data of different formats according to different shooting environments.

[0060] For example, corresponding to scenes with higher requirements for clarity and / or there is a zoom situation, such as the shooting mode is "portrait" or "large aperture" and / or the zoom factor is within "2×" to "4×", you can choose to output image data with higher clarity, such as quad raw images, to ensure that the output image has higher clarity.

[0061] For scenes with high requirements for photosensitivity and / or when there is zoom, for example, when the camera mode is "normal" or "livephoto", and / or the zoom factor is "4×" or above, image data with better photosensitivity, such as bayer raw images, can be used. Furthermore, while ensuring a certain clarity, it can be ensured that the phenomenon of uneven brightness in the image is reduced.

[0062] For scenes with high requirements for clarity, high sensitivity or high image frame rate, such as when the camera mode is "video", the zoom factor is "1×" and / or the ambient light is low, you can choose to output image data with high sensitivity, such as binned images, to ensure that the brightness unevenness in the image is reduced. In addition, since binned images merge pixels, the amount of image data is reduced and the frame rate of the output image can be increased.

[0063] It should be understood that the shooting parameters may also include the exposure rate set by the user, whether to add a filter, etc. For example, the user sets a higher exposure rate, and then can choose to output a binned image, etc. The format of the image data may also include 4K ultra high definition (UHD) images, nine-in-one binned images (nona pixel), or 3F raw images. This application does not specifically limit the types of shooting parameters and the types of image data formats.

[0064] In some embodiments, the terminal device can pre-store the correspondence between multiple shooting parameters and image data formats, for example, generate an extensible markup language (XML) configuration table of the correspondence, the XML configuration table may include capability values ​​corresponding to different shooting modes, identification bits corresponding to different zoom factors and / or ambient light parameters, and image data formats corresponding to different capability values ​​and identification bits.

[0065] After the camera application is started, the processor of the terminal device, such as ISP23 or central processing unit (CPU), can obtain the shooting mode and zoom ratio and other parameters selected by the user in the camera application, and / or read the ambient light parameters of the current shooting through sensor22 or ambient light sensor. Then the processor of the terminal device can determine the capability value and identification bit corresponding to the current shooting environment according to the shooting parameters such as shooting mode, zoom ratio, ambient light parameters, etc., and determine the corresponding image data format in the XML configuration table. Then, the sensor can be controlled to output image data of the corresponding format.

[0066] In other embodiments, the terminal device may also send the shooting parameters to other processors of the terminal device or processors of other devices for processing. The other processors determine the image data format corresponding to the shooting parameters and send instructions to sensor 22 to output the corresponding image data format.

[0067] Furthermore, based on the above-mentioned image generation method, the terminal device can determine the corresponding shooting environment and the shooting environment's requirements for clarity and / or photosensitivity according to the current shooting parameters, and control the camera to output image data in different formats. Furthermore, the best image can be generated in different scenes, which improves the image quality, avoids the user spending time debugging the image parameters, and improves the user's photo-taking experience.

[0068] The terminal device may be any device with a camera, such as the aforementioned mobile phone 10, or a tablet computer, a wearable device, a vehicle-mounted device, an AR / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or a dedicated camera (such as a SLR camera, a card camera), etc. The present application does not impose any specific restrictions on the type of the terminal device.

[0069] The following first introduces the terminal device involved in the embodiments of the present application.

[0070] See also Figure 3A , Figure 3A A schematic structural diagram of an exemplary terminal device 100 provided in an embodiment of the present application is shown.

[0071] The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include an ambient light sensor 180A, etc.

[0072] It is understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split 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.

[0073] 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 processing unit (GPU), an ISP, a controller, a memory, a video codec, a DSP, a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0074] The controller may be the nerve center and command center of the terminal device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0075] 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.

[0076] In some embodiments of the present application, the memory in the processor 110 may store a correspondence between shooting parameters and image data formats, such as an XML configuration table. The processor 110 may obtain parameters such as the shooting mode and zoom ratio selected by the user in the camera application, and / or read the ambient light parameters of the current shooting through sensor 22 or the ambient light sensor 180A. Then, the capability value and identification bit corresponding to the current shooting environment are determined according to the shooting parameters such as the shooting mode, zoom ratio, and ambient light parameters, and the corresponding image data format is determined in the XML configuration table. Furthermore, the sensor 22 may be controlled to output an image in the corresponding image data format.

[0077] The charging management module 140 is used to receive charging input from a charger, where the charger can be a wireless charger or a wired charger.

[0078] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0079] The wireless communication function of the terminal device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0080] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover a single or multiple communication frequency bands.

[0081] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the terminal device 100. The wireless communication module 160 can provide solutions for wireless communications including UWB, wireless local area networks (WLAN) (such as wireless fidelity (WiFi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared technology (IR), etc., applied to the terminal device 100.

[0082] The terminal 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, which execute program instructions to generate or change display information.

[0083] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), etc. In some embodiments, the terminal device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0084] In some embodiments of the present application, the display screen 194 displays the interface content currently output by the system. For example, the interface content is the interface provided by the camera application. For details, please refer to Figure 1 (A) and Figure 1(B) and its related description.

[0085] The terminal device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0086] 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, brightness, and skin color 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.

[0087] 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 CCD or CMOS phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it 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 terminal device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0088] In some embodiments of the present application, the structure of the camera 193 can also refer to the aforementioned Figure 2 The related descriptions will not be repeated here.

[0089] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the terminal device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

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

[0091] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 100.

[0092] The internal memory 121 may be used to store computer executable program codes, wherein the executable program codes include instructions.

[0093] The terminal device 100 can implement audio functions such as music playing and recording through the audio module 170 and the application processor.

[0094] The ambient light sensor 180A is used to sense the ambient light brightness. The terminal device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. The ambient light sensor 180A can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180A can also cooperate with the proximity light sensor to detect whether the terminal device 100 is in a pocket to prevent accidental touch.

[0095] In some embodiments of the present application, the ambient light sensor 180A may also be used to obtain ambient light parameters of the current shooting environment, and then the processor may be used to control the sensor to output image data in different formats.

[0096] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be connected to and separated from the terminal device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195.

[0097] Figure 3B A software structure block diagram of the terminal device 100 according to an embodiment of the present application is shown.

[0098] The layered architecture divides the software 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 from top to bottom into the application layer, the application framework layer, the hardware abstraction layer (HAL), and the kernel layer.

[0099] The application layer can include a series of application packages. Figure 3B As shown, the application package may include a camera (camera APK). In addition, the application package may also include: gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, game, shopping, travel, instant messaging (such as short message) and other applications, which are not shown in the figure.

[0100] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 3B As shown, the application framework layer may include a camera service. In addition, the application framework layer may also include an input manager, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a display manager, an activity manager, etc. It should be noted that any two modules in the camera service, the input manager, the window manager, the content provider, the view system, and the activity manager may call each other.

[0101] The camera service is used to receive instructions or requests reported by lower layers such as the kernel layer and the hardware abstraction layer, such as the images collected by the sensor, and send the collected images to the camera application for display.

[0102] The hardware abstraction layer HAL layer is the interface layer between the operating system software and the hardware components, which provides an interface for the interaction between the upper-layer software and the lower-layer hardware. The HAL layer abstracts the underlying hardware into software containing the corresponding hardware interface. By accessing the HAL layer, the settings of the underlying hardware devices can be realized, for example, the related hardware components can be enabled or disabled at the HAL layer. In some embodiments, the core architecture of the HAL layer is composed of at least one of C++ or C.

[0103] Figure 3B The camera hardware interface (CHI) and camera development kit (CDK) involved in the HAL layer of the embodiment of the present application are shown, collectively referred to as chi-cdk below. The HAL layer also includes the camx architecture, the self-developed camera system (os_camera), and the kernel mode driver (video for linux 2kernel mode driver, V4L2 KMD) of the linux video device driver framework. os_camera includes multiple custom camera modes, such as ForceSensorMode.

[0104] Among them, chi-cdk contains a set of code implementations for customizable requirements, that is, it can include multiple function-driven features (features), for example, it can include a feature for implementing the above-mentioned image generation method, or a feature for implementing an artificial intelligence photo-taking mode. Figure 3BThe feature of the image generation method is chifeature2 for example. Chiframework is used to process the acquired photo request and call camx to obtain the image. Sensor XML contains the configuration information corresponding to the feature, such as the XML configuration table of the corresponding relationship between the shooting parameters and image data format required by chifeature2.

[0105] camx contains a collection of code implementations of common functional interfaces of cameras. The sensor nodes (sensornode) contained in camx include interfaces that can obtain various parameters in the sensor, such as interfaces for obtaining autofocus (AF), auto exposure (AE) and auto white balance (AWB), sensor image signals, optical image stabilizer (OIS) parameters and other parameters. Among them, AF, AE and AWB can also be collectively referred to as 3A. The 3A status module (3Astaus module) can be used to identify the status of the parameters obtained by the 3A interface. For example, the current ambient light parameters can be determined according to the AE value, and then the current ambient light level can be determined, such as whether the current environment is a dark environment, a relatively bright environment, or a medium-high brightness environment.

[0106] V4L2 KMD can realize the communication between modules such as camx and sensors in the lower kernel layer. For example, camx and sensor can communicate through the ioct1 function, such as sending instructions to the sensor to output image data in the corresponding format.

[0107] The kernel layer is the layer between hardware and software. The kernel layer includes at least the image sensor driver, and may also include display driver, audio driver, sensor driver, touch chip driver and input system, etc.

[0108] Through the above software architecture, when the user triggers a photo request through the shooting button provided by the camera application, chiframework can send the photo request to the camx architecture, and the camx architecture obtains the image signal generated by the sensor through the V4L2 KMD and feeds it back to the chiframework to display the preview image in the camera application.

[0109] In some embodiments of the present application, chi-cdk can also obtain information such as shooting mode and zoom parameters in the camera application in the application layer, and obtain the ambient brightness value in 3A through camx. chi-cdk can determine the corresponding image data format in the XML configuration table according to the obtained shooting mode, zoom parameter and ambient brightness value, where each shooting parameter has corresponding set image data format information. Then, the sensor is controlled to output image data in the corresponding format.

[0110] For example, chi-cdk can first obtain the currently used shooting mode from the camera APK. In the XML configuration table, each shooting mode has a corresponding scene configuration parameter. For example, the scene configuration parameter of the normal mode is "0". Corresponding to different shooting modes, the XML configuration table is also configured with corresponding capability values. For example, the shooting mode is normal mode, live mode, portrait mode or large aperture mode, and the corresponding capability value is the preset value "1", indicating that the corresponding image data needs to be selected according to the XML configuration table. Furthermore, corresponding to the currently used shooting mode, the corresponding capability value can be determined in the XML configuration table.

[0111] If chi-cdk determines that the capability value corresponding to the currently used shooting mode is a preset value, chi-cdk can also obtain the zoom parameter used for the current shooting from the camera APK, and read the brightness value in 3A from camx. Then determine whether it is currently in an ISZ scene based on the zoom factor and ambient light parameters. For example, if the current zoom factor is greater than "2×" and / or the current ambient light parameters indicate that the current scene is medium-high brightness, it can be determined that the current identification position is an ISZ scene. Then, the image data format setting value (setting) preset in the XML configuration table can be used to control the output of image data in the corresponding format through V4L2 KMD.

[0112] In some embodiments, chi-cdk may determine the corresponding image data format only according to the correspondence between the scene configuration parameters and the settings in the XML configuration table, without obtaining whether it is in the ISZ scene.

[0113] It is to be understood that the structure illustrated in the present application does not constitute a specific limitation on the terminal device 100. In other embodiments, the terminal device 100 may include more or fewer components than shown in the figure, or combine some components, or split 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.

[0114] The following describes an image generation method provided by an embodiment of the present application, which can be applied to the above-mentioned terminal device 100, such as a mobile phone 10. Figure 4A As shown, Figure 4AThe steps in the above can be specifically as follows: Figure 2 The ISP23 or other processor that can send instructions to sensor22 is collectively referred to as processor 110 below.

[0115] S401: Acquire shooting parameters.

[0116] The user can open the camera application through the terminal device 100 to shoot an image or video. When the user opens the camera application or triggers a photo request through a shooting button provided by the camera application, for example, the user clicks Figure 1 When the shutter button 15 in the interface shown in (A) is pressed, the processor 110 will obtain the shooting parameters currently used for shooting, such as one or more of the shooting parameters such as shooting mode, zoom factor, ambient light parameters, etc.

[0117] The shooting modes include but are not limited to "large aperture", "night scene", "portrait", "photo", "video" and "multi-lens video". The zoom multiple includes but is not limited to "1.0×", "2.0×" and the like. The ambient light parameter may specifically be the current ambient light brightness value, or a brightness level determined according to the current ambient light brightness value, such as whether the current environment is a dark environment, a relatively bright environment or a medium to high brightness environment.

[0118] In some embodiments, the processor 110 may specifically be configured as follows: Figure 3B The camera application (camera APK) in the image processing module obtains the shooting mode and zoom factor, and the ambient light brightness value in 3A can be obtained from camx.

[0119] In some other embodiments, in addition to obtaining the specific values ​​of the shooting mode, zoom factor and ambient light parameter, the processor 110 may also obtain identifiers corresponding to the above shooting parameters. For example, chi-cdk may also determine the corresponding capability value according to the shooting mode, and determine the corresponding ISZ flag according to the zoom parameter and the ambient brightness value.

[0120] It should be understood that the shooting parameters may also include the exposure rate set by the user, whether to add a filter, etc., and this application does not impose any specific restrictions on this.

[0121] In other embodiments, when the terminal device 100 has multiple cameras, the processor 110 will also obtain corresponding shooting parameters for each camera and generate corresponding private variables. Alternatively, the processor 110 may also generate corresponding private variables only for the currently effective camera. In addition, the problem that different cameras determine different image data formats according to shooting parameters, resulting in the processor 110 being unable to determine which image data format is used by different sensors, is avoided.

[0122] S402: Determine a corresponding image data format according to the shooting parameters.

[0123] The processor 110 can determine the image data format corresponding to the current shooting parameters according to the acquired shooting parameters. Furthermore, the processor 110 can send an instruction to the sensor 22 to output image data in a corresponding format, such as the aforementioned bayerraw, binning image or quad raw image, UHD image, nona pixel, etc. The present application does not specifically limit the type of image data format.

[0124] In some embodiments, the processor 110 can determine the image data format corresponding to the current shooting parameters based on the correspondence between preset shooting parameters and image data formats. For example, the correspondence can be an XML configuration table, which may include capability values ​​corresponding to different shooting modes, identification bits corresponding to different zoom factors and / or ambient light parameters, and image data formats corresponding to different capability values ​​and identification bits.

[0125] The following is an example of the image data formats corresponding to different shooting parameters.

[0126] The processor 110 may determine the corresponding image data format only according to the ambient light parameter or the corresponding brightness level. For example, for a dark environment with a brightness level, it may be determined to output a binned image. For a medium-high brightness environment with a brightness level, it may be determined to output a bayer raw image. For a relatively bright environment with a brightness level, it may be determined to output a quad raw image.

[0127] The processor 110 may determine the corresponding image data format only according to the shooting mode. For example, for shooting modes such as "recording" and "night scene", it may be determined to output a binned image. For shooting modes such as "normal" and "live", it may be determined to output a bayer raw image. For shooting modes such as "portrait" and "large aperture", it may be determined to output a quaddraw image.

[0128] The processor 110 may determine the corresponding image data format based only on the zoom factor. For example, for a zoom factor of "1.0×", it may be determined to output a binned image. For zoom factors of "2.0×" to "4.0×", it may be determined to output a full-size image such as a bayer raw image or a quad raw image. For zoom factors of "4.0×" and above, it may be determined to output a full-size image such as a bayer raw image or a quad raw image, and it may also be ensured that the number of pixels is sufficient for digital zoom.

[0129] In other embodiments, the processor 110 may also determine the corresponding image data format according to multiple of the ambient light parameters, the shooting mode, and the zoom factor. When determining the image data format according to multiple shooting parameters, priorities may be set for different shooting parameters. If the corresponding image data formats determined by the multiple shooting parameters are different, the image data format may be determined according to the shooting parameter with a higher priority. Alternatively, the processor 110 may count the image data formats corresponding to different shooting parameters, and determine the final image data format according to the image data formats corresponding to more shooting parameters.

[0130] In other embodiments, the processor 110 may also preset a correspondence between a plurality of shooting parameters and image data formats. For example, for a shooting mode such as "portrait" or "large aperture", a zoom factor of "2×" to "4×", and a medium to high brightness scene, a quad raw image may be selected. For a shooting mode such as "normal" or "livephoto", a zoom factor of "4×" or above, and a medium to high brightness scene, a bayer raw image may be used. For other remaining scenes, a binning image may be selected for output.

[0131] It should be understood that the above only illustrates the correspondence between shooting parameters and image data formats by way of example. In actual applications, different terminal devices may set different correspondences according to requirements, and this application does not impose any specific limitations thereto.

[0132] In other embodiments, the processor 110 can obtain the image data formats corresponding to different zoom factors, ambient light parameters and shooting modes according to the correspondence between various shooting parameters and image data formats pre-stored in chi-cdk, such as an XML configuration table. Figure 3B and its related description.

[0133] S403: Control sensor 22 to output image data in a corresponding image data format.

[0134] The processor 110 determines the corresponding image data format based on shooting parameters such as zoom factor, ambient light parameters and shooting mode, and can send corresponding instructions to sensor 22, so that sensor 22 can output the collected image signal as image data according to the determined image data format.

[0135] In some embodiments, the image data output by sensor 22 can be used to generate a preview image on the camera interface, or to generate a corresponding image saved in the terminal device after the user clicks the shutter button.

[0136] In other embodiments, the image used for preview and the image finally saved may be images of the same image data format, for example, both are images of the image data format determined in step S402. Alternatively, the image used for preview and the image finally saved may also be images of different image data formats, for example, both the images used for preview may be binning images, and the image finally saved may be an image of the image data format determined in step S402. This application does not impose any specific restrictions on this.

[0137] Furthermore, based on the above-mentioned image generation method, the terminal device can determine the corresponding shooting environment and the shooting environment's requirements for clarity and / or photosensitivity according to the current shooting parameters, and control the camera to output image data in different formats. Furthermore, the best image can be generated in different scenes, which improves the image quality, avoids the user spending time debugging the image parameters, and improves the user's photo-taking experience.

[0138] It should be understood that in some embodiments, the terminal device may also repeatedly perform the above Figure 4A The specific process can be found in Figure 4B ,include:

[0139] S410: Detecting a first shooting parameter.

[0140] When the user opens the camera application or triggers a photo request through a shooting button provided by the camera application, the processor 110 will obtain the first shooting parameters currently used for shooting, such as one or more of the shooting parameters such as shooting mode, zoom factor, ambient light parameters, etc. For details, please refer to the aforementioned step S401, which will not be repeated here.

[0141] S420: Control sensor 22 to output an image in the first image format.

[0142] The processor 110 can determine the first format corresponding to the current first shooting parameter according to the acquired first shooting parameter, and control the sensor 22 to output the currently acquired first image signal according to the determined first format. For details, please refer to the aforementioned steps S402 to S403, which will not be repeated here.

[0143] S430: Detecting a second shooting parameter.

[0144] When it is obtained that the user has changed the shooting mode or zoom ratio, or when it is detected that the ambient light parameters have changed significantly, the processor 110 may execute the above steps again. Alternatively, the processor 110 may also periodically obtain the current shooting parameters at a preset time. Then, the processor 110 will again obtain the second shooting parameters used for the current shooting. For details, please refer to the above step S401, which will not be repeated here.

[0145] S440: Control sensor 22 to output images in the second image format.

[0146] The processor 110 can determine the second format corresponding to the current second shooting parameter according to the acquired second shooting parameter, and control the sensor 22 to output the currently acquired second image signal according to the determined second format. For details, please refer to the aforementioned steps S402 to S403, which will not be repeated here.

[0147] Furthermore, based on the above image generation method, the terminal device can obtain the current shooting scene based on the shooting parameters when the user opens the camera application or triggers the photo request, so as to control the camera to output image data in different formats. Furthermore, the best image can be generated in different scenes, which improves the image quality, avoids the user spending time debugging the image parameters, and improves the user's photo experience.

[0148] In some embodiments, the processor 110 may first determine the capability value corresponding to the currently used shooting mode, and when the capability value is determined to be a preset value, determine whether the current scene is in an ISZ scene according to the zoom factor and the ambient light parameter, and if in an ISZ scene, control the sensor 22 to output an image through the image data format set in the XML configuration table. For details, please refer to Figure 5 The steps shown include:

[0149] S510: Acquire the current scene.

[0150] When the user opens the camera application or triggers a photo request through the shooting button provided by the camera application, the processor 110 can obtain the currently used shooting mode from the camera APK, such as shooting modes such as "large aperture", "night scene", "portrait", "photo", "video" and "multi-lens video". Each shooting mode has a corresponding scene configuration parameter, for example, the scene configuration parameter of the normal mode and the "photo" mode is "0".

[0151] In addition, for multiple cameras, the ID of each camera, that is, camera id, is also obtained. For multiple cameras turned on, different cameras can obtain corresponding shooting modes and generate corresponding private variables.

[0152] S520: Match product XML configuration items.

[0153] The processor 110 can search for the configuration items corresponding to the scene in sensorXML according to the scene configuration parameters corresponding to the shooting mode. Figure 6A schematic diagram of an XML configuration table is shown, the XML configuration table is named "forceSelectSensorModeConfig", and the XML configuration table includes the sensor name "sensorName", the scene configuration parameter "sceneMode", the frame rate "fps", the capability value "capability" and the corresponding image format setting number "forceSelectSensorMode". For example, the corresponding scene configuration parameter is "0", the frame rate is 30, the capability value is 1, and the setting number is 14. Or, the corresponding scene configuration parameter is "23", the frame rate is 30, the capability value is 1, and the setting number is 3. In addition, the corresponding sub-scene configuration parameter (subSceneMode) can also be configured, and subSceneMode is used to further subdivide the scene into multiple sub-scenes.

[0154] S530: Check whether the scene is matched successfully. If yes, go to step S540; if no, end.

[0155] If the processor 110 finds the configuration item corresponding to the scene in the XML configuration table according to the currently used shooting mode, the scene matching is successful, and then step S540 is executed. If no corresponding configuration item is found, the process ends, for example, the image is output in the default image data format.

[0156] S540: Obtain the capability value of the current scene configuration.

[0157] like Figure 6 As shown, corresponding to different shooting modes, the XML configuration table also configures corresponding capability values. ISP23 can determine the corresponding capability value according to the corresponding configuration item. For details, please refer to Figure 6 .

[0158] S550: Is the capability value 0? If yes, end. If no, go to step S560.

[0159] If the corresponding capability value is the preset value "1", it means that the corresponding image data format needs to be selected according to the XML configuration table. Then, step S560 can be executed. If so, it means that the capability value is "0", and the processor 110 can output the image in the default image data format.

[0160] In some embodiments, for example, the capability value for scenes such as “normal”, “live”, “portrait”, and “large aperture” may be “1”.

[0161] In some embodiments, corresponding to the capability value being "0", the processor 110 may also determine the corresponding image data format according to the setting in the XML configuration table. Alternatively, the processor 110 may not perform step 550, that is, regardless of the capability value, the corresponding image data format is determined according to the setting in the XML configuration table.

[0162] It should be understood that the above description of the capability value is in the form of examples. In some embodiments, the capability value may also be set to other numerical values ​​or symbols, and the present application does not impose specific limitations on this.

[0163] S560: Get the current status flag.

[0164] The chi-cdk in the processor 110 can determine whether it is currently in an ISZ scene based on the zoom factor and the ambient light parameters. For example, if the current zoom factor is greater than "2×" and / or the current ambient light parameters indicate that the current scene is medium-high brightness, it can be determined that the current state flag is an ISZ scene.

[0165] It should be understood that chi-cdk can determine the current flag at step S510, for example, when the user opens the camera application or triggers a photo request through a capture button provided by the camera application. This application does not impose any specific restrictions on the time when the status flag is generated.

[0166] S570: Check whether the status flag is ISZ. If yes, go to step S580; if no, end.

[0167] When the processor 110 determines that the state flag is ISZ, it will determine the corresponding image data format according to the setting in the XML configuration table. If not, it means that the scene can output the image in the default image data format.

[0168] S580: Obtain the sentting sequence number configured in the current scene.

[0169] The settings in the XML configuration table correspond to different image data formats. The processor 110 can send the corresponding setting value to the sensor 22 according to the determined setting value, so that the sensor 22 outputs the image in the image data format corresponding to the setting.

[0170] Furthermore, based on the above image generation method, the terminal device can obtain the current shooting scene based on the shooting parameters when the user opens the camera application or triggers the photo request, so as to control the camera to output image data in different formats. Furthermore, the best image can be generated in different scenes, which improves the image quality, avoids the user spending time debugging the image parameters, and improves the user's photo experience.

[0171] In order to solve the above-mentioned problem of large difference in image quality, the present application provides an image generating device 700, including an acquiring unit 710, a determining unit 720 and a sending unit 730.

[0172] The acquisition unit 710 is used to acquire a first shooting parameter used by the image sensor of the shooting device to collect a first image signal. The determination unit 720 is used to determine that the first shooting parameter corresponds to a first image format, and the sending unit 730 is used to send a first output instruction to the image sensor, wherein the first output instruction is used to instruct the image sensor to output the collected first image signal as first image data having a first image format. The acquisition unit 710 is also used to acquire a second shooting parameter used by the image sensor of the shooting device to collect a second image signal. The determination unit 720 is also used to determine that the second shooting parameter corresponds to a second image format, and the sending unit 730 is also used to send a second output instruction to the image sensor, wherein the second output instruction is used to instruct the image sensor to output the collected second image signal as second image data having a second image format.

[0173] In some embodiments, the first shooting parameter and the second shooting parameter include one or more of a shooting mode, a zoom factor, and an ambient light parameter.

[0174] In other embodiments, the shooting mode included in the first shooting parameter is the normal mode or the live mode, the shooting mode included in the second shooting parameter is the portrait mode or the large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format; or, the shooting mode included in the first shooting parameter is the video mode, the shooting mode included in the second shooting parameter is the normal mode, the live mode, the portrait mode or the large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format.

[0175] In some other embodiments, the zoom factor included in the first shooting parameter is smaller than the zoom factor included in the second shooting parameter, and the number of pixels in the first image format is greater than the number of pixels in the second image format.

[0176] In some other embodiments, the ambient light parameter included in the first shooting parameter is smaller than the ambient light parameter included in the second shooting parameter, and the brightness contrast parameter of the first image format is higher than the brightness contrast parameter of the second image format.

[0177] In other embodiments, corresponding to the first image format being the Bayer image format, the second image format is the four-in-one Bayer image format or the pixel-merged image format; corresponding to the first image format being the four-in-one Bayer image format, the second image format is the Bayer image format or the pixel-merged image format; corresponding to the first image format being the pixel-merged image format, the second image format is the Bayer image format or the four-in-one Bayer image format.

[0178] In some other embodiments, the acquisition unit 710 is further used to acquire an image format configuration table, which includes a correspondence between a shooting mode, a capability value, and an image format. The determination unit 720 is further used to determine, based on the image format configuration table, a first capability value corresponding to the first shooting mode in the first shooting parameter. The determination unit 720 is further used to determine that the first image format is an image format corresponding to the first shooting mode in the image format configuration table in response to the first capability value being a first preset value; the determination unit 720 is further used to determine that the first image format is a preset image format in response to the first capability value not being a first preset value.

[0179] In other embodiments, the determination unit 720 is further used to determine a first identification bit corresponding to the first shooting parameter based on the first zoom factor and the first ambient light parameter in the first shooting parameter, wherein the first identification bit is used to indicate whether the scene corresponding to the first shooting parameter is a zoom scene; the determination unit 720 is further used to determine that the first image format is an image format corresponding to the first shooting mode in the configuration table based on the first capability value being a first preset value and the first identification bit being a second preset value; the determination unit 720 is further used to determine that the first image format is a preset image format based on the first capability value being a first preset value and the first identification bit being not the second preset value.

[0180] In other embodiments, the terminal device includes a hardware abstraction layer, the hardware abstraction layer includes a camera platform architecture, and the camera hardware interface in the camera platform architecture and the camera development kit chi-cdk include an image format configuration table.

[0181] In some other embodiments, the terminal device also includes an application layer, the camera platform architecture also includes a camx interface, and the chi-cdk is used to: obtain a first shooting mode and a first zoom factor of the camera application from the application layer, and obtain a first ambient light parameter from the camx interface, and determine a first image format based on the first shooting mode, the first zoom factor and the first ambient light parameter, and send a first output instruction to the image sensor through the camx interface.

[0182] Furthermore, based on the above-mentioned image generation device 700, the current shooting scene can be obtained based on the shooting parameters when the user opens the camera application or triggers the photo request, so as to control the camera to output image data in different formats. Furthermore, the best image can be generated in different scenes, which improves the image quality, avoids the user spending time debugging the image parameters, and improves the user's photo experience.

[0183] 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.

[0184] A person 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 a computer program to instruct the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-mentioned method embodiments. The aforementioned storage medium includes: a read-only memory (ROM) or a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

Claims

1. An image generation method, characterized in that: Applied to electronic equipment, the method comprises: Acquire a first shooting parameter used by an image sensor of a shooting device to collect a first image signal; Determining that the first shooting parameter corresponds to a first image format, and sending a first output instruction to the image sensor, wherein the first output instruction is used to instruct the image sensor to output the first image signal acquired as first image data having the first image format; Acquire a second shooting parameter used by the image sensor of the shooting device to collect a second image signal; determining that the second shooting parameter corresponds to a second image format, and sending a second output instruction to the image sensor, wherein the second output instruction is used to instruct the image sensor to output the collected second image signal as second image data having the second image format, The first shooting parameter and the second shooting parameter include one or more of a shooting mode, a zoom factor, and an ambient light parameter. Corresponding to the first shooting parameter and the second shooting parameter including a shooting mode, the shooting mode included in the first shooting parameter is a normal mode or a live mode, the shooting mode included in the second shooting parameter is a portrait mode or a large aperture mode, and the definition of the first image format is lower than the definition of the second image format; or, Corresponding to the first shooting parameter and the second shooting parameter including a shooting mode, the shooting mode included in the first shooting parameter is a video mode, the shooting mode included in the second shooting parameter is a normal mode, a live mode, a portrait mode or a large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format.

2. The method according to claim 1, characterized in that: Corresponding to the first shooting parameter and the second shooting parameter including a zoom factor, and the zoom factor included in the first shooting parameter is smaller than the zoom factor included in the second shooting parameter, the number of pixels in the first image format is lower than the number of pixels in the second image format.

3. The method according to claim 1, characterized in that Corresponding to the first shooting parameter and the second shooting parameter including an ambient light parameter, and the ambient light parameter included in the first shooting parameter is smaller than the ambient light parameter included in the second shooting parameter, the brightness contrast parameter of the first image format is higher than the brightness contrast parameter of the second image format.

4. The method according to claim 1, characterized in that: Corresponding to the first image format being the Bayer image format, the second image format is the four-in-one Bayer image format or the pixel-merged image format; Corresponding to the first image format being a four-in-one Bayer image format, the second image format is a Bayer image format or a pixel-merged image format; Corresponding to the first image format being a pixel-merged image format, the second image format is a Bayer image format or a four-in-one Bayer image format.

5. The method according to claim 1, characterized in that The method further comprises: Obtaining an image format configuration table, wherein the image format configuration table includes a correspondence between a shooting mode, a capability value, and an image format; The determining a first image format corresponding to the first shooting parameter includes: Based on the image format configuration table, determining a first capability value corresponding to a first shooting mode in the first shooting parameter; Corresponding to the first capability value being a first preset value, determining the first image format to be an image format corresponding to the first shooting mode in the image format configuration table; Corresponding to the first capability value not being the first preset value, the first image format is determined to be a preset image format.

6. The method according to claim 5, characterized in that The method further comprises: Determining a first identification bit corresponding to the first shooting parameter based on a first zoom factor and a first ambient light parameter in the first shooting parameter, wherein the first identification bit is used to indicate whether a scene corresponding to the first shooting parameter is a zoom scene; The determining a first image format corresponding to the first shooting parameter includes: Based on the first capability value being a first preset value and the first identification bit being a second preset value, determining that the first image format is an image format corresponding to the first shooting mode in the configuration table; Based on the first capability value being a first preset value and the first identification bit being not the second preset value, it is determined that the first image format is the preset image format.

7. The method according to claim 6, characterized in that The electronic device comprises a hardware abstraction layer, the hardware abstraction layer comprises a camera platform architecture, and the camera hardware interface and the camera development kit chi-cdk in the camera platform architecture comprise the image format configuration table.

8. The method according to claim 7, characterized in that The electronic device further includes an application layer, the camera platform architecture further includes a camx interface, and the obtaining of a first shooting parameter of the shooting device includes: The chi-cdk is used to: acquiring the first shooting mode and the first zoom factor of a camera application from the application layer, and, Acquire the first ambient light parameter from the camx interface, and determining the first image format based on the first shooting mode, the first zoom factor and the first ambient light parameter, The first output instruction is sent to the image sensor through the camx interface.

9. An electronic device, characterized in that: Including a processor, an image sensor, wherein: The processor is used to obtain a first shooting parameter used by an image sensor of a shooting device to collect a first image signal; and Determining that the first shooting parameter corresponds to a first image format, and sending a first output instruction to the image sensor; The image sensor is used to output the collected first image signal as first image data having the first image format based on the first output instruction; The processor is further configured to obtain a second shooting parameter used by the image sensor of the shooting device to collect a second image signal; and Determining that the second shooting parameter corresponds to a second image format, and sending a second output instruction to the image sensor; The image sensor is further configured to output the collected second image signal as second image data having the second image format based on the second output instruction. The first shooting parameter and the second shooting parameter include one or more of a shooting mode, a zoom factor, and an ambient light parameter. The first shooting parameter and the second shooting parameter include a shooting mode, and the shooting mode of the first shooting parameter is a normal mode or a live mode, the shooting mode included in the second shooting parameter is a portrait mode or a large aperture mode, and the definition of the first image format is lower than the definition of the second image format; or, Corresponding to the first shooting parameter and the second shooting parameter including a shooting mode, the shooting mode included in the first shooting parameter is a video mode, the shooting mode included in the second shooting parameter is a normal mode, a live mode, a portrait mode or a large aperture mode, and the clarity of the first image format is lower than the clarity of the second image format.

10. The electronic device according to claim 9, characterized in that: The processor determines the first image format corresponding to the first shooting parameter in the following manner: Obtaining an image format configuration table, wherein the image format configuration table includes a correspondence between a shooting mode, a capability value, and an image format; Based on the image format configuration table, determining a first capability value corresponding to a first shooting mode in the first shooting parameter; Corresponding to the first capability value being a first preset value, determining the first image format to be an image format corresponding to the first shooting mode in the image format configuration table; Corresponding to the first capability value not being the first preset value, the first image format is determined to be a preset image format.

11. The electronic device according to claim 9, characterized in that: The processor is one or more of an image signal processor, a central processing unit, a digital signal processor, and a graphics processor.

12. A computer-readable storage medium, characterized in that: The method comprises instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Image saving method and terminal

    CN105812572A

  • Photographing method and device for camera

    CN108769513A