Image generation method, medium and electronic equipment
By determining the image format according to the shooting parameters of different scenes and controlling the image sensor output, the problem of image quality differences in different scenes is solved, and image quality and user experience are improved.
Patent Information
- Application Number
- CN202411718860.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-06-24
AI Technical Summary
When users take photos in different scenarios, the image quality varies greatly and cannot meet the user's requirements.
By acquiring the shooting parameters used by the image sensor of the photographing device to acquire the image signal, determining the corresponding image format, and sending output commands to the image sensor to control the camera to output image data in different formats.
Generate the best-effect image in different scenarios, which improves the overall quality of the image, avoids users spending time debugging image parameters, and improves the user's photography experience.
Smart Images

Figure CN120201285A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with the application number 202311778556.9, the application date of December 21, 2023, and the invention creation name of "Image Generation Method, Medium and Electronic Device" submitted to the China National Patent Office. Technical Field
[0002] This application relates to the field of terminal technologies, and in particular, to an image generation method, a medium, and an electronic device. Background Art
[0003] With the continuous improvement of the software and hardware performance of electronic devices, the camera functions of electronic devices such as mobile phones have become increasingly powerful. At the same time, users' requirements for taking pictures are getting higher and higher. However, due to the differences in the environments and scenarios where users use electronic devices to take pictures, for example, the ambient light is different in different scenarios, the quality differences of the captured images are relatively large, and the image quality often fails to meet the requirements of users. Summary of the Invention
[0004] In view of this, this application provides an image generation method, a medium, and an electronic device.
[0005] In a first aspect, an image generation method is provided. The method includes: first obtaining first shooting parameters used by an image sensor of a shooting device to collect a first image signal; then determining a first image format corresponding to the first shooting parameters, and sending a first output instruction to the image sensor, where the first output instruction is used to instruct the image sensor to output the collected first image signal as first image data having the first image format. However, corresponding to obtaining second shooting parameters used by the image sensor of the shooting device to collect a second image signal; determining a second image format corresponding to the second shooting parameters, and sending a second output instruction to the image sensor, where 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.
[0006] In the above solution, the electronic device can control the camera to output image data in different formats according to the current shooting parameters. For example, the first shooting parameters and the second shooting parameters can be different shooting parameters. Furthermore, corresponding different image formats can be determined in different scenarios, and then the image with the best effect in the current scenario can be generated, thereby improving the overall image quality, avoiding the user spending time debugging the image parameters, and improving the user's photo-taking experience.
[0007] In combination with the first aspect, in some implementation manners, the first shooting parameters and the second shooting parameters include one or more of a shooting mode, a zoom factor, and an ambient light parameter.
[0008] In the above solution, the electronic device can determine the corresponding shooting environment according to the current shooting parameters, such as the shooting mode, and determine the requirements of the shooting environment for clarity and / or photosensitivity according to the zoom ratio and ambient light parameters, and then control the camera to output image data in different formats. It can generate the best-quality images in different scenarios, improve the image quality, avoid the user spending time debugging the image parameters, and improve the user's photo-taking experience. In some implementation manners, the shooting parameters may further include the exposure rate set by the user, whether to add a filter, etc.
[0009] Combined with the first aspect, in some implementation manners, 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 that of the second image format; or, the shooting mode included in the first shooting parameter is the video recording 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 that of the second image format.
[0010] In the above solution, the electronic device can determine the corresponding image data format according to the shooting mode. For example, corresponding to the shooting modes of "normal" and "live", it can be determined to output images with relatively high photosensitivity and clarity, such as Bayer images. Furthermore, while ensuring a certain clarity, it can ensure reducing the phenomenon of uneven brightness in the image. Corresponding to the shooting modes of "portrait" and "large aperture", it can be determined to output images with higher clarity, such as four-in-one Bayer images, to ensure that the output images have high clarity.
[0011] Combined with the first aspect, in some implementation manners, the zoom ratio included in the first shooting parameter is less than the zoom ratio included in the second shooting parameter, and the number of pixel points of the first image format is lower than the number of pixel points of the second image format.
[0012] In the above solution, for scenarios with zoom, it is necessary to output full-size images, such as four-in-one Bayer images and Bayer images, to be able to complete digital zoom, and then ensure a certain clarity after digital zoom.
[0013] Combined with the first aspect, in some implementation manners, the ambient light parameter included in the first shooting parameter is less 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.
[0014] In the above solution, for a darker environment in terms of brightness level, an image with better brightness presentation ability can be determined, such as a pixel merged image. Corresponding to a medium-high brightness environment, a Bayer image or a four-in-one Bayer image, etc., can be determined. Furthermore, it is ensured that in a darker scene, the object contour can be better presented in the image.
[0015] Combined with the first aspect, in some implementation manners, 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.
[0016] In the above solution, both the four-in-one Bayer image and the Bayer image are full-size, with more pixels and being more suitable for the digital zoom scenario, and 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 relatively high, but the number of pixel points is small and it is not suitable for the zoom scenario.
[0017] Combined with the first aspect, in some implementation manners, an image format configuration table is obtained. The image format configuration table includes the correspondence between the shooting mode, the ability value, and the image format; based on the image format configuration table, the first ability value corresponding to the first shooting mode in the first shooting parameters is determined; corresponding to the first ability value being the first preset value, the first image format is determined as the image format corresponding to the first shooting mode in the image format configuration table; corresponding to the first ability value not being the first preset value, the first image format is determined as the preset image format.
[0018] In the above solution, if the corresponding ability value is the preset value, it means that the corresponding image data format needs to be selected according to the image format configuration table. If the corresponding ability value is not the preset value, the image can be output in the default image data format. For example, the ability values for scenarios such as "ordinary", "live", "portrait", and "large aperture" can be preset values. The electronic device can determine the corresponding shooting environment according to the current shooting parameters, and then control the camera to output image data in different formats. The best-quality images can be generated in different scenarios, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0019] In combination with the first aspect, in some implementation manners, based on the first zoom ratio and the first ambient light parameter in the first shooting parameter, a first identification bit corresponding to the first shooting parameter is determined, where 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, it is determined that the first image format is the 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 not being the second preset value, it is determined that the first image format is a preset image format.
[0020] In the above solution, when the electronic device determines that the status 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. Otherwise, it means that when the scene can output images in the default image data format. Whether it is a digital zoom scene is determined through the status identification bit, and then the requirements of the shooting environment for clarity and / or photosensitivity are determined, and then the camera is controlled to output image data in different formats. The best-quality images can be generated in different scenarios, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0021] In combination with the first aspect, in some implementation manners, the electronic device includes a hardware abstraction layer, and the hardware abstraction layer includes a camera platform architecture. The camera hardware interface and the camera development kit chi-cdk in the camera platform architecture include an image format configuration table.
[0022] In combination with the first aspect, in some implementation manners, the electronic device further includes an application layer. The camera platform architecture further includes a camx interface. The chi-cdk is used to: obtain the first shooting mode and the first zoom ratio of the camera application from the application layer, and obtain the first ambient light parameter from the camx interface, and determine the first image format based on the first shooting mode, the first zoom ratio, and the first ambient light parameter, and send a first output instruction to the image sensor through the camx interface.
[0023] In the above solution, it is the chi-cdk that determines the format that the image sensor needs to output, and then sends an instruction to the image sensor through the camx interface. Furthermore, the image sensor can output image data in different formats. The best-quality images can be generated in different scenarios, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0024] In a second aspect, the present application provides an electronic device, including a processor and an image sensor. The image sensor is configured to collect an image signal and output image data corresponding to the image signal in an image format indicated by an output instruction sent by the processor. The processor is configured to obtain shooting parameters used by the image sensor to collect the image signal, determine an image format corresponding to the shooting parameters, and send an output instruction to the image sensor.
[0025] In combination with the second aspect, in some implementation manners, the processor determines the image format of the image data output by the image sensor in the following manner: corresponding to the shooting parameters matching the first shooting parameters in the shooting parameter and image format configuration table, determining that the output format of the image data is the first image format corresponding to the first shooting parameters in the shooting parameter and image format configuration table; corresponding to the shooting parameters matching the second shooting parameters in the shooting parameter and image format configuration table, determining that the output format of the image data is the second image format corresponding to the second shooting parameters in the shooting parameter and image format configuration table.
[0026] In combination with the second aspect, in some implementation manners, the shooting mode included in the first shooting parameters is a normal mode or a live mode, the shooting mode included in the second shooting parameters is a portrait mode or a large aperture mode, and the clarity of the first image format is lower than that of the second image format; or, the shooting mode included in the first shooting parameters is a video recording mode, the shooting modes included in the second shooting parameters are 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 that of the second image format.
[0027] In combination with the second aspect, in some implementation manners, the processor is one or more of an image signal processor, a central processing unit, a digital signal processor, and a graphics processing unit.
[0028] In a third aspect, the present application provides a computer-readable storage medium, in which instructions are stored. When the instructions run on an electronic device, the method described in the first aspect is executed.
[0029] In a fourth aspect, the present application provides a computer program product, which includes computer instructions. When executed by a computing device, the computing device executes the method described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments.
[0031] Figure 1 is a schematic diagram of an interface of a camera application provided by an embodiment of the present application;
[0032] Figure 2It is a schematic structural diagram of a camera provided by an embodiment of the present application;
[0033] Figure 3A It is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application;
[0034] Figure 3B It is a schematic software structure diagram of an electronic device provided by an embodiment of the present application;
[0035] Figure 4A It is a schematic flowchart of a method for determining an image data format in an image generation method provided by an embodiment of the present application;
[0036] Figure 4B It is a schematic flowchart of an image generation method provided by an embodiment of the present application;
[0037] Figure 5 It is a schematic flowchart of another image generation method provided by an embodiment of the present application;
[0038] Figure 6 It is a schematic diagram of a configuration table provided by an embodiment of the present application;
[0039] Figure 7 It is a schematic structural diagram of an image generation device provided by an embodiment of the present application. Detailed implementation manners
[0040] Exemplary embodiments of the present application include, but are not limited to, an image generation method, a medium, and an electronic device.
[0041] As mentioned above, a user can use an electronic device with a camera, such as a mobile phone, to take pictures. Taking the mobile phone 10 as an example, the following introduces the interfaces of the camera applications of the electronic device in some embodiments. For example, Figure 1 As shown in (A) of, the camera application interface of the mobile phone 10 may include a preview screen area 11, a zoom ratio area 12, a shooting mode area 13, an album button 14, a shutter button 15, and a camera switching button 16.
[0042] Among them, the zoom ratio area 12 provides a variety of optional zoom ratios, including but not limited to 0.6 times, 1 time, 2 times, etc. Exemplarily, based on the user's selection of the "1.0×" zoom ratio, the preview screen area 11 is the picture that can be captured at the 1-time zoom ratio. Based on the user's selection of other zoom ratios, the camera can capture objects at different distances. For example, based on the user's adjustment to the "2.0×" zoom ratio, as Figure 1 shown in (B) of, the preview screen area 12 of the mobile phone 10 is the effect shown after magnifying the picture by 2 times.
[0043] It should be understood that to implement the zoom function of the camera, technologies such as optical zoom and / or digital zoom can be adopted. 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 long-focus camera. Digital zoom technology can also be referred to as lossless zoom (in sensor zoom, ISZ). ISZ generates a full-size image, then crops the picture, and finally increases the area of pixels in the cropped picture and / or inserts pixel values in the cropped picture, thereby achieving the zoom effect of enlarging or reducing the captured picture.
[0044] The shooting mode area 13 provides a variety of selectable shooting modes, including but not limited to shooting modes such as "large aperture", "night scene", "portrait", "photo", "video recording", and "multi-lens video recording". For different shooting modes, the mobile phone 10 can adopt different setting parameters and image compensation parameters, such as aperture size, shutter speed, sensitivity (ISO), focusing method, white balance, exposure compensation, etc. It should be understood that in some embodiments, the electronic device may also have other shooting modes, such as "live photo", "slow motion", or "panorama", etc., and the present application does not make specific limitations thereto.
[0045] The mobile phone 10 compensates the captured image through the processing of an image signal processor (ISP) or a digital signal processor (DSP).
[0046] Exemplarily, Figure 2 A schematic structural diagram of a camera 20 is shown. The camera 20 can be disposed in an electronic device, such as the mobile phone 10, or can be independent of the electronic device and connected to the electronic device by means of Bluetooth or wire. The camera 20 can also be referred to as a shooting device.
[0047] The camera 20 includes a lens 21, an image sensor (hereinafter referred to as sensor) 22, and an ISP 23. Among them, the sensor 22 is specifically a photosensitive element, and the photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
[0048] In some embodiments, ISP23 may be built into the camera 20 or may be a module disposed outside the camera 20. ISP23 may also be integrated with sensor22, and the present application does not make specific limitations thereon.
[0049] The process of the camera 20 capturing a static image or video includes: an object generates an optical image through the lens 21 and projects it onto the sensor22. The photosensitive element of the sensor22 converts the optical signal into image data, and then the image data is transmitted to the ISP23 for processing. Among them, the unprocessed digital image signal of the ISP23 can also be referred to as raw data. The ISP23 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 format such as RGB or YUV.
[0050] In some cases, when the lens 21 focuses light on the sensor22, light attenuation will occur, especially the light attenuation at the edge area of the lens 21 is the largest. This situation can be referred to as the lens shading phenomenon. Furthermore, due to the optical characteristics of the lens 21 and the sensor22, the image brightness output by the ISP23 is uneven. For example, the central part of the image is brighter while the edge part is darker.
[0051] The ISP23 or the DSP will perform lens shading correction (LSC) on the image data for the above-mentioned lens shading phenomenon. For example, first obtain an ideal flat illumination image created by software, and then use the lens 21 and the sensor22 to capture an image under uniform illumination conditions as the 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 at the corresponding pixel position. Furthermore, during the shooting process, both the ISP23 and the DSP will use this correction table to perform brightness correction on the output image.
[0052] In practical applications, the same manufacturer will use the same correction table for the same type of lens and sensor to overcome the lens shading situation. However, during the actual production and assembly of the camera, there may be production differences in each module of the camera, and the installation angles of the lens 21 and the sensor22 may also be different. As a result, the ISP23 using the correction table cannot obtain an image with a better brightness correction effect.
[0053] Moreover, during the shooting process, the degree of influence of the incident light angle on the lens shadow phenomenon also varies. For example, when light is incident from different angles, the light attenuation at the edge of the lens will be more severe, resulting in a more obvious shadow effect. Especially when there is movement during the shooting process, this lens shadow phenomenon will be more obvious. For example, when the user holds the mobile phone 10 and moves while shooting, the unevenness of the image brightness will be more obvious under different angles of light.
[0054] It should be understood that the above only takes the lens shadow phenomenon as an example to illustrate the correction method for ISP23. In practical applications, there are also other phenomena for 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.
[0055] In summary, due to the differences in the calibration correction parameters and manufacturing processes of each module in the camera, there will be significant quality differences in the images output by the camera. For example, there are problems such as uneven image brightness distribution, and the unevenness of brightness is also different in different shooting environments.
[0056] Moreover, the formats of the image data that the sensor 22 can output include Bayer image (bayer raw), quad Bayer image (quad bayer raw, also known as quad raw or quard raw), and the image output after pixel binning (binning image), etc. Among them, both bayer raw and quad raw are full size images. For quadraw, it can also be further processed (remosaic) to be restored to a bayer format image with higher clarity (also known as remosaic image). The binning image combines the readout values of adjacent pixels in the full size image, adds the induced charges of adjacent or the same color pixels, and reads them out in the mode of a single analog pixel.
[0057] Among them, both quad raw and bayer raw are fullsize, with more pixels and are more suitable for the ISZ scenario, and the clarity of quad raw is higher than that of bayer raw. The clarity of binning is also relatively high, but the number of pixel points is small, so it is not suitable for the ISZ scenario.
[0058] Currently, sensor22 usually outputs image data in only one format in different scenarios. For example, in the ISZ scenario, that is, when the zoom factor is "2×" or above, it only outputs quad raw or bayer raw images. Although quadraw has higher clarity, its photosensitivity is poor, that is, its ability to present the brightness of the image is poor, making the calibration correction parameters of the module and the uneven brightness caused by the manufacturing process more obvious. If only bayer raw images can be output, their image clarity is relatively low and cannot meet the requirements of scenarios with high image clarity requirements. Furthermore, in different shooting scenarios, there are problems such as uneven brightness or low clarity, resulting in poor image quality.
[0059] Even to achieve a certain degree of shooting effect, some electronic devices provide adjustment functions for various setting parameters such as white balance and exposure compensation. However, this process requires the user to manually adjust and combine repeatedly, which is cumbersome, time-consuming, and inaccurate, reducing the user experience. Moreover, the adjustment of setting parameters requires relatively high professionalism, and it is difficult for most users to obtain satisfactory photos through the adjustment of setting parameters.
[0060] To solve the problem of large differences in image quality described above, the present application provides an image generation method. In this method, the processor of the electronic device can control sensor22 to output different formats of image data in different shooting environments according to the correspondence between preset shooting parameters and image data formats, such as outputting bayer raw, binning images, or quad raw images, etc. Specifically, the electronic device obtains the shooting parameters when the camera 20 takes pictures, such as one or more of the shooting parameters such as shooting mode, zoom factor, and ambient light parameters, and then sends an instruction to sensor22 to output the corresponding format of image data according to the shooting parameters, so that sensor22 can output different formats of image data according to different shooting environments.
[0061] For example, corresponding to scenarios with high clarity requirements and / or in the presence of zoom, such as shooting modes like "portrait" or "large aperture", and / or when the zoom factor is within "2×" to "4×", image data with higher clarity can be selected, such as quad raw images, to ensure that the output images have higher clarity.
[0062] Corresponding to scenarios with high photosensitivity requirements and / or in the presence of zoom, such as shooting modes like "ordinary" or "live photo", and / or when the zoom factor is "4×" or above, image data with better photosensitivity can be used, such as bayer raw images. Furthermore, under the condition of ensuring a certain clarity, the phenomenon of uneven brightness in the image can be reduced.
[0063] For scenarios with higher requirements for clarity, photosensitivity, or image frame rate, such as when the shooting mode is "video recording", the zoom factor is "1×", and / or the ambient light is dim, image data with higher photosensitivity can be selected for output, such as binning images, to ensure a reduction in the phenomenon of uneven brightness in the image. Moreover, since binning images merge pixels, the data volume of the image is reduced, and the frame rate of the output image can also be increased.
[0064] 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, if the user sets a high exposure rate, binning images, etc. can be selected for output. The format of the image data may also include formats such as 4K ultra high definition (UHD) images, nona pixel binning images, or 3F raw images. This application does not specifically limit the types of shooting parameters and the types of image data formats.
[0065] In some embodiments, the terminal device may pre-store the correspondence between various shooting parameters and image data formats, such as generating an extensible markup language (XML) configuration table for the correspondence. The XML configuration table may include the ability values corresponding to different shooting modes, the flag bits corresponding to different zoom factors and / or ambient light parameters, and the image data formats corresponding to different ability values and flag bits.
[0066] After the camera application is launched, the processor of the terminal device, such as ISP23 or the central processing unit (CPU), can obtain the shooting mode selected by the user in the camera application, parameters such as the zoom factor, and / or read the ambient light parameters of the current shooting through sensor22 or the ambient light sensor. Then, the processor of the terminal device can determine the ability value and flag bit corresponding to the current shooting environment based on shooting parameters such as the shooting mode, zoom factor, and ambient light parameters, and determine the corresponding image data format in the XML configuration table. Furthermore, it can control the sensor to output image data in the corresponding format.
[0067] 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 an instruction to sensor22 to output the corresponding image data format.
[0068] Furthermore, based on the above image generation method, the terminal device can determine the corresponding shooting environment according to the current shooting parameters, as well as the requirements of the shooting environment for clarity and / or photosensitivity, so as to control the camera to output image data in different formats. Furthermore, in different scenarios, the best-quality images can be generated, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0069] The above terminal device can 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 laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), or a dedicated camera (such as a single-lens reflex camera, a compact camera), etc. The present application does not specifically limit the type of the terminal device.
[0070] First, the terminal device involved in the embodiments of the present application will be introduced below.
[0071] See Figure 3A , Figure 3A which shows a schematic structural diagram of an exemplary terminal device 100 provided by the embodiments of the present application.
[0072] 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. Among them, the sensor module 180 may include an ambient light sensor 180A, etc.
[0073] It can be understood that the structure schematically shown in the embodiments 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 those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0074] 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. Among them, different processing units may be independent devices or integrated in one or more processors.
[0075] Among them, the controller may be the nerve center and command center of the terminal device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
[0076] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0077] In some embodiments of the present application, the memory in the processor 110 may store the 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 current shooting ambient light parameters through the sensor 22 or the ambient light sensor 180A. Then, according to shooting parameters such as the shooting mode, zoom ratio, and ambient light parameters, determine the capability value and identification bit corresponding to the current shooting environment, and determine the corresponding image data format in the XML configuration table. Furthermore, it may control the sensor 22 to output an image in the corresponding image data format.
[0078] The charging management module 140 is used to receive a charging input from a charger. Among them, the charger may be a wireless charger or a wired charger.
[0079] 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 the inputs from the battery 142 and / or the charging management module 140 to supply power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc.
[0080] The wireless communication function of the terminal device 100 can be implemented by Antenna 1, Antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, and the baseband processor, etc.
[0081] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the terminal device 100 can be used to cover a single or multiple communication frequency bands.
[0082] The mobile communication module 150 can provide solutions for wireless communications such as 2G / 3G / 4G / 5G 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.
[0083] The terminal device 100 implements the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change the display information.
[0084] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), 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.
[0085] In some embodiments of the present application, the interface content currently output by the system is displayed on the display screen 194. For example, the interface content is the interface provided by the camera application, and specific reference can be made to Figure 1 in (A) and Figure 1and its related descriptions in
[0086] The terminal device 100 can implement the shooting function through the ISP, camera 193, video codec, GPU, display screen 194, application processor, etc.
[0087] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light passes through the lens and is transmitted to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be provided in the camera 193.
[0088] The camera 193 is used to capture still images or videos. An 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 light 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 standard RGB, YUV, etc. formats. In some embodiments, the terminal device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0089] In some embodiments of the present application, the structure of the camera 193 may also refer to the foregoing Figure 2 and its related descriptions, which will not be elaborated here.
[0090] 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 terminal device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.
[0091] The video codec is used to compress or decompress digital videos. The terminal device 100 can support one or more video codecs. In this way, the terminal device 100 can play or record videos in multiple coding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0092] 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.
[0093] The internal memory 121 can be used to store computer-executable program code, and the executable program code includes instructions.
[0094] The terminal device 100 can implement audio functions through the audio module 170 and the application processor, etc. For example, music playback, recording, etc.
[0095] 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 sensed ambient light brightness. The ambient light sensor 180A can also be used to automatically adjust the white balance during photography. The ambient light sensor 180A can also cooperate with the proximity light sensor to detect whether the terminal device 100 is in the pocket to prevent accidental touch.
[0096] In some embodiments of the present application, the ambient light sensor 180A can also be used to obtain the ambient light parameters of the current shooting environment, and then the processor can be used to control the sensor to output image data in different formats.
[0097] The keys 190 include a power-on key, volume keys, etc. The keys 190 can be mechanical keys or touch keys. 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 state, power change, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation from the terminal device 100.
[0098] Figure 3B The software structure block diagram of the terminal device 100 according to the embodiments of the present application is shown.
[0099] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is, from top to bottom, the application layer, the application framework layer, the hardware abstraction layer (HAL), and the kernel layer.
[0100] The application layer may include a series of application packages. Such as Figure 3B As shown, the application package may include a camera (camera APK). Additionally, the application package may further include: gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, game, shopping, travel, instant messaging (such as short messages), etc. applications, which are not shown in the figure.
[0101] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions. For example Figure 3B As shown, the application framework layer may include a camera service. Additionally, 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 among the camera service, the input manager, the window manager, the content provider, the view system, and the activity manager can call each other.
[0102] 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 captured by the sensor, etc., and send the captured images to the camera application for display.
[0103] 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 corresponding hardware interfaces, and by accessing the HAL layer, the settings of the underlying hardware devices can be achieved. For example, relevant hardware components can be enabled or disabled in the HAL layer. In some embodiments, the core architecture of the HAL layer is composed of at least one of C++ or C.
[0104] Figure 3B Shows the camera hardware interface (CHI) and the camera development kit (CDK) involved in the HAL layer of the embodiments of the present application, hereinafter collectively referred to as chi-cdk. The HAL layer also includes the camx architecture, the self-developed camera system (os_camera), and the kernel mode driver of the linux video device driver framework (video for linux 2 kernel mode driver, V4L2 KMD). Os_camera includes multiple custom camera modes, such as ForceSensorMode.
[0105] Among them, chi-cdk contains a set of code implementations for customizable requirements, that is, it may include multiple functional driver features, for example, it may include features for implementing the above image generation method, or features for implementing the artificial intelligence shooting mode. Figure 3BThe feature of the Chinese image generation method is used as an example with chifeature2. The Chiframework is used to process the obtained camera shooting requests, etc., and call camx to obtain images. The sensor XML contains the configuration information corresponding to the feature, such as the XML configuration table of the shooting parameters required by chifeature2 and the corresponding relationship of the image data format.
[0106] Camx contains a set of code implementations of the general functional interfaces of the camera. The sensor nodes (sensornodes) included in camx include interfaces that can obtain various parameters in the sensor, such as interfaces for obtaining autofocus (AF), autoexposure (AE), and auto white balance (AWB), sensor image signals, optical image stabilizer (OIS) parameters, etc. Among them, AF, AE, and AWB can also be collectively referred to as 3A. The 3A status module can be used to identify the status of the parameters obtained through the 3A interfaces. For example, according to the AE value, the current ambient light parameters can be determined, and then the current ambient light level can be determined, such as the current environment being a dark environment, a relatively bright environment, or a medium-highlight environment, etc.
[0107] V4L2 KMD can implement the communication between modules such as camx and the sensors in the lower kernel layer. For example, camx and the sensor can communicate through the ioct1 function, such as sending an instruction to the sensor to output image data in the corresponding format.
[0108] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes the driver of the image sensor (sensor), and can also include the display driver, audio driver, sensor driver, driver of the touch chip, and input system, etc.
[0109] Through the above software architecture, when the user triggers a camera shooting request through the shooting button provided by the camera application, the Chiframework can send the shooting request to the camx architecture. The camx architecture can obtain the image signal generated by the sensor through V4L2 KMD and feedback it to the Chiframework to display a preview image in the camera application.
[0110] In some embodiments of the present application, chi-cdk can also obtain information such as shooting modes and zoom parameters in the camera application in the application layer, as well as the ambient brightness value in 3A obtained 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. Among them, each shooting parameter has corresponding set image data format information. Then, it controls the sensor to output image data in the corresponding format.
[0111] For example, chi-cdk can first obtain the currently used shooting mode from the camera APK. Each shooting mode in the XML configuration table has corresponding scene configuration parameters. For example, the scene configuration parameter for the normal mode is "0". Corresponding to different shooting modes, corresponding ability values are also configured in the XML configuration table. For example, when the shooting mode is normal mode, live mode, portrait mode, or large aperture mode, the corresponding ability 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 ability value can be determined in the XML configuration table.
[0112] If chi-cdk determines that the ability value corresponding to the currently used shooting mode is the preset value, chi-cdk can also obtain the zoom parameter used in the current shooting from the camera APK, and read the brightness value in 3A from camx. Then, it determines whether the current is in the ISZ scene according to the zoom multiple and the ambient light parameter. For example, if the current zoom multiple is greater than "2×" and / or the current ambient light parameter indicates that the current is a medium-highlight scene, it can be determined that the current identification bit is the ISZ scene. Furthermore, the corresponding format of image data can be output through the preset image data format setting value (setting) in the XML configuration table by controlling V4L2 KMD.
[0113] In some embodiments, chi-cdk can determine the corresponding image data format only according to the corresponding relationship between the scene configuration parameters and the setting in the XML configuration table, without obtaining whether it is in the ISZ scene.
[0114] It can 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 certain components, or split certain components, or have different component arrangements. The illustrated components can be implemented in hardware, software, or a combination of software and hardware.
[0115] Next, a method for generating an image provided by an embodiment of the present application is introduced. This method can be applied to the above terminal device 100, such as the mobile phone 10. As Figure 4A shown, Figure 4AThe steps in can specifically be performed by, for example, the ISP23 in Figure 2 or other processors that can send instructions to the sensor 22, hereinafter collectively referred to as the processor 110.
[0116] S401: Obtain shooting parameters.
[0117] The user can open the camera application on the terminal device 100 to take pictures or videos. When the user opens the camera application or triggers a shooting request through the shooting button provided by the camera application, for example, when the user clicks the shutter button 15 in the interface shown in (A) in Figure 1 , the processor 110 will obtain the shooting parameters used for the current shooting, such as one or more of the shooting parameters including the shooting mode, zoom ratio, ambient light parameters, etc.
[0118] Among them, the shooting modes include but are not limited to shooting modes such as "large aperture", "night scene", "portrait", "photo", "video recording", and "multi-camera video recording". The zoom ratios include but are not limited to "1.0×", "2.0×", etc. The ambient light parameter can specifically be the current ambient light brightness value, or a brightness level determined according to the current ambient light brightness value. For example, the current environment is a dark environment, a relatively bright environment, or a medium-high brightness environment, etc.
[0119] In some embodiments, the processor 110 can specifically obtain the shooting mode and zoom ratio from, for example, Figure 3B the camera application (camera APK) in, and can obtain the ambient light brightness value in 3A from camx.
[0120] In other embodiments, in addition to obtaining the specific values of the shooting mode, zoom ratio, and ambient light parameters, the processor 110 can also obtain the identifiers corresponding to the above shooting parameters. For example, chi-cdk can also determine the corresponding ability value according to the shooting mode, and determine the corresponding ISZ flag bit according to the zoom parameter and the ambient light brightness value.
[0121] It should be understood that the shooting parameters can also include the exposure rate set by the user, whether to add filters, etc., and the present application does not make specific limitations thereto.
[0122] In other embodiments, in the case where the terminal device 100 has multiple cameras, the processor 110 will also obtain the corresponding shooting parameters for each camera and generate its corresponding private variable. Or, the processor 110 can also generate its corresponding private variable only for the currently active camera. Thus, the problem that different cameras determine different image data formats according to the shooting parameters, resulting in the processor 110 being unable to determine which image data format is specifically used by different sensors, is avoided.
[0123] S402: Determine the corresponding image data format according to the shooting parameters.
[0124] The processor 110 can determine the image data format corresponding to the current shooting parameters according to the acquired shooting parameters. Further, the processor 110 can send an instruction to the sensor 22 to output image data in the corresponding format, such as the aforementioned bayer raw, binning image, or quad raw image, UHD image, nona pixel, etc. The present application does not specifically limit the type of the image data format.
[0125] In some embodiments, the processor 110 can determine the image data format corresponding to the current shooting parameters according to the preset correspondence between the shooting parameters and the image data format. For example, the correspondence can be an XML configuration table, which can include the ability values corresponding to different shooting modes, the flag bits corresponding to different zoom multiples and / or ambient light parameters, and the image data formats corresponding to different ability values and flag bits.
[0126] The following gives examples of the image data formats corresponding to different shooting parameters.
[0127] The processor 110 can 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 can be determined to output a binning image. Corresponding to a medium-highlight environment with a brightness level, it can be determined to output a bayer raw image. Corresponding to a brighter environment with a brightness level, it can be determined to output a quad raw image.
[0128] The processor 110 can determine the corresponding image data format only according to the shooting mode. For example, for shooting modes such as "video recording", "night scene", etc., it can be determined to output a binning image. Corresponding to shooting modes such as "ordinary", "live", it can be determined to output a bayer raw image. Corresponding to shooting modes such as "portrait", "large aperture" mode, it can be determined to output a quadraw image.
[0129] The processor 110 can determine the corresponding image data format only according to the zoom multiple. For example, for a zoom multiple of "1.0×", it can be determined to output a binning image. Corresponding to a zoom multiple from "2.0×" to "4.0×", it can be determined to output a full size image such as a bayer raw image or a quad raw image. Corresponding to a zoom multiple of "4.0×" and above, it can be determined to output a full size image such as a bayer raw image or a quad raw image, and also ensure that the number of pixel points is sufficient for digital zoom.
[0130] In some other embodiments, the processor 110 may also determine the corresponding image data format according to a variety of ambient light parameters, shooting modes, and zoom factors. When determining the image data format according to a variety of shooting parameters, priorities may be set for different shooting parameters. If the corresponding image data formats determined by a variety of 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 format corresponding to more shooting parameters.
[0131] In some other embodiments, the processor 110 may also preset the corresponding relationship between a variety of shooting parameters and image data formats. For example, for shooting modes such as "portrait" or "large aperture", zoom factors within "2×" to "4×", and medium-highlight scenes, quad raw images may be selected. Corresponding to shooting modes such as "ordinary" or "live photo", zoom factors of "4×" and above, and medium-highlight scenes, bayer raw images may be used. Corresponding to other remaining scenes, binning images may be selected for output.
[0132] It should be understood that the above only illustrates the corresponding relationship between shooting parameters and image data formats by way of example. In actual applications, different terminal devices may set different corresponding relationships according to requirements, and this application does not make specific limitations in this regard.
[0133] In some other embodiments, the processor 110 may obtain the image data formats corresponding to different zoom factors, ambient light parameters, and shooting modes according to the corresponding relationship between a variety of shooting parameters and image data formats pre-stored in chi-cdk, such as an XML configuration table. For specific reference, please also refer to the foregoing Figure 3B and its related descriptions.
[0134] S403: Control sensor 22 to output image data in the corresponding image data format.
[0135] Based on shooting parameters such as zoom factor, ambient light parameter, and shooting mode, the processor 110 determines the corresponding image data format, and may send a corresponding instruction to sensor 22. Then, sensor 22 may output the collected image signal as image data in the determined image data format.
[0136] In some embodiments, the image data output by sensor 22 may be used to generate a preview image in the camera interface, or may generate an image corresponding to the one saved in the terminal device after the user clicks the shutter button.
[0137] In some other embodiments, the image for preview and the finally saved image may be images in the same image data format, for example, both are images in the image data format determined according to the above step S402. Or the image for preview and the finally saved image may also be images in different image data formats. For example, the image for preview may be a binning image, and the finally saved image may be an image in the image data format determined according to the above step S402. This application does not make specific limitations on this.
[0138] Furthermore, based on the above image generation method, the terminal device can determine the corresponding shooting environment according to the current shooting parameters, as well as the requirements of the shooting environment for clarity and / or photosensitivity, so as to control the camera to output image data in different formats. Furthermore, in different scenarios, the best-quality images can be generated, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0139] It should be understood that in some embodiments, the terminal device can also repeatedly execute the above Figure 4A shown steps. The specific process can refer to Figure 4B , including:
[0140] S410: Detect the first shooting parameter.
[0141] When the user opens the camera application or triggers a photo-taking request through the shooting button provided by the camera application, the processor 110 will obtain the first shooting parameter used for the current shooting, such as one or more of the shooting parameters such as shooting mode, zoom ratio, and ambient light parameter. For details, refer to the foregoing step S401, which will not be elaborated here.
[0142] S420: Control sensor22 to output an image in the first image format.
[0143] The processor 110 can determine the corresponding first format under the current first shooting parameter according to the obtained first shooting parameter, and control sensor22 to output an image from the currently acquired first image signal in the determined first format. For details, refer to the foregoing steps S402 to S403, which will not be elaborated here.
[0144] S430: Detect the second shooting parameter.
[0145] When the processor 110 detects that the user has changed the shooting mode or zoom ratio, or detects that the ambient light parameter has changed significantly, the processor 110 can execute the above steps again. Or, the processor 110 can also regularly obtain the current shooting parameters at a preset time. Furthermore, the processor 110 will obtain the second shooting parameter used for the current shooting again. For details, refer to the foregoing step S401, which will not be elaborated here.
[0146] S440: Control sensor22 to output an image in the second image format.
[0147] The processor 110 can determine the corresponding second format under the current second shooting parameters according to the obtained second shooting parameters, and control sensor22 to output an image of the currently acquired second image signal in the determined second format. For details, please refer to the foregoing steps S402 to S403, which will not be elaborated here.
[0148] 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 a photo-taking request, so as to control the camera to output image data in different formats. Furthermore, in different scenarios, the best-quality images can be generated, improving the image quality, avoiding the user spending time debugging the image parameters, and improving the user's photo-taking experience.
[0149] In some embodiments, the processor 110 can first determine the ability value corresponding to the currently used shooting mode. When the ability value is determined to be a preset value, it can then determine whether it is currently in the ISZ scene according to the zoom ratio and ambient light parameters. If it is in the ISZ, it can control sensor22 to output an image through the image data format set in the XML configuration table. For details, please refer to the steps as Figure 5 shown, including:
[0150] S510: Obtain the current scene.
[0151] When the user opens the camera application or triggers a photo-taking request through the shooting button provided by the camera application program, the processor 110 can obtain the currently used shooting mode from the camera APK, such as shooting modes like "large aperture", "night scene", "portrait", "photo-taking", "video recording", and "multi-camera video recording". Among them, each shooting mode has corresponding scene configuration parameters. For example, the scene configuration parameter for the normal mode and the "photo-taking" mode is "0".
[0152] Moreover, corresponding to multiple cameras, the ID of each camera, that is, the camera id, will also be obtained. Corresponding to the case where multiple cameras are turned on, different cameras can respectively obtain the corresponding shooting modes and generate corresponding private variables.
[0153] S520: Match the product XML configuration item.
[0154] The processor 110 can find the configuration item corresponding to the scene in the sensorXML according to the scene configuration parameter corresponding to the shooting mode. For example, Figure 6Shows a schematic diagram of an XML configuration table named "forceSelectSensorModeConfig". The XML configuration table includes the sensor name "sensorName", the scene configuration parameter "sceneMode", the frame rate "fps", the capability value "capability", and the setting number "forceSelectSensorMode" of the corresponding image format, etc. 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. And, the corresponding sub-scene configuration parameter (subSceneMode) can also be configured. The subSceneMode is used to further divide the scene into multiple sub-scenes.
[0155] S530: Whether the scene matches successfully. If so, execute step S540. If not, end.
[0156] If the processor 110 finds the configuration item of the corresponding scene in the XML configuration table according to the currently used shooting mode, the scene matches successfully, and then step S540 is executed. If the corresponding configuration item is not found, the process ends. For example, the image is output in the default image data format.
[0157] S540: Obtain the capability value of the current scene configuration.
[0158] As Figure 6 shown, corresponding to different shooting modes, the corresponding capability values are also configured in the XML configuration table. ISP23 can determine the corresponding capability value according to the corresponding configuration item. For details, please refer to Figure 6 .
[0159] S550: Whether the capability value is 0. If so, end. If not, execute step S560.
[0160] 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.
[0161] In some embodiments, for example, the capability values for scenes such as "ordinary", "live", "portrait", and "large aperture" can be "1".
[0162] In some embodiments, corresponding to the ability value being "0", the processor 110 can also determine the corresponding image data format according to the setting in the XML configuration table. Alternatively, the processor 110 may not execute step 550, that is, regardless of the ability value, it determines the corresponding image data format according to the setting in the XML configuration table.
[0163] It should be understood that the ability value is described by way of example above. In some embodiments, the ability value can also be set to other numerical values or symbols, and the present application does not make specific limitations thereto.
[0164] S560: Obtain the current status flag bit.
[0165] The chi-cdk in the processor 110 can determine whether it is currently in the ISZ scene according to the zoom ratio and the ambient light parameter. For example, if the current zoom ratio is greater than "2×" and / or the current ambient light parameter indicates that the current is a medium-highlight scene, it can be determined that the current status flag bit is the ISZ scene.
[0166] It should be understood that the chi-cdk can determine the current flag bit in step S510. For example, when the user opens the camera application or triggers a photo-taking request through the photo-taking button provided by the camera application. The present application does not make specific limitations on the time when the status flag bit is generated.
[0167] S570: Whether the status flag bit is ISZ. If so, execute step S580; if not, end.
[0168] When the processor 110 determines that the status flag bit 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 images in the default image data format.
[0169] S580: Obtain the setting serial number configured for the current scene.
[0170] 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 images in the image data format corresponding to the setting.
[0171] 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 a photo-taking request, so as to control the camera to output image data in different formats. Furthermore, in different scenes, the best-quality images can be generated, improving the image quality, avoiding the user spending time debugging image parameters, and improving the user's photo-taking experience.
[0172] To solve the problem of large differences in the above-mentioned image quality, the present application provides an image generation device 700, including an acquisition unit 710, a determination unit 720, and a transmission unit 730.
[0173] The acquisition unit 710 is configured to acquire a first shooting parameter used by an image sensor of a shooting device to collect a first image signal. The determination unit 720 is configured to determine a first image format corresponding to the first shooting parameter, and the transmission unit 730 is configured to send a first output instruction to the image sensor, where the first output instruction is used to instruct the image sensor to output the collected first image signal as first image data having the first image format. The acquisition unit 710 is further configured 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 further configured to determine a second image format corresponding to the second shooting parameter, and the transmission unit 730 is further configured to send a second output instruction to the image sensor, where 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.
[0174] In some embodiments, the first shooting parameter and the second shooting parameter include one or more of a shooting mode, a zoom ratio, and an ambient light parameter
[0175] In some other embodiments, 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 clarity of the first image format is lower than that of the second image format; or, the shooting mode included in the first shooting parameter is a video recording 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 that of the second image format.
[0176] In some other embodiments, the zoom ratio included in the first shooting parameter is less than the zoom ratio included in the second shooting parameter, and the number of pixel points of the first image format is higher than that of the second image format.
[0177] In some other embodiments, the ambient light parameter included in the first shooting parameter is less than the ambient light parameter included in the second shooting parameter, and the brightness contrast parameter of the first image format is higher than that of the second image format.
[0178] In some 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-binned 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-binned image format; corresponding to the first image format being the pixel-binned image format, the second image format is the Bayer image format or the four-in-one Bayer image format.
[0179] In some other embodiments, the obtaining unit 710 is further configured to obtain an image format configuration table, where the image format configuration table includes the correspondence between the shooting mode, the ability value, and the image format. The determining unit 720 is further configured to determine, based on the image format configuration table, the first ability value corresponding to the first shooting mode in the first shooting parameters. The determining unit 720 is further configured to, corresponding to the first ability value being the first preset value, determine that the first image format is the image format corresponding to the first shooting mode in the image format configuration table; the determining unit 720 is further configured to, corresponding to the first ability value not being the first preset value, determine that the first image format is the preset image format.
[0180] In some other embodiments, the determining unit 720 is further configured to determine, based on the first zoom ratio and the first ambient light parameter in the first shooting parameters, the first identification bit corresponding to the first shooting parameters, where the first identification bit is used to indicate whether the scene corresponding to the first shooting parameters is a zoom scene; the determining unit 720 is further configured to, based on the first ability value being the first preset value and the first identification bit being the second preset value, determine that the first image format is the image format corresponding to the first shooting mode in the configuration table; the determining unit 720 is further configured to, based on the first ability value being the first preset value and the first identification bit not being the second preset value, determine that the first image format is the preset image format.
[0181] In some other embodiments, the terminal device includes a hardware abstraction layer, the hardware abstraction layer includes a camera platform architecture, and the camera hardware interface and the camera development kit chi-cdk in the camera platform architecture include an image format configuration table.
[0182] In some other embodiments, the terminal device further includes an application layer, the camera platform architecture further includes a camx interface, and the chi-cdk is configured to: obtain the first shooting mode and the first zoom ratio of the camera application from the application layer, and obtain the first ambient light parameter from the camx interface, and determine the first image format based on the first shooting mode, the first zoom ratio, and the first ambient light parameter, and send a first output instruction to the image sensor through the camx interface.
[0183] Furthermore, based on the above 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 a photo-taking request, so as to control the camera to output image data in different formats. Furthermore, the best-quality images can be generated in different scenarios, improving the image quality, avoiding the user spending time debugging image parameters, and enhancing the user's photo-taking experience.
[0184] 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 processes or functions described in the embodiments of the present application are 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. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that the computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state drive), etc.
[0185] Those of ordinary skill in the art can understand all or part of the processes in the above method embodiments. These processes can be completed by relevant hardware instructed by a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes various media that can store program codes, such as read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.
Claims
1. An image generation method, characterized in that, Applied to an electronic device, the electronic device includes a camera, and the camera includes an image sensor. The method includes: Receiving a user operation, and the electronic device turns on the camera application; After turning on the camera application, the electronic device enters the in sensor zoom (ISZ) scenario; When the electronic device is in the first ISZ scenario, the image sensor outputs image data in a first image format; When the electronic device is in the second ISZ scenario, the image sensor outputs image data in a second image format.
2. The method according to claim 1, wherein: The first image format is the bayer raw format, and the second image format is the quard raw format.
3. The method according to claim 1, wherein The clarity of the first image format is lower than that of the second image format.
4. The method according to claim 3, wherein: When the electronic device is in the first ISZ scenario, the shooting mode of the camera application is the normal mode or the live mode; When the electronic device is in the second ISZ scenario, the shooting mode of the camera application is the portrait mode or the large aperture mode.
5. The method according to claim 1, characterized in that The number of pixel points of the first image format is lower than that of the second image format.
6. The method according to claim 5, wherein: When the electronic device is in the first ISZ scenario, the zoom ratio of the camera application is the first zoom ratio; When the electronic device is in the second ISZ scenario, the zoom ratio of the camera application is the second zoom ratio, wherein the first zoom ratio is less than the second zoom ratio.
7. The method according to claim 1, characterized in that, The brightness contrast parameter of the first image format is higher than that of the second image format.
8. The method according to claim 7, wherein: When the electronic device is in the first ISZ scenario, the current ambient light brightness is the first brightness; When the electronic device is in the second ISZ scenario, the current ambient light brightness is the second brightness, wherein the first brightness is less than the second brightness.
9. An electronic device, characterized in that, Comprising a processor and an image sensor, wherein: The image sensor is used to output image data; The processor is used to determine the ISZ scenario to control the image sensor to output image data in an image format corresponding to the ISZ scenario to the processor.
10. The electronic device according to claim 9, wherein: When the electronic device is in the first ISZ scenario, the image sensor outputs image data in a first image format to the processor; When the electronic device is in the second ISZ scenario, the image sensor outputs image data in a second image format to the processor.
11. A computer-readable storage medium, characterized in that, Comprising instructions, when the instructions run on the electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 10.