WO2024093518A1 - 一种出图模式切换方法及相关设备 - Google Patents

一种出图模式切换方法及相关设备 Download PDF

Info

Publication number
WO2024093518A1
WO2024093518A1 PCT/CN2023/117483 CN2023117483W WO2024093518A1 WO 2024093518 A1 WO2024093518 A1 WO 2024093518A1 CN 2023117483 W CN2023117483 W CN 2023117483W WO 2024093518 A1 WO2024093518 A1 WO 2024093518A1
Authority
WO
WIPO (PCT)
Prior art keywords
mode
camera
image output
output mode
electronic device
Prior art date
Application number
PCT/CN2023/117483
Other languages
English (en)
French (fr)
Inventor
白春玉
Original Assignee
荣耀终端有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 荣耀终端有限公司 filed Critical 荣耀终端有限公司
Publication of WO2024093518A1 publication Critical patent/WO2024093518A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72448User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions
    • H04M1/72454User interfaces specially adapted for cordless or mobile telephones with means for adapting the functionality of the device according to specific conditions according to context-related or environment-related conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/667Camera operation mode switching, e.g. between still and video, sport and normal or high- and low-resolution modes

Definitions

  • the present application relates to the field of terminal technology, and in particular to a method for switching image output modes and related equipment.
  • image output modes i.e., image readout modes
  • image readout modes Different image output modes
  • users may have different requirements for image output modes.
  • the electronic device can switch to the corresponding image output mode based on the camera mode selected by the user.
  • each camera mode can correspond to multiple image output modes.
  • the electronic device can collect images based on an image output mode in the current camera mode.
  • the electronic device can also determine the current specific shooting scene in combination with factors such as HDR scene judgment results, and determine the target image output mode according to the current specific shooting scene.
  • the multiple image output modes corresponding to the current camera mode may include the target image output mode.
  • the electronic device loads the corresponding mode switching configuration parameters to switch to the target image output mode. It is understandable that the configuration parameters of the target image output mode have been loaded after entering the current camera mode.
  • the electronic device can switch the image output mode of the application from the current image output mode to the target image output mode through the corresponding mode switching configuration parameters. It is understandable that the number of register sequences included in the mode switching configuration parameters is less than the number of register sequences included in the configuration parameters of the image output mode.
  • This method can determine and switch to the corresponding image output mode based on different shooting scenes in the same camera mode, meeting the shooting needs of users in different scenes. At the same time, this method can avoid the delay caused by the need to download the configuration parameters of the output mode when switching the output mode. To some extent, it can avoid problems such as unsmooth images and freezes caused by long loading time of configuration parameters.
  • the present application provides a method for switching an image output mode.
  • the image output mode switching method can be applied to an electronic device.
  • the image output mode switching method may include: when the electronic device enters the first camera mode of a camera application, the electronic device may load a first configuration parameter of the first image output mode and a second configuration parameter of the second image output mode; the electronic device may display a first user interface of the camera application, the first user interface includes a first preview window, and the first preview window includes a first preview image collected by the electronic device based on the first image output mode; when the switching condition for switching the first image output mode to the second image output mode is met, the electronic device may load a third configuration parameter for switching the image output mode, the third configuration parameter is used to indicate that the first image output mode is switched to the second image output mode, and the number of register sequences in the third configuration parameter is less than the number of register sequences in the second configuration parameter; the electronic device may display a second user interface of the camera application, the second user interface includes a second preview window, and the second
  • the electronic device when entering the first camera mode of the camera application, can load the first Configuration parameters of multiple image output modes corresponding to camera modes.
  • the configuration parameters of the multiple image output modes may include configuration parameters of the first image output mode and configuration parameters of the second image output mode.
  • the electronic device may collect a first preview image based on the first image output mode and display the first preview image.
  • the electronic device may load a third configuration parameter for switching the image output mode, and switch the image output mode of the application from the first image output mode to the second image output mode based on the third configuration parameter. It can be understood that the configuration parameters of the second image output mode (i.e., the second configuration parameter) have been loaded long ago.
  • This method can avoid the delay caused by loading the configuration parameters of the second image output mode when switching the image output mode.
  • the number of register sequences in the third configuration parameter is less than the number of register sequences in the second configuration parameter. Therefore, the above method can greatly reduce the delay of switching the image output mode, and avoid the phenomenon of unsmooth picture and jamming caused by excessive delay in switching the image output mode.
  • the first camera mode can be any camera mode, for example, a normal photo mode, an HDR video mode, a night scene mode, and a portrait photo mode.
  • the user can trigger the electronic device to enter the first camera mode of the camera application by touching the camera mode option corresponding to the first camera mode.
  • the relevant description of the camera mode option can be found below and will not be elaborated here.
  • the first camera mode may be a default camera mode.
  • the user may trigger the electronic device to enter the first camera mode of the camera application by touching a camera application icon (e.g., camera application icon 101 shown in FIG. 2A ).
  • the user can also trigger the electronic device to enter the first camera mode through gestures, sounds, etc., and this application does not impose any restrictions on this.
  • the first image output mode is different from the second image output mode.
  • the first image output mode can be any image output mode
  • the second image output mode can be any image output mode different from the first image output mode.
  • the first image output mode may be image output mode C1.
  • the original image corresponding to the first preview image may be original image data P1.
  • the second image output mode may be the target image output mode.
  • the first image output mode is the default image output mode in the first camera mode.
  • the first configuration parameter of the first image output mode refers to the configuration parameter of the first image output mode
  • the second configuration parameter of the second image output mode refers to the configuration parameter of the second image output mode.
  • the first image output mode can be the Binning image output mode
  • the first configuration parameter refers to the configuration parameter of the Binning image output mode
  • the second image output mode can be the Remosaic image output mode
  • the second configuration parameter refers to the configuration parameter of the Remosaic image output mode.
  • the first image output mode can be the Binning image output mode
  • the first configuration parameter refers to the configuration parameter of the Binning image output mode
  • the second image output mode can be the IDCG image output mode
  • the second configuration parameter refers to the configuration parameter of the IDCG image output mode
  • the first user interface may be user interface 200
  • the first preview window may be preview window 201 included in user interface 200
  • the first preview image may be an image displayed in preview window 201 included in user interface 200.
  • the second user interface may be user interface 200
  • the second preview window may be preview window 201 included in user interface 200
  • the second preview image may be an image displayed in preview window 201 included in user interface 200.
  • the first user interface may be user interface 400
  • the first preview window may be preview window 201 included in user interface 400
  • the first preview image may be an image displayed in preview window 201 included in user interface 400.
  • the second user interface may be user interface 400
  • the second preview window may be preview window 201 included in user interface 400
  • the second preview image may be an image displayed in preview window 201 included in user interface 400.
  • the electronic device when the first camera mode is a normal photo mode, when the electronic device enters the first camera mode of the camera application, the electronic device may load the normal photo FMC configuration parameters.
  • the normal photo FMC configuration parameters may include the first configuration parameters and the second configuration parameters.
  • the normal photo FMC configuration parameters may also include configuration parameters of other image output modes.
  • the electronic device may load the HDR video recording FMC configuration parameters.
  • the HDR video recording FMC configuration parameters may include the first configuration parameters and the second configuration parameters.
  • the HDR video recording FMC configuration parameters may also include configuration parameters of other image output modes.
  • the first camera mode can be referred to above for related descriptions of other camera modes, and this application will not go into details here.
  • the third configuration parameter refers to a mode switching configuration parameter.
  • the third configuration parameter may include a control switch configuration parameter for switching to the second image output mode.
  • the number of register sequences in the third configuration parameter is less than the number of register sequences in the second configuration parameter. In some embodiments of the present application, the number of register sequences in the third configuration parameter may be less than the number of register sequences in the first configuration parameter. In some embodiments of the present application, the number of register sequences in the third configuration parameter may be less than the register sequences in the configuration parameters of any image output mode corresponding to the first camera mode.
  • the method may also include: the electronic device may determine whether the current scene is an HDR scene based on the brightness information of the first preview image, and obtain a first HDR scene judgment result; the electronic device may also search for an image output mode corresponding to the first camera mode and the first HDR scene judgment result based on the correspondence between the camera mode, the HDR scene judgment result and the image output mode, and the searched image output mode is the target image output mode. Satisfying the switching condition for switching the first image output mode to the second image output mode may specifically include: the target image output mode is the second image output mode.
  • the electronic device can judge the HDR scene based on the brightness information of the preview image (e.g., the first preview image), and determine the target output mode based on the current camera mode (e.g., the first camera mode) and the HDR scene judgment result. And, when the target output mode is the second output mode, the electronic device can load the third configuration parameter and switch the first output mode to the second output mode. In this way, the electronic device can determine the current specific shooting scene based on the brightness information of the preview image, and select a reasonable output mode according to the current specific shooting scene and camera mode, so that the image can be output through a more appropriate output mode, thereby obtaining an image that better meets the needs of the user.
  • the target output mode e.g., the first preview image
  • the electronic device can load the third configuration parameter and switch the first output mode to the second output mode. In this way, the electronic device can determine the current specific shooting scene based on the brightness information of the preview image, and select a reasonable output mode according to the current specific shooting scene and camera mode, so that the
  • the original image corresponding to the first preview image is the original image data
  • the brightness information of the first preview image can also be understood as the brightness information included in the image data P1-1.
  • the first HDR scene determination result refers to the HDR scene determination result obtained based on the brightness information of the first preview image.
  • the specific description of the HDR scene determination result can be referred to below and will not be repeated here.
  • the electronic device can judge the HDR scene based on the brightness information of the preview image (e.g., the first preview image), and determine the target output mode based on the current camera mode (e.g., the first camera mode), the current zoom factor, and the HDR scene judgment result. And, when the target output mode is the second output mode, the electronic device can load the third configuration parameter and switch the first output mode to the second output mode. In this way, the electronic device can determine the current specific shooting scene based on the brightness information and zoom factor of the preview image, and select a reasonable output mode according to the current specific shooting scene and camera mode, so that the image can be output through a more appropriate output mode, thereby obtaining an image that better meets user needs.
  • the target output mode e.g., the first preview image
  • the electronic device can load the third configuration parameter and switch the first output mode to the second output mode. In this way, the electronic device can determine the current specific shooting scene based on the brightness information and zoom factor of the preview image, and select a reasonable output mode according to the current specific shooting
  • the electronic device determines whether the current scene is an HDR scene based on the brightness information of the first preview image, and obtains a first HDR scene judgment result, which may specifically include: the electronic device may determine a first adaptive dynamic range compression gain, first dark area brightness information, and first ambient brightness based on the brightness information of the first preview image; the electronic device may determine whether the first adaptive dynamic range compression gain, the first dark area brightness information, and the first ambient brightness meet the conditions for entering the HDR scene, and whether they meet the conditions for exiting the HDR scene; when the first adaptive dynamic range compression gain, the first dark area brightness information, and the first ambient brightness meet the conditions for entering the HDR scene, the electronic device may determine that the current scene is an HDR scene, and the first HDR scene judgment result is used to indicate that the current scene is an HDR scene; when the first adaptive dynamic range compression gain, the first dark area brightness information, and the first ambient brightness meet the conditions for exiting the HDR scene, it is determined that the current scene is not an HDR
  • the conditions for entering the HDR scene may include: the first adaptive dynamic range compression gain is greater than the gain threshold Z1 or the first dark area brightness information is less than the dark area brightness threshold A1, and the first environment brightness is greater than the environment brightness threshold H1.
  • the conditions for exiting the HDR scene may include: the first adaptive dynamic range compression gain is less than the gain threshold Z2 or the first dark area brightness information is greater than the dark area brightness threshold A2, and the first environment brightness is less than the environment brightness threshold H2.
  • Z1 is greater than Z2, A1 is less than A2, and H1 is greater than H2.
  • the electronic device can be based on the brightness of the preview image (for example, the first preview image).
  • the information determines the adaptive dynamic range compression gain, dark area brightness information and ambient brightness, and determines whether the current scene is an HDR scene based on these parameters, and obtains a judgment result.
  • the electronic device can determine whether the current specific shooting scene includes an HDR scene, and prepare for the subsequent judgment of whether to switch from the first output mode to the second output mode.
  • the adaptive dynamic range compression gain, dark area brightness information and ambient brightness do not meet the conditions for entering the HDR scene and exiting the HDR scene, the first HDR scene judgment result is consistent with the HDR scene judgment result obtained last time, which can avoid the increase in power consumption due to frequent switching of the output mode.
  • the first adaptive dynamic range compression gain, the first dark area brightness information and the first environment brightness respectively refer to AdrcGain, DarkLuma and LV determined based on the brightness information of the first preview image.
  • the original image corresponding to the first preview image is the original image data P1.
  • the first adaptive dynamic range compression gain, the first dark area brightness information and the first ambient brightness have the same meanings as the adaptive dynamic range compression gain (AdrcGain), the dark area brightness information (DarkLuma) and the ambient brightness (LV) shown in FIG. 6A.
  • the method may further include: when the electronic device enters the first camera mode of the camera application, the electronic device may also load configuration parameters of at least one image output mode other than the first image output mode and the second image output mode.
  • the electronic device when the electronic device enters the first camera mode, more configuration parameters of the image output mode can be loaded, which are not limited to the configuration parameters of the first image output mode (i.e., the first configuration parameters) and the configuration parameters of the second image output mode (i.e., the second configuration parameters). In this way, the electronic device can switch between more image output modes in the same camera mode, which greatly meets the user's diverse shooting needs.
  • the electronic device displays a first user interface of a camera application, which may specifically include: after the electronic device loads the first configuration parameter and before the electronic device loads the second configuration parameter, the electronic device may display the first user interface of the camera application.
  • the first configuration parameters of the first image output mode can be first loaded, a first preview image can be acquired based on the first image output mode, and a first user interface can be displayed. After displaying the first user interface, the electronic device can then load the second configuration parameters of the second image output mode. This method can shorten the delay between entering the camera mode and displaying the preview image.
  • the electronic device displays the first user interface of the camera application, which may specifically include: after the electronic device loads the second configuration parameter, the electronic device may display the first user interface of the camera application.
  • the first configuration parameters of the first image output mode and the second configuration parameters of the second image output mode can be loaded, and then the first preview image can be acquired based on the first image output mode, and the first user interface can be displayed.
  • This method can load the configuration parameters of the image output mode corresponding to the camera mode as much as possible before displaying the preview image, which is conducive to the rapid switching of the image output mode after the camera application enters the camera mode.
  • the electronic device may first load the first configuration parameters of the first image output mode and apply the first configuration parameters, that is, collect images based on the first image output mode. At the same time, the electronic device may continue to load the second configuration parameters of the second image output mode. That is, the time when the electronic device applies the first configuration parameters is the same as the time when the second configuration parameters are loaded. There is no clear order for setting parameters.
  • the second user interface may include a first control.
  • the method may further include: in response to the operation on the first control, the electronic device may load configuration parameters of multiple image output modes corresponding to the second camera mode, and the multiple image output modes may include a third image output mode; the electronic device may also display a third user interface of the camera application, and the third user interface may include a third preview window, and the third preview window may include a third preview image collected by the electronic device based on the third image output mode.
  • a user can trigger an electronic device to switch camera modes (as shown in Figures 2B and 2C).
  • the electronic device can reload the configuration parameters of the various image output modes corresponding to the switched camera mode, and capture images based on the default image output mode in the switched camera mode.
  • the second camera mode is the camera mode after switching.
  • the second camera mode can be any camera mode different from the first camera mode, for example, a normal photo mode, an HDR video mode, a night scene mode, and a portrait photo mode, etc.
  • the third image output mode can be a default image output mode in the second camera mode.
  • the first control can be any camera mode option in the camera mode options 202 (as shown in FIG. 2B ), and the first control is different from the camera mode option corresponding to the first camera mode.
  • the first control can be a night mode option/portrait mode option/photo mode option, etc.
  • the camera mode option corresponding to the first camera mode can be a photo mode option
  • the first control can be a portrait mode option. It is understandable that the camera modes corresponding to the above camera mode options can be referred to below, and will not be described in detail here.
  • the camera mode option 202 may also include an HDR video recording mode option.
  • the first camera mode may be a normal photo mode
  • the second camera mode may be an HDR video recording mode.
  • the image output mode corresponding to the HDR video recording mode may include a Binning image output mode and an IDCG image output mode.
  • the third image output mode may be a Binning image output mode.
  • the third image output mode may be an IDCG image output mode.
  • the first user interface when the first camera mode is a normal photo mode, as shown in FIG2B , the first user interface may be user interface 200.
  • the second camera mode may be an HDR video recording mode
  • the third user interface may be user interface 400
  • the third preview window may be preview window 201 included in user interface 400
  • the third preview image may be an image displayed in preview window 201 included in user interface 400.
  • the first camera mode may be an HDR video recording mode
  • the second camera mode may be a normal photo taking mode
  • the first user interface may be user interface 400.
  • the first camera mode may be a normal photo taking mode
  • the third user interface may be user interface 200
  • the third preview window may be preview window 201 included in user interface 200
  • the third preview image may be an image displayed in preview window 201 included in user interface 200.
  • the electronic device loads configuration parameters of multiple image output modes corresponding to the second camera mode, specifically including: the electronic device can load configuration parameters of all image output modes corresponding to the second camera mode.
  • the third image output mode may be the same as the first image output mode. In some other embodiments of the present application, the third image output mode may be the same as the second image output mode. In some other embodiments of the present application, the third image output mode may be different from the first image output mode and also different from the second image output mode.
  • the electronic device when the electronic device enters the first camera mode of the camera application, loads the first configuration parameters of the first image output mode and the second configuration parameters of the second image output mode, which may specifically include: in response to the operation of switching the camera application from the background running state to the foreground running state, the electronic device may load the configuration parameters of multiple image output modes corresponding to the first camera mode.
  • the multiple image output modes may include the first image output mode and the second image output mode.
  • the first camera mode is the camera mode last used before the camera application switches to the foreground running state.
  • the user can trigger the camera application to switch from background operation to foreground operation (as shown in Figures 2E and 2F).
  • the electronic device can reload the configuration parameters of the multiple image output modes corresponding to the camera mode last used before the camera application switched to the foreground operation state. In this way, when the electronic device switches the image output mode under the same camera mode, there is no need to load the configuration parameters of the image output mode that needs to be switched, so that the delay of switching the image output mode is reduced, so that the picture display can be smoother, and the jamming caused by the excessive delay of switching the image output mode is avoided.
  • the operation of switching the camera application from the background running state to the foreground running state refers to: a user operation acting on the task card 501 (as shown in FIG. 2E ) in the user interface 500.
  • the first camera mode is the HDR video recording mode.
  • the electronic device loads configuration parameters of multiple image output modes corresponding to the first camera mode, specifically including: the electronic device can load configuration parameters of all image output modes corresponding to the first camera mode.
  • the first camera mode may be the historical camera mode L1 shown in FIGS. 8 and 9 .
  • the first image output mode is a default image output mode of the first camera mode.
  • the electronic device after the electronic device switches from background operation to foreground operation, it can capture images based on the default output mode of the camera mode last used before the camera application switches to the foreground operation state.
  • the default image output mode of the first camera mode can be any one of the multiple image output modes corresponding to the first camera mode.
  • the first image output mode is the image output mode last used before the camera application is switched to a foreground running state.
  • the electronic device after the electronic device switches from background operation to foreground operation, it can capture images based on the last image output mode used before the camera application switches to the foreground operation state.
  • the multiple image output modes corresponding to the last camera mode used before the camera application switches to the foreground operation state may include: the last image output mode used before the camera application switches to the foreground operation state.
  • the first image output mode may be the historical image output mode M1 shown in FIG. 9 .
  • the electronic device determines whether the current scene is an HDR scene based on brightness information of the first preview image, and obtains a first HDR scene determination result, which may specifically include:
  • the automatic exposure control module can determine the first adaptive dynamic range compression gain, the first dark area brightness information and the first ambient brightness based on the brightness information of the first preview image;
  • the automatic exposure control module can send the first adaptive dynamic range compression gain, the first dark area brightness information and the first ambient brightness to the perception engine in the electronic device;
  • the perception engine can determine whether the current scene is an HDR scene based on the first adaptive dynamic range compression gain, the first dark area brightness information and the first ambient brightness, and obtain a first HDR scene judgment result.
  • the method may further include: the perception engine may send the first HDR scene judgment result to a decision module in the electronic device.
  • the decision module may determine the target image output mode based on the first camera mode and the first HDR scene judgment result.
  • the decision module may determine the target image output mode based on the first camera mode, the current zoom factor and the first HDR scene judgment result. After the decision module determines the target image output mode, relevant information of the target image output mode may be sent to the sensor node module in the electronic device.
  • the electronic device loads the third configuration parameters for switching the image output mode, which may specifically include: when the target image output mode is the second image output mode, the sensor node module can determine the third configuration parameters, and send the third configuration parameters to the camera in the electronic device; the camera can switch the configuration parameters of the currently applied image output mode from the first configuration parameters to the second configuration parameters based on the third configuration parameters.
  • the present application provides an electronic device, comprising one or more memories and one or more processors; wherein the one or more memories are coupled to the one or more processors, the memories are used to store computer program code, the computer program code comprises computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method described in the first aspect and any possible implementation manner of the first aspect.
  • the present application provides a computer storage medium comprising computer instructions.
  • the computer instructions When the computer instructions are executed on an electronic device, the electronic device executes the method described in the first aspect and any possible implementation of the first aspect.
  • an embodiment of the present application provides a chip that can be applied to an electronic device.
  • the chip includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method described in the above-mentioned first aspect and any possible implementation method of the first aspect.
  • an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute the method described in the first aspect and any possible implementation of the first aspect.
  • the electronic device provided in the second aspect, the computer storage medium provided in the third aspect, the chip provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method described in the first aspect and any possible implementation of the first aspect. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects of the method described in the first aspect and any possible implementation of the first aspect, and will not be repeated here.
  • FIG1 is a schematic diagram of a method for switching image output modes provided in an embodiment of the present application.
  • 2A-2F are schematic diagrams of a group of user interfaces provided in an embodiment of the present application.
  • FIG3 is a schematic diagram of a software structure of an electronic device provided in an embodiment of the present application.
  • FIG4 is a schematic diagram of a software and hardware interaction provided in an embodiment of the present application.
  • FIG5 is a flow chart of a method for switching image output modes provided in an embodiment of the present application.
  • FIG6A is a flowchart of another method for switching image output modes provided in an embodiment of the present application.
  • FIG6B is a schematic diagram of an I2C waveform for loading configuration parameters provided in an embodiment of the present application.
  • FIG7 is a flowchart of another method for switching image output modes provided in an embodiment of the present application.
  • FIG8 is a flowchart of another method for switching image output modes provided in an embodiment of the present application.
  • FIG9 is a flowchart of another method for switching image output modes provided in an embodiment of the present application.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • Camera modules are generally installed in electronic devices such as mobile phones and tablets.
  • the photosensitive element e.g., image sensor
  • the image output mode i.e., image readout mode refers to the way the photosensitive element obtains RAW image.
  • image sensor refers to image sensor.
  • Image sensor can include CCD, CMOS, etc.
  • CCD is called Charge-coupled Device in English, which refers to charge coupled device image sensor.
  • CMOS is called Complementary Metal Oxide Semiconductor in English, which refers to complementary metal oxide semiconductor image sensor.
  • RAW images refer to the original data that is converted into digital signals by image sensors such as CCD or CMOS.
  • Binning is an image readout mode, which refers to adding the induced charges in adjacent pixels together and reading them out in a one-pixel mode. Binning is divided into horizontal Binning and vertical Binning. Horizontal Binning is to add the charges of adjacent rows together for reading, while vertical Binning is to add the charges of adjacent columns together for reading.
  • the advantage of Binning technology is that it can combine several pixels to be used as one pixel, while maintaining the field of view angle unchanged, it can increase the photosensitive area, improve the sensitivity of light sensing in dark places, and reduce the resolution.
  • IDCG stands for Intra-scene Dual Convert Gain, which means the intra-scene dual conversion gain image output mode.
  • IDCG refers to reading out two frames of high conversion gain (HCG) and low conversion gain (LCG) images at the same exposure time, and finally fusing them into one frame.
  • HCG high conversion gain
  • LCG low conversion gain
  • IDCG is to obtain images under two conversion gains in one exposure, and finally fuse them into one frame.
  • Remosaic refers to converting the original pixel arrangement of a 4-cell image sensor into a Bayer arrangement and then reading out the image.
  • reading images based on the Binning output mode can increase the frame rate while keeping the field of view area and ratio unchanged, and can also increase the sensitivity of light sensing in dark places, but this output mode will reduce the output resolution.
  • reading images based on the IDCG output mode can increase the dynamic range of the output image, but this output mode consumes more power.
  • reading images based on the Remosaic output mode can obtain images with many pixels and high clarity, but this output mode will result in small pixels and low sensitivity.
  • the electronic device can choose to switch to the corresponding image output mode based on the different camera modes selected by the user. As shown in Figure 1, after the user turns on the camera application in the electronic device, he can select the camera mode to be used when shooting. For example, normal photo mode, night scene mode, and portrait photo mode. After the electronic device determines that the image output mode corresponding to the camera mode selected by the user is mode X, it can load the initialization configuration parameters, then load the configuration parameters of mode X, and finally use mode X to read the image. Once the electronic device determines that the image output mode is to be changed from mode X to mode Y, the electronic device can load the configuration parameters of mode Y, and finally use mode Y to read the image. Similarly, once the electronic device determines that the image output mode is to be switched from mode Y to mode X, it needs to reload the configuration parameters of mode X and overwrite the previously loaded configuration parameters of mode Y.
  • the electronic device needs to load the configuration parameters of the image output mode.
  • the configuration parameters of the image output mode may include hundreds of register sequences, which will cause a large switching delay. If the electronic device does not have time to complete the loading in a very short time, it may even cause the picture displayed by the electronic device to be not smooth when switching the image output mode.
  • each camera mode can correspond to multiple image output modes.
  • the electronic device can capture images based on an image output mode in the current camera mode.
  • the electronic device can also determine the current specific shooting scene based on factors such as the camera mode and the HDR scene judgment result, and determine the target image output mode based on the current specific shooting scene.
  • the electronic device can load the corresponding mode switching configuration parameters to switch to the target image output mode. It can be understood that the configuration parameters of the target image output mode have been loaded after entering the current camera mode.
  • the electronic device can use the corresponding mode switching configuration parameters to enable the image sensor in the camera to apply the configuration parameters of the target image output mode without having to apply the configuration parameters of the current image output mode.
  • the register sequence included in the mode switching configuration parameters is much less than the register sequence included in the configuration parameters of the image output mode.
  • the corresponding image output mode may include a Binning image output mode and a Remosaic image output mode.
  • the corresponding image output mode may include a Binning image output mode and an IDCG image output mode.
  • the electronic device in this application refers to terminal devices such as mobile phones and tablet computers. It is understood that the electronic device can also be a wearable device, a vehicle-mounted device, an augmented reality (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 (for example, a SLR camera, a card camera) and other devices.
  • AR augmented reality
  • VR virtual reality
  • UMPC ultra-mobile personal computer
  • PDA personal digital assistant
  • This application does not impose any restrictions on the specific type of electronic device.
  • GUI graphical user interface
  • user interface refers to a user interface related to computer operation displayed in a graphical manner. It can be an interface element such as an icon, window, control, etc. displayed on the display screen of an electronic device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets and other visual interface elements.
  • the user interface 100 displays a page including application icons, which may include multiple application icons (e.g., weather application icon, calendar application icon, photo album application icon, notes application icon, email application icon, application store application icon, settings application icon, etc.).
  • a page indicator may also be displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages.
  • There are multiple application icons e.g., camera application icon 101, browser application icon, information application icon, dial application icon
  • the area where these application icons are located may be called a dock bar, and the application icons in the dock bar generally do not change when the page is switched.
  • the camera application icon 101 is an icon of a camera application (ie, a camera application).
  • the camera application icon 101 can be used to trigger the launch of the camera application.
  • the electronic device may detect a user operation on the camera application icon 101.
  • the electronic device may load configuration parameters of all image output modes under a default camera mode (e.g., a normal photo mode), capture an image using the default image output mode under the default camera mode, and display a user interface 200 as shown in FIG. 2B.
  • Screen 200 is a shooting interface of the default camera mode of the camera application, on which the user can preview images and complete taking photos.
  • the user interface 200 may include a preview window 201 , a camera mode option 202 , a zoom factor control 203 , an album shortcut control, a shutter control, and a camera flip control.
  • the preview window 201 can be used to display the preview image.
  • the album shortcut control can be used to open the album application.
  • the shutter control can be used to monitor the user operation that triggers the photo.
  • the camera flip control can be used to monitor the user operation that triggers the flipping of the camera.
  • the one or more camera mode options may be displayed in the camera mode option 202.
  • the one or more camera mode options may include: a night scene mode option, a portrait mode option, a photo mode option 2021, a video recording mode option, and more options 2022.
  • the camera mode corresponding to the photo mode option 2021 is the normal photo mode.
  • the normal photo mode is the default camera mode of the camera application.
  • the camera mode corresponding to the night scene mode option is the night scene mode.
  • the camera mode corresponding to the portrait mode option is the portrait photo mode.
  • the camera mode corresponding to the video recording mode option is the normal video recording mode. It is understandable that the camera mode option 202 may also include more or fewer shooting mode options.
  • the zoom magnification control 203 can be used to adjust the zoom magnification.
  • the specific meaning of the zoom magnification can be referred to below and will not be described in detail here. It is understood that the user can adjust the zoom magnification by touching different positions of the zoom magnification control 203, and can also adjust the zoom magnification by dragging the zoom magnification control 203 up and down.
  • user operations mentioned in this application may include but are not limited to touch (for example, click, etc.), voice control, gestures and other operations, and this application does not limit this.
  • the electronic device can use the default output mode (for example, Binning output mode) in the normal camera mode to capture images. That is to say, the image displayed in the preview window 201 in the user interface 200 is obtained by the camera in the electronic device using the default output mode in the normal camera mode.
  • the electronic device can judge the HDR scene, obtain the HDR scene judgment result, and then determine the target output mode in combination with the camera mode, zoom factor and HDR scene judgment result.
  • the electronic device can switch the current output mode from the default output mode in the normal camera mode to the target output mode.
  • the electronic device may detect a user operation acting on more options 2022 as shown in FIG. 2B .
  • the electronic device may display a user interface 300 as shown in FIG. 2C .
  • the user interface 300 may include several camera mode options.
  • the user interface 300 may include an HDR video recording mode option 301.
  • the camera mode corresponding to the HDR video recording mode option 301 is the HDR video recording mode.
  • the electronic device may detect a user operation on the HDR video recording mode option 301. In response to the user operation, the electronic device may load configuration parameters of all image output modes in the HDR video recording mode, capture images using the default image output mode in the HDR video recording mode, and display a user interface 400 as shown in FIG. 2D.
  • the electronic device can use the default output mode (e.g., IDCG output mode) in the HDR video mode to capture images. That is, the image displayed in the preview window 201 in the user interface 400 is obtained by the camera in the electronic device using the default output mode in the HDR video mode. In this case, the electronic device can judge the HDR scene and obtain the HDR scene judgment result. Then, the target image output mode is determined by combining the camera mode, zoom factor and HDR scene judgment result. When the target image output mode is inconsistent with the default image output mode in the HDR video recording mode, the electronic device can switch the current image output mode from the default image output mode in the HDR video recording mode to the target image output mode.
  • IDCG output mode e.g., IDCG output mode
  • the electronic device can detect a gesture operation of sliding upward and staying at the bottom of the user interface 400. In response to the gesture operation, the camera application exits the foreground operation, and the electronic device can display the user interface 500 shown in FIG2E.
  • the user interface 500 is a task view interface.
  • the user interface 500 includes a task card 501 and a task card 502.
  • Task card 501 is a task card corresponding to the camera application.
  • Task card 502 is a task card corresponding to the communication application.
  • the electronic device can detect a user operation acting on a blank area on the user interface 500. In response to the user operation, the electronic device can redisplay the user interface on which a number of application icons are placed.
  • the user interface on which a number of application icons are placed is similar to FIG2A , except that the time displayed on the user interface on which a number of application icons are placed may be different from that in FIG2A .
  • the user interface on which a number of application icons are placed can be understood as the "desktop" of the electronic device.
  • the present application refers to the user interface on which a number of application icons are placed as user interface J1. It can be understood that when the electronic device displays user interface J1, the camera application is in the background running state.
  • the user can also trigger the camera application to exit the foreground operation in other ways, and this application does not limit this.
  • the user can trigger the camera application to exit the foreground operation by using a navigation key.
  • the electronic device may detect a gesture operation of sliding upward and staying on the bottom of the user interface J1. In response to the gesture operation, the electronic device may redisplay the user interface 500 as shown in FIG. 2E.
  • the electronic device can detect a user operation acting on the task card 501 in the user interface 500. In response to the user operation, the electronic device can determine the most recently used camera mode and the most recently used image output mode, load the configuration parameters of all image output modes corresponding to the most recently used camera mode, and use the most recently used image output mode to capture an image. Accordingly, the electronic device can also display the user interface 600 shown in FIG. 2F. It is understandable that when the electronic device displays the user interface 600, the camera application is in the foreground running state.
  • mode1 may be an HDR video recording mode.
  • mode1 in the HDR recording mode can be used to capture images.
  • the image displayed in the preview window 201 in the user interface 600 is obtained by the camera in the electronic device using mode1.
  • the electronic device can determine the target image output mode based on the camera mode, zoom factor and HDR scene judgment result. When the target image output mode is inconsistent with mode1, the electronic device can switch the current image output mode from mode1 to the target image output mode.
  • the electronic device can detect a user operation on the task card 501 in the user interface 500. In response to the user operation, the electronic device can determine the most recently used camera mode, load the configuration parameters of all image output modes corresponding to the most recently used camera mode, and use the default image output mode under the most recently used image output mode to capture images. Accordingly, the electronic device can also display the user interface 600 shown in FIG. 2F.
  • the camera app when the camera app returns to the foreground, it can use the default output mode in HDR video mode. Capture image. That is, the image displayed in the preview window 201 in the user interface 600 is obtained by the camera in the electronic device using the default image output mode in the HDR video recording mode. Similarly, after the camera application returns to the foreground, the electronic device can determine the target image output mode based on the camera mode, zoom factor and HDR scene judgment result. When the target image output mode is inconsistent with the default image output mode in the HDR video recording mode, the electronic device can switch the current image output mode from the default image output mode in the HDR video recording mode to the target image output mode.
  • the software framework of the electronic device involved in the present application may include an application layer, an application framework layer (framework, FWK), a system library, an Android runtime, a hardware abstraction layer (HAL) and a kernel layer (kernel).
  • an application layer an application framework layer (framework, FWK)
  • FWK application framework layer
  • system library an application framework layer
  • Android runtime an Android runtime
  • HAL hardware abstraction layer
  • kernel layer kernel layer
  • the application layer may include a series of application packages. For example: camera application, calendar, gallery, call, Bluetooth, video, music, short message, WLAN and other applications (also referred to as applications).
  • the camera application may be used to shoot to obtain images and videos. It is understandable that the user may trigger the electronic device to start the camera application by touching the camera application icon 101 shown in FIG. 2A, thereby achieving shooting through the camera application.
  • the application framework layer provides application programming interface (API) and programming framework for the applications in the application layer.
  • API application programming interface
  • the application framework layer includes some predefined functions.
  • the application framework layer can include a series of system services.
  • System services are modular components that focus on specific functions.
  • the functions provided by the application framework API can communicate with system services to access the underlying hardware.
  • the application framework layer can include a camera service.
  • the camera service encapsulates the camera AIDL cross-process interface and provides it to the upper-level application for calling, and then receives image requests from the upper-level application. At the same time, it maintains the processing logic of the request at this layer internally, and finally sends the request by calling the camera HIDL cross-process interface, and waits for the result to be returned, and then uploads the result to the upper-level application.
  • the full name of AIDL in English is Android Interface Definition Language, which means Android interface definition language in Chinese.
  • the full name of HIDL in English is HAL interface definition language, which means hardware abstract layer interface definition language in Chinese.
  • the application framework layer may also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
  • a window manager may also include a content provider, a view system, a phone manager, a resource manager, a notification manager, etc.
  • the specific meanings thereof may be referred to in relevant technical documents and will not be described in detail here.
  • the runtime is responsible for the scheduling and management of the system.
  • the runtime includes a core library and a virtual machine.
  • the core library consists of two parts: one is the function that the programming language (for example, the Java language) needs to call, and the other is the core library of the system.
  • the application layer and the application framework layer run in the virtual machine.
  • the virtual machine executes the programming files (for example, Java files) of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
  • the system library can include multiple functional modules. For example: Surface Manager, Media Libraries, 3D graphics processing library (for example, OpenGL ES), 2D graphics engine (for example, SGL), etc.
  • 3D graphics processing library for example, OpenGL ES
  • 2D graphics engine for example, SGL
  • the specific meaning and function of these functional modules can be referred to in the relevant technical documents, which will not be elaborated here.
  • the Hardware Abstraction Layer is an interface layer between the operating system kernel and the upper-level software. Its purpose is to abstract the hardware.
  • the hardware abstraction layer is an abstract interface driven by the device kernel. It is used to implement the application programming interface that provides access to the underlying device to the higher-level Java API framework.
  • HAL can provide a standard interface to display the device hardware functions to the higher-level Java API framework.
  • HAL contains multiple library modules, such as camera HAL, audio HAL, etc. Each of these library modules implements an interface for a specific type of hardware component.
  • the system framework layer API requires access to the hardware of the portable device
  • the camera HAL can provide an interface for the camera service to access hardware components such as the camera.
  • the kernel layer is the foundation of the Android operating system.
  • the kernel layer is responsible for hardware drivers, networking, power, system security, and memory management.
  • the kernel layer is an intermediate layer between hardware and software, and its role is to pass application requests to the hardware.
  • the kernel layer can include camera drivers, display drivers, camera drivers, audio drivers, and sensor drivers.
  • the camera is used to capture static images or videos.
  • the electronic device may include one or more cameras.
  • the camera may include an image sensor.
  • the image sensor is a photosensitive element in the camera, which can use the photoelectric conversion function of the photoelectric device to convert the light signal on the photosensitive surface into an electrical signal that is proportional to the light signal.
  • the image signal processor (ISP) is used to process the data fed back by the camera.
  • the display screen is used to display images, videos, etc.
  • the display screen may include a display panel.
  • the display panel may be a liquid crystal display, an organic light emitting diode, a flexible light emitting diode, etc.
  • the electronic device may include one or more display screens.
  • the camera photosensitive element transmits the electrical signal to the ISP for processing, thereby obtaining an image visible to the naked eye on the display screen.
  • each camera mode can correspond to multiple image output modes.
  • the default image output mode in the camera mode is one of the multiple image output modes corresponding to the camera mode.
  • the default image output mode in the camera mode can be pre-set.
  • the default image output modes in different camera modes may be the same or different.
  • the normal camera mode and the HDR video recording mode are two camera modes.
  • the image output modes corresponding to the normal camera mode may include the Binning image output mode and the Remosaic image output mode.
  • the image output modes corresponding to the HDR video recording mode may include the Binning image output mode and the IDCG image output mode.
  • the default image output mode in the normal camera mode may be the Binning image output mode, and the default image output mode in the HDR video recording mode may also be the Binning image output mode.
  • the default image output mode in the normal camera mode may be the Binning image output mode, and the default image output mode in the HDR video recording mode may also be the IDCG image output mode.
  • the camera application can determine the current camera mode and the current zoom ratio, and pass the current camera mode and the current zoom ratio to the camera service.
  • the camera service can then pass the current camera mode and the current zoom ratio to the decision module.
  • the camera can send the raw image data collected by the image sensor to the image signal processor.
  • the image signal processor processes the raw image data.
  • the processed image data can be sent to the camera driver.
  • the camera driver then sends the processed image data to the automatic exposure control module.
  • the automatic exposure control module can obtain brightness information based on the processed image data and send the brightness information to the perception engine.
  • the perception engine can determine whether the current scene is an HDR scene based on the received brightness information, obtain an HDR scene judgment result, and send the HDR scene judgment result to the decision module.
  • the decision module can obtain relevant information of the target output mode in combination with the current camera mode, the current zoom multiple and the HDR scene judgment result, and send the relevant information of the target output mode to the sensor node module when the target output mode is inconsistent with the current output mode.
  • the sensor node module can determine the corresponding mode switching configuration parameters based on the relevant information of the target output mode, and send the mode switching configuration parameters to the camera driver. It can be understood that the mode switching configuration parameters may include control switch configuration parameters for switching to the target output mode.
  • the camera driver then sends the mode switching configuration parameters to the camera.
  • the camera can update the configuration parameters of the output mode applied by the image sensor based on the mode switching configuration parameters. That is, the image sensor can apply the configuration parameters of the target output mode.
  • the configuration parameters of the target output mode have been loaded into the register included in the image sensor before switching to the target output mode (for example, when the electronic device enters the current camera mode of the camera application). This means that the configuration parameters of the output mode applied by the electronic device can be updated to the configuration parameters of the target output mode, and the configuration parameters of the current output mode are no longer applied.
  • the image sensor after the image sensor applies the configuration parameters of the target image output mode, it can output frames based on the target image output mode. That is, the camera can collect raw image data based on the target image output mode, and the raw image data is sent to the camera driver after being processed by the image signal processor, and then passed to the camera HAL by the camera driver.
  • the camera HAL can process the image data uploaded by the camera driver to obtain a preview image, and send the preview image to the camera application via the camera service.
  • the camera application can send the preview image to the display screen for display. In this way, the user can see that there is a picture on the display screen.
  • the user can trigger the camera application to start.
  • the electronic device can load the configuration parameters of all image output modes corresponding to the default camera mode, and the electronic device can also apply the configuration parameters of the default image output mode in the default camera mode, thereby capturing images based on the default image output mode in the default camera mode.
  • S501 The camera application receives a request to start the camera application.
  • the user can trigger the electronic device to start the camera application.
  • the camera application in the electronic device can receive the request to start the camera application.
  • a user may click on the camera application icon 101. Accordingly, the electronic device may receive a request to start the camera application. In response to the request to start the camera application, the electronic device may start the camera application and display the user interface 200 shown in FIG2B . It is understandable that the user may also start the camera application by voice, gesture, etc., and the present application does not limit the specific method in which the user triggers the electronic device to start the camera application.
  • S502 The camera application sends a request to the camera service to start the camera service.
  • the camera application After receiving the request to start the camera application, the camera application can send a request to start the camera service to trigger the camera service to start.
  • the camera service can receive the request to start the camera service sent by the camera application and start it.
  • the camera service sends a request to start the camera HAL to the camera HAL.
  • the camera service After the camera service receives the request to start the camera service sent by the camera application, it can send a request to start the camera HAL to trigger the start of the process where the camera HAL is located.
  • the camera HAL can receive the request to start the camera HAL sent by the camera service and can start the corresponding process. It can be understood that after the process where the camera HAL is located is started, the stream can be allocated.
  • step S501-step S503 the specific startup process of the camera application (such as step S501-step S503) can be referred to relevant technical documents and will not be elaborated here.
  • S504 The sensor node module in the camera HAL sends initialization configuration parameters to the camera.
  • the sensor node module in the camera HAL can send initialization configuration parameters to the camera. Specifically, after the process where the camera HAL is located is started, the sensor node module in the camera HAL can send the initialization configuration parameters to the camera driver, and the camera driver then sends the initialization configuration parameters to the camera.
  • the sensor node module can send initialization configuration parameters to the camera.
  • the camera driver can send relevant configuration parameters (e.g., initialization configuration parameters) to the image sensor in the camera through the I2C interface, thereby writing the relevant configuration parameters to the registers included in the image sensor.
  • relevant configuration parameters e.g., initialization configuration parameters
  • I2C refers to Inter-Integrated Circuit, which means integrated circuit in Chinese. The specific meaning and function of I2C can be referred to the following text and related technical documents, and will not be explained in detail here.
  • the initialization configuration parameters may include parameters such as data transmission protocol, internal timing and interrupt frequency.
  • the initialization configuration parameters may specifically include several register sequences.
  • the register sequence may include instructions and addresses. The meanings of the instructions and addresses in the register sequence can be referred to in relevant technical documents and will not be described in detail here.
  • the camera can receive the initialization configuration parameters sent by the sensor node module.
  • the camera stores the initialization configuration parameters in the registers included in the image sensor.
  • the image sensor in the camera may include a register. After the camera receives the initialization configuration parameters sent by the sensor node module, the initialization configuration parameters may be stored in the register included in the image sensor.
  • S506 The camera application determines a default camera mode after startup.
  • the default camera mode can be determined. It is understandable that after the camera application is started, the user's request to change the camera mode has not been received. In this case, the electronic device captures images in the default camera mode.
  • a default zoom factor may also be determined, so that the electronic device may capture images based on the default camera mode and the default zoom factor.
  • the camera application after the camera application receives a request to start the camera application and starts it, it can be determined that the default camera mode is a normal photo taking mode, and the default zoom factor can be 1x.
  • the default camera mode can also be set to other camera modes, and the default zoom ratio can also be set to other zoom ratios.
  • the default camera mode can be a portrait mode.
  • the default zoom ratio can be 1.5x.
  • the camera modes may include normal photo mode, portrait photo mode, night scene mode, normal video mode, micro-movie mode, HDR video mode, etc.
  • the zoom factor mentioned in this application can represent the degree of change in the focal length of the camera, and accordingly, the zoom factor can also represent the degree of change in the field of view angle and the degree of change in the subject in the picture (i.e., the image displayed on the display screen of the electronic device).
  • the subject refers to an object photographed by a camera. In some embodiments of the present application, the subject is a human face.
  • the proportion of the subject in the image captured by the long focal length camera will be larger than that in the image captured by the short focal length camera.
  • the size of the subject in the picture also changes to n times the original size.
  • the focal length of the camera is increased to twice the original focal length
  • the size of the subject in the picture also increases to twice the original size.
  • the field of view angle will also change accordingly.
  • the shorter the focal length the larger the field of view angle.
  • the zoom factor can be expressed as nx. It means that the focal length changes to n times the original focal length. Wherein n is a positive number. According to the above, the larger n is, the longer the focal length, the smaller the field of view angle, and the larger the subject in the image captured by the camera. It can be understood that the present application does not limit the specific value of n. For example, n can be 10, 20, or 50. In some embodiments, n can reach 100 or even exceed 100.
  • the original focal length refers to the default focal length of the camera. In some embodiments of the present application, the camera of the electronic device can be divided into a main camera and a secondary camera. The original focal length refers to the default focal length of the main camera.
  • the camera application sends a default camera mode to the sensor node module.
  • the camera application can send the default camera mode to the camera service, and then the camera service can send the default camera mode to the sensor node module.
  • the camera application may also send an identifier of a default camera mode to the sensor node module.
  • the identifier of the default camera mode may be represented by text, numbers, strings, etc., and the present application does not limit this.
  • the camera application may send Photo to the sensor node. Photo represents a normal camera mode.
  • the sensor node may receive the default camera mode sent by the camera application.
  • the sensor node module determines the FMC configuration parameters corresponding to the default camera mode.
  • the FMC configuration parameters corresponding to the default camera mode include configuration parameters of all image output modes corresponding to the default camera mode and related information of the default image output mode under the default camera mode.
  • the sensor node module After the sensor node module receives the default camera mode sent by the camera application, it can determine the FMC configuration parameters corresponding to the default camera mode.
  • FMC stands for fast mode change, i.e., fast mode switching.
  • the FMC configuration parameters corresponding to the default camera mode may include configuration parameters of all image output modes corresponding to the default camera mode and related information of the default image output mode under the default camera mode. It is understandable that the default image output mode under the default camera mode can be preset.
  • the FMC configuration parameters corresponding to the default camera mode are the normal photo FMC configuration parameters.
  • the normal photo FMC configuration parameters may include configuration parameters of the Binning output mode, configuration parameters of the Remosaic output mode, and related information of the default output mode in the normal photo mode.
  • the configuration parameters of the output mode may include output size, color, data transmission rate, etc. Similar to the initialization configuration parameters, the configuration parameters of the output mode may also specifically include several register sequences. It is understandable that the configuration parameters of each output mode may include several groups of register sequences. In practical applications, the register sequences included in the mode configuration parameters corresponding to an output mode may reach hundreds of groups.
  • the electronic device stores FMC configuration parameters corresponding to several camera modes.
  • the FMC configuration parameters corresponding to each camera mode may include configuration parameters of all image output modes corresponding to the camera mode and the configuration parameters of the camera mode. Information about the default plotting mode in the plotting mode.
  • the relevant information of the default image output mode in the camera mode may be an identifier of the default image output mode. It is understandable that the identifier of the default image output mode may be represented by text, numbers, or strings, and the present application does not limit this.
  • the image output modes corresponding to the normal camera mode include the Binning image output mode and the Remosaic image output mode.
  • the default image output mode in the normal camera mode is identified as Binning
  • the default image output mode in the normal camera mode is the Binning image output mode.
  • the default image output mode in the normal camera mode is identified as Remosaic
  • the default image output mode in the normal camera mode is the Remosaic image output mode.
  • the information related to the default image output mode in the camera mode may be represented by a register sequence.
  • the instructions included in the register sequence may indicate the default image output mode in the camera mode.
  • the image output modes corresponding to the normal camera mode include the Binning image output mode and the Remosaic image output mode.
  • the FMC configuration parameters corresponding to the normal camera mode may include a register sequence for indicating the default image output mode.
  • the register sequence may include 0x0001.
  • 0x0001 is an instruction in the register sequence, which means that the default camera mode in the normal camera mode is the Binning image output mode.
  • the register sequence for indicating the default mode in the FMC configuration parameters corresponding to the normal camera mode may include 0x0011. 0x0011 means that the default camera mode in the normal camera mode is the Remosaic image output mode.
  • the sensor node module sends the FMC configuration parameters corresponding to the default camera mode to the camera.
  • the FMC configuration parameters corresponding to the default camera mode may be sent to the camera driver, which then sends them to the camera.
  • the camera driver may directly write the FMC configuration parameters corresponding to the default camera mode into the registers in the image sensor included in the camera.
  • the camera may receive the FMC configuration parameters corresponding to the default camera mode sent by the sensor node module.
  • the camera stores the FMC configuration parameters corresponding to the default camera mode in a register included in the image sensor.
  • the FMC configuration parameters corresponding to the default camera mode may be stored in a register included in the image sensor.
  • S511 The camera determines a default image output mode under the default camera mode based on the FMC configuration parameters corresponding to the default camera mode, and applies the configuration parameters of the default image output mode.
  • the camera After the camera receives the FMC configuration parameters corresponding to the default camera mode, it can determine the default image output mode under the default camera mode based on the relevant information of the default image output mode included in the FMC configuration parameters, and apply the configuration parameters of the default image output mode.
  • the default camera mode is the normal camera mode.
  • the image output modes corresponding to the normal camera mode include the Binning image output mode and the Remosaic image output mode.
  • the normal camera FMC configuration parameters may include a register sequence for indicating the default mode.
  • the register sequence for indicating the default image output mode includes 0x0001
  • the camera can determine that the default image output mode in the normal camera mode is the Binning image output mode. In this way, the camera can apply the configuration parameters of the Binning image output mode stored in the register.
  • the register sequence for indicating the default image output mode includes 0x0011
  • the camera can determine that the default image output mode in the normal camera mode is the Remosaic image output mode. In this way, The camera can apply the configuration parameters of the Remosaic output mode stored in the registers.
  • S512 The camera collects raw image data based on a default image output mode in a default camera mode.
  • the image sensor included in the camera can output frames according to the default image output mode. That is, the camera can collect raw image data based on the default image output mode.
  • other software and hardware modules in the electronic device can process the raw image data and finally display it on the display screen.
  • the electronic device after the electronic device executes steps S501-S507, it can determine the configuration parameters of all image output modes corresponding to the default camera mode, and first load the configuration parameters of the default image output mode in the default camera mode. After the loading is complete, the electronic device can directly apply the configuration parameters of the default image output mode in the default camera mode, that is, to capture images based on the default image output mode in the default camera mode. After the configuration parameters of the default image output mode in the default camera mode are loaded, the electronic device can continue to load the configuration parameters of other image output modes (except the default image output mode) corresponding to the default camera mode.
  • the configuration parameters of all the output modes corresponding to the default camera mode can be determined.
  • the sensor node module can first send the configuration parameters of the default output mode in the default camera mode to the camera.
  • the camera After the camera receives the configuration parameters of the default output mode in the default camera mode sent by the sensor node module, it can store them in the register included in the image sensor.
  • the camera can directly apply the configuration parameters of the default output mode in the default camera mode, so as to collect images based on the default output mode under the default mode camera.
  • the configuration parameters of other output modes in the default camera mode can be sent to the camera one after another. After the camera receives the configuration parameters of these output modes, it can store them in the register of the image sensor.
  • the electronic device can determine the target image output mode based on the camera mode, zoom factor and HDR scene judgment result, and adjust the current image output mode based on the target image output mode.
  • the electronic device after the electronic device executes the steps shown in FIG. 5, it can continue to determine the target image output mode, and when the target image output mode is inconsistent with the current image output mode, the current image output mode is updated to the target image output mode. That is, after the electronic device executes the steps shown in FIG. 5, it can also execute the steps shown in FIG. 6A.
  • S601 The camera application determines the current camera mode and the current zoom factor.
  • the current camera mode and the current zoom factor can be determined.
  • the camera application can determine the current camera mode and the current zoom factor once every period of time (for example, 1 millisecond) and send them down.
  • the period of time can be set according to actual needs, and the present application does not limit this.
  • S602 The camera application sends the current camera mode and the current zoom factor to the decision module.
  • the current camera mode and the current zoom factor may be sent to the decision module.
  • the decision module may receive the current camera mode and the current zoom factor sent by the camera application.
  • S603 The camera collects original image data P1 based on the image output mode C1.
  • the image sensor included in the camera outputs frames based on the image output mode C1, thereby realizing the collection of raw image data. It should be noted that the camera continuously collects raw image data based on the image output mode C1.
  • the raw image data P1 is only a part of the raw image data. It can be understood that the raw image data P1 can be a RAW image.
  • the original image data P1 may be original image data corresponding to one frame of image captured by a camera. In some other embodiments of the present application, the original image data P1 may also be original image data corresponding to several frames of image captured by a camera.
  • S604 The camera sends original image data P1 to the image signal processor.
  • the raw image data P1 may be sent to an image signal processor (ISP).
  • ISP image signal processor
  • the ISP can receive the original image data P1 sent by the camera.
  • the image signal processor processes the original image data P1 to obtain image data P1-1.
  • the ISP can process the original image data P1 based on the hardware modules such as IFE it includes to obtain image data P1-1.
  • the full name of IFE is Image Front End, which means image front end in Chinese.
  • the main functions of the IFE module include color correction, downsampling, de-mosaicing, and statistical 3A data.
  • ISP can also include hardware modules such as Image Process Engine (IPE) and Bayer Processing Segment (BPS).
  • IPE Image Process Engine
  • BPS Bayer Processing Segment
  • the image signal processor sends the image data P1-1 to the automatic exposure control module.
  • the ISP After the ISP processes the original image data P1 and obtains the image data P1 - 1 , it can send the image data P1 - 1 to the automatic exposure control module in the camera HAL.
  • the automatic exposure control module can receive the image data P1 - 1 sent by the ISP.
  • the automatic exposure control module determines the adaptive dynamic range compression gain, dark area brightness information and ambient brightness based on the image data P1-1.
  • Adaptive dynamic range compression gain refers to Adaptive dynamic range compression Gain, which can be abbreviated as AdrcGain.
  • AdrcGain can represent dynamic range.
  • Dynamic range is a term used to define the range of tonal details that a camera can capture in an image, usually from the lowest value to the highest overflow value. Simply put, it describes the ratio between the brightest and darkest tones that a camera can record in a single frame. The larger the dynamic range, the richer the brightness information contained in the image, and the more vivid the brightness and color performance of the image.
  • the dark area brightness information may include the average brightness of the dark area of the image.
  • DarkLuma is used in this application to represent the average brightness of the dark area of the image.
  • the automatic exposure control module can determine the pixels in the image data P1-1 whose brightness is less than a preset brightness threshold, and these pixels are the dark areas of the image data P1-1.
  • the automatic exposure control module can also determine the average brightness of all pixels in the dark areas of the image data P1-1.
  • the average brightness is the average brightness of the dark areas of the image data P1-1. brightness.
  • the automatic exposure control module can divide the image data P1-1 into regions, sort these regions from small to large according to the average brightness of each region, and then select the top k% of these regions. It can be understood that the k% region is the dark area in the image data P1-1.
  • the automatic exposure control module can determine the average brightness of the k% region. The average brightness is the average brightness of the dark area of the image data P1-1. It can be understood that the range of k is (0,100). For example, k can be 20.
  • the image data P1-1 sent by the ISP to the automatic exposure control module may include a histogram of the original image data P1.
  • the histogram may indicate the brightness of each pixel included in the original image data P1.
  • the automatic exposure control module may determine the average brightness of the first k% of pixels with the lowest brightness based on the histogram.
  • LV is used in this application to represent the ambient brightness. It is understandable that the method for determining LV can refer to relevant technical documents, which will not be described in detail here.
  • the automatic exposure control module can determine AdrcGain, DarkLuma and LV based on the brightness information included in the image data P1-1. It should be noted that AdrcGain, DarkLuma and LV represent the brightness information of the image data P1-1 to some extent.
  • the automatic exposure control module sends the adaptive dynamic range compression gain, dark area brightness information and ambient brightness to the perception engine.
  • the automatic exposure control module determines AdrcGain, DarkLuma and LV based on the image data P1-1, the AdrcGain, DarkLuma and LV can be sent to the perception engine.
  • the perception engine can receive AdrcGain, DarkLuma and LV sent by the automatic exposure control module.
  • the perception engine determines whether the current scene is an HDR scene based on the adaptive dynamic range compression gain, the dark area brightness information, and the ambient brightness, and obtains an HDR scene determination result.
  • HDR refers to High Dynamic Range Imaging
  • its full English name is High Dynamic Range Imaging.
  • computer graphics and film photography it is a set of technologies used to achieve a larger exposure dynamic range (i.e., a greater difference between light and dark) than ordinary digital imaging technology.
  • the perception engine can determine whether AdrcGain, DarkLuma and LV meet the conditions for entering the HDR scene, and whether AdrcGain, DarkLuma and LV meet the conditions for exiting the HDR scene.
  • AdrcGain, DarkLuma and LV meet the conditions for entering the HDR scene
  • the perception engine can determine that the current scene is an HDR scene and obtain the corresponding HDR scene judgment result.
  • AdrcGain, DarkLuma and LV meet the conditions for exiting the HDR scene, the perception engine can determine that the current scene is not an HDR scene and obtain the corresponding HDR scene judgment result.
  • the perception engine can determine that the current scene is consistent with the scene determined last time, that is, the HDR scene judgment result obtained this time is consistent with the HDR scene judgment result obtained last time.
  • the conditions for entering the HDR scene may include: AdrcGain is greater than the gain threshold Z1 or DarkLuma is less than the dark area brightness threshold A1, and LV is greater than the ambient brightness threshold H1.
  • the conditions for exiting the HDR scene may include: AdrcGain is less than the gain threshold Z2 or DarkLuma is greater than the dark area brightness threshold A2, and LV is less than the ambient brightness threshold H2. It can be understood that Z1>Z2, A1 ⁇ A2, H1>H2.
  • the gain threshold Z1, the dark area brightness threshold A1, the ambient brightness threshold H1, the gain threshold Z2, the dark area brightness The threshold A2 and the ambient brightness threshold H2 can be set according to actual needs, and the present application does not limit this.
  • the gain threshold Z1 can be 2.2
  • the dark area brightness threshold A1 can be 27,
  • the ambient brightness threshold H1 can be 50
  • the gain threshold Z2 can be 1.6
  • the dark area brightness threshold A2 can be 36
  • the ambient brightness threshold H2 can be 46.
  • the units of the ambient brightness threshold H1 and the ambient brightness threshold H2 can be candela/square meter (cd/m2).
  • the brightness mentioned in this application can also be represented by the grayscale value of the pixels in the image.
  • the perception engine may first determine whether AdrcGain, DarkLuma, and LV meet the conditions for entering the HDR scene. If AdrcGain, DarkLuma, and LV do not meet the conditions for entering the HDR scene, then determine whether AdrcGain, DarkLuma, and LV meet the conditions for exiting the HDR scene. For another example, the perception engine may first determine whether AdrcGain, DarkLuma, and LV meet the conditions for exiting the HDR scene. If AdrcGain, DarkLuma, and LV do not meet the conditions for exiting the HDR scene, then determine whether AdrcGain, DarkLuma, and LV meet the conditions for entering the HDR scene.
  • the perception engine can determine whether AdrcGain is greater than the gain threshold Z1, whether DarkLuma is less than the dark area brightness threshold A1, and whether LV is greater than the ambient brightness threshold H1. If AdrcGain is greater than the gain threshold Z1 or DarkLuma is less than the dark area brightness threshold A1, and LV is greater than the ambient brightness threshold H1, the perception engine can determine that the current scene is an HDR scene and obtain the corresponding HDR scene judgment result. Otherwise, the perception engine can determine that the current scene is not an HDR scene and obtain the corresponding HDR scene judgment result.
  • the perception engine can determine whether AdrcGain is less than the gain threshold Z2, whether DarkLuma is greater than the dark area brightness threshold A2, and whether LV is less than the ambient brightness threshold H2. If AdrcGain is less than the gain threshold Z2 or DarkLuma is greater than the dark area brightness threshold A2, and LV is less than the ambient brightness threshold H2, the perception engine can determine that the current scene is not an HDR scene and obtain the corresponding HDR scene judgment result. Otherwise, the perception engine can determine that the current scene is an HDR scene and obtain the corresponding HDR scene judgment result.
  • the HDR scene judgment result can be expressed in the form of text, numbers, words, strings, etc., and this application does not limit this.
  • the HDR scene judgment result obtained by the perception engine is "yes"
  • the HDR scene judgment result obtained by the perception engine is "no"
  • the HDR scene judgment result obtained by the perception engine is 1, and when the perception engine determines that the current scene is not an HDR scene, the HDR scene judgment result obtained by the perception engine is 0.
  • the perception engine determines that the current scene is an HDR scene, the HDR scene judgment result obtained by the perception engine is true, and when the perception engine determines that the current scene is not an HDR scene, the HDR scene judgment result obtained by the perception engine is false.
  • S610 The perception engine sends the HDR scene judgment result to the decision module.
  • the perception engine After the perception engine obtains the HDR scene judgment result, it can send the HDR scene judgment result to the decision module.
  • the decision module can receive the HDR scene judgment result sent by the perception engine.
  • the decision module determines the target image output mode based on the current camera mode, the current zoom factor and the HDR scene judgment result.
  • the electronic device may pre-store the corresponding relationship between the camera mode, zoom ratio, HDR scene judgment result and image output mode.
  • the decision module may search for the corresponding relationship with the current camera mode, the current zoom ratio and the image output mode.
  • the image output mode corresponding to the received HDR scene judgment result is the target image output mode determined by the decision module.
  • the corresponding image output mode is the Binning image output mode
  • the corresponding image output mode is the Remosaic image output mode
  • the corresponding image output mode is the Binning image output mode.
  • the camera mode is the HDR video recording mode
  • the corresponding image output mode is the IDCG image output mode
  • the corresponding image output mode is the Binning image output mode.
  • Table 1 is only an example, and the correspondence between the camera mode, zoom factor, HDR scene judgment result and image output mode is not limited to the contents shown in Table 1.
  • the current camera mode and the current zoom factor can be continuously obtained, and the HDR scene judgment can be continuously performed.
  • the current camera mode received by the decision module can be the normal photo mode
  • the current zoom factor can be 2x
  • the HDR scene judgment result can be "yes”
  • the decision module can determine that the target output mode is the Remosaic output mode based on Table 1.
  • the decision module sends relevant information of the target output mode to the sensor node module.
  • the relevant information of the target output mode can be sent to the sensor node module.
  • the relevant information of the target output mode may include the name of the target output mode (e.g., Binning/IDCG/Remosaic), and may also include the identifier of the target output mode.
  • the identifier of the target output mode may be represented by text, numbers, characters, words, etc., and this application does not limit this.
  • the identifier of the Binning output mode may be s1
  • the identifier of the IDCG output mode may be s2
  • the identifier of the Remosaic output mode may be s3.
  • s3 may be sent to the sensor node module.
  • the sensor node module can receive relevant information of the target output mode sent by the decision module.
  • the sensor node module determines whether the target image output mode is consistent with the image output mode C1 based on the relevant information of the target image output mode.
  • the sensor node module After the sensor node module receives the relevant information of the target output mode sent by the decision module, it can determine the target output mode.
  • the target output mode is compared with the current output mode (i.e., output mode C1) to determine whether the target output mode is consistent with the current output mode. It is understandable that the sensor node module can obtain relevant information of the current output mode.
  • the sensor node module may store relevant information of the current output mode.
  • the description of the relevant information of the current output mode can refer to the description of the relevant information of the target output mode above, which will not be repeated here.
  • the sensor node module can receive s3 to determine that the target image output mode is the Remosaic image output mode.
  • the current camera mode is the default camera mode. If the default camera mode is the normal camera mode, and the default image output mode in the normal camera mode is the Binning image output mode, then the current image output mode (i.e., image output mode C1) is the Binning image output mode.
  • the sensor node module can store relevant information about the Binning image output mode. Then, the sensor node module can determine that the target image output mode is inconsistent with the image output mode C1.
  • the electronic device may not perform subsequent steps. In this case, the camera may continue to collect raw image data based on the image output mode C1.
  • the target image output mode and the image output mode C1 are the image output modes corresponding to the current camera mode. If the sensor node module determines that the target image output mode is inconsistent with the image output mode C1, the mode switching configuration parameters can be determined.
  • the mode switching configuration parameters can be used to indicate that the camera application stores the configuration parameters of the target image output mode in the register included in its image sensor. It is understandable that the mode switching configuration parameters may include control switch configuration parameters for switching to the target image output mode. It is understandable that the mode switching configuration parameters may include several register sequences. It should be noted that the register sequence included in the mode switching configuration parameters is far less than the register sequence included in the configuration parameters of one image output mode. Typically, the register sequence included in the mode switching configuration parameters is a few groups or more than a dozen groups, while the register sequence included in the configuration parameters of one image output mode can reach hundreds of groups.
  • the sensor node module can determine that the mode switching configuration parameter is setting0. It is understandable that setting0 can be used to instruct the camera to switch from the Binning image output mode to the Remosaic image output mode. Setting0 may include a register sequence of configuration parameters for indicating that the camera applies the Remosaic image output mode.
  • the sensor node module can determine that the mode switching configuration parameter is setting1.
  • setting1 can be used to instruct the camera to switch from the Remosaic image output mode to the Binning image output mode.
  • Setting1 may include a register sequence of configuration parameters for indicating that the camera applies the Binning image output mode.
  • setting0 may include 0100
  • setting1 may include 0101.
  • mode switching configuration parameters can be seamless switching configuration parameters, that is, seamless setting.
  • the corresponding mode switching configuration parameters may include seamless setting0 and seamless setting1.
  • the sensor node module may determine that the mode switching configuration parameter is seamless setting1.
  • the sensor node module may determine that the mode switching configuration parameter is seamless setting0.
  • the corresponding mode switching when switching the image output mode in different camera modes, the corresponding mode switching
  • the configuration parameters can be the same.
  • the corresponding mode switching configuration parameters may include seamless setting0 and seamless setting1.
  • the corresponding mode switching configuration parameters may also include seamless setting0 and seamless setting1.
  • the corresponding mode switching configuration parameter is seamless setting1
  • the corresponding mode switching configuration parameter is seamless setting0
  • the corresponding mode switching configuration parameter is seamless setting1
  • the corresponding mode switching configuration parameter is seamless setting0
  • S615 The sensor node module sends the mode switching configuration parameters to the camera.
  • the sensor node module After the sensor node module determines the mode switching configuration parameters, it can send the mode switching configuration parameters to the camera driver, and the camera driver then sends the mode switching configuration parameters to the camera.
  • the camera can receive the mode switching configuration parameters sent by the sensor node module.
  • S616 The camera stores the mode switching configuration parameters in a register included in the image sensor.
  • the mode switching configuration parameters may be stored in a register included in the image sensor.
  • S617 The camera updates the current image output mode from the image output mode C1 to the target switching mode based on the mode switching configuration parameters.
  • the camera can apply the configuration parameters of the target switching mode based on the register sequence included in the mode switching configuration parameters, that is, the camera can adjust the configuration parameters of the currently applied image output mode from the configuration parameters of the image output mode C1 to the configuration parameters of the target switching mode.
  • S618 The camera collects raw image data based on the target image output mode.
  • the camera After the camera updates the current image output mode, it can collect raw image data based on the updated image output mode. That is, the camera can collect raw image data based on the target image output mode.
  • other software and hardware modules in the electronic device can process the raw image data and finally display it on the display screen.
  • the electronic device may determine one or more of the adaptive dynamic range compression gain, dark area brightness information, and ambient brightness (i.e., AdrcGain, DarkLuma, and LV) based on the image data P1-1, and determine whether the current scene is an HDR scene based on the determined one or more contents, and obtain an HDR scene judgment result.
  • the automatic exposure control module may determine one or more of the adaptive dynamic range compression gain, dark area brightness information, and ambient brightness based on the image data P1-1, and send the determined one or more contents to the perception engine.
  • the perception engine may determine whether the current scene is an HDR scene based on the one or more contents, and obtain an HDR scene judgment result.
  • the electronic device can determine AdrcGain and LV based on the image data P1-1, and determine whether the current scene is an HDR scene based on AdrcGain and LV.
  • the electronic device may determine whether AdrcGain and LV meet the requirements for entering the HDR scene. When AdrcGain and LV meet the conditions for entering an HDR scene and exiting an HDR scene. When AdrcGain and LV meet the conditions for exiting an HDR scene, the electronic device can determine that the current scene is an HDR scene and obtain the corresponding HDR scene judgment result. When AdrcGain and LV meet the conditions for exiting an HDR scene, the electronic device can determine that the current scene is not an HDR scene and obtain the corresponding HDR scene judgment result.
  • the perception engine can determine that the current scene is consistent with the scene determined last time, that is, the HDR scene judgment result obtained this time is consistent with the HDR scene judgment result obtained last time.
  • the conditions for entering the HDR scene may include: AdrcGain is greater than the gain threshold Z1 and LV is greater than the ambient brightness threshold H1.
  • the conditions for exiting the HDR scene may include: AdrcGain is less than the gain threshold Z2 and LV is less than the ambient brightness threshold H2. It can be understood that Z1>Z2, H1>H2.
  • the electronic device when AdrcGain is greater than the gain threshold Z1 and LV is greater than the ambient brightness threshold H1, the electronic device can determine that the current scene is an HDR scene and obtain a corresponding HDR scene judgment result. Otherwise, the electronic device can determine that the current scene is not an HDR scene and obtain a corresponding HDR scene judgment result.
  • the electronic device can determine DarkLuma and LV based on the image data P1-1, and determine whether the current scene is an HDR scene based on DarkLuma and LV.
  • the electronic device can determine whether DarkLuma and LV meet the conditions for entering and exiting the HDR scene. When DarkLuma and LV meet the conditions for entering the HDR scene, the electronic device can determine that the current scene is an HDR scene and obtain the corresponding HDR scene judgment result. When DarkLuma and LV meet the conditions for exiting the HDR scene, the electronic device can determine that the current scene is not an HDR scene and obtain the corresponding HDR scene judgment result. When DarkLuma and LV neither meet the conditions for entering nor exiting the HDR scene, the perception engine can determine that the current scene is consistent with the scene determined last time, that is, the HDR scene judgment result obtained this time is consistent with the HDR scene judgment result obtained last time.
  • the conditions for entering the HDR scene may include: DarkLuma is less than the dark area brightness threshold A1 and LV is greater than the ambient brightness threshold H1.
  • the conditions for exiting the HDR scene may include: DarkLuma is greater than the dark area brightness threshold A2 and LV is less than the ambient brightness threshold H2. It can be understood that A1 ⁇ A2, H1>H2.
  • the electronic device when DarkLuma is less than the dark area brightness threshold A1 and LV is greater than the ambient brightness threshold H1, the electronic device can determine that the current scene is an HDR scene and obtain a corresponding HDR scene judgment result. Otherwise, the electronic device can determine that the current scene is not an HDR scene and obtain a corresponding HDR scene judgment result.
  • the electronic device can determine the current ambient brightness based on the image data P1-1, and judge whether the current scene is an HDR scene based on the current ambient brightness. In one possible implementation, if the current ambient brightness is greater than the ambient brightness threshold H1, the electronic device can determine that the current scene is an HDR scene. Otherwise, the electronic device can determine that the current scene is not an HDR scene. In another possible implementation, if the current ambient brightness is greater than the ambient brightness threshold H1, the electronic device can determine that the current scene is an HDR scene, and obtain an HDR scene judgment result. If the current ambient brightness is less than the ambient brightness threshold H2, the electronic device can determine that the current scene is not an HDR scene, and obtain an HDR scene judgment result. If the current ambient brightness is between the ambient brightness threshold H1 and the ambient brightness threshold H2 (including the ambient brightness threshold H1 and the ambient brightness threshold H2), the electronic device can obtain The HDR scene judgment result is the same as the HDR scene judgment result obtained last time.
  • the electronic device may also obtain other types of brightness information based on the image data P1-1, and determine whether the current scene is an HDR scene based on the other types of brightness information.
  • the other types of brightness information may include the difference between the dark area and the average brightness in the image data P1-1, and may also include the difference between the bright area and the average brightness in the image data P1-1.
  • the electronic device may determine the target output mode based on the current camera mode and the HDR scene judgment result, without considering the zoom multiple.
  • the camera application may determine the current camera mode and send the current camera mode to the decision module.
  • the decision module may determine the target output mode based on the current camera mode and the HDR scene judgment result.
  • the electronic device may pre-store the correspondence between the camera mode, the HDR scene judgment result, and the output mode.
  • the decision module may search for the output mode corresponding to the current camera mode and the received HDR scene judgment result in the correspondence.
  • the output mode is the target output mode determined by the decision module. It can be understood that the correspondence between the camera mode, the HDR scene judgment result, and the output mode can be set according to actual needs, and the present application does not limit this.
  • the corresponding image output mode is the Remosaic image output mode
  • the corresponding image output mode is the Binning image output mode.
  • the camera mode is the HDR video recording mode
  • the corresponding image output mode is the IDCG image output mode
  • the corresponding image output mode is the Binning image output mode.
  • Table 2 is only an example, and the correspondence between the camera mode, HDR scene judgment result and the image output mode is not limited to the contents shown in Table 2.
  • the electronic device can also determine the target image output mode based on the current camera mode and zoom factor, without considering the HDR scene judgment result.
  • the specific implementation method can be referred to above and will not be repeated here.
  • the electronic device can also determine the target image output mode based on other factors (for example, the size of the subject in the picture, the motion state of the subject, etc.), and this application does not limit this.
  • the electronic device can load the configuration parameters of all image output modes in the default camera mode, and apply the configuration parameters of the default image output mode in the default camera mode, thereby realizing image acquisition based on the default image output mode in the default camera mode.
  • the electronic device can load the mode switching configuration parameters, and switch the configuration parameters of the currently applied image output mode from the configuration parameters of the image output mode C1 to the configuration parameters of the target image output mode based on the mode switching configuration parameters, that is, by loading the control switch to switch to the target image output mode, the electronic device can load the mode switching configuration parameters, and switch to the target image output mode.
  • the output mode can be switched by changing the control switch configuration parameters without reloading the configuration parameters of the target output mode.
  • the number of register sequences included in the control switch configuration parameters is smaller than the number of register sequences included in the configuration parameters of the target output mode, which allows the electronic device to spend less time to complete the switching of the output mode, that is, the switching delay of the output mode is reduced.
  • the electronic device enters the HDR video recording mode, and the electronic device starts to load the configuration parameters of all the output modes corresponding to the HDR video recording mode (i.e., the HDR video recording FMC configuration parameters).
  • the configuration parameters of all the output modes corresponding to the HDR video recording mode may include the configuration parameters of the Binning output mode and the configuration parameters of the IDCG output mode.
  • the electronic device ends loading the HDR video recording FMC configuration parameters. It can be understood that after the HDR video recording FMC configuration parameters are loaded, the electronic device can capture images based on the Binning output mode in the HDR video recording mode.
  • seamless setting1 is a mode switching configuration parameter indicating the switching from the Binning output mode to the IDCG output mode.
  • the electronic device ends loading seamless setting1.
  • the number of groups of settings included in the HDR video recording FMC configuration parameters is greater than the number of groups of settings included in seamless setting1.
  • Setting refers to a configuration parameter.
  • a group of settings may include at least one group of register sequences.
  • the electronic device when the electronic device loads a set of settings, it first loads the slave address (i.e., slave address), then loads the sub-address (i.e., sub-address), and then writes the data.
  • the slave address refers to the address of the device (e.g., camera) addressed by the host on the I2C bus
  • the sub-address refers to the address of the addressing device of different components or storage units inside the device (e.g., the register in the image sensor included in the camera).
  • the electronic device loads the settings included in seamless setting1
  • the address of the register used to control the stop/start flow is not involved when loading the sub-address. That is to say, in an embodiment of the present application, when the electronic device switches the image output mode during the shooting process, the image data reported by the camera will not have the phenomenon of stop/start flow interruption, making the image output mode switching process faster and smoother, improving the user experience.
  • the user can trigger the camera mode switch. Please refer to FIG7 , after the camera mode is switched, the electronic device can load the configuration parameters of all image output modes corresponding to the switched camera mode, and the electronic device can also apply the configuration parameters of the default image output mode in the switched camera mode, so as to capture images based on the default image output mode in the switched camera mode.
  • the electronic device after the electronic device executes the steps shown in Figures 5 and 6A, it can also respond to the user operation of switching the camera mode, load the configuration parameters of all image output modes corresponding to the switched camera mode, and capture images based on the default image output mode under the switched camera mode.
  • S701 The camera application receives a request to switch camera mode.
  • the user can trigger the camera mode switching. Accordingly, the camera application in the electronic device can receive the request to switch the camera mode.
  • the user may click on the HDR video mode option 301. Accordingly, the electronic device may receive a request to switch the camera mode to the HDR video mode. In response to the request to switch the camera mode to the HDR video mode, the electronic device may capture an image based on the HDR video mode (see steps S702 to S708 for details).
  • the user interface 400 shown in Figure 2D is displayed. It is understandable that the user can also trigger the camera mode switching by voice, gesture, etc., and the present application does not limit the specific method for the user to trigger the electronic device to switch the camera mode.
  • S702 The camera application switches the camera mode and obtains the switched camera mode.
  • the camera application After receiving the request to switch the camera mode, the camera application can switch the camera mode and obtain the switched camera mode.
  • S703 The camera application sends the switched camera mode to the sensor node module.
  • the switched camera mode can be sent to the sensor node module. Specifically, the camera application can send the switched camera mode to the camera service, and then the camera service can send the switched camera mode to the sensor node module.
  • the sensor node module may receive the switched camera mode sent by the camera application.
  • the sensor node module determines the FMC configuration parameters corresponding to the switched camera mode.
  • the FMC configuration parameters corresponding to the switched camera mode include configuration parameters of all image output modes corresponding to the switched camera mode and related information of the default image output mode under the switched camera mode.
  • the sensor node module After the sensor node module receives the switched camera mode sent by the camera application, it can determine the FMC configuration parameters corresponding to the switched camera mode.
  • the FMC configuration parameters corresponding to the switched camera mode may include configuration parameters of all image output modes corresponding to the switched camera mode and related information of the default image output mode under the switched camera mode. It is understandable that the default image output mode under the switched camera mode can be preset.
  • the user can trigger the camera mode to switch from the normal photo mode to the HDR video mode. That is, the camera mode after switching is the HDR video mode.
  • the FMC configuration parameters corresponding to the HDR video mode are the HDR video FMC configuration parameters.
  • the HDR video FMC configuration parameters may include the configuration parameters of the Binning output mode, the configuration parameters of the IDCG output mode, and the relevant information of the default output mode in the HDR video mode.
  • step S704 can refer to step S508 and will not be repeated here.
  • the sensor node module sends the FMC configuration parameters corresponding to the switched camera mode to the camera.
  • the FMC configuration parameters corresponding to the switched camera mode can be sent to the camera driver, which then sends them to the camera.
  • the camera driver may directly write the FMC configuration parameters corresponding to the switched camera mode into a register in the image sensor included in the camera.
  • the camera can receive the FMC configuration parameters corresponding to the switched camera mode sent by the sensor node module.
  • the camera stores the FMC configuration parameters corresponding to the switched camera mode in a register included in the image sensor.
  • the FMC configuration parameters corresponding to the switched camera mode may be stored in a register included in the image sensor.
  • the camera determines a default image output mode under the switched camera mode based on the FMC configuration parameters corresponding to the switched camera mode, and applies the configuration parameters of the default image output mode.
  • the camera After the camera receives the FMC configuration parameters corresponding to the switched camera mode, it can determine the default image output mode under the switched camera mode based on the relevant information of the default image output mode included in the FMC configuration parameters, and apply the configuration parameters of the default image output mode.
  • step S707 can refer to step S511 and will not be repeated here.
  • S708 The camera collects raw image data based on the default image output mode in the switched camera mode.
  • the image sensor included in the camera can output frames according to the default image output mode. That is, the camera can collect raw image data based on the default image output mode.
  • other software and hardware modules in the electronic device can process the raw image data and finally display it on the display screen.
  • the electronic device can continue to determine the target image output mode in combination with the camera mode, zoom factor and HDR scene judgment result, and adjust the current image output mode based on the target image output mode. That is, after the electronic device executes the steps shown in Figure 7, it can also execute the steps shown in Figure 6A.
  • the electronic device may first determine whether the camera mode is switched before executing step S613. If the camera mode has been switched, the electronic device may continue to execute steps S613 to S618 after executing steps S704 to S708. If the camera mode has not been switched, the electronic device may directly continue to execute steps S613 to S618.
  • the electronic device after the electronic device executes steps S701-S703, it can determine the configuration parameters of all image output modes corresponding to the switched camera mode, and first load the configuration parameters of the default image output mode in the switched camera mode. After the loading is completed, the electronic device can directly apply the configuration parameters of the default image output mode in the switched camera mode, that is, to capture images based on the default image output mode in the switched camera mode. After the configuration parameters of the default image output mode in the switched camera mode are loaded, the electronic device can continue to load the configuration parameters of other image output modes (except the default image output mode) corresponding to the switched camera mode.
  • the sensor node module after the sensor node module receives the switched camera mode sent by the camera application, it can determine the configuration parameters of all the output modes corresponding to the switched camera mode.
  • the sensor node module can first send the configuration parameters of the default output mode in the switched camera mode to the camera.
  • the camera After the camera receives the configuration parameters of the default output mode in the switched camera mode sent by the sensor node module, it can store it in the register included in the image sensor.
  • the camera can directly apply the configuration parameters of the default output mode in the switched camera mode, so as to collect images based on the default output mode under the switched mode camera.
  • the sensor node module After the sensor node module sends the configuration parameters of the default output mode in the switched camera mode to the camera, it can successively send the configuration parameters of other output modes in the switched camera mode to the camera. After the camera receives the configuration parameters of these output modes, it can store them in the register of the image sensor.
  • the camera application can exit the foreground operation and switch to the background operation.
  • the user can trigger the camera application to switch from the background operation to the foreground operation.
  • FIG8 After the camera application switches from the background operation to the foreground operation, the configuration parameters of all the image output modes corresponding to the historical camera mode can be loaded, and the electronic device can also apply the configuration parameters of the default image output mode in the historical camera mode, thereby Acquire images.
  • S801 The camera application receives a request to switch from background operation to foreground operation.
  • the user can trigger the camera application to switch to the foreground running.
  • the camera application can receive a request to switch from the background running to the foreground running.
  • the user can click on the task card 501. Accordingly, the electronic device can receive a request to switch the camera application from background operation to foreground operation. In response to the request to switch the camera application from background operation to foreground operation, the electronic device can capture images based on the historical camera mode and the historical image output mode (see steps S802-S808 for details), and display the user interface 600 shown in FIG2F . It is understandable that the user can also switch the camera application from background operation to foreground operation through voice, gestures, etc., and the present application does not limit the specific method in which the user triggers the electronic device to switch the camera application from background operation to foreground operation.
  • step S801 it may also execute steps S501 to S505.
  • the camera application determines a historical camera mode L1.
  • the historical camera mode L1 is the camera mode most recently used before the camera application is switched to the foreground.
  • the camera application may determine a historical camera mode L1, which is the camera mode most recently used before the camera application switches to foreground operation.
  • the historical camera mode L1 can be a normal photo mode or an HDR video mode.
  • the historical camera mode L1 can be other camera modes, and this application does not limit this.
  • S803 The camera application sends the historical camera mode L1 to the sensor node module.
  • the historical camera mode L1 may be sent to the sensor node module.
  • the sensor node module may receive the historical camera mode L1 sent by the camera application.
  • the sensor node module determines the FMC configuration parameters corresponding to the historical camera mode L1.
  • the FMC configuration parameters corresponding to the historical camera mode L1 include configuration parameters of all image output modes corresponding to the historical camera mode L1 and related information of the default image output mode of the historical camera mode L1.
  • the sensor node module After the sensor node module receives the historical camera mode L1 sent by the camera application, it can also determine the FMC configuration parameters corresponding to the historical camera mode L1.
  • the FMC configuration parameters corresponding to the historical camera mode L1 include configuration parameters of all image output modes corresponding to the historical camera mode L1 and relevant information of the default image output mode of the historical camera mode L1. It can be understood that the relevant description of the default image output mode can be referred to above and will not be repeated here.
  • the historical camera mode L1 may be a normal photographing mode.
  • the FMC configuration parameters corresponding to the normal photographing mode are the normal photographing FMC configuration parameters.
  • the normal photographing FMC configuration parameters may include configuration parameters of the Binning output mode, configuration parameters of the Remosaic output mode, and related information of the default output mode in the normal photographing mode.
  • the historical camera mode L1 may be an HDR video recording mode.
  • the FMC configuration parameters corresponding to the HDR video recording mode are HDR video recording FMC configuration parameters.
  • the HDR video recording FMC configuration parameters may include configuration parameters of the Binning output mode, configuration parameters of the IDCG output mode, and related information of the default output mode in the HDR video recording mode.
  • step S803 can refer to step S508 and step S704, which will not be repeated here.
  • the sensor node module sends the FMC configuration parameters corresponding to the historical camera mode L1 to the camera.
  • the FMC configuration parameters corresponding to the historical camera mode L1 can be sent to the camera driver, which then sends them to the camera.
  • the camera driver may directly write the FMC configuration parameters corresponding to the historical camera mode L1 into a register in the image sensor included in the camera.
  • the camera can receive the FMC configuration parameters corresponding to the historical camera mode L1 sent by the sensor node module.
  • the camera stores the FMC configuration parameters corresponding to the historical camera mode L1 in a register included in the image sensor.
  • the camera determines a default image output mode under the historical camera mode L1 based on the FMC configuration parameters corresponding to the historical camera mode L1, and applies the configuration parameters of the default image output mode.
  • S808 The camera collects raw image data based on the default image output mode under the historical camera mode L1.
  • steps S806 to S808 can refer to steps S510 to S512 and steps S706 to S708.
  • the electronic device after the electronic device executes the steps shown in FIG. 5 and FIG. 6A , it may also execute the steps shown in FIG. 8 .
  • the electronic device after the electronic device executes steps S801-S803, it can determine the configuration parameters of all image output modes corresponding to the historical camera mode L1, and first load the configuration parameters of the default image output mode under the historical camera mode L1. After the loading is completed, the electronic device can directly apply the configuration parameters of the default image output mode under the historical camera mode L1, that is, to capture images based on the default image output mode under the historical camera mode L1. After the configuration parameters of the default image output mode under the historical camera mode L1 are loaded, the electronic device can continue to load the configuration parameters of other image output modes (except the default image output mode) corresponding to the historical camera mode L1.
  • the sensor node module after the sensor node module receives the historical camera mode L1 sent by the camera application, it can determine the configuration parameters of all image output modes corresponding to the historical camera mode L1.
  • the sensor node module can first send the configuration parameters of the default image output mode under the historical camera mode L1 to the camera.
  • the camera After the camera receives the configuration parameters of the default image output mode under the historical camera mode L1 sent by the sensor node module, it can store them in the register included in the image sensor.
  • the camera can directly apply the configuration parameters of the default image output mode under the historical camera mode L1, so as to collect images based on the default image output mode under the historical camera mode L1.
  • the sensor node module After the sensor node module sends the configuration parameters of the default image output mode under the historical camera mode L1 to the camera, it can successively send the configuration parameters of other image output modes under the historical camera mode L1 to the camera. After the camera receives the configuration parameters of these image output modes, it can store them in the register of the image sensor.
  • the camera application can exit the foreground operation and switch to the background operation.
  • the user can trigger the camera application to switch from the background operation to the foreground operation.
  • the configuration parameters of all the output modes corresponding to the historical camera mode can be loaded. All the output modes corresponding to the historical camera mode can include the historical output mode.
  • the electronic device can also apply the configuration parameters of the historical output mode to capture images based on the historical output mode.
  • S901 The camera application receives a request to switch from background operation to foreground operation.
  • step S901 can refer to step S801 and will not be repeated here.
  • the user can click on the task card 501. Accordingly, the electronic device can receive a request to switch the camera application from background operation to foreground operation. In response to the request to switch the camera application from background operation to foreground operation, the electronic device can capture images based on the default output mode in the historical camera mode (see steps S902-S908 for details) and display the user interface 600 shown in FIG2F . It is understandable that the user can also switch the camera application from background operation to foreground operation through voice, gestures, etc., and the present application does not limit the specific method in which the user triggers the electronic device to switch the camera application from background operation to foreground operation.
  • step S901 it may also execute steps S501 to S505.
  • the camera application determines a historical camera mode L1 and a historical image output mode M1.
  • the historical camera mode L1 is the camera mode most recently used before the camera application is turned to the foreground
  • the historical image output mode M1 is the image output mode corresponding to the camera mode most recently used before the camera application is turned to the foreground.
  • the image output mode corresponding to the historical camera mode L1 includes the historical image output mode M1.
  • the historical camera mode L1 and the historical image output mode M1 may be determined.
  • the historical camera mode L1 is the camera mode most recently used before the camera application switches to foreground operation
  • the historical image output mode M1 is the image output mode corresponding to the camera mode most recently used before the camera application switches to foreground operation. It is understandable that the image output mode corresponding to the historical camera mode L1 may include the historical image output mode M1.
  • the historical image output mode M1 can be the mode1 mentioned above.
  • the camera application sends the historical camera mode L1 and the historical image output mode M1 to the sensor node module.
  • the historical camera mode L1 and the historical image output mode M1 may be sent to the sensor node module.
  • the camera application can send relevant information of the historical image output mode M1 to the sensor node module.
  • the relevant information of the historical image output mode M1 may include the identification of the historical image output mode.
  • the relevant description of the identification of the image output mode can be referred to above and will not be repeated here.
  • the electronic device can capture images based on the Binning output mode (as shown in FIG. 5 ). Then, the camera application can be switched from foreground operation to background operation. It is understandable that the camera application can be switched from background operation to foreground operation.
  • the historical camera mode L1 is the normal photographing mode
  • the historical output mode M1 can be the Binning output mode.
  • the electronic device can capture images based on the Binning output mode, and can also switch the output mode from the Binning output mode to the Remosaic output mode (as shown in Figure 6A). Then the camera application can be switched from foreground operation to background operation. It is understandable that the camera application can be switched from background operation to foreground operation.
  • the historical camera mode L1 is the normal camera mode
  • the historical output mode M1 can be the Remosaic output mode.
  • the electronic device can capture images based on the Binning output mode, and can also switch the camera mode to the HDR recording mode, and capture images based on the IDCG output mode. Then, the camera application can be switched from foreground operation to background operation. It is understandable that the camera application can be switched from background operation to foreground operation.
  • the historical camera mode L1 is the HDR recording mode
  • the historical output mode M1 can be the IDCG output mode.
  • the electronic device can output the image based on Binning.
  • the camera application can be switched from the foreground to the background. It is understandable that the camera application can be switched from the background to the foreground.
  • the historical camera mode L1 is the HDR recording mode
  • the historical output mode M1 can be the Binning output mode.
  • the sensor node module can receive the historical camera mode L1 and the historical image output mode M1 sent by the camera application.
  • the sensor node module determines the FMC configuration parameters corresponding to the historical camera mode L1.
  • the FMC configuration parameters corresponding to the historical camera mode L1 include configuration parameters of all image output modes corresponding to the historical camera mode L1.
  • step S904 can refer to step S803, step S508 and step S704, which will not be repeated here.
  • the sensor node module sends the FMC configuration parameters corresponding to the historical camera mode L1 and related information of the historical image output mode M1 to the camera.
  • the sensor node module After the sensor node module determines the FMC configuration parameters corresponding to the historical camera mode L1, it can send the FMC configuration parameters corresponding to the historical camera mode L1 to the camera. After the sensor node module receives the historical image output mode M1 sent by the camera application, it can also send relevant information of the historical image output mode M1 to the camera.
  • the camera can receive the FMC configuration parameters corresponding to the historical camera mode L1 and the related information of the historical image output mode M1 sent by the sensor node module.
  • the camera stores the FMC configuration parameters corresponding to the historical camera mode L1 in a register included in the image sensor.
  • step S906 can refer to step S806 and will not be repeated here.
  • S907 The camera applies the configuration parameters of the historical image output mode M1 included in the FMC configuration parameters corresponding to the historical camera mode L1 based on the relevant information of the historical image output mode M1.
  • the camera can determine the configuration parameters of the historical image output mode M1 in the FMC configuration parameters corresponding to the historical camera mode L1 based on the relevant information of the historical image output mode M1.
  • the image sensor in the camera can apply the configuration parameters of the historical image output mode M1.
  • S908 The camera collects raw image data based on the historical image output mode M1.
  • the image sensor After the image sensor applies the configuration parameters of the historical image output mode M1, it can output frames based on the configuration parameters of the historical image output mode M1. That is, the camera can collect raw image data based on the historical image output mode M1. Correspondingly, other software and hardware modules in the electronic device can process the raw image data and finally display it on the display screen.
  • the electronic device after the electronic device executes steps S901 to S903, it can determine the configuration parameters of all image output modes corresponding to the historical camera mode L1, and first load the configuration parameters of the historical image output mode M1 under the historical camera mode L1. After the loading is completed, the electronic device can directly apply the configuration parameters of the historical image output mode M1, that is, to capture images based on the historical image output mode M1 under the historical camera mode L1. After the configuration parameters of the historical image output mode M1 under the historical camera mode L1 are loaded, the electronic device can continue to load the configuration parameters of other image output modes (except the historical image output mode M1) corresponding to the historical camera mode L1.
  • the sensor node module receives the historical camera mode L1 and the historical image output mode M1 sent by the camera application. After that, the configuration parameters of all image output modes corresponding to the historical camera mode L1 can be determined.
  • the sensor node module can first send the configuration parameters of the historical image output mode M1 under the historical camera mode L1 to the camera. After the camera receives the configuration parameters of the historical image output mode M1 under the historical camera mode L1 sent by the sensor node module, it can store them in the register included in the image sensor. Moreover, the camera can directly apply the configuration parameters of the historical image output mode M1, so as to collect images based on the historical image output mode M1 under the historical camera mode L1.
  • the sensor node module After the sensor node module sends the configuration parameters of the historical image output mode M1 under the historical camera mode L1 to the camera, it can successively send the configuration parameters of other image output modes under the historical camera mode L1 to the camera. After the camera receives the configuration parameters of these image output modes, it can store them in the register of the image sensor.
  • the electronic device may execute the steps shown in FIG. 6A , and may also execute the steps shown in FIG. 7 .
  • the above embodiments only take the normal photo mode and the HDR video recording mode as examples. It is understandable that the above embodiments may also be applicable to other camera modes such as the night scene mode and the portrait photo mode.
  • FIG. 10 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application.
  • the electronic device may include a processor 110 , an external memory interface 120 , an internal memory 121 , an audio module 130 , a speaker 130A, a receiver 130B, a microphone 130C, an earphone interface 130D, a display screen 140 , a camera 150 , and a touch sensor 160 .
  • the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently.
  • the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
  • the interface connection relationship between the modules illustrated in the embodiments of the present invention is only a schematic illustration and does not constitute a structural limitation on the electronic device.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU).
  • the processor 110 may also be provided with a memory for storing instructions and data.
  • the processor 110 may include one or more interfaces, such as an Inter-integrated Circuit (I2C) interface, a Mobile Industry Processor Interface (MIPI), an Inter-integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver/Transmitter (UART) interface, a General-Purpose Input/Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface.
  • I2C Inter-integrated Circuit
  • MIPI Mobile Industry Processor Interface
  • I2S Inter-integrated Circuit Sound
  • PCM Pulse Code Modulation
  • UART Universal Asynchronous Receiver/Transmitter
  • GPIO General-Purpose Input/Output
  • SIM Subscriber Identity Module
  • USB Universal Serial Bus
  • I2C is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL).
  • the processor 110 may include multiple I2C buses.
  • the processor 110 may be coupled to the touch sensor 160, the charger, the flash, the camera 150, etc. through different I2C bus interfaces.
  • the processor 110 may be coupled to the touch sensor 160 through the I2C interface, so that the processor 110 It communicates with the touch sensor 160 via an I2C bus interface to implement the touch function of the electronic device 100 .
  • the camera driver can update the configuration parameters to the registers included in the image sensor through the I2C interface. It can be understood that in this application, the specific method of updating the configuration parameters of the image output mode to the registers included in the image sensor can be direct write, burst, or sequence.
  • the MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 140 and the camera 150.
  • the MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc.
  • the processor 110 and the camera 150 communicate through the CSI interface to realize the shooting function of the electronic device 100.
  • the processor 110 and the display screen 140 communicate through the DSI interface to realize the display function of the electronic device 100.
  • the electronic device can realize the display function through a GPU, a display screen 140, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 140 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.
  • the relevant description of the display screen 140 can be referred to above and will not be described in detail here.
  • the electronic device may include one or more display screens 140.
  • the ability of the electronic device to display images captured by the camera and the user interface shown in Figures 2A-2F depends on the display function provided by the above-mentioned GPU, display screen 140, and application processor.
  • the electronic device can realize the shooting function through the ISP, the camera 150, the video codec, the GPU, the display screen 140 and the application processor.
  • the camera 150 is used to capture static images or videos. The relevant description of the camera 150 can be found above and will not be elaborated here.
  • the electronic device implements camera application-based photo taking, which firstly relies on the image captured by the camera 150 and processed by the ISP, and secondly relies on the video codec, and the image calculation and processing capabilities provided by the GPU.
  • the internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).
  • RAM random access memories
  • NVM non-volatile memories
  • the random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.
  • the non-volatile memory can also store executable programs and user and application data, and can be loaded into the random access memory in advance for direct reading and writing by the processor 110.
  • the code for implementing the image output mode switching method described in the embodiment of the present application can be stored in a non-volatile memory.
  • the electronic device can load the executable code stored in the non-volatile memory into the random access memory.
  • the external memory interface 120 may be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device.
  • the electronic device can implement audio functions through the audio module 130, the speaker 130A, the receiver 130B, the microphone 130C, the headphone interface 130D, and the application processor.
  • the audio module 130 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input
  • the speaker 130A also called a "speaker”
  • the receiver 130B also called a “earpiece”
  • the microphone 130C also called a “microphone”
  • the headphone jack 130D is used to connect a wired headphone.
  • the electronic device when the electronic device enables the camera to collect images, it can also enable the microphone 130C to collect sound signals, and convert the sound signals into electrical signals and store them. In this way, the user can obtain video with sound.
  • the touch sensor 160 is also called a "touch control device”.
  • the touch sensor 160 can be arranged on the display screen 140.
  • the touch sensor 160 and the display screen 140 form a touch screen, also called a "touch control screen”.
  • the touch sensor 160 is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • Visual output related to the touch operation can be provided through the display screen 140.
  • the touch sensor 160 can also be arranged on the surface of the electronic device, which is different from the position of the display screen 140.
  • the electronic device may utilize the touch sensor 160 to detect operations such as clicks and slides performed by a user on the display screen 140 to implement the image output mode switching method shown in FIGS. 2A-2F .

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Environmental & Geological Engineering (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Studio Devices (AREA)

Abstract

本申请提供了一种出图模式切换方法及相关设备。根据该方法,电子设备基于第一相机模式下的第一出图模式采集图像,在满足将第一出图模式切换为第二出图模式的切换条件的情况下,基于相应模式切换配置参数将当前应用的出图模式的配置参数由第一出图模式的配置参数切换至第二出图模式的配置参数,并基于第一相机模式下的第二出图模式采集图像。第二出图模式的配置参数为确定切换至第二出图模式前预先加载好的配置参数。通过这种方法,电子设备可实现同一相机模式下的出图模式的切换,满足了用户在不同场景下的拍摄需求,避免了切换出图模式时下载出图模式的配置参数所带来的时延。

Description

一种出图模式切换方法及相关设备
本申请要求于2022年11月01日提交中国专利局、申请号为202211356362.5、申请名称为“一种出图模式切换方法及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种出图模式切换方法及相关设备。
背景技术
不同的出图模式(即图像读出模式)具有不同的优点和缺点。在基于不同的相机模式进行拍摄时,用户对于出图模式的需求可能不同。在实际应用中,电子设备可以基于用户选择的相机模式来切换至相应的出图模式。
发明内容
本申请提供了一种出图模式切换方法及相关设备。根据该出图模式切换方法,每一种相机模式均可对应多种出图模式。在进行拍摄时,电子设备可以基于当前相机模式下的一种出图模式采集图像。同时,电子设备还可以结合HDR场景判断结果等因素确定当前的具体拍摄场景,并根据当前的具体拍摄场景确定目标出图模式。可理解,当前相机模式对应的多种出图模式可以包括该目标出图模式。在目标出图模式与当前出图模式不一致的情况下,电子设备加载相应的模式切换配置参数即可切换至该目标出图模式。可理解,目标出图模式的配置参数在进入当前的相机模式后就已经加载完成。电子设备可以通过相应的模式切换配置参数来将应用的出图模式由当前出图模式切换至目标出图模式。可理解,模式切换配置参数包括的寄存器序列的数量小于出图模式的配置参数包括的寄存器序列的数量。这种方法可以基于同一相机模式下的不同拍摄场景确定并切换至相应的出图模式,满足了用户在不同场景下的拍摄需求。同时,这种方法可以避免因切换出图模式需要下载出图模式的配置参数而带来的时延,某种程度上可以避免由于加载配置参数时间过长而导致的画面不流畅及卡顿等问题。
第一方面,本申请提供了一种出图模式切换方法。该出图模式切换方法可以应用于电子设备。该出图模式切换方法可以包括:当电子设备进入相机应用的第一相机模式时,电子设备可以加载第一出图模式的第一配置参数和第二出图模式的第二配置参数;电子设备可以显示相机应用的第一用户界面,第一用户界面包括第一预览窗,第一预览窗中包括电子设备基于第一出图模式采集的第一预览图像;当满足将第一出图模式切换至第二出图模式的切换条件的情况下,电子设备可以加载切换出图模式的第三配置参数,第三配置参数用于指示将第一出图模式切换为第二出图模式,第三配置参数中的寄存器序列的数量小于第二配置参数中的寄存器序列的数量;电子设备可以显示相机应用的第二用户界面,第二用户界面包括第二预览窗,第二预览窗中包括电子设备基于第二出图模式采集的第二预览图像。
在本申请提供的方案中,在进入相机应用的第一相机模式时,电子设备可以加载第一 相机模式对应的多种出图模式的配置参数。该多种出图模式的配置参数可以包括第一出图模式的配置参数和第二出图模式的配置参数。电子设备可以基于第一出图模式采集第一预览图像并显示第一预览图像。在满足将第一出图模式切换至第二出图模式的切换条件的情况下,电子设备可以加载切换出图模式的第三配置参数,并基于第三配置参数将应用的出图模式由第一出图模式切换至第二出图模式。可理解,第二出图模式的配置参数(即第二配置参数)早已加载完成。这种方法可以避免由于切换出图模式时加载第二出图模式的配置参数所带来的时延。并且,第三配置参数中的寄存器序列的数量小于第二配置参数中的寄存器序列的数量,因此,上述方法可以大大减小切换出图模式的时延,避免因切换出图模式的时延过大而导致的画面不流畅及卡顿等现象。
可理解,第一相机模式可以为任意一种相机模式。例如,普通拍照模式、HDR录像模式、夜景模式和人像拍照模式等。
在本申请的一些实施例中,用户可以通过触摸第一相机模式对应的相机模式选项来触发电子设备进入相机应用的第一相机模式。相机模式选项的相关描述可以参考后文,在此不展开说明。
在本申请的一些实施例中,第一相机模式可以为默认相机模式。在这种情况下,用户可以通过触摸相机应用图标(例如,图2A所示的相机应用图标101)来触发电子设备进入相机应用的第一相机模式。
当然,用户还可以通过手势、声音等方式触发电子设备进入第一相机模式,本申请对此不作限制。
在本申请的一些实施例中,第一出图模式不同于第二出图模式。第一出图模式可以为任意一种出图模式,第二出图模式可以为不同于第一出图模式的任意一种出图模式。
在本申请的一些实施例中,如图6A所示,第一出图模式可以为出图模式C1。在这种情况下,第一预览图像对应的原始图像可以为原始图像数据P1。在出图模式C1与目标出图模式不一致的情况下,第二出图模式可以为目标出图模式。
可理解,第一出图模式为第一相机模式下的默认出图模式。第一出图模式的第一配置参数指的是第一出图模式的配置参数,第二出图模式的第二配置参数指的是第二出图模式的配置参数。例如,第一相机模式为普通拍照模式时,第一出图模式可以为Binning出图模式,第一配置参数指的是Binning出图模式的配置参数,第二出图模式可以为Remosaic出图模式,第二配置参数指的是Remosaic出图模式的配置参数。再例如,第一相机模式为HDR录像模式时,第一出图模式可以为Binning出图模式,第一配置参数指的是Binning出图模式的配置参数,第二出图模式可以为IDCG出图模式,第二配置参数指的是IDCG出图模式的配置参数。
示例性的,在第一相机模式为普通拍照模式的情况下,如图2B所示,第一用户界面可以为用户界面200,第一预览窗可以为用户界面200包括的预览窗201,第一预览图像可以为用户界面200包括的预览窗201中显示的图像。
示例性的,在第一相机模式为普通拍照模式的情况下,如图2B所示,第二用户界面可以为用户界面200,第二预览窗可以为用户界面200包括的预览窗201,第二预览图像可以为用户界面200包括的预览窗201中显示的图像。
示例性的,在第一相机模式为HDR录像模式的情况下,如图2D所示,第一用户界面可以为用户界面400,第一预览窗可以为用户界面400包括的预览窗201,第一预览图像可以为用户界面400包括的预览窗201中显示的图像。
示例性的,在第一相机模式为HDR录像模式的情况下,如图2D所示,第二用户界面可以为用户界面400,第二预览窗可以为用户界面400包括的预览窗201,第二预览图像可以为用户界面400包括的预览窗201中显示的图像。
在本申请的一些实施例中,在第一相机模式为普通拍照模式的情况下,电子设备进入相机应用的第一相机模式时,电子设备可以加载普通拍照FMC配置参数。普通拍照FMC配置参数可以包括第一配置参数和第二配置参数。在一种可能的实现方式中,普通拍照FMC配置参数还可以包括其他出图模式的配置参数。
类似的,在第一相机模式为HDR录像模式的情况下,电子设备进入相机应用的第一相机模式时,电子设备可以加载HDR录像FMC配置参数。HDR录像FMC配置参数可以包括第一配置参数和第二配置参数。在一种可能的实现方式中,HDR录像FMC配置参数还可以包括其他出图模式的配置参数。
可理解,第一相机模式为其他相机模式的相关描述可以参考上文,本申请在此不再赘述。
可理解,第三配置参数指的是模式切换配置参数。第三配置参数可以包括切换至第二出图模式的控制开关配置参数。
可理解,第三配置参数中的寄存器序列的数量小于第二配置参数中的寄存器序列的数量。在本申请的一些实施例中,第三配置参数中的寄存器序列的数量可以小于第一配置参数中的寄存器序列的数量。在本申请的一些实施例中,第三配置参数中的寄存器序列的数量可以小于第一相机模式对应的任一出图模式的配置参数中的寄存器序列。
结合第一方面,在一种可能的实现方式中,当满足将第一出图模式切换至第二出图模式的切换条件的情况下,电子设备加载切换出图模式的第三配置参数之前,该方法还可以包括:电子设备可以基于第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果;电子设备还可以基于相机模式、HDR场景判断结果和出图模式的对应关系,查找与第一相机模式和第一HDR场景判断结果对应的出图模式,该查找到的出图模式为目标出图模式。满足将第一出图模式切换至第二出图模式的切换条件,具体可以包括:目标出图模式为第二出图模式。
在本申请提供的方案中,电子设备可以基于预览图像(例如,第一预览图像)的亮度信息进行HDR场景的判断,并基于当前相机模式(例如,第一相机模式)和HDR场景判断结果确定目标出图模式。并且,在目标出图模式为第二出图模式的情况下,电子设备可以加载第三配置参数,并将第一出图模式切换至第二出图模式。通过这种方法,电子设备可以基于预览图像的亮度信息确定当前的具体拍摄场景,并根据当前的具体拍摄场景和相机模式来选择合理的出图模式,这样可以通过更恰当的出图模式来输出图像,从而得到更满足用户需求的图像。
根据上文,在本申请的一些实施例中,第一预览图像对应的原始图像为原始图像数据 P1。在这种情况下,第一预览图像的亮度信息也可以理解为图像数据P1-1包括的亮度信息。
可理解,第一HDR场景判断结果指的是基于第一预览图像的亮度信息得到的HDR场景判断结果。HDR场景判断结果的具体描述可以参考后文,在此不再赘述。
可理解,相机模式、HDR场景判断结果和出图模式的对应关系可以参考表2。
结合第一方面,在一种可能的实现方式中,当满足将第一出图模式切换至第二出图模式的切换条件的情况下,电子设备加载切换出图模式的第三配置参数之前,该方法还可以包括:电子设备可以确定当前的变焦倍数;电子设备还可以基于第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果;电子设备还可以基于相机模式、变焦倍数、HDR场景判断结果和出图模式的对应关系,查找与第一相机模式、当前的变焦倍数和第一HDR场景判断结果对应的出图模式,该查找到的出图模式为目标出图模式。满足将第一出图模式切换至第二出图模式的切换条件,具体可以包括:目标出图模式为第二出图模式。
在本申请提供的方案中,电子设备可以基于预览图像(例如,第一预览图像)的亮度信息进行HDR场景的判断,并基于当前相机模式(例如,第一相机模式)、当前的变焦倍数和HDR场景判断结果确定目标出图模式。并且,在目标出图模式为第二出图模式的情况下,电子设备可以加载第三配置参数,并将第一出图模式切换至第二出图模式。通过这种方法,电子设备可以基于预览图像的亮度信息和变焦倍数确定当前的具体拍摄场景,并根据当前的具体拍摄场景和相机模式来选择合理的出图模式,这样可以通过更恰当的出图模式来输出图像,从而得到更满足用户需求的图像。
可理解,相机模式、变焦倍数、HDR场景判断结果和出图模式的对应关系可以参考表1。
结合第一方面,在一种可能的实现方式中,电子设备基于第一预览图像的亮度信息确定当前场景是否为HDR场景,得到第一HDR场景判断结果,具体可以包括:电子设备可以基于第一预览图像的亮度信息确定第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度;电子设备可以确定第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度是否满足进入HDR场景条件,以及是否满足退出HDR场景条件;在第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度满足进入HDR场景条件的情况下,电子设备可以确定当前场景为HDR场景,第一HDR场景判断结果用于表示当前场景为HDR场景;在第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度满足退出HDR场景条件的情况下,确定当前场景不为HDR场景,第一HDR场景判断结果用于表示当前场景不为HDR场景;在第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度不满足进入HDR场景条件和退出HDR场景条件的情况下,第一HDR场景判断结果与上一次得到的HDR场景判断结果一致。其中,进入HDR场景条件可以包括:第一自适应动态范围压缩增益大于增益阈值Z1或者第一暗区亮度信息小于暗区亮度阈值A1,且第一环境亮度大于环境亮度阈值H1。退出HDR场景条件可以包括:第一自适应动态范围压缩增益小于增益阈值Z2或者第一暗区亮度信息大于暗区亮度阈值A2,且第一环境亮度小于环境亮度阈值H2。Z1大于Z2,A1小于A2,H1大于H2。
在本申请提供的方案中,电子设备可以基于预览图像(例如,第一预览图像)的亮度 信息确定自适应动态范围压缩增益、暗区亮度信息和环境亮度,并根据这些参数确定当前场景是否为HDR场景,并得到判断结果。通过这种方法,电子设备可以确定当前的具体拍摄场景是否包括HDR场景,为后续判断是否满足从第一出图模式切换至第二出图模式做准备。并且,通过上述方法,若自适应动态范围压缩增益、暗区亮度信息和环境亮度不满足进入HDR场景条件和退出HDR场景条件,则第一HDR场景判断结果与上一次得到的HDR场景判断结果一致,这样可以避免因频繁切换出图模式而导致功耗增大。
可理解,第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度分别指的是基于第一预览图像的亮度信息确定的AdrcGain、DarkLuma和LV。
根据上文,在本申请的一些实施例中,第一预览图像对应的原始图像为原始图像数据P1。在这种情况下,第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度与图6A所示的自适应动态范围压缩增益(AdrcGain)、暗区亮度信息(DarkLuma)和环境亮度(LV)、表示的含义相同。
可理解,进入HDR场景条件和退出HDR场景条件的相关描述可以参考后文,在此不展开说明。
结合第一方面,在一种可能的实现方式中,该方法还可以包括:当电子设备进入相机应用的第一相机模式时,电子设备还可以加载除第一出图模式和第二出图模式以外的至少一种出图模式的配置参数。
在本申请提供的方案中,电子设备进入第一相机模式时,可以加载更多的出图模式的配置参数,不只限于第一出图模式的配置参数(即第一配置参数)和第二出图模式的配置参数(即第二配置参数)。通过这种方式,电子设备可以在同一种相机模式下实现更多出图模式之间的切换,极大地满足了用户多样的拍摄需求。
结合第一方面,在一种可能的实现方式中,电子设备显示相机应用的第一用户界面,具体可以包括:电子设备加载第一配置参数之后,且电子设备加载第二配置参数之前,电子设备可以显示相机应用的第一用户界面。
在本申请提供的方案中,电子设备进入相机应用的第一相机模式时,可以首先加载第一出图模式的第一配置参数,基于第一出图模式采集第一预览图像,并显示第一用户界面。显示第一用户界面后,电子设备可以再加载第二出图模式的第二配置参数。这种方式可以缩短进入相机模式到显示预览图像之间的时延。
结合第一方面,在一种可能的实现方式中,电子设备显示相机应用的第一用户界面,具体可以包括:电子设备加载第二配置参数之后,电子设备可以显示相机应用的第一用户界面。
在本申请提供的方案中,电子设备进入相机应用的第一相机模式时,可以加载第一出图模式的第一配置参数和第二出图模式的第二配置参数,再基于第一出图模式采集第一预览图像,并显示第一用户界面。这种方式可以在显示预览图像之前尽量加载相机模式对应的出图模式的配置参数,有利于相机应用进入相机模式后的出图模式的快速切换。
在本申请的一些实施例中,电子设备可以首先加载第一出图模式的第一配置参数,并应用第一配置参数,即基于第一出图模式采集图像,与此同时,电子设备可以继续加载第二出图模式的第二配置参数。也就是说,电子设备应用第一配置参数的时刻与加载第二配 置参数的时刻并没有明确的先后顺序。
结合第一方面,在一种可能的实现方式中,第二用户界面可以包括第一控件。电子设备显示相机应用的第二用户界面之后,该方法还可以包括:响应于作用在第一控件上的操作,电子设备可以加载第二相机模式对应的多种出图模式的配置参数,该多种出图模式可以包括第三出图模式;电子设备还可以显示相机应用的第三用户界面,第三用户界面可以包括第三预览窗,第三预览窗中可以包括电子设备使用基于第三出图模式采集的第三预览图像。
在本申请提供的方案中,用户可以触发电子设备切换相机模式(如图2B和图2C所示)。响应于该切换相机模式的操作,电子设备可以重新加载切换后的相机模式所对应的多种出图模式的配置参数,并基于切换后的相机模式下的默认出图模式采集图像。可理解,上述内容的具体描述可以参考图7,在此不展开说明。通过这种方式,电子设备在同一种相机模式下切换出图模式时就无需再加载需要切换的出图模式的配置参数,使得切换出图模式的时延得以减小,从而可以使得画面显示更加流畅,避免了因切换出图模式的时延过大而导致的卡顿。
可理解,如图7所示,第二相机模式为切换后的相机模式。
可理解,第二相机模式可以为不同于第一相机模式的任意一种相机模式。例如,普通拍照模式、HDR录像模式、夜景模式和人像拍照模式等。第三出图模式可以为第二相机模式下的默认出图模式。
可理解,第一控件可以为相机模式选项202(如图2B所示)中的任一相机模式选项,并且第一控件不同于第一相机模式对应的相机模式选项。第一控件可以为夜景模式选项/人像模式选项/拍照模式选项等。例如,第一相机模式对应的相机模式选项可以为拍照模式选项,第一控件可以为人像模式选项。可理解,上述相机模式选项各自对应的相机模式可以参考后文,在此不展开说明。
在本申请的一些实施例中,相机模式选项202还可以包括HDR录像模式选项。在这种情况下,第一相机模式可以为普通拍照模式,第二相机模式可以为HDR录像模式。可理解,HDR录像模式对应的出图模式可以包括Binning出图模式和IDCG出图模式。在一种可能的实现方式中,第三出图模式可以为Binning出图模式。在又一种可能的实现方式中,第三出图模式可以为IDCG出图模式。
示例性的,在第一相机模式为普通拍照模式的情况下,如图2B所示,第一用户界面可以为用户界面200。在这种情况下,第二相机模式可以为HDR录像模式,如图2D所示,第三用户界面可以为用户界面400,第三预览窗可以为用户界面400包括的预览窗201,第三预览图像可以为用户界面400包括的预览窗201中显示的图像。
在本申请的一些实施例中,第一相机模式可以为HDR录像模式,第二相机模式可以为普通拍照模式。
示例性的,在第一相机模式为HDR录像模式的情况下,如图2D所示,第一用户界面可以为用户界面400。在这种情况下,第一相机模式可以为普通拍照模式,如图2B所示,第三用户界面可以为用户界面200,第三预览窗可以为用户界面200包括的预览窗201,第三预览图像可以为用户界面200包括的预览窗201中显示的图像。
在本申请的一些实施例中,电子设备加载第二相机模式对应的多种出图模式的配置参数,具体包括:电子设备可以加载第二相机模式对应的所有出图模式的配置参数。
在本申请的一些实施例中,第三出图模式为第二相机模式下的默认出图模式。
在本申请的一些实施例中,第三出图模式可以与第一出图模式相同。在本申请的又一些实施例中,第三出图模式可以与第二出图模式相同。在本申请的又一些实施例中,第三出图模式可以不同于第一出图模式,也不同于第二出图模式。
结合第一方面,在一种可能的实现方式中,当电子设备进入相机应用的第一相机模式时,电子设备加载第一出图模式的第一配置参数和第二出图模式的第二配置参数,具体可以包括:响应于将相机应用从后台运行状态转为前台运行状态的操作,电子设备可以加载第一相机模式对应的多种出图模式的配置参数。该多种出图模式可以包括第一出图模式和第二出图模式。第一相机模式为相机应用转为前台运行状态之前最后一次采用的相机模式。
在本申请提供的方案中,用户可以触发相机应用由后台运行转为前台运行(如图2E和图2F所示)。响应于将该相机应用由后台运行转为前台运行的操作,电子设备可以重新加载相机应用转为前台运行状态之前最后一次采用的相机模式所对应的多种出图模式的配置参数。通过这种方式,电子设备在同一种相机模式下切换出图模式时就无需再加载需要切换的出图模式的配置参数,使得切换出图模式的时延得以减小,从而可以使得画面显示更加流畅,避免了因切换出图模式的时延过大而导致的卡顿。
在本申请的一些实施例中,将相机应用从后台运行状态转为前台运行状态的操作指的是:作用于用户界面500中的任务卡片501(如图2E所示)的用户操作。在这种情况下,第一相机模式为HDR录像模式。
在本申请的一些实施例中,电子设备加载第一相机模式对应的多种出图模式的配置参数,具体包括:电子设备可以加载第一相机模式对应的所有出图模式的配置参数。
在本申请的一些实施例中,第一相机模式可以为图8和图9所示的历史相机模式L1。
结合第一方面,在一种可能的实现方式中,第一出图模式为第一相机模式的默认出图模式。
在本申请提供的方案中,电子设备由后台运行转为前台运行后,可以基于相机应用转为前台运行状态之前最后一次采用的相机模式下的默认出图模式采集图像。
可理解,第一相机模式的默认出图模式可以为第一相机模式对应的多种出图模式中的任意一种出图模式。
结合第一方面,在一种可能的实现方式中,第一出图模式为相机应用转为前台运行状态之前最后一次采用的出图模式。
在本申请提供的方案中,电子设备由后台运行转为前台运行后,可以基于相机应用转为前台运行状态之前最后一次采用的出图模式采集图像。可理解,相机应用转为前台运行状态之前最后一次采用的相机模式所对应的多种出图模式可以包括:相机应用转为前台运行状态之前最后一次采用的出图模式。
在本申请的一些实施例中,第一出图模式可以为图9所示的历史出图模式M1。
结合第一方面,在一种可能的实现方式中,电子设备基于第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果,具体可以包括:电子设备中 的自动曝光控制模块可以基于第一预览图像的亮度信息确定第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度;自动曝光控制模块可以将第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度发送给电子设备中的感知引擎;感知引擎可以基于第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度判断当前场景是否为HDR场景,并得到第一HDR场景判断结果。
可理解,感知引擎得到第一HDR场景判断结果之后,该方法还可以包括:感知引擎可以将第一HDR场景判断结果发送给电子设备中的决策模块。在一种可能的实现方式中,决策模块可以基于第一相机模式和第一HDR场景判断结果确定目标出图模式。在又一种可能的实现方式中,决策模块可以基于第一相机模式、当前的变焦倍数和第一HDR场景判断结果确定目标出图模式。决策模块确定目标出图模式之后,可以将目标出图模式的相关信息发送给电子设备中的传感器节点模块。
结合第一方面,在一种可能的实现方式中,当满足将第一出图模式切换至第二出图模式的切换条件的情况下,电子设备加载切换出图模式的第三配置参数,具体可以包括:在目标出图模式为第二出图模式的情况下,传感器节点模块可以确定第三配置参数,并将第三配置参数发送给电子设备中的摄像头;摄像头可以基于第三配置参数,将当前应用的出图模式的配置参数由第一配置参数切换至第二配置参数。
第二方面,本申请提供了一种电子设备,该电子设备包括一个或多个存储器和一个或多个处理器;其中,一个或多个存储器与一个或多个处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,当一个或多个处理器执行计算机指令时,使得电子设备执行如第一方面以及第一方面中任一可能的实现方式所描述的方法。
第三方面,本申请提供一种计算机存储介质,包括计算机指令,当该计算机指令在电子设备上运行时,使得该电子设备执行上述第一方面以及第一方面中任一可能的实现方式所描述的方法。
第四方面,本申请实施例提供一种芯片,该芯片可以应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行上述第一方面以及第一方面中任一可能的实现方式所描述的方法。
第五方面,本申请实施例提供一种包含指令的计算机程序产品,当该计算机程序产品在电子设备上运行时,使得该电子设备执行上述第一方面以及第一方面中任一可能的实现方式所描述的方法。
可理解,上述第二方面提供的电子设备、第三方面提供的计算机存储介质、第四方面提供的芯片,以及第五方面提供的计算机程序产品均用于执行上述第一方面以及第一方面中任一可能的实现方式所描述的方法。因此,其所能达到的有益效果可参考上述第一方面以及第一方面中任一可能的实现方式所描述的方法的有益效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种出图模式切换方法的示意图;
图2A-图2F为本申请实施例提供的一组用户界面示意图;
图3为本申请实施例提供的一种电子设备的软件结构示意图;
图4为本申请实施例提供的一种软硬件交互示意图;
图5为本申请实施例提供的一种出图模式切换方法的流程图;
图6A为本申请实施例提供的又一种出图模式切换方法的流程图;
图6B为本申请实施例提供的一种加载配置参数的I2C波形示意图;
图7为本申请实施例提供的又一种出图模式切换方法的流程图;
图8为本申请实施例提供的又一种出图模式切换方法的流程图;
图9为本申请实施例提供的又一种出图模式切换方法的流程图;
图10为本申请实施例提供的一种电子设备的硬件结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。
应当理解,本申请的说明书和权利要求书及附图中的术语“第一”、“第二”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本申请所描述的实施例可以与其它实施例相结合。
手机、平板等电子设备中一般设置有摄像头模组。在利用电子设备进行拍摄时,摄像头模组中的感光元件(例如,图像传感器)可以实现光电转换,从而得到原始图像数据(即RAW图)。图像读出指的就是感光元件得到RAW图的过程。相应的,出图模式(即图像读出模式)指的就是感光元件得到RAW图的方式。
可理解,图像传感器指的是image sensor。image sensor可以包括CCD、CMOS等。其中,CCD的英文全称为Charge-coupled Device,指的是电荷耦合器件图像传感器。CMOS的英文全称为Complementary Metal Oxide Semiconductor,指的是互补金属氧化物半导体图像传感器。
可理解,RAW图指的是CCD或者CMOS等图像传感器将捕捉到的光源信号转化为数字信号的原始数据。
下面对三种出图模式进行说明。
1、Binning
Binning是一种图像读出模式,指的是将相邻像素中的感应电荷加在一起,以一个像素的模式读出。Binning分为水平方向Binning和垂直方向Binning,水平方向Binning是将相邻的行的电荷加在一起读出,而垂直方向Binning是将相邻的列的电荷加在一起读出。Binning这一技术的优点是能将几个像素联合起来作为一个像素使用,在维持视场角不变的同时,可以增加感光面积,提高暗处对光感应的灵敏度,降低分辨率。
2、IDCG
IDCG的英文全称为Intra-scene Dual Convert Gain,即场景内双转换增益出图模式。IDCG指的是基于同样的曝光时间,同时读出高转换增益(High Conversion Gain,HCG)和低转换增益(Low Conversion Gain,LCG)两帧图像,最终融合成一帧图像。简单来说,IDCG就是一次曝光得到两种转换增益下的图像,并最终融合得到一帧图像。
3、Remosaic
Remosaic指的是将4像元图像传感器(4-cell sensor)的原始像素排布方式转换成拜耳(Bayer)排布方式,再读出图像。
根据上文,不同的出图模式具有不同的优点和缺点。例如,基于Binning出图模式来读出图像,可以在视野面积和比例不变的前提下提高帧数,同时也可以提高暗处对光感应的灵敏度,但是这种出图模式会降低输出分辨率。例如,基于IDCG出图模式来读出图像,可以提高输出图像的动态范围,但是这种出图模式的功耗较大。再例如,基于Remosaic出图模式来读出图像,可以得到像素点多、清晰度高的图像,但是这种出图模式会导致像素点小、感光度低。
基于不同出图模式的不同优缺点,电子设备可以基于用户选择的不同的相机模式来选择切换至相应的出图模式。如图1所示,用户开启电子设备中的相机应用之后,可以选择拍摄时采用的相机模式。例如,普通拍照模式、夜景模式、以及人像拍照模式等。电子设备确定用户选择的相机模式对应的出图模式为模式X之后,可以加载初始化配置参数,然后加载模式X的配置参数,最终采用模式X读出图像。一旦电子设备确定要将出图模式由模式X转变为模式Y,电子设备可以加载模式Y的配置参数,最终采用模式Y读出图像。类似的,一旦电子设备确定要将出图模式由模式Y切换为模式X,需要重新加载模式X的配置参数,并覆盖之前加载的模式Y的配置参数。
也就是说,在一种相机模式下,每一次切换出图模式,电子设备都需要加载出图模式的配置参数。而出图模式的配置参数可以包括几百组寄存器序列,会带来较大的切换时延。一旦电子设备来不及在极短的时间内加载完成,甚至会造成切换出图模式时电子设备所显示的画面不流畅的情况。
本申请提供了一种出图模式切换方法及相关设备。根据该出图模式切换方法,每一种相机模式均可对应多种出图模式。在进行拍摄时,电子设备可以基于当前相机模式下的一种出图模式采集图像。同时,电子设备还可以结合相机模式和HDR场景判断结果等因素确定当前的具体拍摄场景,并根据当前的具体拍摄场景确定目标出图模式。在该目标出图模 式与当前出图模式不一致的情况下,电子设备加载相应的模式切换配置参数即可切换至该目标出图模式。可理解,目标出图模式的配置参数在进入当前的相机模式后就已经加载完成。电子设备可以通过相应的模式切换配置参数来使得摄像头中的图像传感器应用目标出图模式的配置参数,而不必再应用该当前出图模式的配置参数。在一些实施例中,模式切换配置参数包括的寄存器序列远远少于出图模式的配置参数包括的寄存器序列。这种方法可以基于同一相机模式下的不同拍摄场景确定并切换至相应的出图模式,满足了用户在不同场景下的拍摄需求。同时,这种方法可以避免因切换出图模式需要下载出图模式的配置参数而带来的时延,某种程度上可以避免由于加载配置参数时间过长而导致的画面不流畅及卡顿等问题。
示例性的,相机模式为普通拍照模式时,其对应的出图模式可以包括Binning出图模式和Remosaic出图模式。而相机模式为HDR录像模式时,其对应的出图模式可以包括Binning出图模式和IDCG出图模式。
可理解,本申请中的电子设备指的是手机、平板电脑等终端设备。可理解,电子设备具体还可以是可穿戴设备、车载设备、增强现实(Augmented Reality,AR)/虚拟现实(Virtual Reality,VR)设备、笔记本电脑、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本、个人数字助理(Personal Digital Assistant,PDA)或专门的照相机(例如,单反相机、卡片式相机)等设备,本申请对电子设备的具体类型不作任何限制。
下面结合一组用户界面示意图介绍本申请提供的一些出图模式的切换场景。
可理解,本申请的说明书和权利要求书及附图中的术语“界面”和“用户界面”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(graphic user interface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。
1、启动相机应用,并显示默认相机模式(图2A-图2B)
如图2A所示,用户界面100显示了一个包括应用图标的页面,该页面可包括多个应用图标(例如,天气应用图标、日历应用图标、相册应用图标、便签应用图标、电子邮件应用图标、应用商店应用图标、设置应用图标等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个应用图标(例如,相机应用图标101、浏览器应用图标、信息应用图标、拨号应用图标)。这些应用图标所在的区域可称为dock栏,在页面切换时dock栏中的应用图标一般不会变换。
可理解,相机应用图标101为相机应用程序(即相机应用)的图标。相机应用图标101可以用于触发启动相机应用程序。
电子设备可以检测到作用于相机应用图标101的用户操作。响应于该用户操作,电子设备可以加载默认相机模式(例如,普通拍照模式)下的所有出图模式的配置参数,采用该默认相机模式下的默认出图模式采集图像,并显示如图2B所示的用户界面200。用户界 面200为相机应用的默认相机模式的拍摄界面,用户可以在该界面上预览图像并完成拍照。
如图2B所示,用户界面200可包括预览窗201、相机模式选项202、变焦倍数控件203、相册快捷控件、快门控件和摄像头翻转控件。
其中,预览窗201可用于显示预览图像。相册快捷控件可用于开启相册应用程序。快门控件可用于监听触发拍照的用户操作。摄像头翻转控件可用于监听触发翻转摄像头的用户操作。
相机模式选项202中可以显示有一个或多个相机模式选项。这一个或多个相机模式选项可以包括:夜景模式选项、人像模式选项、拍照模式选项2021、录像模式选项和更多选项2022。其中,拍照模式选项2021对应的相机模式为普通拍照模式。通常,如图2B所示,普通拍照模式为相机应用的默认相机模式。夜景模式选项对应的相机模式为夜景模式。人像模式选项对应的相机模式为人像拍照模式。录像模式选项对应的相机模式为普通录像模式。可理解,相机模式选项202中还可以包含更多或更少的拍摄模式选项。
变焦倍数控件203可用于调整变焦倍数。变焦倍数的具体含义可以参考后文,在此不展开说明。可理解,用户可以通过触摸变焦倍数控件203的不同位置来实现对变焦倍数的调整,还可以通过上下拖动变焦倍数控件203来实现对变焦倍数的调整。
可理解,本申请中所提及的用户操作可以包括但不限于触摸(例如,点击等)、声控、手势等操作,本申请对此不作限制。
可理解,相机应用启动后,电子设备可以采用普通拍照模式下的默认出图模式(例如,Binning出图模式)来采集图像。也就是说,用户界面200中的预览窗201所显示的图像是电子设备中的摄像头采用普通拍照模式下的默认出图模式获取的。在这种情况下,电子设备可以对HDR场景进行判断,得到HDR场景判断结果,然后结合相机模式、变焦倍数和HDR场景判断结果来确定目标出图模式。在目标出图模式与普通拍照模式下的默认出图模式不一致的情况下,电子设备可以将当前的出图模式由普通拍照模式下的默认出图模式切换为目标出图模式。
可理解,电子设备确定目标出图模式的具体方式可以参考后文,在此不展开说明。
2、切换相机模式(图2C-图2D)
电子设备可以检测到作用于如图2B所示的更多选项2022的用户操作。响应于该用户操作,电子设备可以显示如图2C所示的用户界面300。用户界面300可以包括若干相机模式选项。如图2C所示,用户界面300可以包括HDR录像模式选项301。HDR录像模式选项301对应的相机模式为HDR录像模式。
电子设备可以检测到作用于HDR录像模式选项301的用户操作。响应于该用户操作,电子设备可以加载HDR录像模式下的所有出图模式的配置参数,采用HDR录像模式下的默认出图模式采集图像,并显示如图2D所示的用户界面400。
可理解,相机模式由普通拍照模式切换为HDR录像模式之后,电子设备可以采用HDR录像模式下的默认出图模式(例如,IDCG出图模式)采集图像。也就是说,用户界面400中的预览窗201所显示的图像是电子设备中的摄像头采用HDR录像模式下的默认出图模式获取的。在这种情况下,电子设备可以对HDR场景进行判断,得到HDR场景判断结果, 然后结合相机模式、变焦倍数和HDR场景判断结果来确定目标出图模式。在目标出图模式与HDR录像模式下的默认出图模式不一致的情况下,电子设备可以将当前的出图模式由HDR录像模式下的默认出图模式切换为目标出图模式。
3、相机应用退出前台运行(图2E)
电子设备可以检测到作用于用户界面400底部的向上滑动并停留的手势操作。响应于该手势操作,相机应用退出前台运行,电子设备可以显示如图2E所示的用户界面500。用户界面500为任务视图界面。用户界面500包括任务卡片501和任务卡片502。任务卡片501为相机应用对应的任务卡片。任务卡片502为通讯应用对应的任务卡片。
电子设备可以检测到作用于用户界面500上的空白区域的用户操作。响应于该用户操作,电子设备可以重新显示放置有若干应用图标的用户界面。该放置有若干应用图标的用户界面与图2A类似,相区别的是,该放置有若干应用图标的用户界面上所显示的时间可能与图2A不同。该放置有若干应用图标的用户界面可以理解为电子设备的“桌面”。为了便于描述,本申请将该放置有若干应用图标的用户界面记为用户界面J1。可理解,电子设备显示用户界面J1时,相机应用处于后台运行状态。
需要说明的是,用户还可以通过其他方式触发相机应用退出前台运行,本申请对此不作限制。例如,用户可以通过导航键来触发相机应用退出前台运行。
4、相机应用回到前台运行(图2F)
电子设备可以检测到作用于用户界面J1底部的向上滑动并停留的手势操作。响应于该手势操作,电子设备可以重新显示如图2E所示的用户界面500。
电子设备可以检测到作用于用户界面500中的任务卡片501的用户操作。响应于该用户操作,电子设备可以确定最近一次采用的相机模式和最近一次采用的出图模式,加载该最近一次采用的相机模式对应的所有出图模式的配置参数,并采用该最近一次采用的出图模式采集图像。相应的,电子设备还可以显示如图2F所示的用户界面600。可理解,电子设备显示用户界面600时,相机应用处于前台运行状态。
可理解,该最近一次采用的相机模式对应的所有出图模式包括该最近一次采用的出图模式。为了便于描述,可以将该最近一次采用的出图模式记为mode1。如图2D所示,mode1可以为HDR录像模式。
可理解,相机应用重新回到前台运行时,可以采用HDR录像模式下的mode1来采集图像。也就是说,用户界面600中的预览窗201所显示的图像是电子设备中的摄像头采用mode1获取的。类似的,相机应用重新回到前台运行后,电子设备可以结合相机模式、变焦倍数和HDR场景判断结果来确定目标出图模式。在目标出图模式与mode1不一致的情况下,电子设备可以将当前的出图模式由mode1切换为目标出图模式。
在本申请的一些实施例中,电子设备可以检测到作用于用户界面500中的任务卡片501的用户操作,响应于该用户操作,电子设备可以确定最近一次采用的相机模式,加载该最近一次采用的相机模式对应的所有出图模式的配置参数,并采用该最近一次采用的出图模式下的默认出图模式采集图像。相应的,电子设备还可以显示如图2F所示的用户界面600。
可理解,相机应用重新回到前台运行时,可以采用HDR录像模式下的默认出图模式来 采集图像。也就是说,用户界面600中的预览窗201所显示的图像是电子设备中的摄像头采用HDR录像模式下的默认出图模式获取的。类似的,相机应用重新回到前台运行后,电子设备可以结合相机模式、变焦倍数和HDR场景判断结果来确定目标出图模式。在目标出图模式与HDR录像模式下的默认出图模式不一致的情况下,电子设备可以将当前的出图模式由HDR录像模式下的默认出图模式切换为目标出图模式。
下面结合图3介绍本申请实施例提供的一种电子设备的软件结构。
如图3所示,本申请涉及的电子设备的软件框架可以包括应用程序层,应用程序框架层(framework,FWK)、系统库、安卓运行时、硬件抽象层(HAL)和内核层(kernel)。
其中,应用程序层可以包括一系列应用程序包。例如:相机应用,日历,图库,通话,蓝牙,视频,音乐,短信息,WLAN等应用程序(也可以简称为应用)。其中,相机应用可以用于拍摄以获取图像和视频。可理解,用户可以通过触摸图2A所示的相机应用图标101来触发电子设备启动相机应用,从而实现通过相机应用进行的拍摄。
应用程序框架层为应用程序层的应用程序提供应用编程接口(Application Programming Interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
应用程序框架层可以包括一系列系统服务。系统服务是专注于特定功能的模块化组件。应用框架API所提供的功能可与系统服务通信,以访问底层硬件。如图3所示,应用程序框架层可以包括相机服务。在系统启动初期,相机服务会运行起来。相机服务封装了相机AIDL跨进程接口,提供给上层应用进行调用,进而接收来自上层应用的图像请求,同时内部维护着关于请求在该层的处理逻辑,最终通过调用相机HIDL跨进程接口将请求下发,并且等待结果的回传,进而将结果上传至上层应用中。其中,AIDL的英文全称为Android Interface Definition Language,中文含义为安卓接口定义语言。HIDL的英文全称是HAL interface definition language,中文含义为硬件抽象层接口定义语言。
可理解,应用程序框架层还可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。其具体含义可以参考相关技术文档,在此不展开说明。
运行时(Runtime)负责系统的调度和管理。Runtime包括核心库和虚拟机。其中,核心库包含两部分:一部分是编程语言(例如,java语言)需要调用的功能函数,另一部分是系统的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的编程文件(例如,java文件)执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(Surface Manager),媒体库(Media Libraries),三维图形处理库(例如,OpenGL ES),二维图形引擎(例如,SGL)等。这些功能模块的具体含义和作用可以参考相关技术文档,在此不展开说明。
硬件抽象层(HAL)是位于操作系统内核与上层软件之间的接口层,其目的在于将硬件抽象化。硬件抽象层是设备内核驱动的抽象接口,用于实现向更高级别的Java API框架提供访问底层设备的应用编程接口。HAL可以提供标准界面,向更高级别的Java API框架显示设备硬件功能。HAL包含多个库模块,例如相机HAL、音频HAL等。其中每个库模块都为特定类型的硬件组件实现一个界面。为当系统框架层API要求访问便携设备的硬件 时,操作系统将为该硬件组件加载库模块。可理解,相机HAL可以为相机服务提供访问摄像头等硬件组件的接口。
内核层是Android操作系统的基础。内核层负责硬件的驱动程序、网络、电源、系统安全以及内存管理等功能。内核层是硬件与软件之间的一个中间层,其作用是将应用程序的请求传递给硬件。内核层可以包括相机驱动、显示驱动、摄像头驱动、音频驱动和传感器驱动。
需要说明的是,本申请提供的图3所示的电子设备的软件结构示意图仅作为一种示例,并不限定Android操作系统不同分层中的具体模块划分,具体可以参考常规技术中对Android操作系统软件结构的介绍。另外,本申请提供的出图模式切换方法还可以基于其他操作系统实现,本申请不再一一举例。
基于图3所示的电子设备的软件结构,结合图4从软硬件协作的角度介绍本申请实施例提供的一种出图模式切换方法。
首先对图4所涉及的硬件进行说明。
摄像头用于捕获静态图像或视频。在一些实施例中,电子设备可以包括1个或多个摄像头。摄像头可以包括图像传感器。图像传感器是摄像头中的感光元件,它可以利用光电器件的光电转换功能将感光面上的光信号转换为与光信号成相应比例关系的电信号。图像信号处理器(Image Signal Processor,ISP)用于处理摄像头反馈的数据。显示屏用于显示图像、视频等。显示屏可以包括显示面板。显示面板可以采用液晶显示屏,有机发光二极管,柔性发光二极管等。在一些实施例中,电子设备可以包括1个或多个显示屏。
可理解,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号。摄像头感光元件将所述电信号传递给ISP处理,从而得到显示屏上肉眼可见的图像。
可理解,相机应用进入一种相机模式后,电子设备可以加载该相机模式对应的所有出图模式的配置参数,并应用该相机模式下的默认出图模式的配置参数,即基于该相机模式下的默认出图模式采集图像。根据上文,每一种相机模式均可以对应有多种出图模式。相机模式下的默认出图模式为该相机模式对应的多种出图模式之一。相机模式下的默认出图模式可以预先设置。不同相机模式下的默认出图模式可以相同,也可以不相同。
示例性的,普通拍照模式和HDR录像模式为两种相机模式。普通拍照模式对应的出图模式可以包括Binning出图模式和Remosaic出图模式。HDR录像模式对应的出图模式可以包括Binning出图模式和IDCG出图模式。在一种可能的实现方式中,普通拍照模式下的默认出图模式可以为Binning出图模式,HDR录像模式下的默认出图模式也可以为Binning出图模式。在又一种可能的实现方式中,普通拍照模式下的默认出图模式可以为Binning出图模式,HDR录像模式下的默认出图模式也可以为IDCG出图模式。
如图4所示,一方面,相机应用启动后且处于前台运行状态时,相机应用可以确定当前的相机模式和当前的变焦倍数,并将当前的相机模式和当前的变焦倍数传递给相机服务。相机服务可以再将当前的相机模式和当前的变焦倍数传递给决策模块。另一方面,摄像头可以将图像传感器采集的原始图像数据发送给图像信号处理器。图像信号处理器对该原始 图像数据进行处理之后,可以将处理后的图像数据发送给相机驱动。相机驱动再将该处理后的图像数据发送给自动曝光控制模块。自动曝光控制模块可以基于该处理后的图像数据获取亮度信息,并将该亮度信息发送给感知引擎。感知引擎可以基于接收的亮度信息确定当前场景是否为HDR场景,得出HDR场景判断结果,并将HDR场景判断结果发送给决策模块。
决策模块可以结合当前的相机模式、当前的变焦倍数和HDR场景判断结果得到目标出图模式的相关信息,并在目标出图模式和当前出图模式不一致的情况下将目标出图模式的相关信息发送给传感器节点模块。传感器节点模块可以基于目标出图模式的相关信息确定相应的模式切换配置参数,并将该模式切换配置参数发送给相机驱动。可理解,该模式切换配置参数可以包括切换至目标出图模式的控制开关配置参数。相机驱动再将该模式切换配置参数发送给摄像头。摄像头可以基于该模式切换配置参数更新图像传感器所应用的出图模式的配置参数。即图像传感器可以应用目标出图模式的配置参数。可理解,目标出图模式的配置参数早已经在切换至目标出图模式前(例如,电子设备进入相机应用的当前的相机模式时)就加载到图像传感器包括的寄存器中了。这也就意味着,电子设备应用的出图模式的配置参数可以更新为目标出图模式的配置参数,而不再应用当前出图模式的配置参数。
可理解,图像传感器应用目标出图模式的配置参数之后,可以基于目标出图模式出帧。即摄像头可以基于目标出图模式采集原始图像数据,该原始图像数据经过图像信号处理器处理后发送给相机驱动,再由相机驱动向上传递到相机HAL。相机HAL可以对相机驱动上传的图像数据进行处理,得到预览图像,并将预览图像向上经相机服务发送给相机应用。相机应用可以将预览图像送显到显示屏进行显示。这样,用户可以看到显示屏上有画面出现。
下面结合图5-图9说明前述实施例的具体实现。
一、相机应用启动,加载默认相机模式对应的所有出图模式的配置参数(如图5所示)
用户可以触发启动相机应用。请参阅图5,相机应用启动后,电子设备可以加载默认相机模式对应的所有出图模式的配置参数,并且电子设备还可以应用该默认相机模式下的默认出图模式的配置参数,从而基于该默认相机模式下的默认出图模式采集图像。
S501:相机应用接收到启动相机应用的请求。
可理解,用户可以触发电子设备启动相机应用。相应的,电子设备中的相机应用可以接收到该启动相机应用的请求。
示例性的,如图2A所示,用户可以点击相机应用图标101。相应的,电子设备可以接收到启动相机应用的请求。响应于该启动相机应用的请求,电子设备可以启动相机应用并显示图2B所示的用户界面200。可理解,用户也可以通过语音、手势等方式启动相机应用,本申请对用户触发电子设备启动相机应用的具体方式不作限制。
S502:相机应用向相机服务发送启动相机服务的请求。
相机应用接收启动相机应用的请求之后,可以下发启动相机服务的请求以触发相机服务启动。相应的,相机服务可以接收相机应用发送的启动相机服务的请求,并启动。
S503:相机服务向相机HAL发送启动相机HAL的请求。
相机服务接收相机应用发送的启动相机服务的请求之后,可以向下发启动相机HAL的请求以触发相机HAL所在的进程启动。相应的,相机HAL可以接收相机服务发送的启动相机HAL的请求,并且可以启动相应的进程。可理解,相机HAL所在的进程启动之后,可以进行配流。
可理解,相机应用的具体启动过程(如步骤S501-步骤S503)可以参考相关技术文档,在此不展开说明。
S504:相机HAL中的传感器节点模块向摄像头发送初始化配置参数。
相机应用启动之后,相机HAL中的传感器节点模块可以向摄像头发送初始化配置参数。具体地,相机HAL所在进程启动之后,相机HAL中的传感器节点模块可以将初始化配置参数发送给相机驱动,相机驱动再将初始化配置参数发送给摄像头。
在本申请的一些实施例中,相机HAL配流之后,传感器节点模块可以向摄像头发送初始化配置参数。
在本申请的一些实施例中,相机驱动可以通过I2C接口将相关配置参数(例如,初始化配置参数)发送给摄像头中的图像传感器,从而实现将该相关配置参数写到图像传感器包括的寄存器中。I2C指的是Inter-Integrated Circuit,中文含义为集成电路。I2C的具体含义和作用可以参考后文及相关技术文档,在此不展开说明。
可理解,初始化配置参数可以包括数据传输协议、内部时序和中断频率等参数。
需要说明的是,初始化配置参数可以具体包括若干寄存器序列。寄存器序列可以包括指令和地址。寄存器序列中的指令和地址的含义可以参考相关技术文档,在此不展开说明。
相应的,摄像头可以接收传感器节点模块发送的初始化配置参数。
S505:摄像头将初始化配置参数存储到图像传感器包括的寄存器中。
可理解,摄像头中的图像传感器可以包括寄存器。摄像头接收传感器节点模块发送的初始化配置参数之后,可以将初始化配置参数存储到图像传感器包括的寄存器中。
S506:相机应用确定启动后的默认相机模式。
相机应用接收启动相机应用的请求并启动之后,可以确定默认相机模式。可理解,相机应用启动之后,还未接收用户改变相机模式的请求,这种情况下,电子设备在默认相机模式下采集图像。
在本申请的一些实施例中,相机应用启动之后,还可以确定默认变焦倍数。这样,电子设备可以基于默认相机模式和默认变焦倍数来采集图像。
示例性的,相机应用接收启动相机应用的请求并启动之后,可以确定默认相机模式为普通拍照模式,默认变焦倍数可以为1x。
当然,默认相机模式还可以设置为其他相机模式,默认变焦倍数也可以设置为其他变焦倍数。例如,默认相机模式可以为人像拍照模式。例如,默认变焦倍数可以为1.5x。
可理解,相机模式可以包括普通拍照模式、人像拍照模式、夜景模式、普通录像模式、微电影模式、HDR录像模式等。
需要说明的是,本申请中所提及的变焦倍数可以表征摄像头焦距的变化程度,相应的,变焦倍数也可以表征视场角的变化程度以及被摄体在画面(即电子设备显示屏所显示的图 像)中的大小变化。其中,被摄体指的是摄像头拍摄的对象物体。在本申请的一些实施例中,被摄体为人脸。
可理解,在被摄体与摄像头距离相同的情况下,与使用短焦距摄像头所采集的图像相比,使用长焦距摄像头所采集的图像中的被摄体所占的比例会更大一些。具体地,在焦距变化至原焦距的n倍的情况下,被摄体在画面中的大小也变化至原大小的n倍。例如,若摄像头的焦距增大至原焦距的2倍,被摄体在画面中的大小也增大至原来大小的2倍。另外,在焦距发生变化的情况下,视场角也会相应变化。一般情况下,焦距越短,视场角越大。
在本申请中,变焦倍数可以表示为nx。其含义是焦距变化为原焦距的n倍。其中,n为正数。根据上文,n越大,焦距越长,视场角越小,摄像头采集的图像中的被摄体越大。可理解,本申请对n的具体数值不作限制。例如,n可以为10,还可以为20,还可以为50。在一些实施例中,n可以达到100,甚至超过100。需要说明的是,原焦距指的是摄像头的默认焦距。在本申请的一些实施例中,电子设备的摄像头可以分为主摄像头和副摄像头。原焦距指的是主摄像头的默认焦距。
S507:相机应用向传感器节点模块发送默认相机模式。
相机应用可以将默认相机模式发送给相机服务,然后相机服务可以再将默认相机模式发送给传感器节点模块。
在本申请的一些实施例中,相机应用还可以向传感器节点模块发送默认相机模式的标识。默认相机模式的标识可以通过文字、数字、字符串等形式表示,本申请对此不作限制。例如,相机应用可以将Photo发送给传感器节点。Photo表示的是普通拍照模式。
相应的,传感器节点可以接收相机应用发送的默认相机模式。
S508:传感器节点模块确定默认相机模式对应的FMC配置参数。默认相机模式对应的FMC配置参数包括默认相机模式对应的所有出图模式的配置参数和默认相机模式下的默认出图模式的相关信息。
传感器节点模块接收相机应用发送的默认相机模式之后,可以确定默认相机模式对应的FMC配置参数。FMC表示的是fast mode change,即快速模式切换。默认相机模式对应的FMC配置参数可以包括默认相机模式对应的所有出图模式的配置参数和默认相机模式下的默认出图模式的相关信息。可理解,该默认相机模式下的默认出图模式可以预先设置。
示例性的,在默认相机模式为普通拍照模式的情况下,默认相机模式对应的FMC配置参数即为普通拍照FMC配置参数。普通拍照FMC配置参数可以包括Binning出图模式的配置参数、Remosaic出图模式的配置参数,以及普通拍照模式下的默认出图模式的相关信息。
可理解,出图模式的配置参数可以包括出图尺寸、颜色和数据传输速率等。与初始化配置参数类似,出图模式的配置参数也可以具体包括若干寄存器序列。可理解,每一种出图模式的配置参数都可以包括若干组寄存器序列。在实际应用中,一种出图模式对应的模式配置参数所包括的寄存器序列可以达到上百组。
可理解,电子设备中存储有若干相机模式对应的FMC配置参数。其中,每一种相机模式对应的FMC配置参数均可以包括该相机模式对应的所有出图模式的配置参数和该相机 模式下的默认出图模式的相关信息。
在本申请的一些实施例中,相机模式下的默认出图模式的相关信息可以为该默认出图模式的标识。可理解,默认出图模式的标识可以通过文字、数字、字符串表示,本申请对此不作限制。
例如,普通拍照模式对应的出图模式包括Binning出图模式和Remosaic出图模式。在普通拍照模式下的默认出图模式的标识为Binning的情况下,普通拍照模式下的默认出图模式为Binning出图模式。在普通拍照模式下的默认出图模式的标识为Remosaic的情况下,普通拍照模式下的默认出图模式为Remosaic出图模式。
在本申请的一些实施例中,相机模式下的默认出图模式的相关信息可以由寄存器序列表示。该寄存器序列包括的指令可以指示该相机模式下的默认出图模式。
例如,普通拍照模式对应的出图模式包括Binning出图模式和Remosaic出图模式。普通拍照模式对应的FMC配置参数可以包括用于指示默认出图模式的寄存器序列。该寄存器序列可以包括0x0001。0x0001是该寄存器序列中的指令,其表示的含义是普通拍照模式下的默认拍照模式为Binning出图模式。类似的,普通拍照模式对应的FMC配置参数中的用于指示默认模式的寄存器序列可以包括0x0011。0x0011表示的含义是普通拍照模式下的默认拍照模式为Remosaic出图模式。
S509:传感器节点模块向摄像头发送默认相机模式对应的FMC配置参数。
传感器节点模块确定默认相机模式对应的FMC配置参数之后,可以将默认相机模式对应的FMC配置参数发送给相机驱动,再由相机驱动发送给摄像头。
在本申请的一些实施例中,相机驱动可以直接将默认相机模式对应的FMC配置参数写入摄像头包括的图像传感器中的寄存器。
相应的,摄像头可以接收传感器节点模块发送的默认相机模式对应的FMC配置参数。
S510:摄像头将默认相机模式对应的FMC配置参数存储到图像传感器包括的寄存器中。
摄像头接收传感器节点模块发送的默认相机模式对应的FMC配置参数之后,可以将默认相机模式对应的FMC配置参数存储到图像传感器包括的寄存器中。
S511:摄像头基于默认相机模式对应的FMC配置参数确定默认相机模式下的默认出图模式,并应用该默认出图模式的配置参数。
摄像头接收默认相机模式对应的FMC配置参数之后,可以基于该FMC配置参数包括的默认出图模式的相关信息确定默认相机模式下的默认出图模式,并应用该默认出图模式的配置参数。
例如,默认拍照模式为普通拍照模式。普通拍照模式对应的出图模式包括Binning出图模式和Remosaic出图模式。普通拍照FMC配置参数可以包括用于指示默认模式的寄存器序列。在该用于指示默认出图模式的寄存器序列包括0x0001的情况下,摄像头可以确定普通拍照模式下的默认出图模式为Binning出图模式。这样,摄像头可以应用存储在寄存器中的Binning出图模式的配置参数。在该用于指示默认出图模式的寄存器序列包括0x0011的情况下,摄像头可以确定普通拍照模式下的默认出图模式为Remosaic出图模式。这样, 摄像头可以应用存储在寄存器中的Remosaic出图模式的配置参数。
S512:摄像头基于默认相机模式下的默认出图模式采集原始图像数据。
摄像头确定默认相机模式下的默认出图模式之后,摄像头包括的图像传感器可以按照该默认出图模式出帧。即摄像头可以基于该默认出图模式采集原始图像数据。相应的,电子设备中的其他软硬件模块可以对该原始图像数据进行处理,并最终将其显示在显示屏上。
在本申请的一些实施例中,电子设备执行步骤S501-步骤S507之后,可以确定默认相机模式对应的所有出图模式的配置参数,并首先加载默认相机模式下的默认出图模式的配置参数。待加载完成后,电子设备可以直接应用该默认相机模式下的默认出图模式的配置参数,即基于默认相机模式下的默认出图模式来采集图像。待默认相机模式下的默认出图模式的配置参数加载完成后,电子设备可以继续再加载默认相机模式对应的其他出图模式(默认出图模式除外)的配置参数。
具体地,传感器节点模块接收相机应用发送的默认相机模式之后,可以确定默认相机模式对应的所有出图模式的配置参数。传感器节点模块可以首先将默认相机模式下的默认出图模式的配置参数发送给摄像头。摄像头接收传感器节点模块发送的默认相机模式下的默认出图模式的配置参数之后,可以将其存储在图像传感器包括的寄存器中。并且,摄像头可以直接应用该默认相机模式下的默认出图模式的配置参数,从而基于默认模式相机下的默认出图模式采集图像。而传感器节点模块将默认相机模式下的默认出图模式的配置参数发送给摄像头之后,可以再陆续将默认相机模式下的其他出图模式的配置参数发送给摄像头。而摄像头接收这些出图模式的配置参数之后,可以将其存储在图像传感器的寄存器中。
二、确定目标出图模式,并基于目标出图模式调节当前的出图模式(如图6A所示)
请参阅图6A,相机应用运行且相机模式不变时,电子设备可以结合相机模式、变焦倍数和HDR场景判断结果确定目标出图模式,并基于目标出图模式调节当前的出图模式。
在本申请的一些实施例中,电子设备执行如图5所示的步骤之后,可以持续确定目标出图模式,并在目标出图模式与当前的出图模式不一致的情况下,将当前的出图模式更新为目标出图模式。即电子设备执行如图5所示的步骤之后,还可以执行如图6A所示的步骤。
S601:相机应用确定当前的相机模式和当前的变焦倍数。
相机应用处于运行状态时,可以确定当前的相机模式和当前的变焦倍数。在本申请的一些实施例中,相机应用每隔一段时间(例如,1毫秒)可以确定一次当前的相机模式和当前的变焦倍数,并将其下发。该一段时间可以根据实际需要进行设置,本申请对此不作限制。
S602:相机应用向决策模块发送当前的相机模式和当前的变焦倍数。
相机应用确定当前的相机模式和当前的变焦倍数之后,可以将当前的相机模式和当前的变焦倍数发送给决策模块。
相应的,决策模块可以接收相机应用发送的当前的相机模式和当前的变焦倍数。
S603:摄像头基于出图模式C1采集原始图像数据P1。
摄像头包括的图像传感器基于出图模式C1出帧,从而实现对原始图像数据的采集。需要说明的是,摄像头持续基于出图模式C1采集原始图像数据。原始图像数据P1仅为该原始图像数据中的一部分。可理解,原始图像数据P1可以为RAW图。
在本申请的一些实施例中,原始图像数据P1可以为摄像头采集的一帧图像对应的原始图像数据。在本申请的又一些实施例中,原始图像数据P1还可以为摄像头采集的若干帧图像对应的原始图像数据。
可理解,电子设备中的其他软硬件模块可以对原始图像数据P1进行处理,并最终将其显示在显示屏上。
S604:摄像头向图像信号处理器发送原始图像数据P1。
摄像头采集原始图像数据P1之后,可以将原始图像数据P1发送给图像信号处理器(ISP)。
相应的,ISP可以接收摄像头发送的原始图像数据P1。
S605:图像信号处理器对原始图像数据P1进行处理,得到图像数据P1-1。
ISP接收摄像头发送的原始图像数据P1之后,可以基于其包括的IFE等硬件模块对原始图像数据P1进行处理,得到图像数据P1-1。其中,IFE的英文全称为Image Front End,其中文含义为图像前端。IFE模块的主要作用可以包括颜色校正、下采样、去马赛克、统计3A数据等。
可理解,ISP还可以包括图像处理引擎(Image Process Engine,IPE)、拜耳处理模块(Bayer Processing Segment,BPS)等硬件模块。ISP包括的硬件模块和这些硬件模块的具体含义可以参考相关技术文档,在此不展开说明。
S606:图像信号处理器向自动曝光控制模块发送图像数据P1-1。
ISP对原始图像数据P1进行处理并得到图像数据P1-1之后,可以向相机HAL中的自动曝光控制模块发送图像数据P1-1。
相应的,自动曝光控制模块可以接收ISP发送的图像数据P1-1。
S607:自动曝光控制模块基于图像数据P1-1确定自适应动态范围压缩增益、暗区亮度信息和环境亮度。
首先介绍自适应动态范围压缩增益、暗区亮度信息和环境亮度。
自适应动态范围压缩增益指的是Adaptive dynamic range compression Gain,可以简称为AdrcGain。AdrcGain可以表示动态范围。动态范围(dynamic range)是一个用于定义相机可以在多大范围内捕捉图像的影调细节的术语,通常指由最低值到最高溢出值之间的范围。简单地说,它描述的是相机在单帧内可以记录的最亮和最暗影调之间的比率。动态范围越大,图像所包含的亮度信息越丰富,图像的明暗和色彩表现也更生动。
暗区亮度信息可以包括图像暗区的平均亮度。为了便于描述,本申请中用DarkLuma表示图像暗区的平均亮度。
在本申请的一些实施例中,自动曝光控制模块可以确定图像数据P1-1中亮度小于预设亮度阈值的像素,这些像素即为图像数据P1-1的暗区。自动曝光控制模块还可以确定图像数据P1-1的暗区中所有像素的亮度的平均值。该平均值即为图像数据P1-1的暗区的平均 亮度。
在本申请的一些实施例中,自动曝光控制模块可以对图像数据P1-1划分区域,依据每个区域的亮度平均值由小到大对这些区域进行排序,然后选取这些区域中排序前k%的区域。可理解,该k%的区域即为图像数据P1-1中的暗区。自动曝光控制模块可以确定该k%的区域的平均亮度。该平均亮度即为图像数据P1-1的暗区的平均亮度。可理解,k的范围为(0,100)。例如,k可以为20。
在本申请的一些实施例中,ISP向自动曝光控制模块发送的图像数据P1-1可以包括原始图像数据P1的直方图。该直方图可以表明原始图像数据P1包括的每一个像素的亮度。自动曝光控制模块接收图像数据P1-1之后,可以基于该直方图确定亮度最低的前k%的像素的平均亮度。
为了便于描述,本申请中用LV表示环境亮度。可理解,LV的确定方法可以参考相关技术文档,在此不展开说明。
可理解,自动曝光控制模块可以基于图像数据P1-1所包括的亮度信息确定AdrcGain、DarkLuma和LV。需要说明的是,AdrcGain、DarkLuma和LV在某种程度上表示的即为图像数据P1-1的亮度信息。
S608:自动曝光控制模块向感知引擎发送自适应动态范围压缩增益、暗区亮度信息和环境亮度。
自动曝光控制模块基于图像数据P1-1确定AdrcGain、DarkLuma和LV之后,可以将AdrcGain、DarkLuma和LV发送给感知引擎。
相应的,感知引擎可以接收自动曝光控制模块发送的AdrcGain、DarkLuma和LV。
S609:感知引擎基于自适应动态范围压缩增益、暗区亮度信息和环境亮度判断当前是否为HDR场景,并得到HDR场景判断结果。
可理解,HDR指的是高动态范围成像,其英文全称为High Dynamic Range Imaging。在计算机图形学与电影摄影术中,是用来实现比普通数位图像技术更大曝光动态范围(即更大的明暗差别)的一组技术。
在本申请的一些实施例中,感知引擎可以确定AdrcGain、DarkLuma和LV是否满足进入HDR场景条件,以及AdrcGain、DarkLuma和LV是否满足退出HDR场景条件。在AdrcGain、DarkLuma和LV满足进入HDR场景条件下,感知引擎可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。在AdrcGain、DarkLuma和LV满足退出HDR场景条件下,感知引擎可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。而在AdrcGain、DarkLuma和LV既不满足进入HDR场景条件又不满足退出HDR场景条件的情况下,感知引擎可以确定当前场景与上一次确定的场景一致,即本次得到的HDR场景判断结果与上一次得到的HDR场景判断结果一致。
其中,进入HDR场景条件可以包括:AdrcGain大于增益阈值Z1或者DarkLuma小于暗区亮度阈值A1,且LV大于环境亮度阈值H1。退出HDR场景条件可以包括:AdrcGain小于增益阈值Z2或者DarkLuma大于暗区亮度阈值A2,且LV小于环境亮度阈值H2。可理解,Z1>Z2,A1<A2,H1>H2。
可理解,增益阈值Z1、暗区亮度阈值A1、环境亮度阈值H1、增益阈值Z2、暗区亮度 阈值A2和环境亮度阈值H2可以根据实际需要进行设置,本申请对此不作限制。例如,增益阈值Z1可以为2.2,暗区亮度阈值A1可以为27,环境亮度阈值H1可以为50,增益阈值Z2可以为1.6,暗区亮度阈值A2可以为36,环境亮度阈值H2可以为46。可理解,环境亮度阈值H1和环境亮度阈值H2的单位可以为坎德拉/平方米(cd/m2)。
可理解,本申请中所提及的亮度还可以通过图像中像素的灰度值来表示。
需要说明的是,本申请对于感知引擎确定AdrcGain、DarkLuma和LV是否满足进入HDR场景条件,以及是否满足退出HDR场景条件的先后顺序不作限制。例如,感知引擎可以首先确定AdrcGain、DarkLuma和LV是否满足进入HDR场景条件,若AdrcGain、DarkLuma和LV不满足进入HDR场景条件,再确定AdrcGain、DarkLuma和LV是否满足退出HDR场景条件。再例如,感知引擎可以首先确定AdrcGain、DarkLuma和LV是否满足退出HDR场景条件,若AdrcGain、DarkLuma和LV不满足退出HDR场景条件,再确定AdrcGain、DarkLuma和LV是否满足进入HDR场景条件。
在本申请的一些实施例中,感知引擎可以判断AdrcGain是否大于增益阈值Z1,DarkLuma是否小于暗区亮度阈值A1,以及LV是否大于环境亮度阈值H1。若AdrcGain大于增益阈值Z1或者DarkLuma小于暗区亮度阈值A1,且LV大于环境亮度阈值H1,则感知引擎可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。否则,感知引擎可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。
在本申请的一些实施例中,感知引擎可以判断AdrcGain是否小于增益阈值Z2,DarkLuma是否大于暗区亮度阈值A2,以及LV是否小于环境亮度阈值H2。若AdrcGain小于增益阈值Z2或者DarkLuma大于暗区亮度阈值A2,且LV小于环境亮度阈值H2,则感知引擎可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。否则,感知引擎可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。
可理解,HDR场景判断结果可以通过文字、数字、单词、字符串等形式表现,本申请对此不作限制。例如,在感知引擎确定当前场景为HDR场景的情况下,感知引擎得到的HDR场景判断结果为“是”,而在感知引擎确定当前场景不为HDR场景的情况下,感知引擎得到的HDR场景判断结果为“否”。例如,在在感知引擎确定当前场景为HDR场景的情况下,感知引擎得到的HDR场景判断结果为1,而在感知引擎确定当前场景不为HDR场景的情况下,感知引擎得到的HDR场景判断结果为0。再例如,在在感知引擎确定当前场景为HDR场景的情况下,感知引擎得到的HDR场景判断结果为true,而在感知引擎确定当前场景不为HDR场景的情况下,感知引擎得到的HDR场景判断结果为false。
S610:感知引擎向决策模块发送HDR场景判断结果。
感知引擎得到HDR场景判断结果之后,可以将HDR场景判断结果发送给决策模块。
相应的,决策模块可以接收感知引擎发送的HDR场景判断结果。
S611:决策模块基于当前的相机模式、当前的变焦倍数和HDR场景判断结果确定目标出图模式。
可理解,电子设备中可以预先存储有相机模式、变焦倍数、HDR场景判断结果和出图模式的对应关系。决策模块可以在该对应关系中查找与当前的相机模式、当前的变焦倍数 和接收的HDR场景判断结果所对应的出图模式。该出图模式即为决策模块确定的目标出图模式。
可理解,拍照模式、变焦倍数、HDR场景判断结果和出图模式的对应关系可以根据实际需要进行设置,本申请对此不作限制。
示例性的,如表1所示,在相机模式为普通拍照模式的情况下,若变焦倍数小于2x,则对应的出图模式为Binning出图模式,若变焦倍数不小于2x且当前场景为HDR场景,则对应的出图模式为Remosaic出图模式,若变焦倍数不小于2x且当前场景不为HDR场景,则对应的出图模式为Binning出图模式。在相机模式为HDR录像模式的情况下,若当前场景为HDR场景,则对应的出图模式为IDCG出图模式,若当前场景不为HDR场景,则对应的出图模式为Binning出图模式。
表1
当然,表1仅为示例,相机模式、变焦倍数、HDR场景判断结果和出图模式的对应关系不限于表1所示的内容。
示例性的,相机应用启动并进入普通拍照模式之后,可以持续获取当前的相机模式和当前的变焦倍数,还可以持续进行HDR场景判断。决策模块接收的当前的相机模式可以为普通拍照模式,当前的变焦倍数可以为2x,HDR场景判断结果可以为“是”,则决策模块可以基于表1确定目标出图模式为Remosaic出图模式。
S612:决策模块向传感器节点模块发送目标出图模式的相关信息。
决策模块确定目标出图模式之后,可以将目标出图模式的相关信息发送给传感器节点模块。
可理解,目标出图模式的相关信息可以包括目标出图模式的名称(例如,Binning/IDCG/Remosaic),还可以包括目标出图模式的标识。其中,目标出图模式的标识可以由文字、数字、字符、单词等形式表示,本申请对此不作限制。例如,Binning出图模式的标识可以为s1,IDCG出图模式的标识可以为s2,Remosaic出图模式的标识可以为s3。
示例性的,决策模块确定目标出图模式为Remosaic出图模式之后,可以向传感器节点模块发送s3。
相应的,传感器节点模块可以接收决策模块发送的目标出图模式的相关信息。
S613:传感器节点模块基于目标出图模式的相关信息确定目标出图模式与出图模式C1是否一致。
传感器节点模块接收决策模块发送的目标出图模式的相关信息之后,可以确定目标出 图模式,并将目标出图模式与当前出图模式(即出图模式C1)进行比较,确定目标出图模式与当前出图模式是否一致。可理解,传感器节点模块可以获取当前的出图模式的相关信息。在本申请的一些实施例中,传感器节点模块可以存储有当前的出图模式的相关信息。当前的出图模式的相关信息的描述可以参考上文对目标出图模式的相关信息的描述,在此不再赘述。
例如,传感器节点模块可以接收s3,从而确定目标出图模式为Remosaic出图模式。在相机应用启动且未调整相机模式的情况下,当前的相机模式即为默认相机模式。若默认相机模式为普通拍照模式,且普通拍照模式下的默认出图模式为Binning出图模式,则当前的出图模式(即出图模式C1)即为Binning出图模式。传感器节点模块可以存储有Binning出图模式的相关信息。那么,传感器节点模块可以确定目标出图模式和出图模式C1不一致。
需要说明的是,若目标出图模式与出图模式C1一致,电子设备可以不执行后续步骤。在这种情况下,摄像头可以继续基于出图模式C1来采集原始图像数据。
S614:若目标出图模式与出图模式C1不一致,传感器节点模块确定模式切换配置参数。
可理解,由于当前的相机模式没有变化,因此,目标出图模式与出图模式C1为当前的相机模式对应的出图模式。若传感器节点模块确定目标出图模式与出图模式C1不一致,可以确定模式切换配置参数。该模式切换配置参数可以用于指示摄像头应用存储在其图像传感器包括的寄存器中的目标出图模式的配置参数。可理解,该模式切换配置参数可以包括切换至目标出图模式的控制开关配置参数。可理解,模式切换配置参数可以包括若干寄存器序列。需要说明的是,模式切换配置参数所包括的寄存器序列远远少于一种出图模式的配置参数所包括的寄存器序列。通常,模式切换配置参数所包括的寄存器序列为几组或十几组,而一种出图模式的配置参数所包括的寄存器序列可以达到几百组。
例如,在当前的相机模式为普通拍照模式的情况下,若出图模式C1为Binning出图模式,而目标出图模式为Remosaic出图模式,则传感器节点模块可以确定模式切换配置参数为setting0。可理解,setting0可以用于指示摄像头从Binning出图模式切换为Remosaic出图模式。setting0可以包括用于指示摄像头应用Remosaic出图模式的配置参数的寄存器序列。类似的,在当前的相机模式为普通拍照模式的情况下,若出图模式C1为Remosaic出图模式,而目标出图模式为Binning出图模式,则传感器节点模块可以确定模式切换配置参数为setting1。可理解,setting1可以用于指示摄像头从Remosaic出图模式切换为Binning出图模式。setting1可以包括用于指示摄像头应用Binning出图模式的配置参数的寄存器序列。示例性的,setting0可以包括0100,setting1可以包括0101。
可理解,模式切换配置参数可以为无缝切换配置参数,即seamless setting。
例如,在普通拍照模式下进行出图模式切换时,对应的模式切换配置参数可以包括seamless setting0和seamless setting1。在出图模式C1为Binning出图模式,目标模式为Remosaic出图模式的情况下,传感器节点模块可以确定模式切换配置参数是seamless setting1。在出图模式C1为Remosaic出图模式,目标模式为Binning出图模式的情况下,传感器节点模块可以确定模式切换配置参数是seamless setting0。
在本申请的一些实施例中,在不同相机模式下进行出图模式切换时,对应的模式切换 配置参数可以相同。
例如,在普通拍照模式下进行出图模式切换时,对应的模式切换配置参数可以包括seamless setting0和seamless setting1。而在HDR录像模式下进行出图模式切换时,对应的模式切换配置参数也可以包括seamless setting0和seamless setting1。相区别的是,在普通拍照模式下进行出图模式切换时,若对应的模式切换配置参数为seamless setting1,则表示出图模式由Binning出图模式切换为Remosaic出图模式,若对应的模式切换配置参数为seamless setting0,则表示出图模式由Remosaic出图模式切换为Binning出图模式,而在HDR录像模式下进行出图模式切换时,若对应的模式切换配置参数为seamless setting1,则表示出图模式由Binning出图模式切换为IDCG出图模式,若对应的模式切换配置参数为seamless setting0,则表示出图模式由IDCG出图模式切换为Binning出图模式。
S615:传感器节点模块向摄像头发送模式切换配置参数。
传感器节点模块确定模式切换配置参数之后,可以将该模式切换配置参数发送给相机驱动,相机驱动再将模式切换配置参数发送给摄像头。
相应的,摄像头可以接收传感器节点模块发送的模式切换配置参数。
S616:摄像头将模式切换配置参数存储到图像传感器包括的寄存器中。
摄像头接收传感器节点模块发送的模式切换配置参数之后,可以将该模式切换配置参数存储到图像传感器包括的寄存器中。
S617:摄像头基于模式切换配置参数将当前的出图模式由出图模式C1更新为目标切换模式。
摄像头可以基于模式切换配置参数包括的寄存器序列来应用目标切换模式的配置参数。即摄像头可以将当前应用的出图模式的配置参数由出图模式C1的配置参数调整为目标切换模式的配置参数。
S618:摄像头基于目标出图模式采集原始图像数据。
摄像头更新当前的出图模式之后,可以基于更新后的出图模式采集原始图像数据。即摄像头可以基于目标出图模式采集原始图像数据。相应的,电子设备中的其他软硬件模块可以对该原始图像数据进行处理,并最终将其显示在显示屏上。
在本申请的一些实施例中,电子设备可以基于图像数据P1-1确定自适应动态范围压缩增益、暗区亮度信息和环境亮度(即AdrcGain、DarkLuma和LV)中的一项或多项,并基于该确定的一项或多项内容判断当前是否为HDR场景,得到HDR场景判断结果。具体地,在执行步骤S607和步骤S608时,自动曝光控制模块可以基于图像数据P1-1确定自适应动态范围压缩增益、暗区亮度信息和环境亮度中的一项或多项,并将该确定的一项或多项内容发送给感知引擎。并且,在执行步骤S609时,感知引擎可以基于该一项或多项内容判断当前是否为HDR场景,并得到HDR场景判断结果。
以自适应动态范围压缩增益和环境亮度为例进行说明,电子设备可以基于图像数据P1-1确定AdrcGain和LV,并基于AdrcGain和LV判断当前场景是否为HDR场景。
在一种可能的实现方式中,电子设备可以确定AdrcGain和LV是否满足进入HDR场 景条件和退出HDR场景条件。在AdrcGain和LV满足进入HDR场景条件的情况下,电子设备可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。在AdrcGain和LV满足退出HDR场景条件的情况下,电子设备可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。在AdrcGain和LV既不满足进入HDR场景条件又不满足退出HDR场景条件的情况下,感知引擎可以确定当前场景与上一次确定的场景一致,即本次得到的HDR场景判断结果与上一次得到的HDR场景判断结果一致。
其中,进入HDR场景条件可以包括:AdrcGain大于增益阈值Z1且LV大于环境亮度阈值H1。退出HDR场景条件可以包括:AdrcGain小于增益阈值Z2且LV小于环境亮度阈值H2。可理解,Z1>Z2,H1>H2。
在又一种可能的实现方式中,在AdrcGain大于增益阈值Z1且LV大于环境亮度阈值H1的情况下,电子设备可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。否则,电子设备可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。
类似的,以暗区亮度信息和环境亮度为例进行说明,电子设备可以基于图像数据P1-1确定DarkLuma和LV,并基于DarkLuma和LV判断当前场景是否为HDR场景。
在一种可能的实现方式中,电子设备可以确定DarkLuma和LV是否满足进入HDR场景条件和退出HDR场景条件。在DarkLuma和LV满足进入HDR场景条件的情况下,电子设备可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。在DarkLuma和LV满足退出HDR场景条件的情况下,电子设备可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。在DarkLuma和LV既不满足进入HDR场景条件又不满足退出HDR场景条件的情况下,感知引擎可以确定当前场景与上一次确定的场景一致,即本次得到的HDR场景判断结果与上一次得到的HDR场景判断结果一致。
其中,进入HDR场景条件可以包括:DarkLuma小于暗区亮度阈值A1且LV大于环境亮度阈值H1。退出HDR场景条件可以包括:DarkLuma大于暗区亮度阈值A2且LV小于环境亮度阈值H2。可理解,A1<A2,H1>H2。
在又一种可能的实现方式中,在DarkLuma小于暗区亮度阈值A1且LV大于环境亮度阈值H1的情况下,电子设备可以确定当前场景为HDR场景,并得到相应的HDR场景判断结果。否则,电子设备可以确定当前场景不为HDR场景,并得到相应的HDR场景判断结果。
类似的,以环境亮度为例进行说明,电子设备可以基于图像数据P1-1确定当前的环境亮度,并基于该当前的环境亮度判断当前场景是否为HDR场景。在一种可能的实现方式中,若当前的环境亮度大于环境亮度阈值H1,则电子设备可以确定当前场景为HDR场景。否则,电子设备可以确定当前场景不为HDR场景。在又一种可能的实现方式中,若当前的环境亮度大于环境亮度阈值H1,则电子设备可以确定当前场景为HDR场景,并得到HDR场景判断结果。若当前的环境亮度小于环境亮度阈值H2,则电子设备可以确定当前场景不为HDR场景,并得到HDR场景判断结果。若当前的环境亮度在环境亮度阈值H1和环境亮度阈值H2之间(包括环境亮度阈值H1和环境亮度阈值H2),则电子设备可以得到的 HDR场景判断结果与上一次得到的HDR场景判断结果相同。
需要说明的是,电子设备还可以基于图像数据P1-1获取其他类型的亮度信息,并基于该其他类型的亮度信息判断当前场景是否为HDR场景。例如,该其他类型的亮度信息可以包括图像数据P1-1中的暗区与平均亮度的差值,还可以包括图像数据P1-1中的亮区与平均亮度的差值。
在本申请的一些实施例中,电子设备可以基于当前的相机模式和HDR场景判断结果确定目标出图模式,而不考虑变焦倍数。具体地,在执行步骤S601和步骤S602时,相机应用可以确定当前的相机模式,并将当前的相机模式发送给决策模块。在执行步骤S611时,决策模块可以基于当前的相机模式和HDR场景判断结果确定目标出图模式。具体地,电子设备中可以预先存储有相机模式、HDR场景判断结果和出图模式的对应关系。决策模块可以在该对应关系中查找与当前的相机模式和接收的HDR场景判断结果所对应的出图模式。该出图模式即为决策模块确定的目标出图模式。可理解,相机模式、HDR场景判断结果和出图模式的对应关系可以根据实际需要进行设置,本申请对此不作限制。
示例性的,如表2所示,在相机模式为普通拍照模式的情况下,若当前场景为HDR场景,则对应的出图模式为Remosaic出图模式,若当前场景不为HDR场景,则对应的出图模式为Binning出图模式。在相机模式为HDR录像模式的情况下,若当前场景为HDR场景,则对应的出图模式为IDCG出图模式,若当前场景不为HDR场景,则对应的出图模式为Binning出图模式。
表2
当然,表2仅为示例,相机模式、HDR场景判断结果和出图模式的对应关系不限于表2所示的内容。
在本申请的一些实施例中,电子设备还可以基于当前的相机模式和变焦倍数确定目标出图模式,而不考虑HDR场景判断结果,具体实现方式可以参考上文,在此不再赘述。
当然,电子设备还可以基于其他因素(例如,被摄体在画面中的大小、被摄体的运动状态等)确定目标出图模式,本申请对此不作限制。
基于图5和图6A可知,相机应用启动后,电子设备可以加载默认相机模式下的所有出图模式的配置参数,并应用默认相机模式下的默认出图模式的配置参数,从而实现基于默认相机模式下的默认出图模式采集图像。而在默认相机模式下,电子设备可以加载模式切换配置参数,并基于模式切换配置参数来将当前应用的出图模式的配置参数由出图模式C1的配置参数切换为目标出图模式的配置参数,即通过加载切换至目标出图模式的控制开 关配置参数就能实现出图模式的切换,无需重新加载目标出图模式的配置参数。而该控制开关配置参数包括的寄存器序列的数量小于目标出图模式的配置参数包括的寄存器序列的数量,这就使得电子设备可以花费更少的时间完成出图模式的切换,即出图模式的切换时延减小。
示例性的,如图6B所示,在t1时刻,电子设备进入HDR录像模式,电子设备开始加载HDR录像模式对应的所有出图模式的配置参数(即HDR录像FMC配置参数)。其中,HDR录像模式对应的所有出图模式的配置参数可以包括Binning出图模式的配置参数和IDCG出图模式的配置参数。在t2时刻,电子设备结束加载HDR录像FMC配置参数。可理解,HDR录像FMC配置参数加载完成之后,电子设备可以基于HDR录像模式下的Binning出图模式采集图像。在t3时刻,电子设备开始从Binning出图模式切换至IDCG出图模式,电子设备开始加载seamless setting1。在HDR录像模式下,seamless setting1是指示由Binning出图模式切换至IDCG出图模式的模式切换配置参数。在t4时刻,电子设备结束加载seamless setting1。如图6B所示,HDR录像FMC配置参数所包括的setting的组数大于seamless setting1包括的setting的组数。setting指的是配置参数。一组setting可以包括至少一组寄存器序列。具体地,如图6B所示,电子设备加载一组setting时,首先会加载从机地址(即slave address),再加载子地址(即sub-address),然后再写入数据。其中,从机地址指的是器件(例如,摄像头)在I2C总线上被主机寻址的地址,而子地址指的是该器件内部不同部件或存储单元的编址器件(例如,摄像头包括的图像传感器中的寄存器)的地址。需要说明的是,电子设备加载seamless setting1包含的setting时,加载子地址时并未涉及用于控制停流/启流的寄存器的地址。也就是说,在本申请实施例中,电子设备在拍摄过程中切换出图模式时,摄像头上报的图像数据不会出现停流/启流的断流现象,使得出图模式切换的过程更加快速和平滑,提高用户的使用体验。
三、切换相机模式后,加载切换后的相机模式对应的所有出图模式的配置参数(如图7所示)
用户可以触发切换相机模式。请参阅图7,相机模式切换之后,电子设备可以加载切换后的相机模式对应的所有出图模式的配置参数,并且电子设备还可以应用该切换后的相机模式下的默认出图模式的配置参数,从而基于该切换后的相机模式下的默认出图模式采集图像。
在本申请的一些实施例中,电子设备执行如图5和图6A所示的步骤之后,还可以响应于切换相机模式的用户操作,加载切换后的相机模式对应的所有出图模式的配置参数,并基于该切换后的相机模式下的默认出图模式采集图像。
S701:相机应用接收到切换相机模式的请求。
可理解,用户可以触发切换相机模式。相应的,电子设备中的相机应用可以接收切换相机模式的请求。
示例性的,如图2C所示,用户可以点击HDR录像模式选项301。相应的,电子设备可以接收到将相机模式切换至HDR录像模式的请求。响应于该将相机模式切换至HDR录像模式的请求,电子设备可以基于HDR录像模式采集图像(具体参见步骤S702-步骤S708), 并显示图2D所示的用户界面400。可理解,用户也可以通过语音、手势等方式触发切换相机模式,本申请对用户触发电子设备切换相机模式的具体方式不作限制。
S702:相机应用切换相机模式并得到切换后的相机模式。
相机应用接收到切换相机模式的请求后,可以切换相机模式,并得到切换后的相机模式。
S703:相机应用向传感器节点模块发送切换后的相机模式。
相机应用确定切换后的相机模式之后,可以将切换后的相机模式发送给传感器节点模块。具体地,相机应用可以将切换后的相机模式发送给相机服务,然后相机服务可以再将切换后的相机模式发送给传感器节点模块。
相应的,传感器节点模块可以接收相机应用发送的切换后的相机模式。
S704:传感器节点模块确定切换后的相机模式对应的FMC配置参数。切换后的相机模式对应的FMC配置参数包括切换后的相机模式对应的所有出图模式的配置参数和切换后的相机模式下的默认出图模式的相关信息。
传感器节点模块接收相机应用发送的切换后的相机模式之后,可以确定切换后的相机模式对应的FMC配置参数。切换后的相机模式对应的FMC配置参数可以包括切换后的相机模式对应的所有出图模式的配置参数和切换后的相机模式下的默认出图模式的相关信息。可理解,该切换后的相机模式下的默认出图模式可以预先设置。
示例性的,如图2C所示,用户可以触发将相机模式由普通拍照模式切换为HDR录像模式。也就是说,切换后的相机模式为HDR录像模式。HDR录像模式对应的FMC配置参数即为HDR录像FMC配置参数。HDR录像FMC配置参数可以包括Binning出图模式的配置参数、IDCG出图模式的配置参数,以及HDR录像模式下的默认出图模式的相关信息。
可理解,步骤S704的相关描述可以参考步骤S508,在此不再赘述。
S705:传感器节点模块向摄像头发送切换后的相机模式对应的FMC配置参数。
传感器节点模块确定切换后的相机模式对应的FMC配置参数之后,可以将切换后的相机模式对应的FMC配置参数发送给相机驱动,再由相机驱动发送给摄像头。
在本申请的一些实施例中,相机驱动可以直接将切换后的相机模式对应的FMC配置参数写入摄像头包括的图像传感器中的寄存器。
相应的,摄像头可以接收传感器节点模块发送的切换后的相机模式对应的FMC配置参数。
S706:摄像头将切换后的相机模式对应的FMC配置参数存储到图像传感器包括的寄存器中。
摄像头接收传感器节点模块发送的切换后的相机模式对应的FMC配置参数之后,可以将切换后的相机模式对应的FMC配置参数存储到图像传感器包括的寄存器中。
S707:摄像头基于切换后的相机模式对应的FMC配置参数确定切换后的相机模式下的默认出图模式,并应用该默认出图模式的配置参数。
摄像头接收切换后的相机模式对应的FMC配置参数之后,可以基于该FMC配置参数包括的默认出图模式的相关信息确定切换后的相机模式下的默认出图模式,并应用该默认出图模式的配置参数。
可理解,步骤S707的相关描述可以参考步骤S511,在此不再赘述。
S708:摄像头基于切换后的相机模式下的默认出图模式采集原始图像数据。
摄像头确定切换后的相机模式下的默认出图模式之后,摄像头包括的图像传感器可以按照该默认出图模式出帧。即摄像头可以基于该默认出图模式采集原始图像数据。相应的,电子设备中的其他软硬件模块可以对该原始图像数据进行处理,并最终将其显示在显示屏上。
需要说明的是,相机模式切换后,电子设备可以再结合相机模式、变焦倍数和HDR场景判断结果持续确定目标出图模式,并基于目标出图模式调节当前的出图模式。也就是说,电子设备执行如图7所示的步骤之后,还可以执行如图6A所示的步骤。
可理解,在本申请的一些实施例中,在执行图6A所示的步骤的基础上,电子设备执行步骤S613之前,可以先确定相机模式是否切换。若相机模式已切换,则电子设备可以在执行步骤S704-步骤S708后,继续执行步骤S613-步骤S618。若相机模式未切换,则电子设备可以直接继续执行步骤S613-步骤S618。
在本申请的一些实施例中,电子设备执行步骤S701-步骤S703之后,可以确定切换后的相机模式对应的所有出图模式的配置参数,并首先加载切换后的相机模式下的默认出图模式的配置参数。待加载完成后,电子设备可以直接应用该切换后的相机模式下的默认出图模式的配置参数,即基于切换后的相机模式下的默认出图模式来采集图像。待切换后的相机模式下的默认出图模式的配置参数加载完成后,电子设备可以继续再加载切换后的相机模式对应的其他出图模式(默认出图模式除外)的配置参数。
具体地,传感器节点模块接收相机应用发送的切换后的相机模式之后,可以确定切换后的相机模式对应的所有出图模式的配置参数。传感器节点模块可以首先将切换后的相机模式下的默认出图模式的配置参数发送给摄像头。摄像头接收传感器节点模块发送的切换后的相机模式下的默认出图模式的配置参数之后,可以将其存储在图像传感器包括的寄存器中。并且,摄像头可以直接应用该切换后的相机模式下的默认出图模式的配置参数,从而基于切换后的模式相机下的默认出图模式采集图像。而传感器节点模块将切换后的相机模式下的默认出图模式的配置参数发送给摄像头之后,可以再陆续将切换后的相机模式下的其他出图模式的配置参数发送给摄像头。而摄像头接收这些出图模式的配置参数之后,可以将其存储在图像传感器的寄存器中。
四、相机应用从后台运行转为前台运行后,加载历史相机模式对应的所有出图模式的配置参数(如图8和图9所示)
可理解,相机应用可以退出前台运行,转为后台运行。在这种情况下,用户可以再触发相机应用由后台运行转为前台运行。请参阅图8,相机应用从后台运行转为前台运行之后,可以加载历史相机模式对应的所有出图模式的配置参数,并且电子设备还可以应用该历史相机模式下的默认出图模式的配置参数,从而基于该历史相机模式下的默认出图模式 采集图像。
S801:相机应用接收到从后台运行转为前台运行的请求。
可理解,在相机应用处于后台运行状态的情况下,用户可以触发相机应用转为前台运行。相应的,相机应用可以接收到从后台运行转为前台运行的请求。
示例性的,如图2E所示,用户可以点击任务卡片501。相应的,电子设备可以接收到将相机应用从后台运行转为前台运行的请求。响应于该将相机应用从后台运行转为前台运行的请求,电子设备可以基于历史相机模式和历史出图模式采集图像(具体参见步骤S802-步骤S808),并显示图2F所示的用户界面600。可理解,用户也可以通过语音、手势等方式将相机应用从后台运行转为前台运行,本申请对用户触发电子设备将相机应用从后台运行转为前台运行的具体方式不作限制。
可理解,电子设备执行步骤S801之后,还可以执行步骤S501-步骤S505。
S802:相机应用确定历史相机模式L1。历史相机模式L1为相机应用转为前台运行之前最近一次采用的相机模式。
相机应用接收从后台运行转为前台运行的请求之后,可以确定历史相机模式L1。历史相机模式L1为相机应用转为前台运行之前最近一次采用的相机模式。
可理解,历史相机模式L1可以为普通拍照模式,还可以为HDR录像模式。当然,历史相机模式L1可以为其他相机模式,本申请对此不作限制。
S803:相机应用向传感器节点模块发送历史相机模式L1。
相机应用确定历史相机模式L1之后,可以将历史相机模式L1发送给传感器节点模块。
相应的,传感器节点模块可以接收相机应用发送的历史相机模式L1。
S804:传感器节点模块确定历史相机模式L1对应的FMC配置参数。历史相机模式L1对应的FMC配置参数包括历史相机模式L1对应的所有出图模式的配置参数和历史相机模式L1的默认出图模式的相关信息。
传感器节点模块接收相机应用发送的历史相机模式L1之后,还可以确定历史相机模式L1对应的FMC配置参数。历史相机模式L1对应的FMC配置参数包括历史相机模式L1对应的所有出图模式的配置参数和历史相机模式L1的默认出图模式的相关信息。可理解,默认出图模式的相关描述可以参考上文,在此不再赘述。
示例性的,历史相机模式L1可以为普通拍照模式。普通拍照模式对应的FMC配置参数即为普通拍照FMC配置参数。普通拍照FMC配置参数可以包括Binning出图模式的配置参数、Remosaic出图模式的配置参数,以及普通拍照模式下的默认出图模式的相关信息。
示例性的,历史相机模式L1可以为HDR录像模式。HDR录像模式对应的FMC配置参数即为HDR录像FMC配置参数。HDR录像FMC配置参数可以包括Binning出图模式的配置参数、IDCG出图模式的配置参数,以及HDR录像模式下的默认出图模式的相关信息。
可理解,步骤S803的相关描述可以参考步骤S508、步骤S704,在此不再赘述。
S805:传感器节点模块向摄像头发送历史相机模式L1对应的FMC配置参数。
传感器节点模块确定历史相机模式L1对应的FMC配置参数之后,可以将历史相机模式L1对应的FMC配置参数发送给相机驱动,再由相机驱动发送给摄像头。
在本申请的一些实施例中,相机驱动可以直接将历史相机模式L1对应的FMC配置参数写入摄像头包括的图像传感器中的寄存器。
相应的,摄像头可以接收传感器节点模块发送的历史相机模式L1对应的FMC配置参数。
S806:摄像头将历史相机模式L1对应的FMC配置参数存储到图像传感器包括的寄存器中。
S807:摄像头基于历史相机模式L1对应的FMC配置参数确定历史相机模式L1下的默认出图模式,并应用该默认出图模式的配置参数。
S808:摄像头基于历史相机模式L1下的默认出图模式采集原始图像数据。
可理解,步骤S806-步骤S808的相关描述可以参考步骤S510-步骤S512和步骤S706-步骤S708。
在本申请的一些实施例中,电子设备执行如图5和图6A所示的步骤之后,还可以执行如图8所示的步骤。
在本申请的一些实施例中,电子设备执行如图5-图7所示的步骤之后,还可以执行如图8所示的步骤。
在本申请的一些实施例中,电子设备执行步骤S801-步骤S803之后,可以确定历史相机模式L1对应的所有出图模式的配置参数,并首先加载历史相机模式L1下的默认出图模式的配置参数。待加载完成后,电子设备可以直接应用该历史相机模式L1下的默认出图模式的配置参数,即基于历史相机模式L1下的默认出图模式来采集图像。待历史相机模式L1下的默认出图模式的配置参数加载完成后,电子设备可以继续再加载历史相机模式L1对应的其他出图模式(默认出图模式除外)的配置参数。
具体地,传感器节点模块接收相机应用发送的历史相机模式L1之后,可以确定历史相机模式L1对应的所有出图模式的配置参数。传感器节点模块可以首先将历史相机模式L1下的默认出图模式的配置参数发送给摄像头。摄像头接收传感器节点模块发送的历史相机模式L1下的默认出图模式的配置参数之后,可以将其存储在图像传感器包括的寄存器中。并且,摄像头可以直接应用该历史相机模式L1下的默认出图模式的配置参数,从而基于历史相机模式L1下的默认出图模式采集图像。而传感器节点模块将历史相机模式L1下的默认出图模式的配置参数发送给摄像头之后,可以再陆续将历史相机模式L1下的其他出图模式的配置参数发送给摄像头。而摄像头接收这些出图模式的配置参数之后,可以将其存储在图像传感器的寄存器中。
可理解,相机应用可以退出前台运行,转为后台运行。在这种情况下,用户可以再触发相机应用由后台运行转为前台运行。请参阅图9,相机应用从后台运行转为前台运行之后,可以加载历史相机模式对应的所有出图模式的配置参数。历史相机模式对应的所有出图模式可以包括历史出图模式。电子设备还可以应用该历史出图模式的配置参数,从而基于该历史出图模式采集图像。
S901:相机应用接收到从后台运行转为前台运行的请求。
可理解,步骤S901的相关描述可以参考步骤S801,在此不再赘述。
示例性的,如图2E所示,用户可以点击任务卡片501。相应的,电子设备可以接收到将相机应用从后台运行转为前台运行的请求。响应于该将相机应用从后台运行转为前台运行的请求,电子设备可以基于历史相机模式下的默认出图模式采集图像(具体参见步骤S902-步骤S908),并显示图2F所示的用户界面600。可理解,用户也可以通过语音、手势等方式将相机应用从后台运行转为前台运行,本申请对用户触发电子设备将相机应用从后台运行转为前台运行的具体方式不作限制。
可理解,电子设备执行步骤S901之后,还可以执行步骤S501-步骤S505。
S902:相机应用确定历史相机模式L1和历史出图模式M1。历史相机模式L1是相机应用转为前台运行之前最近一次采用的相机模式,历史出图模式M1是相机应用转为前台运行之前最近一次采用的相机模式所对应的出图模式。历史相机模式L1对应的出图模式包括历史出图模式M1。
相机应用接收从后台运行转为前台运行的请求之后,可以确定历史相机模式L1和历史出图模式M1。历史相机模式L1是相机应用转为前台运行之前最近一次采用的相机模式,历史出图模式M1是相机应用转为前台运行之前最近一次采用的相机模式所对应的出图模式。可理解,历史相机模式L1对应的出图模式可以包括历史出图模式M1。
可理解,历史出图模式M1可以为前文所提及的mode1。
S903:相机应用向传感器节点模块发送历史相机模式L1和历史出图模式M1。
相机应用确定历史相机模式L1和历史出图模式M1之后,可以将历史相机模式L1和历史出图模式M1发送给传感器节点模块。
可理解,相机应用可以向传感器节点模块发送历史出图模式M1的相关信息。该历史出图模式M1的相关信息可以包括历史出图模式的标识。出图模式的标识的相关描述可以参考上文,在此不再赘述。
示例性的,在相机应用启动并进入普通拍照模式后,电子设备可以基于Binning出图模式采集图像(如图5所示)。然后,相机应用可以由前台运行转为后台运行。可理解,相机应用可以再由后台运行转为前台运行。在这种情况下,历史相机模式L1为普通拍照模式,历史出图模式M1可以为Binning出图模式。
示例性的,在相机应用启动并进入普通拍照模式后,电子设备可以基于Binning出图模式采集图像,还可以将出图模式由Binning出图模式切换至Remosaic出图模式(如图6A所示)。然后相机应用可以由前台运行转为后台运行。可理解,相机应用可以再由后台运行转为前台运行。在这种情况下,历史相机模式L1为普通拍照模式,历史出图模式M1可以为Remosaic出图模式。
示例性的,在相机应用启动并进入普通拍照模式后,电子设备可以基于Binning出图模式采集图像,还可以将相机模式切换至HDR录像模式,并基于IDCG出图模式采集图像。然后,相机应用可以由前台运行转为后台运行。可理解,相机应用可以再由后台运行转为前台运行。在这种情况下,历史相机模式L1为HDR录像模式,历史出图模式M1可以为IDCG出图模式。
示例性的,在相机应用启动并进入普通拍照模式后,电子设备可以基于Binning出图 模式采集图像,还可以将相机模式切换至HDR录像模式,并基于IDCG出图模式采集图像,再将出图模式由IDCG出图模式切换至Binning出图模式(如图6A所示)。然后,相机应用可以由前台运行转为后台运行。可理解,相机应用可以再由后台运行转为前台运行。在这种情况下,历史相机模式L1为HDR录像模式,历史出图模式M1可以为Binning出图模式。
相应的,传感器节点模块可以接收相机应用发送的历史相机模式L1和历史出图模式M1。
S904:传感器节点模块确定历史相机模式L1对应的FMC配置参数。历史相机模式L1对应的FMC配置参数包括历史相机模式L1对应的所有出图模式的配置参数。
可理解,步骤S904的相关描述可以参考步骤S803、步骤S508和步骤S704,在此不再赘述。
S905:传感器节点模块向摄像头发送历史相机模式L1对应的FMC配置参数和历史出图模式M1的相关信息。
传感器节点模块确定历史相机模式L1对应的FMC配置参数之后,可以将历史相机模式L1对应的FMC配置参数发送给摄像头。传感器节点模块接收相机应用发送的历史出图模式M1之后,还可以将历史出图模式M1的相关信息发送给摄像头。
相应的,摄像头可以接收传感器节点模块发送的历史相机模式L1对应的FMC配置参数和历史出图模式M1的相关信息。
S906:摄像头将历史相机模式L1对应的FMC配置参数存储到图像传感器包括的寄存器中。
可理解,步骤S906的相关描述可以参考步骤S806,在此不再赘述。
S907:摄像头基于历史出图模式M1的相关信息应用历史相机模式L1对应的FMC配置参数所包括的历史出图模式M1的配置参数。
摄像头可以基于历史出图模式M1的相关信息,在历史相机模式L1对应的FMC配置参数中确定历史出图模式M1的配置参数。摄像头中的图像传感器可以应用该历史出图模式M1的配置参数。
S908:摄像头基于历史出图模式M1采集原始图像数据。
图像传感器应用历史出图模式M1的配置参数之后,可以基于该历史出图模式M1的配置参数出帧。即摄像头可以基于历史出图模式M1采集原始图像数据。相应的,电子设备中的其他软硬件模块可以对该原始图像数据进行处理,并最终将其显示在显示屏上。
在本申请的一些实施例中,电子设备执行步骤S901-步骤S903之后,可以确定历史相机模式L1对应的所有出图模式的配置参数,并首先加载历史相机模式L1下的历史出图模式M1的配置参数。待加载完成后,电子设备可以直接应用该历史出图模式M1的配置参数,即基于历史相机模式L1下的历史出图模式M1来采集图像。待历史相机模式L1下的历史出图模式M1的配置参数加载完成后,电子设备可以继续再加载历史相机模式L1对应的其他出图模式(历史出图模式M1除外)的配置参数。
具体地,传感器节点模块接收相机应用发送的历史相机模式L1和历史出图模式M1之 后,可以确定历史相机模式L1对应的所有出图模式的配置参数。传感器节点模块可以首先将历史相机模式L1下的历史出图模式M1的配置参数发送给摄像头。摄像头接收传感器节点模块发送的历史相机模式L1下的历史出图模式M1的配置参数之后,可以将其存储在图像传感器包括的寄存器中。并且,摄像头可以直接应用该历史出图模式M1的配置参数,从而基于历史相机模式L1下的历史出图模式M1采集图像。而传感器节点模块将历史相机模式L1下的历史出图模式M1的配置参数发送给摄像头之后,可以再陆续将历史相机模式L1下的其他出图模式的配置参数发送给摄像头。而摄像头接收这些出图模式的配置参数之后,可以将其存储在图像传感器的寄存器中。
可理解,在执行如图8或如图9所示的步骤之后,电子设备可以执行如图6A所示的步骤,还可以执行如图7所示的步骤。
以上实施例中仅以普通拍照模式和HDR录像模式举例说明,可以理解的是,以上实施例还可以适用夜景模式、人像拍照模式等其他相机模式。
下面介绍本申请实施例提供的一种电子设备的硬件结构。
请参阅图10,图10为本申请实施例提供的一种电子设备的硬件结构示意图。
电子设备可以包括处理器110,外部存储器接口120,内部存储器121,音频模块130,扬声器130A,受话器130B,麦克风130C,耳机接口130D,显示屏140,摄像头150,触摸传感器160。
本发明实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。本发明实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备的结构限定。
处理器110可以包括一个或多个处理单元。例如,处理器110可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processing Unit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。处理器110中还可以设置有存储器,用于存储指令和数据。
在一些实施例中,处理器110可以包括一个或多个接口。例如,集成电路(Inter-integrated Circuit,I2C)接口,移动产业处理器接口(Mobile Industry Processor Interface,MIPI),集成电路内置音频(Inter-integrated Circuit Sound,I2S)接口,脉冲编码调制(Pulse Code Modulation,PCM)接口,通用异步收发传输器(Universal Asynchronous Receiver/Transmitter,UART)接口,通用输入输出(General-Purpose Input/Output,GPIO)接口,用户标识模块(Subscriber Identity Module,SIM)接口,和/或通用串行总线(Universal Serial Bus,USB)接口等。
I2C是一种双向同步串行总线,包括一根串行数据线(Serial Data Line,SDA)和一根串行时钟线(Derail Clock Line,SCL)。在一些实施例中,处理器110可以包含多组I2C总线。处理器110可以通过不同的I2C总线接口分别耦合触摸传感器160,充电器,闪光灯,摄像头150等。例如,处理器110可以通过I2C接口耦合触摸传感器160,使处理器110 与触摸传感器160通过I2C总线接口通信,实现电子设备100的触摸功能。
需要说明的是,相机驱动可以通过I2C接口来将配置参数更新到图像传感器包括的寄存器中。可理解,在本申请中,将出图模式的配置参数更新到图像传感器包括的寄存器中的具体方式可以为direct write,还可以为burst,还可以为sequeue。
MIPI接口可以被用于连接处理器110与显示屏140,摄像头150等外围器件。MIPI接口包括摄像头串行接口(Camera Serial Interface,CSI),显示屏串行接口(Display Serial Interface,DSI)等。在一些实施例中,处理器110和摄像头150通过CSI接口通信,实现电子设备100的拍摄功能。处理器110和显示屏140通过DSI接口通信,实现电子设备100的显示功能。
电子设备可以通过GPU,显示屏140,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏140和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。显示屏140的相关描述可以参考上文,在此不展开说明。在一些实施例中,电子设备可以包括1个或多个显示屏140。
在本申请实施例中,电子设备显示摄像头采集的图像,以及图2A-图2F所示的用户界面的能力,依赖于上述GPU,显示屏140,以及应用处理器提供的显示功能。
电子设备可以通过ISP,摄像头150,视频编解码器,GPU,显示屏140以及应用处理器等实现拍摄功能。
摄像头150用于捕获静态图像或视频。摄像头150的相关描述可以参考上文,在此不展开说明。
在本申请实施例中,电子设备实现基于相机应用的拍照,首先依赖于摄像头150采集并经过ISP处理的图像,其次还依赖于视频编解码器,以及GPU提供的图像计算与处理能力。
内部存储器121可以包括一个或多个随机存取存储器(Random Access Memory,RAM)和一个或多个非易失性存储器(Non-Volatile Memory,NVM)。随机存取存储器可以由处理器110直接进行读写,可以用于存储操作系统或其他正在运行中的程序的可执行程序(例如机器指令),还可以用于存储用户及应用程序的数据等。非易失性存储器也可以存储可执行程序和存储用户及应用程序的数据等,可以提前加载到随机存取存储器中,用于处理器110直接进行读写。
在本申请实施例中,实现本申请实施例所述的出图模式切换方法的代码可存储在非易失性存储器上。在运行相机应用时,电子设备可将非易失性存储器中存储的可执行代码加载到随机存取存储器。
外部存储器接口120可以用于连接外部的非易失性存储器,实现扩展电子设备的存储能力。
电子设备可以通过音频模块130,扬声器130A,受话器130B,麦克风130C,耳机接口130D,以及应用处理器等实现音频功能。
音频模块130用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入 转换为数字音频信号。扬声器130A,也称“喇叭”,用于将音频电信号转换为声音信号。受话器130B,也称“听筒”,用于将音频电信号转换成声音信号。麦克风130C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。耳机接口130D用于连接有线耳机。
在本申请实施例中,电子设备在启用摄像头采集图像的过程中,可以同时启用麦克风130C采集声音信号,并将声音信号转换为电信号存储下来。这样,用户可以得到有声视频。
触摸传感器160,也称“触控器件”。触摸传感器160可以设置于显示屏140,由触摸传感器160与显示屏140组成触摸屏,也称“触控屏”。触摸传感器160用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏140提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器160也可以设置于电子设备的表面,与显示屏140所处的位置不同。
在本申请实施例中,电子设备可利用触摸传感器160检测用户作用于显示屏140上的点击、滑动等操作,以实现图2A-图2F所示的出图模式切换方法。
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。

Claims (16)

  1. 一种出图模式切换方法,其特征在于,应用于电子设备,所述方法包括:
    当所述电子设备进入相机应用的第一相机模式时,加载第一出图模式的第一配置参数和第二出图模式的第二配置参数;
    显示所述相机应用的第一用户界面,所述第一用户界面包括第一预览窗,所述第一预览窗中包括所述电子设备基于所述第一出图模式采集的第一预览图像;
    当满足将所述第一出图模式切换至所述第二出图模式的切换条件的情况下,加载切换出图模式的第三配置参数,所述第三配置参数用于指示将所述第一出图模式切换为所述第二出图模式,所述第三配置参数中的寄存器序列的数量小于所述第二配置参数中的寄存器序列的数量;
    显示所述相机应用的第二用户界面,所述第二用户界面包括第二预览窗,所述第二预览窗中包括所述电子设备基于所述第二出图模式采集的第二预览图像。
  2. 如权利要求1所述的方法,其特征在于,所述当满足将所述第一出图模式切换至所述第二出图模式的切换条件的情况下,加载切换出图模式的第三配置参数之前,所述方法还包括:
    基于所述第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果;
    基于相机模式、HDR场景判断结果和出图模式的对应关系,查找与所述第一相机模式和所述第一HDR场景判断结果对应的出图模式,所述查找到的出图模式为目标出图模式;
    所述满足将所述第一出图模式切换至所述第二出图模式的切换条件,具体包括:所述目标出图模式为所述第二出图模式。
  3. 如权利要求1所述的方法,其特征在于,所述当满足将所述第一出图模式切换至所述第二出图模式的切换条件的情况下,加载切换出图模式的第三配置参数之前,所述方法还包括:
    确定当前的变焦倍数;
    基于所述第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果;
    基于相机模式、变焦倍数、HDR场景判断结果和出图模式的对应关系,查找与所述第一相机模式、所述当前的变焦倍数和所述第一HDR场景判断结果对应的出图模式,所述查找到的出图模式为目标出图模式;
    所述满足将所述第一出图模式切换至所述第二出图模式的切换条件,具体包括:所述目标出图模式为所述第二出图模式。
  4. 如权利要求2或3所述的方法,其特征在于,所述基于所述第一预览图像的亮度信息确定当前场景是否为HDR场景,得到第一HDR场景判断结果,具体包括:
    基于所述第一预览图像的亮度信息确定第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度;
    确定所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度是否满足进入HDR场景条件,以及是否满足退出HDR场景条件;
    在所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度满足所述进入HDR场景条件的情况下,确定所述当前场景为所述HDR场景;所述第一HDR场景判断结果用于表示所述当前场景为所述HDR场景;
    在所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度满足所述退出HDR场景条件的情况下,确定所述当前场景不为所述HDR场景;所述第一HDR场景判断结果用于表示所述当前场景不为所述HDR场景;
    在所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度不满足所述进入HDR场景条件和所述退出HDR场景条件的情况下,所述第一HDR场景判断结果与上一次得到的HDR场景判断结果一致;
    其中,所述进入HDR场景条件包括:所述第一自适应动态范围压缩增益大于增益阈值Z1或者所述第一暗区亮度信息小于暗区亮度阈值A1,且所述第一环境亮度大于环境亮度阈值H1;所述退出HDR场景条件包括:所述第一自适应动态范围压缩增益小于增益阈值Z2或者所述第一暗区亮度信息大于暗区亮度阈值A2,且所述第一环境亮度小于环境亮度阈值H2;所述Z1大于所述Z2,所述A1小于所述A2,所述H1大于所述H2。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述第二用户界面包括第一控件;所述显示所述相机应用的第二用户界面之后,所述方法还包括:
    响应于作用在所述第一控件上的操作,加载第二相机模式对应的多种出图模式的配置参数;所述多种出图模式包括第三出图模式;
    显示所述相机应用的第三用户界面,所述第三用户界面包括第三预览窗,所述第三预览窗中包括所述电子设备使用基于所述第三出图模式采集的第三预览图像。
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述当所述电子设备进入相机应用的第一相机模式时,加载第一出图模式的第一配置参数和第二出图模式的第二配置参数,具体包括:
    响应于将所述相机应用从后台运行状态转为前台运行状态的操作,加载所述第一相机模式对应的多种出图模式的配置参数;所述第一相机模式为所述相机应用转为所述前台运行状态之前最后一次采用的相机模式;所述多种出图模式包括所述第一出图模式和所述第二出图模式。
  7. 如权利要求6所述的方法,其特征在于,所述第一出图模式为所述第一相机模式的默认出图模式。
  8. 如权利要求6所述的方法,其特征在于,所述第一出图模式为所述相机应用转为所述前台运行状态之前最后一次采用的出图模式。
  9. 如权利要求1-8任一项所述的方法,其特征在于,所述方法还包括:当所述电子设备进入所述相机应用的所述第一相机模式时,加载除所述第一出图模式和所述第二出图模 式以外的至少一种出图模式的配置参数。
  10. 如权利要求1-9任一项所述的方法,其特征在于,所述显示所述相机应用的第一用户界面,具体包括:
    加载所述第一配置参数之后,且加载所述第二配置参数之前,显示所述相机应用的所述第一用户界面。
  11. 如权利要求1-9任一项所述的方法,其特征在于,所述显示所述相机应用的第一用户界面,具体包括:
    加载所述第二配置参数之后,显示所述相机应用的所述第一用户界面。
  12. 如权利要求1-11任一项所述的方法,其特征在于,所述第三配置参数中的寄存器序列的数量小于所述第一配置参数中的寄存器序列的数量。
  13. 如权利要求2-4任一项所述的方法,其特征在于,所述基于所述第一预览图像的亮度信息判断当前场景是否为HDR场景,得到第一HDR场景判断结果,具体包括:
    所述电子设备中的自动曝光控制模块基于所述第一预览图像的亮度信息确定第一自适应动态范围压缩增益、第一暗区亮度信息和第一环境亮度;
    所述自动曝光控制模块将所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度发送给所述电子设备中的感知引擎;
    所述感知引擎基于所述第一自适应动态范围压缩增益、所述第一暗区亮度信息和所述第一环境亮度判断所述当前场景是否为所述HDR场景,并得到所述第一HDR场景判断结果。
  14. 如权利要求12所述的方法,其特征在于,所述当满足将所述第一出图模式切换至所述第二出图模式的切换条件的情况下,加载切换出图模式的第三配置参数,具体包括:
    在所述目标出图模式为所述第二出图模式的情况下,所述电子设备中的传感器节点模块确定所述第三配置参数,并将所述第三配置参数发送给所述电子设备中的摄像头;
    所述摄像头基于所述第三配置参数,将所述当前应用的出图模式的配置参数由所述第一配置参数切换至所述第二配置参数。
  15. 一种电子设备,包括一个或多个存储器、一个或多个处理器,其特征在于,所述一个或多个存储器与所述一个或多个处理器耦合;所述存储器用于存储计算机程序;所述处理器用于调用所述计算机程序,使得所述电子设备执行权利要求1-14中任一项所述的方法。
  16. 一种计算机存储介质,其特征在于,包括:计算机指令;当所述计算机指令在电子设备上运行时,使得所述电子设备执行权利要求1-14中任一项所述的方法。
PCT/CN2023/117483 2022-11-01 2023-09-07 一种出图模式切换方法及相关设备 WO2024093518A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211356362.5A CN118042275A (zh) 2022-11-01 2022-11-01 一种出图模式切换方法及相关设备
CN202211356362.5 2022-11-01

Publications (1)

Publication Number Publication Date
WO2024093518A1 true WO2024093518A1 (zh) 2024-05-10

Family

ID=90929656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/117483 WO2024093518A1 (zh) 2022-11-01 2023-09-07 一种出图模式切换方法及相关设备

Country Status (2)

Country Link
CN (1) CN118042275A (zh)
WO (1) WO2024093518A1 (zh)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210067749A1 (en) * 2019-08-26 2021-03-04 Samsung Electronics Co., Ltd. System and method for content enhancement using quad color filter array sensors
CN113347334A (zh) * 2021-05-31 2021-09-03 惠州Tcl移动通信有限公司 一种移动终端无损拍照方法、装置、终端设备及存储介质
CN113727016A (zh) * 2021-06-15 2021-11-30 荣耀终端有限公司 一种拍摄方法及电子设备
CN114007011A (zh) * 2021-10-26 2022-02-01 希姆通信息技术(上海)有限公司 基于相机的输出模式切换方法及其系统
WO2022073364A1 (zh) * 2020-10-09 2022-04-14 Oppo广东移动通信有限公司 图像获取方法及装置、终端和计算机可读存储介质
CN115550541A (zh) * 2022-04-22 2022-12-30 荣耀终端有限公司 一种相机参数配置方法及电子设备
CN116567407A (zh) * 2023-05-04 2023-08-08 荣耀终端有限公司 一种相机参数配置方法及电子设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210067749A1 (en) * 2019-08-26 2021-03-04 Samsung Electronics Co., Ltd. System and method for content enhancement using quad color filter array sensors
WO2022073364A1 (zh) * 2020-10-09 2022-04-14 Oppo广东移动通信有限公司 图像获取方法及装置、终端和计算机可读存储介质
CN113347334A (zh) * 2021-05-31 2021-09-03 惠州Tcl移动通信有限公司 一种移动终端无损拍照方法、装置、终端设备及存储介质
CN113727016A (zh) * 2021-06-15 2021-11-30 荣耀终端有限公司 一种拍摄方法及电子设备
CN114007011A (zh) * 2021-10-26 2022-02-01 希姆通信息技术(上海)有限公司 基于相机的输出模式切换方法及其系统
CN115550541A (zh) * 2022-04-22 2022-12-30 荣耀终端有限公司 一种相机参数配置方法及电子设备
CN116567407A (zh) * 2023-05-04 2023-08-08 荣耀终端有限公司 一种相机参数配置方法及电子设备

Also Published As

Publication number Publication date
CN118042275A (zh) 2024-05-14

Similar Documents

Publication Publication Date Title
WO2017215501A1 (zh) 图像降噪处理方法、装置及计算机存储介质
CN114205522B (zh) 一种长焦拍摄的方法及电子设备
US9232125B2 (en) Method of eliminating a shutter-lag, camera module, and mobile device having the same
CN110505411B (zh) 图像拍摄方法、装置、存储介质及电子设备
CN111491102B (zh) 拍照场景的检测方法、系统、移动终端及存储介质
CN113382169A (zh) 一种拍照方法及电子设备
KR20110003571A (ko) 개선된 이미지 캡처를 제공하는 방법과 장치 및 프로그램 저장 장치
CN116567407B (zh) 一种相机参数配置方法及电子设备
WO2023160285A1 (zh) 视频处理方法和装置
CN115689963B (zh) 一种图像处理方法及电子设备
CN115550541A (zh) 一种相机参数配置方法及电子设备
CN113630558B (zh) 一种摄像曝光方法及电子设备
CN116744120B (zh) 图像处理方法和电子设备
TW202318331A (zh) 用於減少延遲的相機初始化
CN114390212B (zh) 拍照预览方法、电子设备以及存储介质
WO2024093545A1 (zh) 拍照方法及电子设备
WO2023160230A9 (zh) 一种拍摄方法及相关设备
CN116389885B (zh) 拍摄方法、电子设备及存储介质
WO2023160221A1 (zh) 一种图像处理方法和电子设备
WO2024093518A1 (zh) 一种出图模式切换方法及相关设备
CN116028383B (zh) 缓存管理方法及电子设备
WO2024179108A1 (zh) 一种拍照方法及电子设备
WO2023035868A1 (zh) 拍摄方法及电子设备
WO2023160220A1 (zh) 一种图像处理方法和电子设备
WO2024109213A1 (zh) 拍摄模式切换方法及相关装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23884454

Country of ref document: EP

Kind code of ref document: A1