WO2024255314A1 - 模式控制方法、电子设备、存储介质及程序产品 - Google Patents

模式控制方法、电子设备、存储介质及程序产品 Download PDF

Info

Publication number
WO2024255314A1
WO2024255314A1 PCT/CN2024/078621 CN2024078621W WO2024255314A1 WO 2024255314 A1 WO2024255314 A1 WO 2024255314A1 CN 2024078621 W CN2024078621 W CN 2024078621W WO 2024255314 A1 WO2024255314 A1 WO 2024255314A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
electronic device
mode
pixel
image output
Prior art date
Legal status (The legal status 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 status listed.)
Ceased
Application number
PCT/CN2024/078621
Other languages
English (en)
French (fr)
Inventor
仝思宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Publication of WO2024255314A1 publication Critical patent/WO2024255314A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • 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
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Definitions

  • the present application relates to the field of electronic technology, and in particular to a mode control method, electronic equipment, storage medium and program product.
  • the embodiments of the present application provide a mode control method, an electronic device, a storage medium and a program product, which enable a camera to output a captured image in different image output modes under different ambient brightness, thereby improving the clarity of the image output by the camera and thereby improving the image quality.
  • the embodiment of the present application proposes a mode control method, which is applied to an electronic device, wherein the electronic device includes a camera application and a camera, and the method includes: when the camera application is started, the electronic device obtains the sensitivity of the camera; when the sensitivity is greater than a first sensitivity threshold and the image output mode of the camera is a full pixel mode, the electronic device displays a first preview interface, the first preview interface includes a first image, and the first image is an image output by the camera in a pixel merging mode; when the sensitivity is less than a second sensitivity threshold and the image output mode of the camera is a pixel merging mode, the electronic device displays a second preview interface, the second preview interface includes a second image, and the second image is an image output by the camera in a full pixel mode.
  • the pixel merging mode is used to merge multiple adjacent pixels of the same color into one pixel, and the full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold is not equal to the second sensitivity threshold.
  • the sensitivity when the sensitivity is greater than the first sensitivity threshold, it means that the camera is in a low-brightness environment at this time, and the camera uses the pixel merging mode to output the image it has collected.
  • the photosensitive area of a single pixel By merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, the noise of the image can be reduced, the clarity and brightness of the image can be improved, and the image quality can be improved.
  • the sensitivity when the sensitivity is less than the second sensitivity threshold, it means that the camera is in a high-brightness environment at this time, and the camera uses the full-pixel mode to output the image it has collected.
  • the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, so that the clarity of the image is high, and the image quality is improved.
  • the first sensitivity threshold is greater than the second sensitivity threshold. In this way, while improving image quality, the ping-pong switching between the full pixel mode and the pixel merging mode of the camera can be reduced, thereby reducing the problem of image flickering on the image displayed by the electronic device caused by the switching of the image output mode of the camera.
  • the electronic device after the electronic device obtains the sensitivity of the camera, it also includes: when the sensitivity is less than or equal to the first sensitivity threshold and the image output mode of the camera is the full pixel mode, the electronic device displays a third preview interface, the third preview interface includes a third image, and the third image is the image output by the camera in the full pixel mode; when the sensitivity is greater than or equal to the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, the electronic device displays a fourth preview interface, the fourth preview interface includes a fourth image, and the fourth image is the image output by the camera in the pixel merging mode.
  • the image output mode of the camera when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the image output mode of the camera is controlled to continue to remain in the full pixel mode to improve the clarity of the image; when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the image output mode of the camera is controlled to continue to remain in the pixel merging mode to improve the clarity of the image and the brightness of the picture.
  • the electronic device displays a first preview interface, including: when the image output mode of the camera is the full pixel mode, the electronic device determines whether the sensitivity is greater than the first sensitivity threshold; when the sensitivity is greater than the first sensitivity threshold, the electronic device switches the image output mode of the camera from the full pixel mode to the pixel merging mode; the electronic device obtains the first image output by the camera in the pixel merging mode, and displays the first image in the first preview interface.
  • the electronic device displays a second preview interface, including: when the image output mode of the camera is the pixel merging mode, the electronic device determines whether the sensitivity is less than the second sensitivity threshold; when the sensitivity is less than the second sensitivity threshold, the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode; the electronic device obtains the second image output by the camera in the full pixel mode, and displays the second image in the second preview interface.
  • the image output mode of the camera is switched between the pixel merging mode and the full pixel mode to improve the clarity of the image output by the camera under different ambient brightness.
  • the electronic device displays a third preview interface, including: when the image output mode of the camera is the full pixel mode, the electronic device determines whether the sensitivity is greater than the first sensitivity threshold; when the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the full pixel mode; the electronic device obtains a third image output by the camera in the full pixel mode, and displays the third image on the third preview interface.
  • the electronic device displays a fourth preview interface, including: when the image output mode of the camera is the pixel merging mode, the electronic device determines whether the sensitivity is less than the second sensitivity threshold; when the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode; the electronic device obtains a fourth image output by the camera in the pixel merging mode, and displays the fourth image on the fourth preview interface.
  • the method further includes: after a preset number of frames after each configuration of the camera's image output mode, the electronic device again determines whether to switch the camera's image output mode; or after a preset time after each configuration of the camera's image output mode, the electronic device again determines whether to switch the camera's image output mode.
  • the camera's image output mode includes a full pixel mode or a pixel merging mode. In this way, a preset number of frames or a preset time can be spaced between two adjacent configurations of the camera's image output mode to reduce the camera's image output mode.
  • the image output mode of the head is switched frequently between the pixel merging mode and the full pixel mode to reduce the problem of screen flickering in the image displayed by the electronic device during the switching process.
  • the electronic device before the electronic device determines again whether to switch the image output mode of the camera, it also includes: the electronic device obtains the motion state of the electronic device; the electronic device determines the preset frame number according to the motion state.
  • the motion state includes a static state, a first moving state and a second moving state, the motion parameter of the second moving state is greater than the motion parameter of the first moving state, the motion parameter of the first moving state is greater than the motion parameter of the static state, and the motion parameter includes at least one of acceleration data, angular velocity data and speed data;
  • the preset frame number corresponding to the static state is the first frame number
  • the preset frame number corresponding to the first moving state is the second frame number
  • the preset frame number corresponding to the second moving state is the third frame number, and at least two of the first frame number, the second frame number and the third frame number are different.
  • the electronic device obtains the motion state of the electronic device, including: after each configuration of the image output mode of the camera, the electronic device obtains the motion state of the electronic device once. Accordingly, after a preset number of frames after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, including: at the first moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets the preset conditions, and the time interval between the first moment and the moment of configuring the image output mode of the camera is equal to the preset number of frames corresponding to the motion state; if the sensitivity meets the preset conditions, the electronic device switches the image output mode of the camera; if the sensitivity does not meet the preset conditions, the electronic device keeps the image output mode of the camera unchanged. In this way, the number of times the motion state of the electronic device is obtained can be reduced to reduce the power consumption of the electronic device.
  • the electronic device obtains the motion state of the electronic device, including: the electronic device obtains the motion state of the electronic device in real time. Accordingly, after a preset number of frames after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, including: at a second moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets a preset condition, and the second moment is the moment when the number of frames in which the motion state remains unchanged reaches a preset number of frames corresponding to the motion state; when the sensitivity meets the preset condition, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged. In this way, the problem of screen flickering in the image displayed by the electronic device during the switching of the image output mode of the camera can be further alleviated, so that the image displayed by the electronic device is more stable.
  • the electronic device obtains the motion state of the electronic device, including: the electronic device obtains the motion state of the electronic device in real time. Accordingly, after the preset number of frames after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, including: after each configuration of the image output mode of the camera, when the target frame number reaches the preset frame number corresponding to the motion state, the electronic device determines whether the sensitivity obtained within the target frame number meets the preset condition, and the target frame number is the frame number in which the motion state remains unchanged; if the sensitivity obtained within the target frame number meets the preset condition, the electronic device switches the image output mode of the camera; if the sensitivity obtained within the target frame number does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged. In this way, the problem of screen flickering in the image displayed by the electronic device during the switching process of the image output mode of the camera is further alleviated, so that the image displayed by the electronic device is
  • the sensitivity when the image output mode of the camera is full pixel mode, When the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition.
  • the image output mode of the camera is the pixel merging mode, when the sensitivity is less than the second sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is greater than or equal to the second sensitivity threshold, the sensitivity does not meet the preset condition.
  • the first preview interface also includes a first shooting control
  • the second preview interface also includes a second shooting control.
  • the electronic device After the electronic device displays the first preview interface, it also includes: the electronic device saves the first image in response to the first operation on the first shooting control.
  • the electronic device After the electronic device displays the second preview interface, it also includes: the electronic device saves the second image in response to the second operation on the second shooting control.
  • the size of the second image is larger than the size of the first image.
  • the camera application includes multiple shooting modes, at least some of the multiple shooting modes correspond to different first sensitivity thresholds, and/or at least some of the multiple shooting modes correspond to different second sensitivity thresholds.
  • appropriate first sensitivity thresholds and second sensitivity thresholds are selected according to different shooting modes to reduce the problem of screen flickering in the image displayed by the electronic device during the switching of the image output mode of the camera.
  • the camera includes an image sensor, the image sensor includes a pixel array, the pixel array includes a plurality of pixel sets, each pixel set in the plurality of pixel sets includes a plurality of pixel units, each pixel unit in the plurality of pixel units includes a plurality of pixels; the colors of the plurality of pixels in each pixel unit are the same, and at least some of the plurality of pixel units are pixel units of different colors.
  • the arrangement of the pixel array in the full pixel mode is the same as the arrangement of the pixel array in the pixel merging mode.
  • the pixel merging mode includes a four-in-one pixel merging mode, and the four-in-one pixel merging mode is used to merge four adjacent pixels of the same color into one pixel.
  • the electronic device also includes a camera hardware abstraction module and a camera driver.
  • the method also includes: the camera hardware abstraction module configures the image output mode of the camera, the image output mode of the camera includes a full pixel mode or a pixel merging mode; the camera hardware abstraction module sends the image output mode of the camera to the camera driver; the camera driver drives the camera to output the captured image in the image output mode of the camera according to the image output mode of the camera.
  • the image output mode of the camera is configured by the camera hardware abstraction module, so that the camera outputs the captured image in the corresponding image output mode, and the control method of the image output mode of the camera is relatively simple and easy to implement.
  • an embodiment of the present application proposes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the above-mentioned mode control method.
  • an embodiment of the present application proposes a computer-readable storage medium, in which a computer program or instruction is stored. When the computer program or instruction is executed, the above-mentioned mode control method is implemented.
  • an embodiment of the present application proposes a computer program product, including a computer program, which enables a computer to execute the above-mentioned mode control method when the computer program is executed.
  • FIG1 is a schematic diagram of the structure of a camera provided in an embodiment of the present application.
  • FIG2 is a schematic diagram of pixel merging of a four-Bayer array of an image sensor provided by an embodiment of the present application
  • FIG3 is a schematic diagram of mosaic rearrangement of a quad-Bayer array of an image sensor provided by an embodiment of the present application.
  • FIG4 is a schematic diagram of the hardware system structure of an electronic device provided in an embodiment of the present application.
  • FIG5 is a schematic diagram of the software system structure of an electronic device provided in an embodiment of the present application.
  • FIG6 is a schematic diagram of an interface of an application scenario provided in an embodiment of the present application.
  • FIG7 is a flow chart of a mode control method provided in an embodiment of the present application.
  • FIG8 is a schematic diagram of module interaction of a mode control method provided in an embodiment of the present application.
  • FIG9 is a flowchart of switching the image output mode of a camera according to the motion state of an electronic device provided in an embodiment of the present application.
  • FIG10 is a schematic diagram of module interaction of another mode control method provided in an embodiment of the present application.
  • FIG11 is a schematic diagram of module interaction during image capture provided by an embodiment of the present application.
  • FIG12 is a schematic diagram of the structure of a mode control device provided in an embodiment of the present application.
  • FIG. 13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application.
  • the words “first” and “second” are used to distinguish the same items or similar items with basically the same functions and effects.
  • the first chip and the second chip are only used to distinguish different chips, and their order is not limited.
  • the words “first” and “second” do not limit the quantity and execution order, and the words “first” and “second” do not necessarily limit them to be different.
  • At least one refers to one or more, and “more than one” refers to two or more.
  • “And/or” describes the association relationship of associated objects, indicating that three relationships may exist.
  • a and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural.
  • the character “/” generally indicates that the previous and next associated objects are in an “or” relationship.
  • “At least one of the following” or similar expressions refers to any combination of these items, including any combination of single or plural items.
  • At least one of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple.
  • some electronic devices are provided with cameras.
  • the camera in the electronic device can be used to take photos or videos.
  • the camera may include a lens 10 and an image sensor 20 arranged along an optical path.
  • the lens 10 may include a plurality of optical lenses stacked along an optical axis.
  • the image sensor 20 may also be referred to as a camera sensor.
  • the image sensor 20 includes a filter 21 and a photosensitive element 22, wherein the filter 21 is located between the lens 10 and the photosensitive element 22.
  • the light reflected by the object passes through the lens 10 and the filter 21 in sequence and then is projected onto the photosensitive element 22, which converts the light signal into an electrical signal for imaging.
  • the pixel array in the traditional image sensor adopts the cross-distribution of red, green and blue pixels.
  • This pixel arrangement technology arranges M adjacent pixels of the same color together to form a pixel with an area M larger than the original pixel. times the area of the original pixel, M is an integer greater than 1. For example, M may be equal to 4, which is to arrange four adjacent pixels of the same color together to form a pixel that is four times larger than the original pixel area.
  • the camera provided therein may adopt a four-in-one pixel image sensor.
  • the image sensor 20 as a four-in-one pixel image sensor as an example, as shown in (a) in FIG. 2 and (a) in FIG. 3 , the pixel array of the image sensor 20 includes a plurality of pixel sets 23, and each pixel set 23 in the plurality of pixel sets 23 includes four pixel units, which are respectively a first pixel unit 231, a second pixel unit 232, a third pixel unit 233, and a fourth pixel unit 234.
  • the first pixel unit 231 includes four red (R) pixels
  • the second pixel unit 232 includes four green (G) pixels
  • the third pixel unit 233 includes four green (G) pixels
  • the fourth pixel unit 234 includes four blue (B) pixels.
  • the color of the pixel in the first pixel unit 231 is different from the color of the pixel in the second pixel unit 232, the color of the pixel in the third pixel unit 233, and the color of the pixel in the fourth pixel unit 234, that is, the first pixel unit 231 and the second pixel unit 232, the third pixel unit 233 and the fourth pixel unit 234 are pixel units of different colors.
  • the color of the pixel in the second pixel unit 232 is also different from the color of the pixel in the fourth pixel unit 234, that is, the second pixel unit 232 and the fourth pixel unit 234 are pixel units of different colors.
  • the color of the pixel in the third pixel unit 233 is also different from the color of the pixel in the fourth pixel unit 234, that is, the third pixel unit 233 and the fourth pixel unit 234 are pixel units of different colors.
  • the pixel array of the image sensor 20 can be called a quad Bayer array.
  • the pixel array of the image sensor in the embodiment of the present application in addition to the four-Bayer array shown in (a) in Figure 2 and (a) in Figure 3, can also adopt a nine-Bayer array or a sixteen-Bayer array, etc.
  • the embodiment of the present application does not limit the specific form of the pixel array of the image sensor.
  • the pixel array of the image sensor When the pixel array of the image sensor is a nine-Bayer array, the pixel array of the image sensor includes a plurality of pixel sets, each pixel set includes four pixel units, each pixel unit may include nine pixels of the same color, and at least some of the four pixel units are pixel units of different colors.
  • the pixel array of the image sensor is a sixteen-Bayer array
  • the pixel array of the image sensor includes a plurality of pixel sets, each pixel set includes four pixel units, each pixel unit may include sixteen pixels of the same color, and at least some of the four pixel units are pixel units of different colors.
  • the camera includes an image sensor, the image sensor includes a pixel array, the pixel array of the image sensor includes a plurality of pixel sets, each pixel set in the plurality of pixel sets includes a plurality of pixel units, each pixel unit in the plurality of pixel units includes a plurality of pixels, wherein the colors of the plurality of pixels in each pixel unit are the same, and at least some of the plurality of pixel units are pixel units of different colors.
  • the filter 21 may include a single filter array, the filter unit array may include multiple filter unit sets, each filter unit set in the multiple filter unit sets may include multiple filter units, and each filter unit allows the same color of light to pass through.
  • the photosensitive element 22 may include a photosensitive unit array, the photosensitive unit array may include multiple photosensitive unit sets, each photosensitive unit set in the multiple photosensitive unit sets may include multiple photosensitive units, and each photosensitive unit in the multiple photosensitive units includes multiple photosensitive pixels.
  • each filter unit in the filter 21 corresponds one-to-one to each photosensitive unit in the photosensitive element 22, and the multiple photosensitive pixels in each photosensitive unit are used to receive light filtered by its corresponding filter unit. In this way, the filter unit array and the photosensitive unit array covered by the filter unit array together constitute the pixel array of the image sensor 20. Therefore, Each pixel unit in the image sensor 20 may actually include a filter unit and a photosensitive unit covered by the filter unit.
  • each filter unit set in the filter 21 may include four filter units, which are respectively a first filter unit, a second filter unit, a third filter unit and a fourth filter unit.
  • the color of the light allowed to pass through by the first filter unit is red
  • the color of the light allowed to pass through by the second filter unit is green
  • the color of the light allowed to pass through by the third filter unit is green
  • the color of the light allowed to pass through by the fourth filter unit is blue
  • each photosensitive unit set in the photosensitive element 22 may include four photosensitive units, which are respectively a first photosensitive unit, a second photosensitive unit, a third photosensitive unit and a fourth photosensitive unit, and each of the four photosensitive units includes four photosensitive pixels.
  • the first filter unit corresponds to the first photosensitive unit, and the first filter unit and the first photosensitive unit it covers together constitute a first pixel unit 231;
  • the second filter unit corresponds to the second photosensitive unit, and the second filter unit and the second photosensitive unit it covers together constitute a second pixel unit 232;
  • the third filter unit corresponds to the third photosensitive unit, and the third filter unit and the third photosensitive unit it covers together constitute a third pixel unit 233;
  • the fourth filter unit corresponds to the fourth photosensitive unit, and the fourth filter unit and the fourth photosensitive unit it covers together constitute a fourth pixel unit 234.
  • the camera uses a pixel merging mode (ie, binning mode) to output the captured images.
  • a pixel merging mode ie, binning mode
  • multiple adjacent pixels of the same color can be merged into one pixel by pixel merging, that is, multiple pixels in each pixel unit are merged into one pixel, and the colors of the multiple pixels in each pixel unit are the same.
  • the camera in the electronic device using a four-in-one pixel image sensor when the camera is in the pixel merging mode, it merges four pixels of the same color in each pixel unit into one pixel. Specifically, the four red pixels in the first pixel unit 231 are merged into one red pixel, the four green pixels in the second pixel unit 232 are merged into one green pixel, the four green pixels in the third pixel unit 233 are merged into one green pixel, and the four blue pixels in the fourth pixel unit 234 are merged into one blue pixel.
  • the camera uses the pixel merging mode to output the image it has captured, by merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, image noise can be reduced, image clarity and brightness can be improved, and image quality can be improved.
  • the number of pixels included in the image output by the camera is 1/M times the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is reduced, resulting in a decrease in the resolution of the image, and the clarity of the image is reduced, thereby reducing the image quality.
  • the camera uses a full-pixel mode (i.e., full-size mode) to output the collected images.
  • the full-pixel mode can also be called a full-size mode.
  • the pixels in the image captured by the image sensor can be rearranged into a Bayer array using a mosaic rearrangement method (i.e., a remosaic method).
  • a mosaic rearrangement method i.e., a remosaic method.
  • the Bayer array may be an RGGB array. Since human vision is more sensitive to green, in the Bayer array, green pixels may account for 50% of all pixels and red pixels may account for 10% of all pixels. 25%, blue pixels account for 25% of all pixels, that is, each pixel unit in the Bayer array can include one red pixel, two green pixels and one blue pixel, and these one red pixel, two green pixels and one blue pixel are arranged in a 2 ⁇ 2 manner.
  • the four red pixels in the first pixel unit 231 are rearranged into red pixels, green pixels, green pixels and blue pixels
  • the four green pixels in the second pixel unit 232 are rearranged into red pixels, green pixels, green pixels and blue pixels
  • the four green pixels in the third pixel unit 233 are rearranged into red pixels, green pixels, green pixels and blue pixels
  • the four blue pixels in the fourth pixel unit 234 are rearranged into red pixels, green pixels, green pixels and blue pixels.
  • the pixels are rearranged into a Bayer array so that the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, making the image clearer and thus improving the image quality.
  • the photosensitive area of a single pixel is small, and the image has many noise points, which reduces the clarity of the image and thus reduces the image quality.
  • the embodiment of the present application provides a mode control method, by obtaining the sensitivity of the camera when starting the camera application; when the sensitivity is greater than the first sensitivity threshold and the image output mode of the camera is the full pixel mode, displaying the first preview interface, the first preview interface includes the first image, the first image is the image output by the camera in the pixel merging mode; when the sensitivity is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, displaying the second preview interface, the second preview interface includes the second image, the second image is the image output by the camera in the full pixel mode.
  • the first sensitivity threshold is not equal to the second sensitivity threshold.
  • the light sensitivity (light sensitivity ordinance, ISO) of a camera is used to measure the sensitivity of a camera to light.
  • the embodiments of the present application may use the light sensitivity of a camera to determine the ambient brightness of the environment in which the camera is located when performing image acquisition. Specifically, when the ambient brightness is lower, the light sensitivity of the camera is higher, the camera is more sensitive to light, and the more light it senses; when the ambient brightness is higher, the light sensitivity of the camera is lower, the camera is less sensitive to light, and the less light it senses.
  • the sensitivity when the sensitivity is greater than the first sensitivity threshold, it means that the camera is in a low-brightness environment at this time, and the camera uses the pixel merging mode to output the image it has collected.
  • the photosensitive area of a single pixel By merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, the noise of the image can be reduced, the clarity and brightness of the image can be improved, and the image quality can be improved.
  • the sensitivity when the sensitivity is less than the second sensitivity threshold, it means that the camera is in a high-brightness environment at this time, and the camera uses the full-pixel mode to output the image it has collected.
  • the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, so that the clarity of the image is high, and the image quality is improved.
  • the embodiment of the present application adjusts the image output mode of the camera according to the different ambient brightness.
  • the image output mode of the camera is adjusted to the full-pixel mode, and in a low-brightness environment, the camera is adjusted to the full-pixel mode.
  • the image output mode of the camera is the pixel merging mode, which improves the clarity of the image output by the camera under different ambient brightness, thereby improving the image quality.
  • the image output mode of the camera can also be called the image output specification of the camera.
  • the mode control method provided in the embodiment of the present application can be applied to an electronic device with a camera.
  • the electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc.
  • a terminal device which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc.
  • UE user equipment
  • MS mobile station
  • MT mobile terminal
  • the electronic device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control (industrial control), a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in a smart city (smart city), a wireless terminal in a smart home (smart home), etc.
  • the embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.
  • FIG4 shows a schematic diagram of the structure of an electronic device 400.
  • the electronic device 400 may include a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, an antenna 1, an antenna 2, a mobile communication module 450, a wireless communication module 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an earphone interface 470D, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495.
  • the sensor module 480 may include a motion sensor 480A.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 400.
  • the electronic device 400 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently.
  • the components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
  • the processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc.
  • AP application processor
  • GPU graphics processor
  • ISP image signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • Different processing units may be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
  • the processor 410 may also be provided with a memory for storing instructions and data.
  • the memory in the processor 410 is a cache memory.
  • the memory may store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
  • the charging management module 440 is used to receive charging input from a charger.
  • the charger may be a wireless charger or a wired charger.
  • the charging management module 440 may receive charging input from the wired charger through the USB interface 430.
  • the charging management module 440 may receive charging input from the wired charger through the USB interface 430.
  • the wireless charging input may be received through the wireless charging coil of the electronic device 400. While the charging management module 440 is charging the battery 442, the power management module 441 may also be used to power the electronic device.
  • the power management module 441 is used to connect the battery 442, the charging management module 440 and the processor 410.
  • the power management module 441 receives input from the battery 442 and/or the charging management module 440, and supplies power to the processor 410, the internal memory 421, the display screen 494, the camera 493, and the wireless communication module 460.
  • the power management module 441 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc.
  • the power management module 441 can also be set in the processor 410.
  • the power management module 441 and the charging management module 440 can also be set in the same device.
  • the wireless communication function of the electronic device 400 can be implemented through the antenna 1, the antenna 2, the mobile communication module 450, the wireless communication module 460, the modem processor and the baseband processor.
  • Mobile communication module 450 can provide solutions for wireless communications including 2G/3G/4G/5G applied to electronic device 400.
  • Mobile communication module 450 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • LNA low noise amplifier
  • at least some functional modules of mobile communication module 450 may be arranged in the same device as at least some modules of processor 410.
  • the wireless communication module 460 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) and the like applied to the electronic device 400.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication
  • IR infrared
  • the wireless communication module 460 can be one or more devices integrating at least one communication processing module.
  • the wireless communication module 460 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 410.
  • the wireless communication module 460 can also receive the signal to be sent from the processor 410, modulate the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
  • antenna 1 of electronic device 400 is coupled to mobile communication module 450, and antenna 2 is coupled to wireless communication module 460, so that electronic device 400 can communicate with the network and other devices through wireless communication technology.
  • the electronic device 400 implements the display function through a GPU, a display screen 494, and an application processor.
  • the GPU is a microprocessor for image processing, which connects the display screen 494 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations for graphics rendering.
  • the processor 410 may include one or more GPUs, which execute program instructions to generate or change display information.
  • the display screen 494 is used to display images, display videos, and receive sliding operations, etc.
  • the display screen 494 includes a display panel.
  • the display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diodes (QLED), etc.
  • the electronic device 400 may include 1 or N display screens 494, where N is a positive integer greater than 1.
  • the electronic device 400 can realize the shooting function through ISP, camera 493, video codec, GPU, display screen 494 and application processor.
  • ISP is used to process the data fed back by camera 493.
  • the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens.
  • the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye.
  • ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image.
  • ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • ISP can be set in camera 493.
  • the camera 493 is used to capture still images or videos.
  • the object generates an optical image through the lens and projects it onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal oxide semiconductor (CMOS) phototransistor.
  • CMOS complementary metal oxide semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal.
  • the ISP outputs the digital image signal to the DSP for processing.
  • the DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format.
  • the electronic device 400 may include 1 or N cameras 493, where N is a positive integer greater than 1.
  • the digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 400 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital videos.
  • the electronic device 400 may support one or more video codecs.
  • the electronic device 400 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG Moving Picture Experts Group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain.
  • NPU can realize applications such as intelligent cognition of electronic device 400, such as image recognition, face recognition, voice recognition, text understanding, etc.
  • the external memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 400.
  • the external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
  • the internal memory 421 can be used to store computer executable program codes, and the executable program codes include instructions.
  • the internal memory 421 may include a program storage area and a data storage area.
  • the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.
  • the data storage area may store data created during the use of the electronic device 400 (such as audio data, a phone book, etc.), etc.
  • the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (universal flash storage, UFS), etc.
  • the processor 410 executes various functional applications and data processing of the electronic device 400 by running instructions stored in the internal memory 421 and/or instructions stored in a memory provided in the processor.
  • the electronic device 400 can implement audio functions such as music playing and recording through the audio module 470, the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
  • the motion sensor 480A may include at least one of an acceleration sensor, a gyroscope sensor, and a speed sensor.
  • the acceleration sensor can detect the magnitude of the acceleration of the electronic device 400 in various directions (generally three axes), so as to monitor the motion state of the electronic device 400. When the electronic device 400 is stationary, the magnitude of gravity can be detected. Accelerometers can also be used to identify the posture of electronic devices and are used in applications such as horizontal and vertical screen switching and pedometers.
  • the gyroscope sensor can be used to determine the motion posture of the electronic device 400.
  • the angular velocity of the electronic device 400 around three axes i.e., x, y, and z axes
  • the gyroscope sensor can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor detects the angle of the shaking of the electronic device 400, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 400 through reverse movement to achieve anti-shake.
  • Gyroscope sensors can also be used for navigation and somatosensory game scenes.
  • the speed sensor can be used to detect the speed of the electronic device 400 in various directions (generally three axes), so as to monitor the motion state of the electronic device 400.
  • the key 490 includes a power key, a volume key, etc.
  • the key 490 may be a mechanical key or a touch key.
  • the electronic device 400 may receive key input and generate key signal input related to user settings and function control of the electronic device 400.
  • Motor 491 can generate vibration prompts.
  • Motor 491 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback.
  • touch operations acting on different applications can correspond to different vibration feedback effects.
  • touch operations acting on different areas of the display screen 494 motor 491 can also correspond to different vibration feedback effects.
  • Different application scenarios for example: time reminders, receiving messages, alarm clocks, games, etc.
  • the touch vibration feedback effect can also support customization.
  • Indicator 492 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
  • the SIM card interface 495 is used to connect a SIM card.
  • the SIM card can be connected to and separated from the electronic device 400 by inserting it into the SIM card interface 495 or pulling it out from the SIM card interface 495.
  • the electronic device 400 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • the SIM card interface 495 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 495 at the same time. The types of the multiple cards can be the same or different.
  • the SIM card interface 495 can also be compatible with different types of SIM cards.
  • the SIM card interface 495 can also be compatible with external memory cards.
  • the electronic device 400 interacts with the network through the SIM card to implement functions such as calls and data communications.
  • the electronic device 400 uses an eSIM, i.e., an embedded SIM card.
  • the eSIM card can be embedded in the electronic device 400 and cannot be separated from the electronic device 400.
  • the software system of the electronic device 400 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc.
  • the embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 400.
  • FIG5 is a software structure diagram of an electronic device 400 according to an embodiment of the present application.
  • the layered architecture divides the software into several layers, each with clear roles and division of labor.
  • the layers communicate with each other through software interfaces.
  • the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime and system library, the hardware abstraction layer, and the kernel layer.
  • the application layer may include a series of application packages. As shown in FIG5 , the application package may include applications such as camera, settings, and calendar.
  • the camera application is an application with the functions of photographing and recording, and the electronic device can respond to the user's operation of opening the camera application to take photos or record videos. It is understandable that the camera application's photo taking and video recording functions can also be called by other applications.
  • 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 may also include a camera service, which can be called by the camera application to realize functions such as taking photos or recording videos.
  • the application framework layer may include a camera access interface and a Java native interface (JNI).
  • the camera access interface may be used to provide an interface for accessing the camera, and the JNI interface provides several APIs to implement communication between Java and other languages.
  • the binder mechanism is used to implement inter-process communication.
  • the binder mechanism is an inter-process communication (IPC) mechanism.
  • IPC inter-process communication
  • the client process refers to the party that initiates the process request
  • the server process refers to the process that is requested to execute the camera service.
  • the application framework layer may also include a window manager, a content provider, a resource manager, a view system, and the like.
  • the window manager is used to manage window programs.
  • the window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
  • Content providers are used to store and retrieve data and make it accessible to applications.
  • This data can include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
  • the resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
  • the view system includes visual controls, such as controls for displaying text, controls for displaying images, etc.
  • the view system can be used to build applications.
  • a display interface can be composed of one or more views.
  • a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
  • Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the Java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • functional modules such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.
  • the surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG2, H.262, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc.
  • the 2D graphics engine is a drawing engine for 2D drawing.
  • the hardware abstraction layer is an abstract structure between the kernel layer and the Android runtime.
  • the image layer can be a package of the hardware driver of the kernel layer, providing a calling interface for the application framework layer.
  • the hardware abstraction layer may include a camera hardware abstraction layer (camera HAL).
  • the camera hardware abstraction module is used to configure the image output mode of the camera according to the sensitivity of the camera. In other embodiments, the camera hardware abstraction module is used to configure the image output mode of the camera according to the sensitivity of the camera and the motion state of the electronic device.
  • the kernel layer is a layer between hardware and software.
  • the kernel layer includes at least a camera driver, a sensor driver, and a display driver.
  • the camera driver is used to control the operation of the camera
  • the sensor driver is used to control the operation of the motion sensor
  • the display driver is used to control the display screen to display images.
  • the hardware may be a camera, a motion sensor, a display screen, etc.
  • the camera may be a front camera or a rear camera.
  • the embodiment of the present application takes a mobile phone as an electronic device, and first illustrates the application scenarios of the mode control method in combination with some user interfaces shown in the embodiment of the present application.
  • the electronic device may display the first interface 601 as shown in (a) of Figure 6.
  • the first interface 601 may be the desktop of the electronic device, on which icons of multiple installed applications are displayed, such as a file management application icon, an email application icon, a weather application icon, a calculator application icon, a clock application icon, a recorder application icon, a music application icon, a setting application icon, an address book application icon, a phone application icon, a message application icon, and a camera application icon 6011.
  • the user can perform a touch operation on the camera application icon 6011, and the touch operation can be a click operation, a long press operation, etc., so that the electronic device receives the user's touch operation on the camera application icon 6011, and the electronic device starts the camera application in response to the touch operation.
  • the electronic device may display the second interface 602 as shown in (b) of Figure 6.
  • the second interface 602 may be a preview interface provided by the camera application for implementing a shooting function, including a preview box 6021, a shooting control 6022, and function controls corresponding to a plurality of shooting modes.
  • the preview box 6021 is used to display the image output by the camera in real time.
  • the shooting control 6022 is used to trigger the shooting operation of the electronic device.
  • the functional controls corresponding to the various shooting modes may include night scene mode controls, portrait mode controls, photo mode controls, video mode controls, professional mode controls, and more controls for opening more functions in the camera application.
  • the camera application can be started by performing a touch operation on the camera application icon 6011. After the camera application is started, and in the process of displaying the image output by the camera in real time on the preview interface of the camera application, the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
  • the user can also call the corresponding interface through a third-party application installed on the electronic device.
  • the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
  • the camera application when the camera application switches from background operation to foreground operation, the camera application can be started. After the camera application is started, and in the process of displaying the image output by the camera in real time on the preview interface of the camera application, the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
  • the camera application running in the foreground means that the current screen of the electronic device displays and runs the camera application;
  • the camera application running in the background means that the camera application is running in the system background, and at this time, the electronic device does not display the interface corresponding to the camera application.
  • FIG7 is a flowchart of a mode control method provided in an embodiment of the present application, which can be applied to an electronic device, and the electronic device can include a camera application and a camera.
  • the mode control method can specifically include the following steps:
  • the electronic device starts a camera application and configures the camera's image output mode to be a full-pixel mode.
  • the user can click the camera application icon 6011 as shown in (a) of Figure 6, so that the electronic device can receive the user's touch operation on the camera application icon 6011.
  • the electronic device responds to the touch operation, starts the camera application, and displays the second interface 602 after the camera application is started.
  • the camera application can also be started by voice triggering or sliding triggering.
  • voice triggering when the electronic device is in the lock screen state, the user can slide in a certain direction on the lock screen interface of the electronic device, such as sliding upward, to start the camera application.
  • the specific operation method for starting the camera application is not limited in the embodiment of the present application.
  • the electronic device configures the camera's image output mode to be full pixel mode by default. That is, before configuring the camera's output mode based on the camera's sensitivity provided in the embodiment of the present application, the camera's image output mode defaults to full pixel mode.
  • the full pixel mode is used to rearrange pixels into a Bayer array by using a mosaic rearrangement method.
  • the mosaic rearrangement method can refer to the description corresponding to FIG. 3 above, which will not be repeated here.
  • S702 When the image output mode of the camera is a full-pixel mode, the electronic device determines whether the sensitivity of the camera is greater than a first sensitivity threshold.
  • the electronic device After the electronic device starts the camera application, the electronic device will obtain the sensitivity of the camera in real time to measure the ambient brightness of the environment in which the camera is currently located based on the sensitivity of the camera.
  • the electronic device can compare the sensitivity of the camera with the first sensitivity threshold to determine whether the sensitivity of the camera is greater than the first sensitivity threshold.
  • the electronic device When the light sensitivity of the camera is greater than the first light sensitivity threshold, the electronic device sequentially executes S703 and S704 below; and when the light sensitivity of the camera is less than or equal to the first light sensitivity threshold, the electronic device sequentially executes S705 and S706 below the line.
  • the electronic device determines that the sensitivity of the camera is greater than the first sensitivity threshold, it means that the current environment of the camera is a low-brightness environment, that is, the ambient brightness of the current environment of the camera is dim, then the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode.
  • the pixel merging mode is used to merge multiple adjacent pixels of the same color into one pixel.
  • the specific implementation of the pixel merging mode can refer to the description corresponding to FIG. 2 above, and will not be repeated here.
  • the first sensitivity threshold can be set according to actual conditions.
  • the first sensitivity threshold can be 1400, and when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is greater than 1400, the electronic device switches the image output mode of the camera from the full pixel mode to the pixel merging mode.
  • the electronic device obtains a first image output by the camera in a pixel merging mode, and displays the first image on a first preview interface.
  • the camera can output the first image it has captured in the pixel merging mode, and the electronic device can display the first image output by the camera in the pixel merging mode in the first preview interface.
  • the electronic device when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device can switch the image output mode of the camera from the full pixel mode to the pixel merging mode, and the camera outputs the first image it has collected in the pixel merging mode.
  • the electronic device displays a first preview interface; the first preview interface includes a first image, which is an image output by the camera in the pixel merging mode.
  • the electronic device may continue to execute the following S707 and subsequent steps.
  • the electronic device determines that the sensitivity of the camera is less than or equal to the first sensitivity threshold, it means that the current environment of the camera is a high-brightness environment, that is, the ambient brightness of the current environment of the camera is sufficient. At this time, the sensitivity of the camera has not reached the switching condition from full-pixel mode to pixel merger mode. The electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
  • the electronic device determines that the sensitivity of the camera is less than or equal to the first sensitivity threshold, the electronic device does not switch the image output mode of the camera from full-pixel mode to pixel merging mode.
  • the first sensitivity threshold may be 1400.
  • the electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
  • the electronic device obtains a third image output by the camera in full-pixel mode, and displays the third image on a third preview interface.
  • the camera can output the third image it has captured in full-pixel mode, and the electronic device can display the third image output by the camera in full-pixel mode in the third preview interface.
  • the electronic device when the image output mode of the camera is in full pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the electronic device can control the image output mode of the camera to continue to remain in full pixel mode, and the camera outputs the third image it has collected in full pixel mode.
  • the number of pixels included in the third image output by the camera is equal to the number of pixels included in the image sensor, the resolution of the third image can be improved, the clarity of the third image is higher, and the image quality of the third image is improved.
  • the electronic device displays a third preview interface; the third preview interface includes a third image, and the third image is an image output by the camera in the full-pixel mode.
  • the electronic device may continue to execute the above S702 and subsequent steps.
  • the image output mode of the camera has been switched from the full pixel mode to the pixel merging mode. Therefore, when the image output mode of the camera is the pixel merging mode, the electronic device can compare the sensitivity of the camera with the second sensitivity threshold to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
  • the electronic device sequentially executes the following S708 and S709; and when the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the electronic device sequentially executes the following S710 and S711.
  • the electronic device determines that the sensitivity of the camera is less than the second sensitivity threshold, it means that the current environment of the camera is a high-brightness environment, that is, the ambient brightness of the current environment of the camera is sufficient.
  • the electronic device then switches the image output mode of the camera from the pixel merging mode to the full-pixel mode.
  • the second sensitivity threshold can be set according to actual conditions.
  • the second sensitivity threshold can be 550.
  • the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode.
  • the first sensitivity threshold is not equal to the second sensitivity threshold.
  • the judgment condition when switching from full-pixel mode to pixel binning mode can be different from the judgment condition when switching from pixel binning mode to full-pixel mode, thereby reducing the ping-pong switching of the camera between full-pixel mode and pixel binning mode, thereby reducing the problem of screen flickering in the image displayed by the electronic device caused by the switching of the camera's image output mode.
  • the electronic device obtains a second image output by the camera in full-pixel mode, and displays the second image on a second preview interface.
  • the camera After the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode, the camera The camera can output the second image it captures in full-pixel mode, and the electronic device can display the second image output by the camera in full-pixel mode in the second preview interface.
  • the electronic device when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is less than the second sensitivity threshold, the electronic device can switch the image output mode of the camera from the pixel merging mode to the full pixel mode, and the camera outputs the second image it has collected in the full pixel mode.
  • the number of pixels included in the second image output by the camera is equal to the number of pixels included in the image sensor, the resolution of the second image can be improved, the clarity of the second image is higher, and the image quality of the second image is improved.
  • the electronic device displays a second preview interface; the second preview interface includes a second image, and the second image is an image output by the camera in full pixel mode.
  • the electronic device may continue to execute the above S702 and subsequent steps.
  • the electronic device determines that the sensitivity of the camera is greater than or equal to the second sensitivity threshold, it means that the current environment of the camera is a low-brightness environment, that is, the ambient brightness of the current environment of the camera is dim. At this time, the sensitivity of the camera has not reached the switching condition from the pixel merging mode to the full pixel mode. The electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device determines that the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the electronic device does not switch the image output mode of the camera from the pixel merging mode to the full pixel mode.
  • the second sensitivity threshold may be 550.
  • the image output mode of the camera is a pixel merging mode
  • the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device obtains a fourth image output by the camera in a pixel merging mode, and displays the fourth image on a fourth preview interface.
  • the camera can output the fourth image it has captured in the pixel merging mode, and the electronic device can display the fourth image output by the camera in the pixel merging mode in the fourth preview interface.
  • the electronic device when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the electronic device can control the image output mode of the camera to continue to remain in the pixel merging mode, and the camera outputs the fourth image it has collected in the pixel merging mode.
  • the photosensitive area of a single pixel in the fourth image can be increased, the noise of the fourth image can be reduced, the clarity and picture brightness of the fourth image can be improved, and the image quality of the fourth image can be improved.
  • the electronic device displays a fourth preview interface; the fourth preview interface includes a fourth image, and the fourth image is an image output by the camera in the pixel merging mode.
  • the electronic device may continue to execute the above S707 and subsequent steps.
  • the arrangement of the pixel array in the full pixel mode is the same as the arrangement of the pixel array in the pixel merging mode.
  • the pixel array of the image sensor is composed of a filter unit array and a photosensitive unit array covered by the filter unit array, and the color of the light received by each pixel unit in the pixel array of the image sensor is determined by the color of the light allowed to pass through by the filter unit in the filter unit array, the pixel array of the image sensor in the full pixel mode is arranged in the same manner as the pixel array of the image sensor in the pixel merging mode, which means that the filter unit array in the full pixel mode is arranged in the same manner as the filter unit array in the pixel merging mode.
  • the camera's image output mode is pixel merging mode
  • the camera when the camera outputs the captured image, it adds together the electrical signals sensed by adjacent pixels in the pixel array of the image sensor and outputs it in a single pixel mode, which does not change the arrangement of the pixel array of the image sensor.
  • the corresponding pixel merging methods include horizontal merging and vertical merging.
  • Horizontal merging is to add together the electrical signals sensed by pixels in adjacent rows
  • vertical merging is to add together the electrical signals sensed by pixels in adjacent columns.
  • the camera's image output mode when full-pixel mode, when the camera outputs the captured image, it can rearrange the pixels in the image captured by the image sensor into a Bayer array through a mosaic rearrangement method implemented by software or hardware. This does not change the arrangement of the pixel array of the image sensor.
  • the specific implementation method of the mosaic rearrangement method can be: swapping pixels in the image captured by the image sensor, or calculating a weight ratio based on the distance between a certain pixel and the related pixels around it, and calculating the pixel value of the pixel based on the weight ratio and the pixel values of the related pixels.
  • the pixel merging mode includes a four-in-one pixel merging mode, which is used to merge four adjacent pixels of the same color into one pixel.
  • the pixel array of the image sensor 20 can adopt a quad-Bayer array as shown in (a) in Figure 2 and (a) in Figure 3.
  • the pixel merging mode can be a four-in-one pixel merging mode, which is used to merge four adjacent pixels of the same color into one pixel.
  • the pixel array of the image sensor in the embodiment of the present application may adopt a nine-Bayer array, a sixteen-Bayer array, etc. in addition to the four-Bayer array shown in (a) of FIG. 2 and (a) of FIG. 3.
  • the pixel merging mode includes a nine-in-one pixel merging mode, and the nine-in-one pixel merging mode is used to merge nine adjacent same-color pixels into one pixel.
  • the pixel merging mode includes a sixteen-in-one pixel merging mode, and the sixteen-in-one pixel merging mode is used to merge sixteen adjacent same-color pixels into one pixel.
  • the first light sensitivity threshold is greater than the second light sensitivity threshold.
  • the camera uses the pixel merging mode to output the captured image when the sensitivity of the camera is large enough to improve the clarity and brightness of the image, and the camera uses the full pixel mode to output the captured image when the sensitivity of the camera is small enough to improve the resolution of the image, thereby improving the clarity of the image.
  • the situation of the camera ping-pong switching between the full pixel mode and the pixel merging mode can be reduced, thereby reducing the problem of screen flickering in the image displayed by the electronic device caused by the switching of the camera's image output mode.
  • the camera may be The front camera may also be a rear camera, which is not limited in the embodiments of the present application.
  • the electronic device may include a camera application, a camera service, a camera hardware abstraction module, a camera driver, and a camera.
  • the mode control method may specifically include the following steps:
  • the camera application receives a touch operation on a camera application icon by a user.
  • the camera service sends an image preview request to the camera hardware abstraction module.
  • the camera hardware abstraction module sends an image preview request to the camera driver.
  • S805 The camera driver sends an image preview request to the camera.
  • a camera application icon may be displayed on the desktop of the electronic device.
  • the user may perform a touch operation on the camera application icon, such as a click operation, and the camera application may receive the user's touch operation on the camera application icon.
  • the camera application responds to the touch operation on the camera application icon, starts the camera application, and starts running the camera application on the electronic device. After the camera application is started, the camera application can send an image preview request to the camera service by calling the camera access interface in the application framework layer.
  • the image preview request is used to request to obtain a preview image captured by the camera.
  • the camera service After receiving the image preview request, the camera service sends the image preview request to the camera through the camera hardware abstraction module and the camera driver.
  • the camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
  • the camera can collect the camera's sensitivity in real time and send the camera's sensitivity to the camera driver, and the camera driver then sends the camera's sensitivity to the camera hardware abstraction module.
  • the camera hardware abstraction module configures the image output mode of the camera according to the sensitivity of the camera; the image output mode of the camera includes a full pixel mode or a pixel merging mode.
  • the camera hardware abstract module After receiving the light sensitivity of the camera, the camera hardware abstract module configures the image output mode of the camera according to the light sensitivity of the camera.
  • the camera hardware abstraction module determines that the image output mode of the camera needs to be switched from full-pixel mode to pixel merging mode. In this case, the camera hardware abstraction module configures the image output mode of the camera to pixel merging mode.
  • the camera hardware abstraction module determines that the image output mode of the camera continues to remain in full-pixel mode. In this case, the camera hardware abstraction module configures the image output mode of the camera to full-pixel mode.
  • the camera hardware abstraction module determines that the image output mode of the camera needs to be switched from the pixel merging mode to the pixel merging mode. Switch to full pixel mode. In this case, the camera hardware abstraction module configures the camera's image output mode to full pixel mode.
  • the camera hardware abstraction module determines that the image output mode of the camera continues to remain in the pixel merging mode. In this case, the camera hardware abstraction module configures the image output mode of the camera to the pixel merging mode.
  • the camera hardware abstraction module sends the camera image output mode to the camera driver.
  • S810 The camera driver sends the camera's image output mode to the camera.
  • the camera outputs the captured preview image according to the image output mode of the camera.
  • the camera hardware abstract module After the camera hardware abstract module configures the camera's image output mode according to the camera's sensitivity, the camera hardware abstract module sends the camera's image output mode to the camera driver, and the camera driver then sends the camera's image output mode to the camera, so that the camera can output the preview image it has captured according to the camera's image output mode.
  • the camera driver drives the camera to output the captured image in the image output mode of the camera according to the image output mode of the camera.
  • the preview images under different scenes may be referred to as the first image, the second image, the third image, and the fourth image, respectively.
  • the preview image output by the camera is the first image output by the camera under the pixel-merging mode
  • the preview image output by the camera is the third image output by the camera under the full-pixel mode
  • the preview image output by the camera is the second image output by the camera under the full-pixel mode
  • the preview image output by the camera is the fourth image output by the camera under the pixel-merging mode.
  • the camera hardware abstraction module determines that the image output mode of the camera needs to be switched, the camera hardware abstraction module sends the switched image output mode to the camera through the camera driver, and when the camera hardware abstraction module determines that the image output mode of the camera does not need to be switched, the camera hardware abstraction module does not need to send the camera's continued image output mode to the camera driver.
  • the camera hardware abstraction module may also send the camera's continued image output mode to the camera through the camera driver.
  • the camera may process the image captured by the camera in a pixel merging manner and output the processed image.
  • the processed image output by the camera is the image output by the camera in the pixel merging mode.
  • the camera can process the image collected by the camera in a mosaic rearrangement manner and output the processed image.
  • the processed image output by the camera is the image output by the camera in full pixel mode.
  • the arrangement of the pixel array in the image output by the camera can be consistent with the arrangement of the pixel array in the image output by the camera.
  • the camera hardware abstraction module can process the image output by the camera by pixel merging for the scene where the camera's image output mode is pixel merging mode; for the scene where the camera's image output mode is full pixel mode, the camera hardware abstraction module can process the image output by the camera by mosaic rearrangement.
  • the camera sends a preview image to the camera driver.
  • the camera driver sends a preview image to the camera hardware abstraction module.
  • the camera hardware abstraction module sends a preview image to the camera service.
  • S815 The camera service sends a preview image to the camera application.
  • the camera application displays a preview image.
  • the camera After the camera outputs the preview image it has captured according to the camera's image output mode, the camera sends the output preview image to the camera application through the camera driver, the camera hardware abstract module, and the camera service. After receiving the preview image, the camera application can display the preview image on the preview interface.
  • the camera can continuously output each frame of image it has captured at a certain frame rate, and send each frame of image to the camera application through the camera driver, camera hardware abstraction module and camera service, so that the camera application can display each frame of image in sequence in the preview interface through the display screen.
  • the preview interfaces when different preview images are displayed are respectively referred to as the first preview interface, the second preview interface, the third preview interface and the fourth preview interface.
  • the preview interface when the first image is displayed is the first preview interface
  • the preview interface when the second image is displayed is the second preview interface
  • the preview interface when the third image is displayed is the third preview interface
  • the preview interface when the fourth image is displayed is the fourth preview interface.
  • the preview image sent to the camera application may be an image processed by the ISP.
  • the electronic device after a preset number of frames after each configuration of the image output mode of the camera, the electronic device again determines whether to switch the image output mode of the camera, wherein the image output mode of the camera includes a full pixel mode or a pixel merging mode.
  • the time interval between the next determination of whether to switch the image output mode of the camera can be a preset number of frames.
  • configuring the image output mode of the camera can include switching the image output mode of the camera, and controlling the image output mode of the camera to remain unchanged.
  • the embodiment of the present application can determine the relationship between the sensitivity of the camera and the sensitivity threshold in real time. Moreover, after the preset number of frames after the image output mode of the camera is configured, it is determined whether to switch the image output mode of the camera based on the judgment result of the relationship between the sensitivity of the camera and the sensitivity threshold.
  • the embodiment of the present application may also determine the relationship between the camera's sensitivity and a sensitivity threshold after configuring the camera's image output mode and after a preset number of frames, and determine whether to switch the camera's image output mode based on the relationship between the camera's sensitivity and the sensitivity threshold.
  • the electronic device executes the above S703 and S704 and switches the image output mode of the camera from the full pixel mode to the pixel merging mode, it executes the above S707 again after a preset number of frames to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
  • the electronic device executes the above S705 and S706 and controls the image output mode of the camera to remain in the full pixel mode, it executes the above S702 again after a preset number of frames to determine Whether the sensitivity of the camera is greater than the first sensitivity threshold.
  • the electronic device executes the above S708 and S709 and switches the image output mode of the camera from the pixel merging mode to the full pixel mode, it executes the above S702 again after a preset number of frames to determine whether the sensitivity of the camera is greater than the first sensitivity threshold.
  • the electronic device executes the above S710 and S711 and controls the image output mode of the camera to remain in the pixel merging mode, it executes the above S707 again after a preset number of frames to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
  • the above-mentioned preset frame number can be an empirical value, and different values can be selected according to different modules and complete products.
  • a suitable value can be selected as the preset frame number of the electronic device according to actual product debugging to reduce or solve the problem of screen flickering of the image displayed by the electronic device during the switching process.
  • the preset frame number may be a preset fixed value, such as the preset frame number may be 200 frames.
  • the camera hardware abstraction module in the electronic device can count the number of frames from zero to determine whether the number of frames reaches the preset number of frames.
  • the frame rate of the camera capturing images is consistent with the frame rate of the camera application when displaying the images captured by the camera. Therefore, when the electronic device counts the number of frames, the number of frames counted by the electronic device is accumulated by 1 frame for each frame of image captured by the camera; or, when the electronic device counts the number of frames, the number of frames counted by the electronic device is accumulated by 1 frame for each frame of image captured by the camera displayed by the camera application.
  • the electronic device determines again whether to switch the image output mode of the camera, wherein the image output mode of the camera includes a full pixel mode or a pixel merging mode.
  • the time interval between the electronic device configuring the image output mode of the camera and the next determination of whether to switch the image output mode of the camera can be a preset time length.
  • the embodiment of the present application can determine the relationship between the sensitivity of the camera and the sensitivity threshold in real time, and determine whether to switch the image output mode of the camera based on the judgment result of the relationship between the sensitivity of the camera and the sensitivity threshold after a preset time after the image output mode of the camera is configured.
  • the embodiment of the present application may also determine the relationship between the camera's sensitivity and a sensitivity threshold after a preset time interval after configuring the camera's image output mode, and determine whether to switch the camera's image output mode based on the relationship between the camera's sensitivity and the sensitivity threshold.
  • the electronic device executes the above S703 and S704, switches the image output mode of the camera from the full pixel mode to the pixel merging mode, and then executes the above S707 after a preset time interval to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
  • the electronic device executes the above S705 and S706, controls the image output mode of the camera to remain in the full pixel mode, and then executes the above S702 after a preset time interval to determine whether the sensitivity of the camera is greater than the first sensitivity threshold.
  • the electronic device After the electronic device executes the above S708 and S709, switches the image output mode of the camera from the pixel merging mode to the full pixel mode, and then executes the above S702 after a preset time interval to determine whether the sensitivity of the camera is greater than the first sensitivity threshold.
  • the electronic device executes the above S710 and S711, controls the image output mode of the camera to remain in the pixel merging mode, and then executes the above S707 after a preset time interval to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
  • the above-mentioned preset duration can be an empirical value, which can be selected according to different modules and complete products.
  • an appropriate value can be selected as the preset duration of the electronic device according to actual product debugging to reduce or solve the problem of the image displayed by the electronic device appearing in the switching process. Flickering problem.
  • the preset time length may be a preset fixed value, such as the preset time length may be 8 seconds.
  • the time interval between the next determination of whether to switch the image output mode of the camera can be a preset number of frames, and the preset number of frames can be a fixed value.
  • the embodiment of the present application can also determine the preset number of frames according to the motion state of the electronic device, and determine whether to switch the image output mode of the camera based on the preset number of frames.
  • FIG9 is a flowchart of switching the image output mode of a camera according to the motion state of an electronic device provided in an embodiment of the present application. Referring to FIG9 , the following steps may be specifically included:
  • the electronic device obtains the motion parameters collected by the motion sensor in real time.
  • the electronic device determines a motion state of the electronic device according to the motion parameter; the motion state of the electronic device includes a static state, a first moving state, and a second moving state.
  • the motion parameter of the second moving state is greater than the motion parameter of the first moving state, the motion parameter of the first moving state is greater than the motion parameter of the static state, and the motion parameter includes at least one of acceleration data, angular velocity data and speed data.
  • the electronic device may include a motion sensor, and the motion sensor may include at least one of an acceleration sensor, a gyroscope sensor, and a speed sensor.
  • the motion parameter collected by the acceleration sensor includes acceleration data, which includes accelerations in the x-axis, y-axis, and z-axis directions.
  • the electronic device can determine the motion state of the electronic device based on the acceleration data collected by the acceleration sensor.
  • the acceleration sensor detects that the acceleration data of the electronic device is less than the first acceleration threshold, it is determined that the electronic device is in a stationary state; when the acceleration sensor detects that the acceleration data of the electronic device is greater than or equal to the first acceleration threshold and less than the second acceleration threshold, it is determined that the electronic device is in a first moving state; when the acceleration sensor detects that the acceleration data of the electronic device is greater than or equal to the second acceleration threshold, it is determined that the electronic device is in a second moving state.
  • the second acceleration threshold is greater than the first acceleration threshold, and the first acceleration threshold can be a value close to 0.
  • the motion sensor includes a gyroscope sensor
  • the motion parameter collected by the gyroscope sensor includes angular velocity data, which includes angular velocities in the x-axis, y-axis, and z-axis directions.
  • the electronic device can determine the motion state of the electronic device based on the angular velocity data collected by the gyroscope sensor.
  • the gyroscope sensor detects that the angular velocity data of the electronic device is less than the first angular velocity threshold, it is determined that the electronic device is in a stationary state; when the gyroscope sensor detects that the angular velocity data of the electronic device is greater than or equal to the first angular velocity threshold and less than the second angular velocity threshold, it is determined that the electronic device is in a first moving state; when the gyroscope sensor detects that the angular velocity data of the electronic device is greater than or equal to the second angular velocity threshold, it is determined that the electronic device is in a second moving state.
  • the second angular velocity threshold is greater than the first angular velocity threshold, and the first angular velocity threshold may be a value close to 0.
  • the motion parameter collected by the speed sensor includes speed data, which includes speeds in the x-axis, y-axis and z-axis directions.
  • the electronic device can determine the motion state of the electronic device based on the speed data collected by the speed sensor.
  • the speed sensor detects that the speed data of the electronic device is less than the first speed threshold, it is determined that the electronic device is in a stationary state; when the speed sensor detects that the speed data of the electronic device is greater than or equal to the first speed threshold, it is determined that the electronic device is in a stationary state.
  • the speed sensor detects that the speed data of the electronic device is greater than or equal to the second speed threshold, the electronic device is determined to be in the first moving state.
  • the speed sensor detects that the speed data of the electronic device is greater than or equal to the second speed threshold
  • the electronic device is determined to be in the second moving state.
  • the second speed threshold is greater than the first speed threshold, and the first speed threshold can be a value close to 0.
  • the motion state of the electronic device when the user is walking with the electronic device, the motion state of the electronic device may be the first motion state; when the user is riding in a vehicle with the electronic device, the motion state of the electronic device may be the second motion state.
  • the electronic device can obtain the motion state of the electronic device in real time.
  • S903 The electronic device determines that the preset frame number corresponding to the static state is the first frame number.
  • S904 The electronic device determines that the preset frame number corresponding to the first movement state is the second frame number.
  • the electronic device determines that the preset frame number corresponding to the second movement state is a third frame number.
  • the electronic device is pre-set with preset frame numbers corresponding to different motion states.
  • the electronic device determines that its motion state is a stationary state
  • the electronic device determines that the preset frame number corresponding to the stationary state is a first frame number
  • the electronic device determines that the preset frame number corresponding to the first moving state is a second frame number
  • the electronic device determines that the preset frame number corresponding to the second moving state is a third frame number.
  • the first frame number, the second frame number, and the third frame number may be empirical values, and different values may be selected according to different modules and complete products. For a certain electronic device, appropriate values may be selected as the first frame number, the second frame number, and the third frame number according to actual product debugging.
  • At least two of the first frame number, the second frame number and the third frame number are different.
  • the first frame number corresponding to the static state may be greater than the first frame number corresponding to the first moving state; the first frame number corresponding to the static state may be greater than the third frame number corresponding to the second moving state.
  • the electronic device can determine the preset number of frames corresponding to the motion state according to the motion state.
  • the electronic device may continue to execute the following S906 and subsequent steps; after the electronic device executes the above S904, the electronic device may continue to execute the following S909 and subsequent steps; after the electronic device executes the above S905, the electronic device may continue to execute the following S912 and subsequent steps.
  • the electronic device determines whether the sensitivities obtained within the number of frames in which the static state remains unchanged all meet a preset condition.
  • the electronic device switches the image output mode of the camera.
  • the electronic device configures the image output mode of the camera to be the pixel merging mode, such as switching the image output mode of the camera from the full pixel mode to the pixel merging mode, or controlling the image output mode of the camera to continue to be in the pixel merging mode, if the motion state of the electronic device has been a static state, and the number of frames in which the static state remains unchanged reaches a first number of frames, the electronic device determines that the images acquired within the number of frames in which the static state remains unchanged Whether the sensitivities are all less than the second sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the static state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the first frame number corresponding to the static state is 300 frames
  • the second sensitivity threshold is 550.
  • the electronic device can monitor the motion state of the electronic device in real time and obtain the sensitivity of the camera in real time. Moreover, when the image output mode of the camera is the pixel merging mode, the electronic device will compare the sensitivity of the camera with the second sensitivity threshold in real time.
  • the electronic device configures the image output mode of the camera to the full-pixel mode, such as switching the image output mode of the camera from the pixel merging mode to the full-pixel mode, or controlling the image output mode of the camera to continue to remain in the full-pixel mode, if the motion state of the electronic device has been a static state, and the number of frames in which the static state remains unchanged reaches a first number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the static state remains unchanged is greater than the first sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivity acquired within the number of frames in which the static state remains unchanged is less than or equal to the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
  • the electronic device determines whether the sensitivities obtained within the number of frames in which the first movement state remains unchanged all meet a preset condition.
  • the electronic device configures the image output mode of the camera to the pixel merging mode, such as switching the image output mode of the camera from the full pixel mode to the pixel merging mode, or controlling the image output mode of the camera to continue to remain in the pixel merging mode, if the motion state of the electronic device has been the first moving state, and the number of frames in which the first moving state remains unchanged reaches the second number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the first moving state remains unchanged is less than the second sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the first movement state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the first movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device configures the image output mode of the camera to the full-pixel mode, such as switching the image output mode of the camera from the pixel merging mode to the full-pixel mode, or controlling the image output mode of the camera to continue to remain in the full-pixel mode, if the motion state of the electronic device has been the first moving state, and the number of frames in which the first moving state remains unchanged reaches the second number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the first moving state remains unchanged is greater than the first sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivities acquired within the number of frames in which the first movement state remains unchanged are less than or equal to the first sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the first movement state remains unchanged are not very stable, the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
  • the electronic device determines whether the sensitivities obtained within the number of frames in which the second movement state remains unchanged all meet a preset condition.
  • the electronic device configures the image output mode of the camera to the pixel merging mode, such as switching the image output mode of the camera from the full pixel mode to the pixel merging mode, or controlling the image output mode of the camera to continue to remain in the pixel merging mode, if the motion state of the electronic device has been the second moving state, and the number of frames in which the second moving state remains unchanged reaches a third number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the second moving state remains unchanged is less than the second sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device configures the image output mode of the camera to the full-pixel mode, such as switching the image output mode of the camera from the pixel merging mode to the full-pixel mode, or controlling the image output mode of the camera to continue to remain in the full-pixel mode, if the motion state of the electronic device has been the second moving state, and the number of frames in which the second moving state remains unchanged reaches a third number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the second moving state remains unchanged is greater than the first sensitivity threshold.
  • the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is less than or equal to the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
  • the above description is a scenario in which the motion state of the electronic device remains unchanged between each configuration of the camera's image output mode and the next configuration of the camera's image output mode. If the motion state of the electronic device changes, and the motion state before the change does not satisfy the conditions corresponding to the image output mode of the camera being reconfigured, the electronic device determines whether it satisfies the conditions corresponding to the image output mode of the camera being reconfigured based on the motion state after the change.
  • the electronic device determines whether the sensitivity obtained within the target frame number meets the preset conditions, and the target frame number is the frame number in which the motion state remains unchanged; when the sensitivity obtained within the target frame number meets the preset conditions, the electronic device switches the camera's image output mode; when the sensitivity obtained within the target frame number does not meet the preset conditions, the electronic device keeps the camera's image output mode unchanged.
  • the sensitivity when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition.
  • the image output mode of the camera is the pixel merging mode, when the sensitivity is less than the second sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is greater than or equal to the second sensitivity threshold, the sensitivity does not meet the preset condition.
  • the embodiment of the present application jointly determines whether to switch the image output mode of the camera according to the motion state of the electronic device and the sensitivity of the camera. According to the scenes corresponding to different motion states, different preset frame numbers are matched to increase the smoothness of the image output mode switching process of the camera, further reduce the problem of screen flickering of the image displayed by the electronic device during the switching process of the image output mode of the camera, and make the image displayed by the electronic device more stable.
  • Another implementation method is that after each configuration of the image output mode of the camera, the electronic device obtains the motion state of the electronic device; the electronic device determines a preset number of frames corresponding to the motion state based on the motion state of the electronic device; at the first moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets the preset conditions, and the time interval between the first moment and the moment of configuring the image output mode of the camera is equal to the preset number of frames corresponding to the motion state; when the sensitivity meets the preset conditions, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset conditions, the electronic device keeps the image output mode of the camera unchanged.
  • the sensitivity when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition.
  • the image output mode of the camera is the pixel merging mode, when the sensitivity is less than the second sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is greater than or equal to the second sensitivity threshold, the sensitivity does not meet the preset condition.
  • the electronic device does not need to determine the motion state of the electronic device in real time, and the electronic device obtains the motion state of the electronic device once after configuring the image output mode of the camera each time.
  • the specific method of obtaining the motion state of the electronic device can refer to the corresponding description of S901 and S902 above, which will not be repeated here.
  • the motion state of the electronic device includes a static state, a first moving state and a second moving state.
  • the preset frame number corresponding to the static state is the first frame number; the preset frame number corresponding to the first moving state is the second frame number; and the preset frame number corresponding to the second moving state is the third frame number.
  • the following takes the motion state of the electronic device as the static state as an example to illustrate the specific implementation method of the electronic device controlling the image output mode of the camera under this implementation method.
  • the electronic device determines that after the first frame number after the image output mode of the camera is configured to be the pixel merging mode, the camera Whether the sensitivity is less than the second sensitivity threshold. If the sensitivity of the camera is less than the second sensitivity threshold, the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device determines whether the sensitivity of the camera is greater than the first sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be the full pixel mode. If the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device switches the image output mode of the camera from the full pixel mode to the pixel merging mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the full pixel mode.
  • the electronic device obtains the motion state of the electronic device in real time; the electronic device determines a preset number of frames corresponding to the motion state based on the motion state of the electronic device; at a second moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets a preset condition, the second moment being the moment when the number of frames in which the motion state remains unchanged reaches a preset number of frames corresponding to the motion state; when the sensitivity meets the preset condition, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged.
  • the sensitivity when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition.
  • the image output mode of the camera is the pixel merging mode, when the sensitivity is less than the second sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is greater than or equal to the second sensitivity threshold, the sensitivity does not meet the preset condition.
  • the electronic device acquires the motion state of the electronic device in real time.
  • the specific method of acquiring the motion state of the electronic device can refer to the corresponding description of S901 and S902 above, which will not be repeated here.
  • the motion state of the electronic device includes a static state, a first moving state and a second moving state.
  • the preset frame number corresponding to the static state is the first frame number; the preset frame number corresponding to the first moving state is the second frame number; and the preset frame number corresponding to the second moving state is the third frame number.
  • the following takes the motion state of the electronic device as the static state as an example to illustrate the specific implementation method of the electronic device controlling the image output mode of the camera under this implementation method.
  • the electronic device determines whether the sensitivity of the camera is less than a second sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be the pixel merging mode. If the sensitivity of the camera is less than the second sensitivity threshold, the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
  • the electronic device determines whether the sensitivity of the camera is greater than a first sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be in full-pixel mode. If the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
  • the above description is a scenario in which the motion state of the electronic device remains unchanged from each configuration of the camera's image output mode to the next configuration of the camera's image output mode.
  • the motion state of the electronic device changes, and the number of frames maintained by the motion state before the change does not reach the preset number of frames corresponding to the motion state, the electronic device then determines whether it is necessary to compare the relationship between the sensitivity of the camera and the sensitivity threshold based on whether the number of frames maintained by the motion state after the change reaches the preset number of frames corresponding to the motion state after the change.
  • the electronic device may include a camera application, a camera service, a camera hardware abstraction module, a camera driver and a camera head, a sensor driver and a motion sensor.
  • the mode control method may specifically include the following steps:
  • a camera application receives a touch operation on a camera application icon by a user.
  • S1002 In response to a touch operation on a camera application icon, the camera application sends an image preview request to a camera service.
  • the camera service sends an image preview request to the camera hardware abstraction module.
  • the camera hardware abstraction module sends an image preview request to the camera driver.
  • S1005 The camera driver sends an image preview request to the camera.
  • the camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
  • S1001 to S1007 can refer to the specific implementation of S801 to S807 mentioned above, which will not be repeated here.
  • the camera hardware abstraction module sends a motion parameter acquisition request to the sensor driver.
  • the sensor driver sends a motion parameter acquisition request to the motion sensor.
  • the motion sensor sends the collected motion parameters to the sensor driver.
  • the sensor driver sends motion parameters to the camera hardware abstraction module.
  • the camera hardware abstraction module determines the motion state of the electronic device according to the motion parameters.
  • the camera hardware abstract module stores software code for scheduling the motion sensor. After receiving the image preview request, the camera hardware abstract module can call the sensor driver to drive the motion sensor to collect the motion parameters of the electronic device. The motion sensor sends the collected motion parameters to the camera hardware abstract module through the sensor driver.
  • the camera hardware abstraction module can determine the motion state of the electronic device according to the motion parameters of the electronic device.
  • the specific implementation method thereof can refer to the description corresponding to the above S902, which will not be repeated here.
  • the camera hardware abstraction module configures the image output mode of the camera according to the sensitivity of the camera and the motion state of the electronic device; the image output mode of the camera includes a full pixel mode or a pixel merging mode.
  • the camera hardware abstraction module After receiving the light sensitivity of the camera and determining the motion state of the electronic device, the camera hardware abstraction module configures the camera image output according to the light sensitivity of the camera and the motion state of the electronic device. Exit mode.
  • the camera hardware abstraction module configures the specific implementation of the camera's image output mode according to the camera's sensitivity and the motion state of the electronic device, and the three implementations mentioned above can be referred to.
  • the corresponding description of FIG. 9 above can be referred to, and no further details are given here.
  • the camera hardware abstraction module when counting the number of frames whose motion state remains unchanged, it is the camera hardware abstraction module that performs the statistics.
  • the camera hardware abstraction module sends the camera image output mode to the camera driver.
  • S1015 The camera driver sends the camera's image output mode to the camera.
  • S1016 The camera outputs the captured preview image according to the image output mode of the camera.
  • the camera sends a preview image to the camera driver.
  • the camera driver sends a preview image to the camera hardware abstraction module.
  • the camera hardware abstraction module sends a preview image to the camera service.
  • the camera service sends a preview image to the camera application.
  • the camera application displays a preview image.
  • S1014 to S1021 can refer to the specific implementation of S809 to S816 mentioned above, which will not be repeated here.
  • the camera application includes multiple shooting modes, such as night scene mode, portrait mode, photo mode, video mode, and professional mode, etc. Among them, at least some of the shooting modes in the multiple shooting modes correspond to different first sensitivity thresholds, and/or at least some of the shooting modes in the multiple shooting modes correspond to different second sensitivity thresholds.
  • the first sensitivity threshold corresponding to the photo mode may be 1400, and the first sensitivity threshold corresponding to the portrait mode may be 1300; or, the second sensitivity threshold corresponding to the photo mode may be 550, and the second sensitivity threshold corresponding to the portrait mode may be 500.
  • the image preview request may include the shooting mode of the camera application, so that the camera hardware abstraction module can determine the first sensitivity threshold and the second sensitivity threshold corresponding to the shooting mode based on the shooting mode in the image preview request.
  • the mode control method provided in the embodiment of the present application can be applied not only to the preview scenario of the above-mentioned camera application, but also to the shooting scenario of the camera application.
  • FIG11 is a schematic diagram of module interaction during image capture provided by an embodiment of the present application, which can be applied to an electronic device, and the electronic device can include a camera application, a camera service, a camera hardware abstraction module, a camera driver, and a camera.
  • the following steps can be specifically included:
  • the camera application receives a user's touch operation on a shooting control.
  • S1102 In response to a touch operation on a shooting control, the camera application sends an image shooting request to the camera service.
  • the camera service sends an image capture request to the camera hardware abstraction module.
  • the camera hardware abstraction module sends an image capture request to the camera driver.
  • S1105 The camera driver sends an image capture request to the camera.
  • S1106 The camera sends the acquired image frames to the camera driver according to the image shooting request.
  • a shooting control is provided in the preview interface of the camera application.
  • the user can perform a touch operation on the shooting control, such as a click operation, and the camera application can receive the user's touch operation on the shooting control.
  • the camera application sends an image shooting request to the camera service by calling the camera access interface in the application framework layer.
  • the camera service sends the image shooting request to the camera through the camera hardware abstraction module and the camera driver.
  • the camera captures images according to the image shooting request and outputs the captured image frames based on the current image output mode.
  • the image frames output by the camera can be sent to the camera driver.
  • the camera driver sends the image frame to the camera hardware abstraction module.
  • the camera hardware abstraction module sends the image frame to the camera service.
  • S1109 The camera service sends the image frame to the camera application.
  • the camera application stores the image frame.
  • the camera driver sends the image frames output by the camera to the camera application through the camera hardware abstraction module and the camera service. After receiving the image frames, the camera application can store the image frames in the memory of the electronic device.
  • the preview interface of the camera application may be a first preview interface and a second preview interface, the preview interface when the first image is displayed is the first preview interface, and the preview interface when the second image is displayed is the second preview interface.
  • the shooting control in the first preview interface is referred to as the first shooting control, that is, the first preview interface includes the first shooting control
  • the shooting control in the second preview interface is referred to as the second shooting control, that is, the second preview interface includes the second shooting control.
  • the image frame stored in the above process may be the first image or the second image.
  • the electronic device When the electronic device receives the first operation of the user on the first shooting control, the electronic device responds to the first operation on the first shooting control and saves the first image according to the implementation of S1102 to S1110. Correspondingly, when the electronic device receives the second operation of the user on the second shooting control, the electronic device responds to the second operation on the second shooting control and saves the second image according to the implementation of S1102 to S1110.
  • the first image is a preview image output by the camera in pixel merging mode
  • the second image is a preview image output by the camera in full pixel mode. Therefore, the size of the second image is larger than the size of the first image.
  • the size of the second image is 3840 pixels * 2160 pixels
  • the size of the first image is 1920 pixels * 1080 pixels.
  • the storage space occupied by the second image when stored is also greater than the storage space occupied by the first image when stored.
  • the storage space occupied by the second image when stored is 9 MB, while the storage space occupied by the first image when stored is 2.25 MB.
  • the size of the third image is also greater than that of the fourth image.
  • the storage space occupied by the third image when stored is also greater than the storage space occupied by the fourth image when stored.
  • the storage space occupied by the images output in low brightness environment and high brightness environment is equal, while the storage space occupied by the images output in low brightness environment of the embodiment of the present application is 1/4 of the storage space occupied by the images output in high brightness environment.
  • the storage space occupied by the images output in low brightness environment and high brightness environment of the related art is 9MB, while the storage space occupied by the images output in low brightness environment of the embodiment of the present application can be 2.25MB, and the storage space occupied by the images output in high brightness environment of the embodiment of the present application can also be 9MB.
  • the camera hardware abstraction module continues to count the number of frames, and it does not start counting again from zero due to the shooting operation.
  • the mode control method provided in the embodiment of the present application can also be applied to scenes such as video recording of camera applications. After the video recording is completed, the camera application saves each frame of the image output by the camera in the form of a video in the electronic device.
  • the above describes the mode control method provided by the embodiment of the present application in conjunction with Figures 6 to 11.
  • the following describes the device for executing the above method provided by the embodiment of the present application.
  • the embodiment provides a schematic diagram of the structure of a mode control device.
  • the mode control device can be an electronic device in the embodiment of the present application, or a chip or chip system in the electronic device.
  • the mode control device 1200 may include: a display unit 1201 and a processing unit 1202.
  • the display unit 1201 is used to support the mode control device 1200 to perform the above display steps;
  • the processing unit 1202 is used to support the mode control device 1200 to perform the above processing steps.
  • the processing unit 1202 is used to obtain the sensitivity of the camera; when the sensitivity is greater than the first sensitivity threshold and the image output mode of the camera is the full pixel mode, the display unit 1201 is used to display the first preview interface, the first preview interface includes the first image, and the first image is the image output by the camera in the pixel merging mode; when the sensitivity is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, the display unit 1201 is used to display the second preview interface, the second preview interface includes the second image, and the second image is the image output by the camera in the full pixel mode.
  • the pixel merging mode is used to merge multiple adjacent pixels of the same color into one pixel, and the full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold is not equal to the second sensitivity threshold.
  • the mode control device 1200 further includes a storage unit 1203.
  • the storage unit 1203 and the processing unit 1202 are connected via a line.
  • the storage unit 1203 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits.
  • the storage unit 1203 may exist independently and be connected to the processing unit 1202 via a communication bus.
  • the storage unit 1203 may also be integrated with the processing unit 1202.
  • the storage unit 1203 can store computer-executable instructions of the method in the electronic device so that the processing unit 1202 executes the method in the above embodiment.
  • the storage unit 1203 can be a register, a cache, or a random access memory (RAM), etc.
  • the storage unit 1203 can be integrated with the processing unit 1202.
  • the storage unit 1203 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions.
  • the storage unit 1203 can be independent of the processing unit 1202.
  • FIG13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application.
  • a chip 1300 includes one or more (including two) processors 1301 , a communication line 1302 and a communication interface 1303 , and optionally, the chip 1300 also includes a memory 1304 .
  • the memory 1304 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
  • the method described in the above embodiment of the present application can be applied to the processor 1301, or implemented by the processor 1301.
  • the processor 1301 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1301 or an instruction in the form of software.
  • the above processor 1301 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor, an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components.
  • the processor 1301 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.
  • the steps of the method disclosed in the embodiments of the present application can be directly implemented as a hardware decoding processor, or can be implemented by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a mature storage medium in the art such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM).
  • the storage medium is located in the memory 1304 , and the processor 1301 reads the information in the memory 1304 and completes the steps of the above method in combination with its hardware.
  • the processor 1301 , the memory 1304 , and the communication interface 1303 may communicate with each other via the communication line 1302 .
  • the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.
  • the embodiment of the present application also provides a computer program product, which includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means.
  • wired e.g., coaxial cable, optical fiber, digital subscriber line (DSL)
  • wireless e.g., infrared, wireless, microwave, etc.
  • the computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated.
  • the available medium may include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (DVD)), or a semiconductor medium (e.g., a solid state drive (SSD)), etc.
  • An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and the processor is used to execute the computer program to perform the above-mentioned mode control method.
  • the embodiment of the present application provides a chip.
  • the chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program or instruction.
  • the above method is implemented when the computer program or instruction is executed by the processor.
  • the method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium.
  • Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another.
  • the storage medium can be any target medium that can be accessed by a computer.
  • the computer-readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer-readable medium may include a magnetic disk storage or other magnetic disk storage device.
  • any connecting line may also be appropriately referred to as a computer-readable medium.
  • the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium.
  • Disks and optical discs as used herein include compact discs (CDs), laser discs, optical discs, DVDs, floppy disks and Blu-ray discs, where disks generally reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
  • each process and/or box in the flowchart and/or block diagram and the combination of the process and/or box in the flowchart and/or block diagram can be realized by computer program instructions.
  • These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device produce a device for realizing the function specified in one process or multiple processes in the flowchart and/or one box or multiple boxes in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Studio Devices (AREA)

Abstract

本申请实施例提供一种模式控制方法、电子设备、存储介质及程序产品,应用于电子技术领域。该方法在启动相机应用的情况下,获取摄像头的感光度,在感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,显示第一预览界面,第一预览界面包括第一图像,第一图像为摄像头在像素合并模式下输出的图像,在感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,显示第二预览界面,第二预览界面包括第二图像,第二图像为摄像头在全像素模式下输出的图像。因此,本申请实施例根据环境亮度的不同,调节摄像头的图像输出模式,提高不同的环境亮度下摄像头输出的图像的清晰度,进而提高图像质量。

Description

模式控制方法、电子设备、存储介质及程序产品
本申请要求于2023年06月15日提交中国国家知识产权局、申请号202310714632.3、申请名称为“模式控制方法、电子设备、存储介质及程序产品”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子技术领域,尤其涉及一种模式控制方法、电子设备、存储介质及程序产品。
背景技术
随着电子技术的不断发展,手机、平板电脑等电子设备逐渐成为人们日常生活和工作中较为常见的工具。目前,一些电子设备中设置有摄像头,基于摄像头为用户提供拍照或录像功能。
但是,在不同的环境亮度下,一些电子设备中的摄像头输出的图像存在清晰度差的问题,进而影响图像质量。
发明内容
本申请实施例提供一种模式控制方法、电子设备、存储介质及程序产品,在不同的环境亮度下,使得摄像头以不同的图像输出模式输出采集的图像,提高摄像头输出的图像的清晰度,进而提高图像质量。
第一方面,本申请实施例提出一种模式控制方法,应用于电子设备,电子设备包括相机应用和摄像头,该方法包括:在启动相机应用的情况下,电子设备获取摄像头的感光度;在感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第一预览界面,第一预览界面包括第一图像,第一图像为摄像头在像素合并模式下输出的图像;在感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第二预览界面,第二预览界面包括第二图像,第二图像为摄像头在全像素模式下输出的图像。其中,像素合并模式用于将相邻的多个同色像素合并为一个像素,全像素模式用于采用马赛克重排方式将像素重排为拜耳阵列;第一感光度阈值与第二感光度阈值不相等。
这样,在感光度大于第一感光度阈值时,说明摄像头此时处于低亮度环境下,则摄像头采用像素合并模式输出其采集到的图像,通过将相邻的多个同色像素合并为一个像素,可提高单像素的感光面积,降低图像的噪点,提高图像的清晰度和画面亮度,进而提升图像质量。并且,在感光度小于第二感光度阈值时,说明摄像头此时处于高亮度环境下,则摄像头采用全像素模式输出其采集到的图像,通过将像素重排为拜耳阵列,使得摄像头输出的图像包括的像素数量与图像传感器包括的像素数量相等,即摄像头输出的图像包括的像素数量较多,可提高图像的分辨率,使得图像的清晰度较高,进而提高图像质量。
在一种可能的实现方式中,第一感光度阈值大于第二感光度阈值。这样,在提高图像质量的前提下,可减轻摄像头在全像素模式与像素合并模式之间进行乒乓切换的情况,进而减轻摄像头的图像输出模式的切换过程中,导致的电子设备显示的图像出现画面闪烁的问题。
在一种可能的实现方式中,在电子设备获取摄像头的感光度之后,还包括:在感光度小于或等于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第三预览界面,第三预览界面包括第三图像,第三图像为摄像头在全像素模式下输出的图像;在感光度大于或等于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第四预览界面,第四预览界面包括第四图像,第四图像为摄像头在像素合并模式下输出的图像。这样,在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度小于或等于第一感光度阈值时,控制摄像头的图像输出模式继续保持在全像素模式,以提高图像的清晰度;在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度大于或等于第二感光度阈值时,控制摄像头的图像输出模式继续保持在像素合并模式,以提高图像的清晰度和画面亮度。
在一种可能的实现方式中,在感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第一预览界面,包括:在摄像头的图像输出模式为全像素模式的情况下,电子设备判断感光度是否大于第一感光度阈值;在感光度大于第一感光度阈值的情况下,电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式;电子设备获取摄像头在像素合并模式下输出的第一图像,并在第一预览界面显示第一图像。相应的,在感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第二预览界面,包括:在摄像头的图像输出模式为像素合并模式的情况下,电子设备判断感光度是否小于第二感光度阈值;在感光度小于第二感光度阈值的情况下,电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式;电子设备获取摄像头在全像素模式下输出的第二图像,并在第二预览界面显示第二图像。这样,根据摄像头的感光度不同,将摄像头的图像输出模式在像素合并模式与全像素模式之间进行切换,以提高不同的环境亮度下摄像头输出的图像的清晰度。
在一种可能的实现方式中,在感光度小于或等于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第三预览界面,包括:在摄像头的图像输出模式为全像素模式的情况下,电子设备判断感光度是否大于第一感光度阈值;在感光度小于或等于第一感光度阈值的情况下,电子设备控制摄像头的图像输出模式继续保持在全像素模式;电子设备获取摄像头在全像素模式下输出的第三图像,并在第三预览界面显示第三图像。相应的,在感光度大于或等于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第四预览界面,包括:在摄像头的图像输出模式为像素合并模式的情况下,电子设备判断感光度是否小于第二感光度阈值;在感光度大于或等于第二感光度阈值的情况下,电子设备控制摄像头的图像输出模式继续保持在像素合并模式;电子设备获取摄像头在像素合并模式下输出的第四图像,并在第四预览界面显示第四图像。
在一种可能的实现方式中,该方法还包括:在每次配置摄像头的图像输出模式之后的预设帧数后,电子设备再次确定是否切换摄像头的图像输出模式;或者,在每次配置摄像头的图像输出模式之后的预设时长后,电子设备再次确定是否切换摄像头的图像输出模式。其中,摄像头的图像输出模式包括全像素模式或像素合并模式。这样,相邻两次配置摄像头的图像输出模式之间,可以间隔预设帧数或预设时长,降低摄像 头的图像输出模式在像素合并模式与全像素模式之间进行切换的频次,以减轻切换过程中的电子设备显示的图像出现画面闪烁的问题。
在一种可能的实现方式中,在电子设备再次确定是否切换摄像头的图像输出模式之前,还包括:电子设备获取电子设备的运动状态;电子设备根据运动状态,确定预设帧数。其中,运动状态包括静止状态、第一移动状态和第二移动状态,第二移动状态的运动参数大于第一移动状态的运动参数,第一移动状态的运动参数大于静止状态的运动参数,运动参数包括加速度数据、角速度数据以及速度数据中的至少一者;静止状态对应的预设帧数为第一帧数,第一移动状态对应的预设帧数为第二帧数,第二移动状态对应的预设帧数为第三帧数,第一帧数、第二帧数和第三帧数中的至少两者不同。这样,根据不同运动状态所对应的场景,匹配不同的预设帧数,来增加摄像头的图像输出模式切换过程中的平顺性,进一步减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题,使得电子设备显示的图像更加稳定。
在一种可能的实现方式中,电子设备获取电子设备的运动状态,包括:在每次配置摄像头的图像输出模式之后,电子设备获取一次电子设备的运动状态。相应的,在每次配置摄像头的图像输出模式之后的预设帧数后,电子设备再次确定是否切换摄像头的图像输出模式,包括:在每次配置摄像头的图像输出模式之后的第一时刻,电子设备判断感光度是否满足预设条件,第一时刻与配置摄像头的图像输出模式的时刻之间的时间间隔,等于运动状态对应的预设帧数;在感光度满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。这样,可以减少获取电子设备的运动状态的次数,以降低电子设备的功耗。
在一种可能的实现方式中,电子设备获取电子设备的运动状态,包括:电子设备实时获取电子设备的运动状态。相应的,在每次配置摄像头的图像输出模式之后的预设帧数后,电子设备再次确定是否切换摄像头的图像输出模式,包括:在每次配置摄像头的图像输出模式之后的第二时刻,电子设备判断感光度是否满足预设条件,第二时刻为运动状态保持不变的帧数达到运动状态对应的预设帧数的时刻;在感光度满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。这样,可进一步减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题,使得电子设备显示的图像更加稳定。
在一种可能的实现方式中,电子设备获取电子设备的运动状态,包括:电子设备实时获取电子设备的运动状态。相应的,在每次配置摄像头的图像输出模式之后的预设帧数后,电子设备再次确定是否切换摄像头的图像输出模式,包括:在每次配置摄像头的图像输出模式之后,当目标帧数达到运动状态对应的预设帧数时,电子设备判断目标帧数内获取的感光度是否均满足预设条件,目标帧数为运动状态保持不变的帧数;在目标帧数内获取的感光度均满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在目标帧数内存在获取的感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。这样,进一步减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题,使得电子设备显示的图像更加稳定。
在一种可能的实现方式中,在摄像头的图像输出模式为全像素模式的情况下,当 感光度大于第一感光度阈值时,感光度满足预设条件,当感光度小于或等于第一感光度阈值时,感光度不满足预设条件。在摄像头的图像输出模式为像素合并模式的情况下,当感光度小于第二感光度阈值时,感光度满足预设条件,当感光度大于或等于第二感光度阈值时,感光度不满足预设条件。
在一种可能的实现方式中,第一预览界面还包括第一拍摄控件,第二预览界面还包括第二拍摄控件。在电子设备显示第一预览界面之后,还包括:电子设备响应于对第一拍摄控件的第一操作,保存第一图像。相应的,在电子设备显示第二预览界面之后,还包括:电子设备响应于对第二拍摄控件的第二操作,保存第二图像。其中,第二图像的尺寸大于第一图像的尺寸。这样,在相机应用的拍摄场景下,也可以根据摄像头当前的感光度,使得摄像头以对应的图像输出模式来输出对应的图像。
在一种可能的实现方式中,相机应用包括多种拍摄模式,多种拍摄模式中的至少部分的拍摄模式对应的第一感光度阈值不同,和/或,多种拍摄模式中的至少部分的拍摄模式对应的第二感光度阈值不同。这样,根据不同拍摄模式选取合适的第一感光度阈值和第二感光度阈值,以减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题。
在一种可能的实现方式中,摄像头包括图像传感器,图像传感器包括像素阵列,像素阵列包括多个像素集合,多个像素集合中的每个像素集合均包括多个像素单元,多个像素单元中的每个像素单元均包括多个像素;每个像素单元中的多个像素的颜色均相同,且多个像素单元中的至少部分的像素单元为不同颜色的像素单元。全像素模式下的像素阵列的排列方式,与像素合并模式下的像素阵列的排列方式相同。
在一种可能的实现方式中,像素合并模式包括四合一像素合并模式,四合一像素合并模式用于将相邻的四个同色像素合并为一个像素。
在一种可能的实现方式中,电子设备还包括相机硬件抽象模块和相机驱动。该方法还包括:相机硬件抽象模块配置摄像头的图像输出模式,摄像头的图像输出模式包括全像素模式或像素合并模式;相机硬件抽象模块向相机驱动发送摄像头的图像输出模式;相机驱动根据摄像头的图像输出模式,驱动摄像头以摄像头的图像输出模式输出采集到的图像。这样,通过相机硬件抽象模块配置摄像头的图像输出模式,使得摄像头以对应的图像输出模式输出采集到的图像,摄像头的图像输出模式的控制方式较为简单,易实现。
第二方面,本申请实施例提出一种电子设备,包括存储器和处理器,存储器用于存储计算机程序,处理器用于调用计算机程序,以执行上述的模式控制方法。
第三方面,本申请实施例提出一种计算机可读存储介质,计算机可读存储介质中存储有计算机程序或指令,当计算机程序或指令被运行时,实现上述的模式控制方法。
第四方面,本申请实施例提出一种计算机程序产品,包括计算机程序,当计算机程序被运行时,使得计算机执行上述的模式控制方法。
第二方面至第四方面各可能的实现方式,效果与第一方面以及第一方面的可能的设计中的效果类似,在此不再赘述。
附图说明
图1为本申请实施例提供的摄像头的结构示意图;
图2为本申请实施例提供的对图像传感器的四拜耳阵列进行像素合并的示意图;
图3为本申请实施例提供的对图像传感器的四拜耳阵列进行马赛克重排的示意图;
图4为本申请实施例提供的电子设备的硬件系统结构示意图;
图5为本申请实施例提供的电子设备的软件系统结构示意图;
图6为本申请实施例提供的一种应用场景的界面示意图;
图7为本申请实施例提供的一种模式控制方法的流程图;
图8为本申请实施例提供的一种模式控制方法的模块交互示意图;
图9为本申请实施例提供的根据电子设备的运动状态,切换摄像头的图像输出模式的流程图;
图10为本申请实施例提供的另一种模式控制方法的模块交互示意图;
图11为本申请实施例提供的在进行图像拍摄时的模块交互示意图;
图12为本申请实施例提供的一种模式控制装置的结构示意图;
图13为本申请实施例提供的一种芯片的结构示意图。
具体实施方式
为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。例如,第一芯片和第二芯片仅仅是为了区分不同的芯片,并不对其先后顺序进行限定。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其他实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。
目前,在一些电子设备中设置有摄像头,在用户使用电子设备的过程中,可采用电子设备中的摄像头进行拍照或者录像等。
如图1所示,摄像头可以包括沿光路方向排列的镜头10和图像传感器20,镜头10可以包括多个沿光轴方向层叠设置的光学镜片,图像传感器20也可以称为相机传感器(即camera sensor)。
其中,图像传感器20包括滤光片21和感光元件22,滤光片21位于镜头10与感光元件22之间。被摄物体反射的光线依次经过镜头10和滤光片21之后投射到感光元件22上,感光元件22将光信号转换为电信号以进行成像。
传统的图像传感器中的像素阵列采用红绿蓝三色像素交叉分布,而随着成像技术的发展,伴随着越来越多的高分辨率的摄像头的出现,出现了一种新的像素排列技术,该像素排列技术是将相邻的M个同色像素排列在一起,形成一个较原有像素面积大M 倍的像素,M为大于1的整数。例如,M可以等于4,其是将相邻的四个同色像素排列在一起,形成一个较原有像素面积大四倍的像素。
在一些电子设备中,其设置的摄像头可以采用四合一像素的图像传感器。以图像传感器20为四合一像素的图像传感器为例,如图2中的(a)和图3中的(a)所示,图像传感器20的像素阵列包括多个像素集合23,多个像素集合23中的每个像素集合23包括四个像素单元,其分别为第一像素单元231、第二像素单元232、第三像素单元233和第四像素单元234。其中,第一像素单元231包括四个红色(R)像素,第二像素单元232包括四个绿色(G)像素,第三像素单元233包括四个绿色(G)像素,第四像素单元234包括四个蓝色(B)像素。
可以看出,第一像素单元231中的像素的颜色,与第二像素单元232中的像素的颜色、第三像素单元233中的像素的颜色,以及第四像素单元234中的像素的颜色均不同,即第一像素单元231与第二像素单元232、第三像素单元233和第四像素单元234为不同颜色的像素单元。第二像素单元232中的像素的颜色,还与第四像素单元234中的像素的颜色不同,即第二像素单元232与第四像素单元234为不同颜色的像素单元。第三像素单元233中的像素的颜色,还与第四像素单元234中的像素的颜色不同,即第三像素单元233与第四像素单元234为不同颜色的像素单元。
在图像传感器20为四合一像素的图像传感器时,图像传感器20的像素阵列可以称为四拜耳(quad bayer)阵列。
可以理解的是,本申请实施例中的图像传感器的像素阵列,除了采用如图2中的(a)和图3中的(a)所示的四拜耳阵列之外,还可以采用九拜耳阵列或十六拜耳阵列等,本申请实施例对图像传感器的像素阵列的具体形式不进行限定。
在图像传感器的像素阵列为九拜耳阵列时,图像传感器的像素阵列包括多个像素集合,每个像素集合包括四个像素单元,每个像素单元可以包括九个颜色相同的像素,且这四个像素单元中的至少部分的像素单元为不同颜色的像素单元。在图像传感器的像素阵列为十六拜耳阵列时,图像传感器的像素阵列包括多个像素集合,每个像素集合包括四个像素单元,每个像素单元可以包括十六个颜色相同的像素,且这四个像素单元中的至少部分的像素单元为不同颜色的像素单元。
因此,在本申请实施例中,摄像头包括图像传感器,图像传感器包括像素阵列,图像传感器的像素阵列包括多个像素集合,多个像素集合中的每个像素集合均包括多个像素单元,多个像素单元中的每个像素单元均包括多个像素。其中,每个像素单元中的多个像素的颜色均相同,且多个像素单元中的至少部分的像素单元为不同颜色的像素单元。
可以理解的是,滤光片21可以包括滤光单阵列,滤光单元阵列可以包括多个滤光单元集合,多个滤光单元集合中的每个滤光单元集合可以包括多个滤光单元,每个滤光单元允许透过的光线的颜色相同。感光元件22可以包括感光单元阵列,感光单元阵列可以包括多个感光单元集合,多个感光单元集合中的每个感光单元集合可以包括多个感光单元,多个感光单元中的每个感光单元均包括多个感光像素。并且,滤光片21中的每个滤光单元与感光元件22中的每个感光单元一一对应,每个感光单元中的多个感光像素均用于接收经过其对应的滤光单元过滤后的光线。这样,使得滤光单元阵列和该滤光单元阵列所覆盖的感光单元阵列,共同构成图像传感器20的像素阵列。因此, 图像传感器20中的每个像素单元实际上可以包括滤光单元和该滤光单元所覆盖的感光单元。
以图像传感器20为四合一像素的图像传感器为例,滤光片21中的每个滤光单元集合可以包括四个滤光单元,其分别为第一滤光单元、第二滤光单元、第三滤光单元和第四滤光单元,第一滤光单元允许透过的光线的颜色为红色,第二滤光单元允许透过的光线的颜色为绿色,第三滤光单元允许透过的光线的颜色为绿色,第四滤光单元允许透过的光线的颜色为蓝色;而感光元件22中的每个感光单元集合可以包括四个感光单元,其分别为第一感光单元、第二感光单元、第三感光单元和第四感光单元,且这四个感光单元中的每个感光单元均包括四个感光像素。第一滤光单元与第一感光单元相对应,且第一滤光单元与其覆盖的第一感光单元共同构成第一像素单元231;第二滤光单元与第二感光单元相对应,且第二滤光单元与其覆盖的第二感光单元共同构成第二像素单元232;第三滤光单元与第三感光单元相对应,且第三滤光单元与其覆盖的第三感光单元共同构成第三像素单元233;第四滤光单元与第四感光单元相对应,且第四滤光单元与其覆盖的第四感光单元共同构成第四像素单元234。
在一种相关技术中,在不同的环境亮度下,用户在采用摄像头进行图像采集时,摄像头均采用像素合并模式(即binning模式)输出其采集到的图像。
当摄像头处于像素合并模式时,可以通过像素合并的方式将相邻的多个同色像素合并为一个像素,也就是将每个像素单元中的多个像素合并为一个像素,每个像素单元中的多个像素的颜色均相同。
以电子设备中的摄像头采用四合一像素的图像传感器为例,如图2中的(b)所示,当摄像头处于像素合并模式时,其是将每个像素单元中的四个颜色相同的像素合并为一个像素。具体的,是将第一像素单元231中的四个红色像素合并为一个红色像素,将第二像素单元232中的四个绿色像素合并为一个绿色像素,将第三像素单元233中的四个绿色像素合并为一个绿色像素,以及将第四像素单元234中的四个蓝色像素合并为一个蓝色像素。
因此,在低亮度环境下,摄像头在采用像素合并模式输出其采集到的图像时,通过将相邻的多个同色像素合并为一个像素,可提高单像素的感光面积,降低图像的噪点,提高图像的清晰度和画面亮度,进而提升图像质量。但是,在高亮度环境下,摄像头在采用像素合并模式输出其采集到的图像时,摄像头输出的图像包括的像素数量为图像传感器包括的像素数量的1/M倍,即摄像头输出的图像包括的像素数量减少,使得图像的分辨率降低,则图像的清晰度降低,进而降低图像质量。
在另一种相关技术中,在不同的环境亮度下,用户在采用摄像头进行图像采集时,摄像头均采用全像素模式(即full size模式)输出其采集到的图像。全像素模式也可以为称为全尺寸模式。
当摄像头处于全像素模式时,可以采用马赛克重排方式(即remosaic方式)将图像传感器采集的图像中的像素重排为拜耳(bayer)阵列。当摄像头输出的图像中的像素为拜耳阵列时,该图像中的每个像素仅对应一种颜色的通道信号,且相邻像素的颜色可以不同。
在一些实施例中,拜耳阵列可以为RGGB阵列。由于人的视觉对绿色较为敏感,因此,在拜耳阵列中,可以设定绿色像素占全部像素的50%,红色像素占全部像素的 25%,蓝色像素占全部像素的25%,即拜耳阵列中的每个像素单元中,可以包括一个红色像素、两个绿色像素和一个蓝色像素,且这一个红色像素、两个绿色像素和一个蓝色像素以2×2的方式排布。
以电子设备中的摄像头采用四合一像素的图像传感器为例,如图3中的(b)所示,当摄像头处于全像素模式时,其是将图像传感器20采集的四拜耳阵列的图像,转换为拜耳阵列的图像。具体的,是将第一像素单元231中的四个红色像素分别重排为红色像素、绿色像素、绿色像素和蓝色像素,将第二像素单元232中的四个绿色像素分别重排为红色像素、绿色像素、绿色像素和蓝色像素,将第三像素单元233中的四个绿色像素分别重排为红色像素、绿色像素、绿色像素和蓝色像素,以及将第四像素单元234中的四个蓝色像素分别重排为红色像素、绿色像素、绿色像素和蓝色像素。
因此,在高亮度环境下,摄像头在采用全像素模式输出其采集到的图像时,通过将像素重排为拜耳阵列,使得摄像头输出的图像包括的像素数量与图像传感器包括的像素数量相等,即摄像头输出的图像包括的像素数量较多,可提高图像的分辨率,使得图像的清晰度较高,进而提高图像质量。但是,在低亮度环境下,摄像头在采用全像素模式输出其采集到的图像时,单像素的感光面积较小,图像的噪点多,使得图像的清晰度降低,进而降低图像质量。
综上,可以看出,在不同的环境亮度下,若摄像头一直采用像素合并模式或全像素模式,会导致摄像头输出的图像存在清晰度差的问题,进而影响图像质量。
基于此,本申请实施例提供了一种模式控制方法,通过在启动相机应用的情况下,获取摄像头的感光度;在感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,显示第一预览界面,第一预览界面包括第一图像,第一图像为摄像头在像素合并模式下输出的图像;在感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,显示第二预览界面,第二预览界面包括第二图像,第二图像为摄像头在全像素模式下输出的图像。其中,第一感光度阈值与第二感光度阈值不相等。
摄像头的感光度(light sensibility ordinance,ISO)用于衡量摄像头对光线的敏感程度。本申请实施例可以采用摄像头的感光度,来判断摄像头在进行图像采集时所处环境的环境亮度。具体的,当环境亮度越低时,摄像头的感光度越高,摄像头对光线越敏感,其感应到的光线越多;当环境亮度越高时,摄像头的感光度越低,摄像头对光线越不敏感,其感应到的光线越少。
因此,本申请实施例在感光度大于第一感光度阈值时,说明摄像头此时处于低亮度环境下,则摄像头采用像素合并模式输出其采集到的图像,通过将相邻的多个同色像素合并为一个像素,可提高单像素的感光面积,降低图像的噪点,提高图像的清晰度和画面亮度,进而提升图像质量。并且,在感光度小于第二感光度阈值时,说明摄像头此时处于高亮度环境下,则摄像头采用全像素模式输出其采集到的图像,通过将像素重排为拜耳阵列,使得摄像头输出的图像包括的像素数量与图像传感器包括的像素数量相等,即摄像头输出的图像包括的像素数量较多,可提高图像的分辨率,使得图像的清晰度较高,进而提高图像质量。
综上,本申请实施例根据环境亮度的不同,调节摄像头的图像输出模式。在高亮度环境下,调节摄像头的图像输出模式为全像素模式,在低亮度环境下,调节摄像头 的图像输出模式为像素合并模式,从而提高不同的环境亮度下摄像头输出的图像的清晰度,进而提高图像质量。摄像头的图像输出模式也可以称为摄像头的图像输出规格。
本申请实施例提供的模式控制方法,可以应用在具备摄像头的电子设备中。电子设备包括终端设备,终端设备也可以称为终端(terminal)、用户设备(user equipment,UE)、移动台(mobile station,MS)、移动终端(mobile terminal,MT)等。电子设备可以是手机(mobile phone)、智能电视、穿戴式设备、平板电脑(Pad)、带无线收发功能的电脑、虚拟现实(virtual reality,VR)电子设备、增强现实(augmented reality,AR)电子设备、工业控制(industrial control)中的无线终端、无人驾驶(self-driving)中的无线终端、远程手术(remote medical surgery)中的无线终端、智能电网(smart grid)中的无线终端、运输安全(transportation safety)中的无线终端、智慧城市(smart city)中的无线终端、智慧家庭(smart home)中的无线终端等等。本申请的实施例对电子设备所采用的具体技术和具体设备形态不做限定。
为了能够更好地理解本申请实施例,下面对本申请实施例的电子设备的结构进行介绍。
图4示出了电子设备400的结构示意图。电子设备400可以包括处理器410,外部存储器接口420,内部存储器421,通用串行总线(universal serial bus,USB)接口430,充电管理模块440,电源管理模块441,电池442,天线1,天线2,移动通信模块450,无线通信模块460,音频模块470,扬声器470A,受话器470B,麦克风470C,耳机接口470D,传感器模块480,按键490,马达491,指示器492,摄像头493,显示屏494,以及用户标识模块(subscriber identification module,SIM)卡接口495等。其中,传感器模块480可以包括运动传感器480A。
可以理解的是,本申请实施例示意的结构并不构成对电子设备400的具体限定。在本申请另一些实施例中,电子设备400可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
处理器410可以包括一个或多个处理单元,例如:处理器410可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器410中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器410中的存储器为高速缓冲存储器。该存储器可以保存处理器410刚用过或循环使用的指令或数据。如果处理器410需要再次使用该指令或数据,可从存储器中调用。避免了重复存取,减少了处理器410的等待时间,因而提高了系统的效率。
充电管理模块440用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块440可以通过USB接口430接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块440 可以通过电子设备400的无线充电线圈接收无线充电输入。充电管理模块440为电池442充电的同时,还可以通过电源管理模块441为电子设备供电。
电源管理模块441用于连接电池442,充电管理模块440与处理器410。电源管理模块441接收电池442和/或充电管理模块440的输入,为处理器410,内部存储器421,显示屏494,摄像头493,和无线通信模块460等供电。电源管理模块441还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块441也可以设置于处理器410中。在另一些实施例中,电源管理模块441和充电管理模块440也可以设置于同一个器件中。
电子设备400的无线通信功能可以通过天线1,天线2,移动通信模块450,无线通信模块460,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。移动通信模块450可以提供应用在电子设备400上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块450可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。在一些实施例中,移动通信模块450的至少部分功能模块可以与处理器410的至少部分模块被设置在同一个器件中。
无线通信模块460可以提供应用在电子设备400上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块460可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块460经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器410。无线通信模块460还可以从处理器410接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在一些实施例中,电子设备400的天线1和移动通信模块450耦合,天线2和无线通信模块460耦合,使得电子设备400可以通过无线通信技术与网络以及其他设备通信。
电子设备400通过GPU,显示屏494,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏494和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器410可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏494用于显示图像、显示视频和接收滑动操作等。显示屏494包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备400可以包括1个或N个显示屏494,N为大于1的正整数。
电子设备400可以通过ISP,摄像头493,视频编解码器,GPU,显示屏494以及应用处理器等实现拍摄功能。
ISP用于处理摄像头493反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头493中。
摄像头493用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备400可以包括1个或N个摄像头493,N为大于1的正整数。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备400在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备400可以支持一种或多种视频编解码器。这样,电子设备400可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备400的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口420可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备400的存储能力。外部存储卡通过外部存储器接口420与处理器410通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器421可以用于存储计算机可执行程序代码,可执行程序代码包括指令。内部存储器421可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备400使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器421可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器410通过运行存储在内部存储器421的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备400的各种功能应用以及数据处理。
电子设备400可以通过音频模块470,扬声器470A,受话器470B,麦克风470C,耳机接口470D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
其中,运动传感器480A可以包括加速度传感器、陀螺仪传感器以及速度传感器中的至少一者。
加速度传感器可检测电子设备400在各个方向上(一般为三轴)加速度的大小,从而可以监测电子设备400的运动状态。当电子设备400静止时可检测出重力的大小 及方向。加速度传感器还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用程序。
陀螺仪传感器可以用于确定电子设备400的运动姿态。在一些实施例中,可以通过陀螺仪传感器确定电子设备400围绕三个轴(即,x、y和z轴)的角速度,从而可以监测电子设备400的运动状态。陀螺仪传感器可以用于拍摄防抖。示例性的,当按下快门,陀螺仪传感器检测电子设备400抖动的角度,根据角度计算出镜头模组需要补偿的距离,让镜头通过反向运动抵消电子设备400的抖动,实现防抖。陀螺仪传感器还可以用于导航,体感游戏场景。
速度传感器可以用于检测电子设备400在各个方向上(一般为三轴)速度的大小,从而可以监测电子设备400的运动状态。
按键490包括开机键,音量键等。按键490可以是机械按键。也可以是触摸式按键。电子设备400可以接收按键输入,产生与电子设备400的用户设置以及功能控制有关的键信号输入。
马达491可以产生振动提示。马达491可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用程序(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏494不同区域的触摸操作,马达491也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。
指示器492可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。
SIM卡接口495用于连接SIM卡。SIM卡可以通过插入SIM卡接口495,或从SIM卡接口495拔出,实现和电子设备400的接触和分离。电子设备400可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口495可以支持Nano SIM卡,Micro SIM卡,SIM卡等。同一个SIM卡接口495可以同时插入多张卡。多张卡的类型可以相同,也可以不同。SIM卡接口495也可以兼容不同类型的SIM卡。SIM卡接口495也可以兼容外部存储卡。电子设备400通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备400采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备400中,不能和电子设备400分离。
电子设备400的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构,等。本申请实施例以分层架构的Android系统为例,示例性说明电子设备400的软件结构。
图5是本申请实施例的电子设备400的软件结构框图。分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用层,应用程序框架层,安卓运行时(Android runtime)和系统库,硬件抽象层以及内核层。
应用层可以包括一系列应用程序包。如图5所示,应用程序包可以包括相机、设置以及日历等应用程序。
其中,相机应用为具有拍摄和录像的功能的应用,电子设备可以响应于用户打开相机应用的操作,以进行拍照或录像。可以理解的是,相机应用的拍照和录像功能也可以被其他应用调用。
应用程序框架层为应用层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
其中,如图5所示,应用程序框架层还可以包括相机服务(camera service),相机服务可以供相机应用调用,从而实现拍照或录像等功能。
在一些实施例中,应用程序框架层可以包括相机访问接口和Java本地接口(java native interface,JNI)。相机访问接口可以用于提供访问相机的接口,JNI接口提供了若干的API实现了Java与其他语言的通信。
整个相机服务在运行时,其可以大致分为client(客户端)进程和server(服务端)进程两部分,两者之间使用binder机制实现进程间的通讯。binder机制是一种进程间通信(inter-process communication,IPC)机制,client进程指的是发起进程请求的一方,server进程指的是被请求执行相机服务的进程。
此外,如图5所示,应用程序框架层还可以包括窗口管理器、内容提供器、资源管理器和视图系统等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用层和应用程序框架层运行在虚拟机中。虚拟机将应用层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG2,H.262,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染、合成和图层处理等。二维图形引擎是2D绘图的绘图引擎。
硬件抽象层是介于内核层和Android runtime之间的抽象出来的一层结构。硬件抽 象层可以是对内核层的硬件驱动的一个封装,为应用程序框架层提供调用接口。
在本申请实施例中,硬件抽象层可以包括相机硬件抽象模块(camera hardware abstraction layer,camera HAL)。在一些实施例中,相机硬件抽象模块用于根据摄像头的感光度,配置摄像头的图像输出模式。在另一些实施例中,相机硬件抽象模块用于根据摄像头的感光度和电子设备的运动状态,配置摄像头的图像输出模式。
内核层是硬件和软件之间的层。内核层至少包含相机驱动、传感器驱动和显示驱动等。在一些实施例中,相机驱动用于控制摄像头运行,传感器驱动用于控制运动传感器运行,显示驱动用于控制显示屏显示图像。
硬件可以是摄像头、运动传感器以及显示屏等。在本申请实施例中,摄像头可以是前置摄像头,也可以是后置摄像头。
需要说明的是,本申请实施例虽然以Android系统进行说明,但是模式控制方法的原理同样适用于iOS或windows等操作系统的电子设备。
下面以具体的实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以独立实现,也可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。
为了便于理解,本申请实施例以手机作为电子设备,首先结合本申请实施例示出的一些用户界面,来说明模式控制方法的应用场景。
用户在点亮电子设备的屏幕且控制电子设备处于解锁状态时,电子设备可显示如图6中的(a)所示的第一界面601。其中,第一界面601可以为电子设备的桌面,在电子设备的桌面上显示有安装的多个应用程序的图标,如文件管理应用图标、电子邮件应用图标、天气应用图标、计算器应用图标、时钟应用图标、录音机应用图标、音乐应用图标、设置应用图标、通讯录应用图标、电话应用图标、信息应用图标以及相机应用图标6011等。
用户可以对相机应用图标6011进行触控操作,该触控操作可以是点击操作、长按操作等,使得电子设备接收到用户对相机应用图标6011的触控操作,电子设备响应于该触控操作,启动相机应用。
在相机应用启动之后,电子设备可以显示如图6中的(b)所示的第二界面602。其中,第二界面602可以为相机应用所提供的用于实现拍摄功能的预览界面,其包括预览框6021、拍摄控件6022以及多种拍摄模式所对应的功能控件等。
预览框6021用于实时显示摄像头输出的图像。拍摄控件6022用于触发电子设备的拍摄操作。多种拍摄模式所对应的功能控件可以包括夜景模式控件、人像模式控件、拍照模式控件、录像模式控件、专业模式控件以及用于开启相机应用中的更多功能的更多控件等。
因此,本申请实施例可以通过对相机应用图标6011进行触控操作,以启动相机应用。在相机应用启动之后,并在相机应用的预览界面实时显示摄像头输出的图像的过程中,电子设备可以执行本申请实施例提供的模式控制方法对应的流程。
可以理解的是,图6中的(a)和图6中的(b)所示的界面,仅作为电子设备通过对相机应用图标进行触控操作,来启动相机应用过程中的用户界面的一种示例,并不能构成对本申请实施例的限定。
在另一种场景中,用户还可以通过电子设备上安装的第三方应用调用相应的接口, 访问电子设备的相机应用,以启动相机应用。在相机应用启动之后,并在相机应用的预览界面实时显示摄像头输出的图像的过程中,电子设备可以执行本申请实施例提供的模式控制方法对应的流程。
再一种场景中,当相机应用从后台运行切换为前台运行时,可启动相机应用。在相机应用启动之后,并在相机应用的预览界面实时显示摄像头输出的图像的过程中,电子设备可以执行本申请实施例提供的模式控制方法对应的流程。
其中,相机应用在前台运行指的是电子设备当前的屏幕显示并运行该相机应用;相机应用在后台运行指的是在系统后台运行该相机应用,此时,电子设备没有显示该相机应用对应的界面。
需要说明的是,当相机应用从前台运行切换为后台运行时,可以无需执行本申请实施例提供的模式控制方法对应的流程。
下面详细说明本申请实施例中的电子设备对摄像头的图像输出模式进行控制的具体实现方式。
示例性的,图7为本申请实施例提供的一种模式控制方法的流程图,其可以应用于电子设备中,电子设备可以包括相机应用和摄像头。参照图7所示,该模式控制方法具体可以包括如下步骤:
S701,电子设备启动相机应用,并配置摄像头的图像输出模式为全像素模式。
当用户想要启动相机应用时,用户可以点击如图6中的(a)所示的相机应用图标6011,使得电子设备可以接收到用户对相机应用图标6011的触控操作,电子设备响应于该触控操作,启动相机应用,并在相机应用启动之后显示第二界面602。
可以理解的是,启动相机应用的操作方式有多种,除了上述对相机应用图标6011进行触控操作以启动相机应用之外,还可以通过语音触发或滑动触发等操作方式,以启动相机应用。例如,当电子设备处于锁屏状态下,用户可以在电子设备的锁屏界面朝向某个方向滑动,如向上滑动等,以启动相机应用。本申请实施例对启动相机应用的具体操作方式不进行限定。
电子设备在启动相机应用后的初始状态下,电子设备默认配置摄像头的图像输出模式为全像素模式。也就是说,在按照本申请实施例提供的基于摄像头的感光度,配置摄像头的输出模式之前,摄像头的图像输出模式默认为全像素模式。
其中,全像素模式用于采用马赛克重排方式将像素重排为拜耳阵列。马赛克重排方式可以参照上述图3对应的描述,在此不再赘述。
S702,在摄像头的图像输出模式为全像素模式的情况下,电子设备判断摄像头的感光度是否大于第一感光度阈值。
电子设备在启动相机应用后,电子设备会实时获取摄像头的感光度,以基于摄像头的感光度衡量摄像头当前所处环境的环境亮度。
由于电子设备在启动相机应用后的初始状态下,摄像头的图像输出模式默认为全像素模式,因此,在摄像头的图像输出模式为全像素模式的情况下,电子设备可以将摄像头的感光度与第一感光度阈值进行比较,以判断摄像头的感光度是否大于第一感光度阈值。
在摄像头的感光度大于第一感光度阈值的情况下,电子设备依次执行下面的S703和S704;而当摄像头的感光度小于或等于第一感光度阈值的情况下,电子设备依次执 行下面的S705和S706。
S703,在感光度大于第一感光度阈值的情况下,电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。
在电子设备判断出摄像头的感光度大于第一感光度阈值的情况下,说明摄像头当前所处环境为低亮度环境,即摄像头当前所处环境的环境亮度偏暗,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。
其中,像素合并模式用于将相邻的多个同色像素合并为一个像素。像素合并模式的具体实现方式可以参照上述图2对应的描述,在此不再赘述。
可以理解的是,第一感光度阈值可根据实际情况进行设定。例如,第一感光度阈值可以为1400,在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度大于1400时,电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。
S704,电子设备获取摄像头在像素合并模式下输出的第一图像,并在第一预览界面显示第一图像。
电子设备在将摄像头的图像输出模式从全像素模式切换为像素合并模式之后,摄像头可以采用像素合并模式下输出其采集到的第一图像,则电子设备可以在第一预览界面中,显示摄像头在像素合并模式下输出的第一图像。
本申请实施例在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度大于第一感光度阈值时,电子设备可以将摄像头的图像输出模式从全像素模式切换为像素合并模式,则摄像头采用像素合并模式输出其采集到的第一图像。通过将相邻的多个同色像素合并为一个像素,可提高第一图像中单像素的感光面积,降低第一图像的噪点,提高第一图像的清晰度和画面亮度,进而提升第一图像的图像质量。
因此,按照上述的S702至S704,在摄像头的感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第一预览界面;第一预览界面包括第一图像,第一图像为摄像头在像素合并模式下输出的图像。
电子设备在执行上述S704之后,电子设备可以继续执行下面的S707及之后的步骤。
S705,在感光度小于或等于第一感光度阈值的情况下,电子设备控制摄像头的图像输出模式继续保持在全像素模式。
在电子设备判断出摄像头的感光度小于或等于第一感光度阈值的情况下,说明摄像头当前所处环境为高亮度环境,即摄像头当前所处环境的环境亮度充足,此时摄像头的感光度未达到从全像素模式切换为像素合并模式时的切换条件,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
也就是说,在摄像头的图像输出模式为全像素模式的情况下,当电子设备判断出摄像头的感光度小于或等于第一感光度阈值时,电子设备没有将摄像头的图像输出模式从全像素模式切换为像素合并模式。
例如,第一感光度阈值可以为1400,在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度小于或等于1400时,电子设备控制摄像头的图像输出模式继续保持在全像素模式。
S706,电子设备获取摄像头在全像素模式下输出的第三图像,并在第三预览界面显示第三图像。
电子设备在控制摄像头的图像输出模式继续保持在全像素模式之后,摄像头可以采用全像素模式输出其采集到的第三图像,则电子设备可以在第三预览界面中,显示摄像头在全像素模式下输出的第三图像。
本申请实施例在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度小于或等于第一感光度阈值时,电子设备可以控制摄像头的图像输出模式继续保持在全像素模式,则摄像头采用全像素模式输出其采集到的第三图像。通过将像素重排为拜耳阵列,使得摄像头输出的第三图像包括的像素数量与图像传感器包括的像素数量相等,可提高第三图像的分辨率,使得第三图像的清晰度较高,进而提高第三图像的图像质量。
因此,按照上述的S702、S705和S706,在摄像头的感光度小于或等于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,电子设备显示第三预览界面;第三预览界面包括第三图像,第三图像为摄像头在全像素模式下输出的图像。
电子设备在执行上述S706之后,电子设备可以继续执行上述的S702及之后的步骤。
S707,在摄像头的图像输出模式为像素合并模式的情况下,电子设备判断摄像头的感光度是否小于第二感光度阈值。
电子设备在执行上述S704之后,此时摄像头的图像输出模式已经从全像素模式切换为像素合并模式。因此,在摄像头的图像输出模式为像素合并模式的情况下,电子设备可以将摄像头的感光度与第二感光度阈值进行比较,以判断摄像头的感光度是否小于第二感光度阈值。
在摄像头的感光度小于第二感光度阈值的情况下,电子设备依次执行下面的S708和S709;而当摄像头的感光度大于或等于第二感光度阈值的情况下,电子设备依次执行下面的S710和S711。
S708,在感光度小于第二感光度阈值的情况下,电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。
在电子设备判断出摄像头的感光度小于第二感光度阈值的情况下,说明摄像头当前所处环境为高亮度环境,即摄像头当前所处环境的环境亮度充足,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。
可以理解的是,第二感光度阈值可根据实际情况进行设定。例如,第二感光度阈值可以为550,在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度小于550时,电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。
在本申请实施例中,第一感光度阈值与第二感光度阈值不相等。
通过将第一感光度阈值和第二感光度阈值设置成不相等,可以使得从全像素模式切换为像素合并模式时的判断条件,与从像素合并模式切换为全像素模式时的判断条件不同,减轻摄像头在全像素模式与像素合并模式之间进行乒乓切换的情况,进而减轻摄像头的图像输出模式的切换过程中,导致的电子设备显示的图像出现画面闪烁的问题。
S709,电子设备获取摄像头在全像素模式下输出的第二图像,并在第二预览界面显示第二图像。
电子设备在将摄像头的图像输出模式从像素合并模式切换为全像素模式之后,摄 像头可以采用全像素模式输出其采集到的第二图像,则电子设备可以在第二预览界面中,显示摄像头在全像素模式下输出的第二图像。
本申请实施例在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度小于第二感光度阈值时,电子设备可以将摄像头的图像输出模式从像素合并模式切换为全像素模式,则摄像头采用全像素模式输出其采集到的第二图像。通过将像素重排为拜耳阵列,使得摄像头输出的第二图像包括的像素数量与图像传感器包括的像素数量相等,可提高第二图像的分辨率,使得第二图像的清晰度较高,进而提高第二图像的图像质量。
因此,按照上述的S707至S709,在摄像头的感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第二预览界面;第二预览界面包括第二图像,第二图像为摄像头在全像素模式下输出的图像。
电子设备在执行上述S709之后,电子设备可以继续执行上述的S702及之后的步骤。
S710,在感光度大于或等于第二感光度阈值的情况下,电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
在电子设备判断出摄像头的感光度大于或等于第二感光度阈值的情况下,说明摄像头当前所处环境为低亮度环境,即摄像头当前所处环境的环境亮度偏暗,此时摄像头的感光度未达到从像素合并模式切换为全像素模式时的切换条件,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
也就是说,在摄像头的图像输出模式为像素合并模式的情况下,当电子设备判断出摄像头的感光度大于或等于第二感光度阈值时,电子设备没有将摄像头的图像输出模式从像素合并模式切换为全像素模式。
例如,第二感光度阈值可以为550,在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度大于或等于550时,电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
S711,电子设备获取摄像头在像素合并模式下输出的第四图像,并在第四预览界面显示第四图像。
电子设备在控制摄像头的图像输出模式继续保持在像素合并模式之后,摄像头可以采用像素合并模式输出其采集到的第四图像,则电子设备可以在第四预览界面中,显示摄像头在像素合并模式下输出的第四图像。
本申请实施例在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度大于或等于第二感光度阈值时,电子设备可以控制摄像头的图像输出模式继续保持在像素合并模式,则摄像头采用像素合并模式输出其采集到的第四图像。通过将相邻的多个同色像素合并为一个像素,可提高第四图像中单像素的感光面积,降低第四图像的噪点,提高第四图像的清晰度和画面亮度,进而提升第四图像的图像质量。
因此,按照上述的S707、S710和S711,在感光度大于或等于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,电子设备显示第四预览界面;第四预览界面包括第四图像,第四图像为摄像头在像素合并模式下输出的图像。
电子设备在执行上述S711之后,电子设备可以继续执行上述的S707及之后的步骤。
在本申请实施例中,全像素模式下的像素阵列的排列方式,与像素合并模式下的像素阵列的排列方式相同。
由于图像传感器的像素阵列,是由滤光单元阵列和该滤光单元阵列所覆盖的感光单元阵列构成,且图像传感器的像素阵列中的每个像素单元接收到的光线的颜色,是由滤光单元阵列中的滤光单元允许透过的光线的颜色决定的。因此,全像素模式下图像传感器的像素阵列,与像素合并模式下图像传感器的像素阵列的排列方式相同,也就指的是,全像素模式下的滤光单元阵列,与像素合并模式下的滤光单元阵列的排列方式相同。
在摄像头的图像输出模式为像素合并模式的情况下,摄像头在输出其采集到的图像时,是将图像传感器的像素阵列中相邻像素感应到的电信号加在一起,以一个像素的模式输出,其并未改变图像传感器的像素阵列的排列方式。
具体的,摄像头在处于像素合并模式时,其对应的像素合并的方式包括水平方向上的合并和垂直方向上的合并。水平方向上的合并是将相邻行的像素感应到的电信号加在一起,而垂直方向上的合并是将相邻列的像素感应到的电信号加在一起。
在摄像头的图像输出模式为全像素模式的情况下,摄像头在输出其采集到的图像时,可以通过软件或硬件实现的马赛克重排方式,将图像传感器采集的图像中的像素重排为拜耳阵列,其并未改变图像传感器的像素阵列的排列方式。
例如,马赛克重排方式的具体实现方式可以为:将图像传感器采集的图像中的像素进行互换,或者,根据某一像素与其周围的相关像素之间的距离计算出权重比例,基于权重比例与相关像素的像素值计算得到该像素的像素值。
在一些实施例中,像素合并模式包括四合一像素合并模式,四合一像素合并模式用于将相邻的四个同色像素合并为一个像素。
图像传感器20的像素阵列可以采用如图2中的(a)和图3中的(a)所示的四拜耳阵列,则在将摄像头的图像输出模式配置为像素合并模式时,该像素合并模式可以为四合一像素合并模式,四合一像素合并模式用于将相邻的四个同色像素合并为一个像素。
可以理解的是,本申请实施例中的图像传感器的像素阵列,除了采用如图2中的(a)和图3中的(a)所示的四拜耳阵列之外,还可以采用九拜耳阵列、十六拜耳阵列等。当图像传感器的像素阵列采用九拜耳阵列时,像素合并模式包括九合一像素合并模式,九合一像素合并模式用于将相邻的九个同色像素合并为一个像素。当图像传感器的像素阵列采用十六拜耳阵列列时,像素合并模式包括十六合一像素合并模式,十六合一像素合并模式用于将相邻的十六个同色像素合并为一个像素。
在一些实施例中,第一感光度阈值大于第二感光度阈值。
通过将第一感光度阈值设置成大于第二感光度阈值,使得在摄像头的感光度足够大时,摄像头才采用像素合并模式输出其采集到的图像,以提高图像的清晰度和画面亮度,并在摄像头的感光度足够小时,摄像头才采用全像素模式输出其采集到的图像,以提高图像的分辨率,进而提高图像的清晰度。这样,在提高图像质量的前提下,可减轻摄像头在全像素模式与像素合并模式之间进行乒乓切换的情况,进而减轻摄像头的图像输出模式的切换过程中,导致的电子设备显示的图像出现画面闪烁的问题。
需要说明的是,上述对摄像头的图像输出模式进行控制的方法中,摄像头可以是 前置摄像头,也可以是后置摄像头,本申请实施例对此不进行限定。
为了方便理解,下面结合图8对本申请实施例提供的模式控制方法中,所涉及的各个模块之间的交互过程进行说明。该模式控制方法中,是根据摄像头的感光度来判断是否切换摄像头的图像输出模式的。
如图8所示,电子设备可以包括相机应用、相机服务、相机硬件抽象模块、相机驱动和摄像头。参照图8所示,该模式控制方法具体可以包括如下步骤:
S801,相机应用接收用户对相机应用图标的触控操作。
S802,响应于对相机应用图标的触控操作,相机应用向相机服务发送图像预览请求。
S803,相机服务向相机硬件抽象模块发送图像预览请求。
S804,相机硬件抽象模块向相机驱动发送图像预览请求。
S805,相机驱动向摄像头发送图像预览请求。
示例性的,在电子设备的桌面上可显示有相机应用图标,当用户想要使用相机应用时,用户可以对相机应用图标进行触控操作,如点击操作等,则相机应用可以接收到用户对相机应用图标的触控操作。
相机应用响应于对相机应用图标的触控操作,启动相机应用,并在电子设备上开始运行相机应用。在相机应用启动之后,相机应用可以通过调用应用程序框架层中的相机访问接口,向相机服务发送图像预览请求。图像预览请求用于请求获取摄像头采集的预览图像。
相机服务在接收到图像预览请求之后,相机服务通过相机硬件抽象模块和相机驱动,将图像预览请求发送给摄像头。
S806,在摄像头接收到图像预览请求的情况下,摄像头向相机驱动发送摄像头的感光度。
S807,相机驱动向相机硬件抽象模块发送摄像头的感光度。
在摄像头接收到图像预览请求的情况下,摄像头可以实时采集摄像头的感光度,并将摄像头的感光度发送给相机驱动,相机驱动再将摄像头的感光度发送给相机硬件抽象模块。
S808,相机硬件抽象模块根据摄像头的感光度,配置摄像头的图像输出模式;摄像头的图像输出模式包括全像素模式或像素合并模式。
相机硬件抽象模块在接收到摄像头的感光度之后,相机硬件抽象模块根据摄像头的感光度配置摄像头的图像输出模式。
具体的,在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度大于第一感光度阈值时,相机硬件抽象模块确定摄像头的图像输出模式需要从全像素模式切换为像素合并模式,这种情况下,相机硬件抽象模块配置摄像头的图像输出模式为像素合并模式。
在摄像头的图像输出模式为全像素模式的情况下,当摄像头的感光度小于或等于第一感光度阈值时,相机硬件抽象模块确定摄像头的图像输出模式继续保持在全像素模式,这种情况下,相机硬件抽象模块配置摄像头的图像输出模式为全像素模式。
在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度小于第二感光度阈值时,相机硬件抽象模块确定摄像头的图像输出模式需要从像素合并模式切 换为全像素模式,这种情况下,相机硬件抽象模块配置摄像头的图像输出模式为全像素模式。
在摄像头的图像输出模式为像素合并模式的情况下,当摄像头的感光度大于或等于第二感光度阈值时,相机硬件抽象模块确定摄像头的图像输出模式继续保持在像素合并模式,这种情况下,相机硬件抽象模块配置摄像头的图像输出模式为像素合并模式。
相机硬件抽象模块根据摄像头的感光度,配置摄像头的图像输出模式的具体实现方式,可参照上述图7对应的描述,在此不再赘述。
S809,相机硬件抽象模块向相机驱动发送摄像头的图像输出模式。
S810,相机驱动向摄像头发送摄像头的图像输出模式。
S811,摄像头根据摄像头的图像输出模式,输出其采集到的预览图像。
相机硬件抽象模块在根据摄像头的感光度,配置摄像头的图像输出模式之后,相机硬件抽象模块将摄像头的图像输出模式发送给相机驱动,相机驱动再将摄像头的图像输出模式发送给摄像头,使得摄像头可以根据摄像头的图像输出模式,输出其采集到的预览图像。
因此,按照上述的S810和S811,使得相机驱动根据摄像头的图像输出模式,驱动摄像头以摄像头的图像输出模式输出采集到的图像。
为了便于区分不同环境亮度下摄像头输出的预览图像,可以将不同场景下的预览图像分别称为第一图像、第二图像、第三图像和第四图像。具体的,当摄像头的图像输出模式从全像素模式切换为像素合并模式时,摄像头输出的预览图像是摄像头在像素合并模式下输出的第一图像;当摄像头的图像输出模式继续保持在全像素模式时,摄像头输出的预览图像是摄像头在全像素模式下输出的第三图像;当摄像头的图像输出模式从像素合并模式切换为全像素模式时,摄像头输出的预览图像是摄像头在全像素模式下输出的第二图像;当摄像头的图像输出模式继续保持在像素合并模式时,摄像头输出的预览图像是摄像头在像素合并模式下输出的第四图像。
需要说明的是,当相机硬件抽象模块确定摄像头的图像输出模式需要进行切换时,相机硬件抽象模块才通过相机驱动,向摄像头发送切换后的图像输出模式,而当相机硬件抽象模块确定摄像头的图像输出模式不需要进行切换时,相机硬件抽象模块可以无需向相机驱动发送摄像头继续保持的图像输出模式。或者,当相机硬件抽象模块确定摄像头的图像输出模式不需要进行切换时,相机硬件抽象模块也可以通过相机驱动,向摄像头发送摄像头继续保持的图像输出模式。
在一些实施例中,针对摄像头在像素合并模式下输出其采集到的图像的场景,摄像头在采集图像之后,摄像头可以采用像素合并的方式,对摄像头采集的图像进行处理,并输出处理后的图像。此时,摄像头输出的处理后的图像,也就是摄像头在像素合并模式下输出的图像。
相应的,针对摄像头在全像素模式下输出其采集到的图像的场景,摄像头在采集图像之后,摄像头可以采用马赛克重排方式,对摄像头采集的图像进行处理,并输出处理后的图像。此时,摄像头输出的处理后的图像,也就是摄像头在全像素模式下输出的图像。
在另一些实施例中,摄像头输出的图像中像素阵列的排列方式,可以与图像传感 器的像素阵列一致。这种情况下,摄像头在将输出的图像经过相机驱动发送给相机硬件抽象模块之后,针对摄像头的图像输出模式为像素合并模式的场景,相机硬件抽象模块可以对摄像头输出的图像采用像素合并的方式进行处理;针对摄像头的图像输出模式为全像素模式的场景,相机硬件抽象模块可以对摄像头输出的图像采用马赛克重排方式进行处理。
S812,摄像头向相机驱动发送预览图像。
S813,相机驱动向相机硬件抽象模块发送预览图像。
S814,相机硬件抽象模块向相机服务发送预览图像。
S815,相机服务向相机应用发送预览图像。
S816,相机应用显示预览图像。
摄像头在根据摄像头的图像输出模式,输出其采集到的预览图像之后,摄像头将输出的预览图像通过相机驱动、相机硬件抽象模块和相机服务,发送给相机应用。相机应用在接收到预览图像之后,可以在预览界面显示预览图像。
在本申请实施例中,摄像头可以按照一定的帧率,持续输出其采集到的每一帧图像,并将每一帧图像通过相机驱动、相机硬件抽象模块和相机服务,发送给相机应用,使得相机应用可以通过显示屏,将每一帧图像依次显示在预览界面中。
为了便于区分不同环境亮度下摄像头输出的预览图像在显示时的预览界面,将不同预览图像显示时的预览界面分别称为第一预览界面、第二预览界面、第三预览界面和第四预览界面。具体的,第一图像显示时的预览界面为第一预览界面,第二图像显示时的预览界面为第二预览界面,第三图像显示时的预览界面为第三预览界面,第四图像显示时的预览界面为第四预览界面。
此外,上述发送给相机应用的预览图像,可以是经过ISP处理后的图像。
在一些实施例中,在每次配置摄像头的图像输出模式之后的预设帧数后,电子设备再次确定是否切换摄像头的图像输出模式。其中,摄像头的图像输出模式包括全像素模式或像素合并模式。
也就是说,电子设备在配置摄像头的图像输出模式之后,到下一次判断是否切换摄像头的图像输出模式之间的时间间隔,可以为预设帧数。并且,配置摄像头的图像输出模式可以包括切换摄像头的图像输出模式,以及控制摄像头的图像输出模式保持不变。
由于摄像头的感光度是实时获取的,因此,本申请实施例可以实时判断摄像头的感光度与感光度阈值的大小关系。并且,在配置摄像头的图像输出模式之后的预设帧数后,才基于摄像头的感光度与感光度阈值的大小关系的判断结果,确定是否切换摄像头的图像输出模式。
或者,本申请实施例也可以在配置摄像头的图像输出模式之后,间隔预设帧数后再判断摄像头的感光度与感光度阈值的大小关系,并根据摄像头的感光度与感光度阈值的大小关系,确定是否切换摄像头的图像输出模式。
示例性的,电子设备在执行上述S703和S704,将摄像头的图像输出模式从全像素模式切换为像素合并模式之后,间隔预设帧数后再执行上述的S707,以判断摄像头的感光度是否小于第二感光度阈值。电子设备在执行上述S705和S706,控制摄像头的图像输出模式保持在全像素模式之后,间隔预设帧数后再执行上述的S702,以判断 摄像头的感光度是否大于第一感光度阈值。电子设备在执行上述S708和S709,将摄像头的图像输出模式从像素合并模式切换为全像素模式之后,间隔预设帧数后再执行上述的S702,以判断摄像头的感光度是否大于第一感光度阈值。电子设备在执行上述S710和S711,控制摄像头的图像输出模式保持在像素合并模式之后,间隔预设帧数后再执行上述的S707,以判断摄像头的感光度是否小于第二感光度阈值。
需要说明的是,上述的预设帧数可以为经验值,其可以根据不同模组及整机产品选用不同的数值。针对某一个电子设备,可以根据实际产品调试选用合适的数值来作为该电子设备的预设帧数,以减轻或解决切换过程中的电子设备显示的图像出现画面闪烁的问题。
具体的,针对某一个电子设备,预设帧数可以为预先设定的一个固定数值,如预设帧数可以为200帧。
在每次配置摄像头的图像输出模式之后,电子设备中的相机硬件抽象模块可以从零开始统计帧数,以确定帧数是否达到预设帧数。在一些实施例中,摄像头采集图像的帧率,与相机应用在显示摄像头采集的图像时的帧率是一致的。因此,电子设备在统计帧数时,摄像头每采集一帧图像,电子设备统计的帧数累加1帧;或者,电子设备在统计帧数时,相机应用每显示一帧摄像头采集的图像,电子设备统计的帧数累加1帧。
在另一些实施例中,在每次配置摄像头的图像输出模式之后的预设时长后,电子设备再次确定是否切换摄像头的图像输出模式。其中,摄像头的图像输出模式包括全像素模式或像素合并模式。
也就是说,电子设备在配置摄像头的图像输出模式之后,到下一次判断是否切换摄像头的图像输出模式之间的时间间隔,可以为预设时长。
本申请实施例可以实时判断摄像头的感光度与感光度阈值的大小关系,并且,在配置摄像头的图像输出模式之后的预设时长后,才基于摄像头的感光度与感光度阈值的大小关系的判断结果,确定是否切换摄像头的图像输出模式。
或者,本申请实施例也可以在配置摄像头的图像输出模式之后,间隔预设时长后再判断摄像头的感光度与感光度阈值的大小关系,并根据摄像头的感光度与感光度阈值的大小关系,确定是否切换摄像头的图像输出模式。
示例性的,电子设备在执行上述S703和S704,将摄像头的图像输出模式从全像素模式切换为像素合并模式之后,间隔预设时长后再执行上述的S707,以判断摄像头的感光度是否小于第二感光度阈值。电子设备在执行上述S705和S706,控制摄像头的图像输出模式保持在全像素模式之后,间隔预设时长后再执行上述的S702,以判断摄像头的感光度是否大于第一感光度阈值。电子设备在执行上述S708和S709,将摄像头的图像输出模式从像素合并模式切换为全像素模式之后,间隔预设时长后再执行上述的S702,以判断摄像头的感光度是否大于第一感光度阈值。电子设备在执行上述S710和S711,控制摄像头的图像输出模式保持在像素合并模式之后,间隔预设时长后再执行上述的S707,以判断摄像头的感光度是否小于第二感光度阈值。
需要说明的是,上述的预设时长可以为经验值,其可以根据不同模组及整机产品选用不同的数值。针对某一个电子设备,可以根据实际产品调试选用合适的数值来作为该电子设备的预设时长,以减轻或解决切换过程中的电子设备显示的图像出现画面 闪烁的问题。
具体的,针对某一个电子设备,预设时长可以为预先设定的一个固定数值,如预设时长可以为8秒。
上述过程中,电子设备在配置摄像头的图像输出模式之后,到下一次判断是否切换摄像头的图像输出模式之间的时间间隔,可以为预设帧数,该预设帧数可以为一个固定的数值。另一种可能的实现方式中,本申请实施例还可以根据电子设备的运动状态来确定预设帧数,并基于预设帧数来判断是否切换摄像头的图像输出模式。
一种实现方式,示例性的,图9为本申请实施例提供的根据电子设备的运动状态,切换摄像头的图像输出模式的流程图。参照图9所示,具体可以包括如下步骤:
S901,电子设备实时获取运动传感器采集到的运动参数。
S902,电子设备根据运动参数确定电子设备的运动状态;电子设备的运动状态包括静止状态、第一移动状态和第二移动状态。
其中,第二移动状态的运动参数大于第一移动状态的运动参数,第一移动状态的运动参数大于静止状态的运动参数,运动参数包括加速度数据、角速度数据以及速度数据中的至少一者。
在本申请实施例中,电子设备可以包括运动传感器,运动传感器可以包括加速度传感器、陀螺仪传感器以及速度传感器中的至少一者。
以运动传感器包括加速度传感器为例,此时,加速度传感器采集到的运动参数包括加速度数据,其包括x轴、y轴和z轴方向上的加速度。电子设备可以根据加速度传感器采集到的加速度数据,来确定电子设备的运动状态。
示例性的,当加速度传感器监测到电子设备的加速度数据小于第一加速度阈值时,确定电子设备处于静止状态;当加速度传感器监测到电子设备的加速度数据大于或等于第一加速度阈值,且小于第二加速度阈值时,确定电子设备处于第一移动状态;当加速度传感器监测到电子设备的加速度数据大于或等于第二加速度阈值时,确定电子设备处于第二移动状态。第二加速度阈值大于第一加速度阈值,第一加速度阈值可以为趋近于0的数值。
以运动传感器包括陀螺仪传感器为例,此时,陀螺仪传感器采集到的运动参数包括角速度数据,其包括x轴、y轴和z轴方向上的角速度。电子设备可以根据陀螺仪传感器采集到的角速度数据,来确定电子设备的运动状态。
示例性的,当陀螺仪传感器监测到电子设备的角速度数据小于第一角速度阈值时,确定电子设备处于静止状态;当陀螺仪传感器监测到电子设备的角速度数据大于或等于第一角速度阈值,且小于第二角速度阈值时,确定电子设备处于第一移动状态;当陀螺仪传感器监测到电子设备的角速度数据大于或等于第二角速度阈值时,确定电子设备处于第二移动状态。第二角速度阈值大于第一角速度阈值,第一角速度阈值可以为趋近于0的数值。
以运动传感器包括速度传感器为例,此时,速度传感器采集到的运动参数包括速度数据,其包括x轴、y轴和z轴方向上的速度。电子设备可以根据速度传感器采集到的速度数据,来确定电子设备的运动状态。
示例性的,当速度传感器检测到电子设备的速度数据小于第一速度阈值时,确定电子设备处于静止状态;当速度传感器检测到电子设备的速度数据大于或等于第一速 度阈值,且小于第二速度阈值时,确定电子设备处于第一移动状态;当速度传感器检测到电子设备的速度数据大于或等于第二速度阈值时,确定电子设备处于第二移动状态。第二速度阈值大于第一速度阈值,第一速度阈值可以为趋近于0的数值。
需要说明的是,在用户携带电子设备处于走路的场景下,电子设备的运动状态可以为第一移动状态;在用户携带电子设备处于乘坐交通工具的场景下,电子设备的运动状态可以为第二移动状态。
因此,按照上述的S901和S902,使得电子设备可以实时获取电子设备的运动状态。
S903,电子设备确定静止状态对应的预设帧数为第一帧数。
S904,电子设备确定第一移动状态对应的预设帧数为第二帧数。
S905,电子设备确定第二移动状态对应的预设帧数为第三帧数。
在本申请实施例中,电子设备预先设置有不同运动状态对应的预设帧数。当电子设备确定其运动状态为静止状态时,电子设备确定静止状态对应的预设帧数为第一帧数;当电子设备确定其运动状态为第一移动状态时,电子设备确定第一移动状态对应的预设帧数为第二帧数;当电子设备确定其运动状态为第二移动状态时,电子设备确定第二移动状态对应的预设帧数为第三帧数。
第一帧数、第二帧数和第三帧数可以为经验值,其可以根据不同模组及整机产品选用不同的数值。针对某一个电子设备,可以根据实际产品调试选用合适的数值来分别作为第一帧数、第二帧数和第三帧数。
其中,第一帧数、第二帧数和第三帧数中的至少两者不同。
例如,静止状态下对应的第一帧数,可以大于第一移动状态对应的第一帧数;静止状态下对应的第一帧数可以大于第二移动状态对应的第三帧数。通过将静止状态下的预设帧数延长,可以增加摄像头的图像输出模式的切换过程中的平顺性。
因此,按照上述的S903至S905,使得电子设备可以根据运动状态,确定运动状态对应的预设帧数。
电子设备在执行上述的S903之后,电子设备可以继续执行下面的S906及之后的步骤;电子设备在执行上述的S904之后,电子设备可以继续执行下面的S909及之后的步骤;电子设备在执行上述的S905之后,电子设备可以继续执行下面的S912及之后的步骤。
S906,在每次配置摄像头的图像输出模式之后,当静止状态保持不变的帧数达到第一帧数时,电子设备判断静止状态保持不变的帧数内获取的感光度是否均满足预设条件。
S907,在静止状态保持不变的帧数内获取的感光度均满足预设条件的情况下,电子设备切换摄像头的图像输出模式。
S908,在静止状态保持不变的帧数内存在获取的感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
第一种情况,电子设备在配置摄像头的图像输出模式为像素合并模式之后,如将摄像头的图像输出模式从全像素模式切换为像素合并模式,或者控制摄像头的图像输出模式继续保持在像素合并模式,若电子设备的运动状态一直为静止状态,且静止状态保持不变的帧数达到第一帧数,则电子设备判断静止状态保持不变的帧数内获取的 感光度是否均小于第二感光度阈值。
若静止状态保持不变的帧数内获取的感光度均小于第二感光度阈值,说明静止状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。若静止状态保持不变的帧数内存在获取的感光度大于或等于第二感光度阈值,说明静止状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
例如,静止状态对应的第一帧数为300帧,第二感光度阈值为550,电子设备在摄像头的图像输出模式从全像素模式切换为像素合并模式之后,若连续300帧内电子设备的运动状态一直为静止状态,且连续300帧内获取的感光度均小于550,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。
需要说明的是,电子设备可以实时监测电子设备的运动状态,且实时获取摄像头的感光度。并且,在摄像头的图像输出模式为像素合并模式的情况下,电子设备会实时将摄像头的感光度与第二感光度阈值进行比较。
第二种情况,电子设备在配置摄像头的图像输出模式为全像素模式之后,如将摄像头的图像输出模式从像素合并模式切换为全像素模式,或者控制摄像头的图像输出模式继续保持在全像素模式,若电子设备的运动状态一直为静止状态,且静止状态保持不变的帧数达到第一帧数,则电子设备判断静止状态保持不变的帧数内获取的感光度是否均大于第一感光度阈值。
若静止状态保持不变的帧数内获取的感光度均大于第一感光度阈值,说明静止状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。若静止状态保持不变的帧数内存在获取的感光度小于或等于第一感光度阈值,说明静止状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
S909,在每次配置摄像头的图像输出模式之后,当第一移动状态保持不变的帧数达到第二帧数时,电子设备判断第一移动状态保持不变的帧数内获取的感光度是否均满足预设条件。
S910,在第一移动状态保持不变的帧数内获取的感光度均满足预设条件的情况下,电子设备切换摄像头的图像输出模式。
S911,在第一移动状态保持不变的帧数内存在获取的感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
第一种情况,电子设备在配置摄像头的图像输出模式为像素合并模式之后,如将摄像头的图像输出模式从全像素模式切换为像素合并模式,或者控制摄像头的图像输出模式继续保持在像素合并模式,若电子设备的运动状态一直为第一移动状态,且第一移动状态保持不变的帧数达到第二帧数,则电子设备判断第一移动状态保持不变的帧数内获取的感光度是否均小于第二感光度阈值。
若第一移动状态保持不变的帧数内获取的感光度均小于第二感光度阈值,说明第一移动状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。若第一移动状态保持不变的帧数内存在获取的感光度大于或等于第二感光度阈值,说明第一移动状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
第二种情况,电子设备在配置摄像头的图像输出模式为全像素模式之后,如将摄像头的图像输出模式从像素合并模式切换为全像素模式,或者控制摄像头的图像输出模式继续保持在全像素模式,若电子设备的运动状态一直为第一移动状态,且第一移动状态保持不变的帧数达到第二帧数,则电子设备判断第一移动状态保持不变的帧数内获取的感光度是否均大于第一感光度阈值。
若第一移动状态保持不变的帧数内获取的感光度均大于第一感光度阈值,说明第一移动状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。若第一移动状态保持不变的帧数内存在获取的感光度小于或等于第一感光度阈值,说明第一移动状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
S912,在每次配置摄像头的图像输出模式之后,当第二移动状态保持不变的帧数达到第三帧数时,电子设备判断第二移动状态保持不变的帧数内获取的感光度是否均满足预设条件。
S913,在第二移动状态保持不变的帧数内获取的感光度均满足预设条件的情况下,电子设备切换摄像头的图像输出模式。
S914,在第二移动状态保持不变的帧数内存在获取的感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
第一种情况,电子设备在配置摄像头的图像输出模式为像素合并模式之后,如将摄像头的图像输出模式从全像素模式切换为像素合并模式,或者控制摄像头的图像输出模式继续保持在像素合并模式,若电子设备的运动状态一直为第二移动状态,且第二移动状态保持不变的帧数达到第三帧数,则电子设备判断第二移动状态保持不变的帧数内获取的感光度是否均小于第二感光度阈值。
若第二移动状态保持不变的帧数内获取的感光度均小于第二感光度阈值,说明第二移动状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式。若第二移动状态保持不变的帧数内存在获取的感光度大于或等于第二感光度阈值,说明第二移动状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
第二种情况,电子设备在配置摄像头的图像输出模式为全像素模式之后,如将摄像头的图像输出模式从像素合并模式切换为全像素模式,或者控制摄像头的图像输出模式继续保持在全像素模式,若电子设备的运动状态一直为第二移动状态,且第二移动状态保持不变的帧数达到第三帧数,则电子设备判断第二移动状态保持不变的帧数内获取的感光度是否均大于第一感光度阈值。
若第二移动状态保持不变的帧数内获取的感光度均大于第一感光度阈值,说明第二移动状态保持不变的帧数内获取的感光度比较稳定,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式。若第二移动状态保持不变的帧数内存在获取的感光度小于或等于第一感光度阈值,说明第二移动状态保持不变的帧数内获取的感光度不太稳定,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
需要说明的是,以上的描述是在每次配置摄像头的图像输出模式之后,到下一次配置摄像头的图像输出模式之间的阶段内,电子设备的运动状态保持不变的场景。若在配置摄像头的图像输出模式之后,到下一次配置摄像头的图像输出模式之间的阶段 内,电子设备的运动状态发生改变,且发生改变前的运动状态,不满足再次配置摄像头的图像输出模式所对应的条件,则电子设备根据发生改变后的运动状态,来确定其是否满足再次配置摄像头的图像输出模式所对应的条件。
综上,在每次配置摄像头的图像输出模式之后,当目标帧数达到运动状态对应的预设帧数时,电子设备判断目标帧数内获取的感光度是否均满足预设条件,目标帧数为运动状态保持不变的帧数;在目标帧数内获取的感光度均满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在目标帧数内存在获取的感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
其中,在摄像头的图像输出模式为全像素模式的情况下,当感光度大于第一感光度阈值时,感光度满足预设条件,当感光度小于或等于第一感光度阈值时,感光度不满足预设条件。在摄像头的图像输出模式为像素合并模式的情况下,当感光度小于第二感光度阈值时,感光度满足预设条件,当感光度大于或等于第二感光度阈值时,感光度不满足预设条件。
因此,本申请实施例在每次配置摄像头的图像输出模式之后,根据电子设备的运动状态和摄像头的感光度,来共同来判断是否切换摄像头的图像输出模式。根据不同运动状态所对应的场景,匹配不同的预设帧数,来增加摄像头的图像输出模式切换过程中的平顺性,进一步减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题,使得电子设备显示的图像更加稳定。
另一种实现方式,在每次配置摄像头的图像输出模式之后,电子设备获取一次电子设备的运动状态;电子设备根据电子设备的运动状态,确定运动状态对应的预设帧数;在每次配置摄像头的图像输出模式之后的第一时刻,电子设备判断感光度是否满足预设条件,第一时刻与配置摄像头的图像输出模式的时刻之间的时间间隔,等于运动状态对应的预设帧数;在感光度满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
其中,在摄像头的图像输出模式为全像素模式的情况下,当感光度大于第一感光度阈值时,感光度满足预设条件,当感光度小于或等于第一感光度阈值时,感光度不满足预设条件。在摄像头的图像输出模式为像素合并模式的情况下,当感光度小于第二感光度阈值时,感光度满足预设条件,当感光度大于或等于第二感光度阈值时,感光度不满足预设条件。
这种情况下,电子设备可以无需实时确定电子设备的运动状态,而在每次配置摄像头的图像输出模式之后,电子设备获取一次电子设备的运动状态。获取电子设备的运动状态的具体方式可参照上述的S901和S902对应的描述,在此不再赘述。
电子设备的运动状态包括静止状态、第一移动状态和第二移动状态。静止状态对应的预设帧数为第一帧数;第一移动状态对应的预设帧数为第二帧数;第二移动状态对应的预设帧数为第三帧数。
下面以电子设备的运动状态为静止状态为例,说明这种实现方式下电子设备控制摄像头的图像输出模式的具体实现方式。
第一种情况,电子设备在配置摄像头的图像输出模式为像素合并模式之后,电子设备判断在配置摄像头的图像输出模式为像素合并模式之后的第一帧数后,摄像头的 感光度是否小于第二感光度阈值。若摄像头的感光度小于第二感光度阈值,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式;若感光度大于或等于第二感光度阈值,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
第二种情况,电子设备在配置摄像头的图像输出模式为全像素模式之后,电子设备判断在配置摄像头的图像输出模式为全像素模式之后的第一帧数后,摄像头的感光度是否大于第一感光度阈值。若摄像头的感光度大于第一感光度阈值,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式;若感光度小于或等于第一感光度阈值在,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
再一种实现方式,电子设备实时获取电子设备的运动状态;电子设备根据电子设备的运动状态,确定运动状态对应的预设帧数;在每次配置摄像头的图像输出模式之后的第二时刻,电子设备判断感光度是否满足预设条件,第二时刻为运动状态保持不变的帧数达到运动状态对应的预设帧数的时刻;在感光度满足预设条件的情况下,电子设备切换摄像头的图像输出模式;在感光度不满足预设条件的情况下,电子设备保持摄像头的图像输出模式不变。
其中,在摄像头的图像输出模式为全像素模式的情况下,当感光度大于第一感光度阈值时,感光度满足预设条件,当感光度小于或等于第一感光度阈值时,感光度不满足预设条件。在摄像头的图像输出模式为像素合并模式的情况下,当感光度小于第二感光度阈值时,感光度满足预设条件,当感光度大于或等于第二感光度阈值时,感光度不满足预设条件。
这种情况下,电子设备实时获取电子设备的运动状态。获取电子设备的运动状态的具体方式可参照上述的S901和S902对应的描述,在此不再赘述。
电子设备的运动状态包括静止状态、第一移动状态和第二移动状态。静止状态对应的预设帧数为第一帧数;第一移动状态对应的预设帧数为第二帧数;第二移动状态对应的预设帧数为第三帧数。
下面以电子设备的运动状态为静止状态为例,说明这种实现方式下电子设备控制摄像头的图像输出模式的具体实现方式。
第一种情况,电子设备在配置摄像头的图像输出模式为像素合并模式之后,若电子设备的运动状态一直为静止状态,且静止状态保持不变的帧数达到第一帧数,则电子设备判断在配置摄像头的图像输出模式为像素合并模式之后的第一帧数后,摄像头的感光度是否小于第二感光度阈值。若摄像头的感光度小于第二感光度阈值,则电子设备将摄像头的图像输出模式从像素合并模式切换为全像素模式;若感光度大于或等于第二感光度阈值,则电子设备控制摄像头的图像输出模式继续保持在像素合并模式。
第二种情况,电子设备在配置摄像头的图像输出模式为全像素模式之后,若电子设备的运动状态一直为静止状态,且静止状态保持不变的帧数达到第一帧数,则电子设备判断在配置摄像头的图像输出模式为全像素模式之后的第一帧数后,摄像头的感光度是否大于第一感光度阈值。若摄像头的感光度大于第一感光度阈值,则电子设备将摄像头的图像输出模式从全像素模式切换为像素合并模式;若感光度小于或等于第一感光度阈值在,则电子设备控制摄像头的图像输出模式继续保持在全像素模式。
需要说明的是,以上的描述是在每次配置摄像头的图像输出模式之后,到下一次配置摄像头的图像输出模式之间的阶段内,电子设备的运动状态保持不变的场景。若 在配置摄像头的图像输出模式之后,到下一次配置摄像头的图像输出模式之间的阶段内,电子设备的运动状态发生改变,且发生改变前的运动状态所维持的帧数,没有达到该运动状态对应的预设帧数,则电子设备重新根据发生改变后的运动状态所维持的帧数,是否达到发生改变后的运动状态对应的预设帧数,来确定是否需要比较摄像头的感光度与感光度阈值的大小关系。
这样,根据不同运动状态所对应的场景,匹配不同的预设帧数,来增加摄像头的图像输出模式切换过程中的平顺性,进一步减轻摄像头的图像输出模式的切换过程中,电子设备显示的图像出现画面闪烁的问题,使得电子设备显示的图像更加稳定。
为了方便理解,下面结合图10对本申请实施例提供的模式控制方法中,所涉及的各个模块之间的交互过程进行说明。该模式控制方法中,是根据摄像头的感光度和电子设备的运动状态,来判断是否切换摄像头的图像输出模式的。
如图10所示,电子设备可以包括相机应用、相机服务、相机硬件抽象模块、相机驱动和摄像头、传感器驱动和运动传感器。参照图10所示,该模式控制方法具体可以包括如下步骤:
S1001,相机应用接收用户对相机应用图标的触控操作。
S1002,响应于对相机应用图标的触控操作,相机应用向相机服务发送图像预览请求。
S1003,相机服务向相机硬件抽象模块发送图像预览请求。
S1004,相机硬件抽象模块向相机驱动发送图像预览请求。
S1005,相机驱动向摄像头发送图像预览请求。
S1006,在摄像头接收到图像预览请求的情况下,摄像头向相机驱动发送摄像头的感光度。
S1007,相机驱动向相机硬件抽象模块发送摄像头的感光度。
需要说明的是,S1001至S1007的具体实现方式,可参照上述的S801至S807的具体实现方式,在此不再赘述。
S1008,相机硬件抽象模块向传感器驱动发送运动参数获取请求。
S1009,传感器驱动向运动传感器发送运动参数获取请求。
S1010,运动传感器向传感器驱动发送其采集到的运动参数。
S1011,传感器驱动向相机硬件抽象模块发送运动参数。
S1012,相机硬件抽象模块根据运动参数确定电子设备的运动状态。
在一些实施例中,相机硬件抽象模块中保存有用于调度运动传感器的软件代码,相机硬件抽象模块在接收到图像预览请求后,可以通过调用传感器驱动,由传感器驱动来驱动运动传感器采集电子设备的运动参数。运动传感器将采集到的运动参数,通过传感器驱动发送给相机硬件抽象模块。
相机硬件抽象模块可以根据电子设备的运动参数,来确定电子设备的运动状态。其具体实现方式,可参照上述S902对应的描述,在此不再赘述。
S1013,相机硬件抽象模块根据摄像头的感光度和电子设备的运动状态,配置摄像头的图像输出模式;摄像头的图像输出模式包括全像素模式或像素合并模式。
相机硬件抽象模块在接收到摄像头的感光度,以及确定电子设备的运动状态之后,相机硬件抽象模块根据摄像头的感光度和电子设备的运动状态,配置摄像头的图像输 出模式。
需要说明的是,相机硬件抽象模块根据摄像头的感光度和电子设备的运动状态,配置摄像头的图像输出模式的具体实现方式,可参照上述的三种实现方式。示例性的,可参照上述图9对应的描述,在此不再赘述。其中,在统计运动状态保持不变的帧数时,是相机硬件抽象模块进行统计的。
S1014,相机硬件抽象模块向相机驱动发送摄像头的图像输出模式。
S1015,相机驱动向摄像头发送摄像头的图像输出模式。
S1016,摄像头根据摄像头的图像输出模式,输出其采集到的预览图像。
S1017,摄像头向相机驱动发送预览图像。
S1018,相机驱动向相机硬件抽象模块发送预览图像。
S1019,相机硬件抽象模块向相机服务发送预览图像。
S1020,相机服务向相机应用发送预览图像。
S1021,相机应用显示预览图像。
需要说明的是,S1014至S1021的具体实现方式,可参照上述的S809至S816的具体实现方式,在此不再赘述。
在一些实施例中,相机应用包括多种拍摄模式,如包括夜景模式、人像模式、拍照模式、录像模式以及专业模式等。其中,多种拍摄模式中的至少部分的拍摄模式对应的第一感光度阈值不同,和/或,多种拍摄模式中的至少部分的拍摄模式对应的第二感光度阈值不同。
例如,拍照模式对应的第一感光度阈值可以为1400,人像模式对应的第一感光度阈值可以为1300;或者,拍照模式对应的第二感光度阈值可以为550,人像模式对应的第二感光度阈值可以为500。
具体的,相机应用在通过相机服务向相机硬件抽象模块发送图像预览请求时,该图像预览请求中可以包括相机应用的拍摄模式,进而使得相机硬件抽象模块可以根据图像预览请求中的拍摄模式,确定该拍摄模式对应的第一感光度阈值和第二感光度阈值。
本申请实施例提供的模式控制方法,除了可以应用在上述的相机应用的预览场景外,还可以应用在相机应用的拍摄场景。
示例性的,图11为本申请实施例提供的在进行图像拍摄时的模块交互示意图,其可以应用于电子设备中,电子设备可以包括相机应用、相机服务、相机硬件抽象模块、相机驱动和摄像头。参照图11所示,具体可以包括如下步骤:
S1101,相机应用接收用户对拍摄控件的触控操作。
S1102,响应于对拍摄控件的触控操作,相机应用向相机服务发送图像拍摄请求。
S1103,相机服务向相机硬件抽象模块发送图像拍摄请求。
S1104,相机硬件抽象模块向相机驱动发送图像拍摄请求。
S1105,相机驱动向摄像头发送图像拍摄请求。
S1106,摄像头根据图像拍摄请求,将采集的图像帧发送给相机驱动。
示例性的,在相机应用的预览界面内设置有拍摄控件,当用户想要拍摄图像时,用户可以对拍摄控件进行触控操作,如点击操作等,则相机应用可以接收到用户对拍摄控件的触控操作。
相机应用响应于对拍摄控件的触控操作,通过调用应用程序框架层中的相机访问接口,向相机服务发送图像拍摄请求,相机服务通过相机硬件抽象模块和相机驱动,将图像拍摄请求发送给摄像头。摄像头根据图像拍摄请求采集图像,并基于当前所处的图像输出模式输出采集的图像帧,摄像头输出的图像帧可发送给相机驱动。
S1107,相机驱动向相机硬件抽象模块发送图像帧。
S1008,相机硬件抽象模块向相机服务发送图像帧。
S1109,相机服务向相机应用发送图像帧。
S1110,相机应用存储图像帧。
相机驱动通过相机硬件抽象模块和相机服务,将摄像头输出的图像帧发送给相机应用。相机应用在接收到图像帧后,可以将图像帧存储在电子设备的存储器中。
示例性的,相机应用的预览界面可以为第一预览界面和第二预览界面,第一图像显示时的预览界面为第一预览界面,第二图像显示时的预览界面为第二预览界面。将第一预览界面中的拍摄控件称为第一拍摄控件,即第一预览界面包括第一拍摄控件,将第二预览界面中的拍摄控件称为第二拍摄控件,即第二预览界面包括第二拍摄控件。上述过程中存储的图像帧可以为第一图像,也可以为第二图像。
当电子设备接收到用户对第一拍摄控件的第一操作后,电子设备响应于对第一拍摄控件的第一操作,按照上述的S1102至S1110的实现方式,保存第一图像。相应的,当电子设备接收到用户对第二拍摄控件的第二操作后,电子设备响应于对第二拍摄控件的第二操作,按照上述的S1102至S1110的实现方式,保存第二图像。
其中,第一图像是摄像头在像素合并模式下输出的预览图像,第二图像是摄像头在全像素模式下输出的预览图像。因此,第二图像的尺寸大于第一图像的尺寸。例如,第二图像的尺寸为3840像素*2160像素,第一图像的尺寸为1920像素*1080像素。
并且,第二图像在存储时占用的存储空间,也大于第一图像在存储时占用的存储空间。例如,第二图像在存储时占用的存储空间为9MB,而第一图像在存储时占用的存储空间为2.25MB。
相应的,第三图像的尺寸也大于第四图像的尺寸。第三图像在存储时占用的存储空间,也大于第四图像在存储时占用的存储空间。
以相关技术在不同的环境亮度下均采用全像素模式为例,其在低亮度环境下和高亮度环境下输出的图像占用的存储空间的大小相等,而本申请实施例在低亮度环境下输出的图像占用的存储空间,为高亮度环境下输出的图像占用的存储空间的1/4。例如,相关技术在低亮度环境和高亮度环境下输出的图像占用的存储空间均为9MB,而本申请实施例在低亮度环境下输出的图像占用的存储空间可以为2.25MB,本申请实施例在高亮度环境下输出的图像占用的存储空间也可以为9MB。
需要说明的是,电子设备在接收到对拍摄控件的触控操作后,相机硬件抽象模块在统计帧数时是继续统计的,其并不会因为拍摄操作而从零开始重新统计。
可以理解的是,本申请实施例提供的模式控制方法,还可以应用在相机应用的视频录制等场景中。在视频录制完成后,相机应用以视频的形式将摄像头输出的每一帧图像保存在电子设备中。
上面结合图6至图11,对本申请实施例提供的模式控制方法进行了说明,下面对本申请实施例提供的执行上述方法的装置进行描述。如图12所示,图12为本申请实 施例提供的一种模式控制装置的结构示意图。该模式控制装置可以是本申请实施例中的电子设备,或电子设备内的芯片或芯片系统。
如图12所示,该模式控制装置1200可以包括:显示单元1201和处理单元1202。其中,显示单元1201用于支持模式控制装置1200执行上述的显示步骤;处理单元1202用于支持模式控制装置1200执行上述的处理步骤。
具体的,在启动相机应用的情况下,处理单元1202用于获取摄像头的感光度;在感光度大于第一感光度阈值,且摄像头的图像输出模式为全像素模式的情况下,显示单元1201用于显示第一预览界面,第一预览界面包括第一图像,第一图像为摄像头在像素合并模式下输出的图像;在感光度小于第二感光度阈值,且摄像头的图像输出模式为像素合并模式的情况下,显示单元1201用于显示第二预览界面,第二预览界面包括第二图像,第二图像为摄像头在全像素模式下输出的图像。其中,像素合并模式用于将相邻的多个同色像素合并为一个像素,全像素模式用于采用马赛克重排方式将像素重排为拜耳阵列;第一感光度阈值与第二感光度阈值不相等。
在一种可能的实现方式中,该模式控制装置1200还包括存储单元1203。存储单元1203和处理单元1202通过线路相连。存储单元1203可以包括一个或者多个存储器,存储器可以是一个或者多个设备、电路中用于存储程序或者数据的器件。存储单元1203可以独立存在,通过通信总线与处理单元1202相连。存储单元1203也可以和处理单元1202集成在一起。
存储单元1203可以存储电子设备中的方法的计算机执行指令,以使处理单元1202执行上述实施例中的方法。存储单元1203可以是寄存器、缓存或者随机存取存储器(random access memory,RAM)等,存储单元1203可以和处理单元1202集成在一起。存储单元1203可以是只读存储器(read-only memory,ROM)或者可存储静态信息和指令的其他类型的静态存储设备,存储单元1203可以与处理单元1202相独立。
图13为本申请实施例提供的一种芯片的结构示意图。如图13所示,芯片1300包括一个或两个以上(包括两个)处理器1301、通信线路1302和通信接口1303,可选的,芯片1300还包括存储器1304。
在一些实施方式中,存储器1304存储了如下的元素:可执行模块或者数据结构,或者他们的子集,或者他们的扩展集。
上述本申请实施例描述的方法可以应用于处理器1301中,或者由处理器1301实现。处理器1301可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器1301中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器1301可以是通用处理器(例如,微处理器或常规处理器)、数字信号处理器、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field-programmable gate array,FPGA)或者其他可编程逻辑器件、分立门、晶体管逻辑器件或分立硬件组件,处理器1301可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。
结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。其中,软件模块可以位于随机存储器、只读存储器、可编程只读存储器或带电可擦写可编程存储器(electrically erasable programmable read only memory,EEPROM)等本领域成熟的存储介质中。该 存储介质位于存储器1304,处理器1301读取存储器1304中的信息,结合其硬件完成上述方法的步骤。
处理器1301、存储器1304以及通信接口1303之间可以通过通信线路1302进行通信。
在上述实施例中,存储器存储的供处理器执行的指令可以以计算机程序产品的形式实现。其中,计算机程序产品可以是事先写入在存储器中,也可以是以软件形式下载并安装在存储器中。
本申请实施例还提供一种计算机程序产品,其包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。例如,可用介质可以包括磁性介质(例如,软盘、硬盘或磁带)、光介质(例如,数字通用光盘(digital versatile disc,DVD))、或者半导体介质(例如,固态硬盘(solid state disk,SSD))等。
本申请实施例提供一种电子设备,该电子设备包括处理器和存储器,存储器用于存储计算机程序,处理器用于执行计算机程序,以执行上述的模式控制方法。
本申请实施例提供一种芯片。芯片包括处理器,处理器用于调用存储器中的计算机程序,以执行上述实施例中的技术方案。其实现原理和技术效果与上述相关实施例类似,此处不再赘述。
本申请实施例还提供了一种计算机可读存储介质。计算机可读存储介质存储有计算机程序或指令。计算机程序或指令被处理器执行时实现上述方法。上述实施例中描述的方法可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。如果在软件中实现,则功能可以作为一个或多个指令或代码存储在计算机可读介质上或者在计算机可读介质上传输。计算机可读介质可以包括计算机存储介质和通信介质,还可以包括任何可以将计算机程序从一个地方传送到另一个地方的介质。存储介质可以是可由计算机访问的任何目标介质。
作为一种可能的设计,计算机可读介质可以包括紧凑型光盘只读储存器(compactdisc read-only memory,CD-ROM)、RAM、ROM、EEPROM或其它光盘存储器;计算机可读介质可以包括磁盘存储器或其它磁盘存储设备。而且,任何连接线也可以被适当地称为计算机可读介质。例如,如果使用同轴电缆,光纤电缆,双绞线,DSL或无线技术(如红外,无线电和微波)从网站,服务器或其它远程源传输软件,则同轴电缆,光纤电缆,双绞线,DSL或诸如红外,无线电和微波之类的无线技术包括在介质的定义中。如本文所使用的磁盘和光盘包括光盘(CD),激光盘,光盘,DVD,软盘和蓝光盘,其中磁盘通常以磁性方式再现数据,而光盘利用激光光学地再现数据。上述的组合也应包括在计算机可读介质的范围内。
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理单元以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理单元执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
以上的具体实施方式,对本申请的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上仅为本申请的具体实施方式而已,并不用于限定本申请的保护范围,凡在本申请的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。

Claims (19)

  1. 一种模式控制方法,其特征在于,应用于电子设备,所述电子设备包括相机应用和摄像头,所述方法包括:
    在启动所述相机应用的情况下,所述电子设备获取所述摄像头的感光度;
    在所述感光度大于第一感光度阈值,且所述摄像头的图像输出模式为全像素模式的情况下,所述电子设备显示第一预览界面;所述第一预览界面包括第一图像,所述第一图像为所述摄像头在像素合并模式下输出的图像;
    在所述感光度小于第二感光度阈值,且所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备显示第二预览界面;所述第二预览界面包括第二图像,所述第二图像为所述摄像头在所述全像素模式下输出的图像;
    其中,所述像素合并模式用于将相邻的多个同色像素合并为一个像素,所述全像素模式用于采用马赛克重排方式将像素重排为拜耳阵列;所述第一感光度阈值与所述第二感光度阈值不相等。
  2. 根据权利要求1所述的方法,其特征在于,所述第一感光度阈值大于所述第二感光度阈值。
  3. 根据权利要求1所述的方法,其特征在于,在所述电子设备获取所述摄像头的感光度之后,还包括:
    在所述感光度小于或等于所述第一感光度阈值,且所述摄像头的图像输出模式为所述全像素模式的情况下,所述电子设备显示第三预览界面;所述第三预览界面包括第三图像,所述第三图像为所述摄像头在所述全像素模式下输出的图像;
    在所述感光度大于或等于所述第二感光度阈值,且所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备显示第四预览界面;所述第四预览界面包括第四图像,所述第四图像为所述摄像头在所述像素合并模式下输出的图像。
  4. 根据权利要求1所述的方法,其特征在于,所述在所述感光度大于第一感光度阈值,且所述摄像头的图像输出模式为全像素模式的情况下,所述电子设备显示第一预览界面,包括:
    在所述摄像头的图像输出模式为所述全像素模式的情况下,所述电子设备判断所述感光度是否大于所述第一感光度阈值;
    在所述感光度大于所述第一感光度阈值的情况下,所述电子设备将所述摄像头的图像输出模式从所述全像素模式切换为所述像素合并模式;
    所述电子设备获取所述摄像头在所述像素合并模式下输出的所述第一图像,并在所述第一预览界面显示所述第一图像;
    相应的,所述在所述感光度小于第二感光度阈值,且所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备显示第二预览界面,包括:
    在所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备判断所述感光度是否小于所述第二感光度阈值;
    在所述感光度小于所述第二感光度阈值的情况下,所述电子设备将所述摄像头的图像输出模式从所述像素合并模式切换为所述全像素模式;
    所述电子设备获取所述摄像头在所述全像素模式下输出的所述第二图像,并在所述第二预览界面显示所述第二图像。
  5. 根据权利要求3所述的方法,其特征在于,所述在所述感光度小于或等于所述第一感光度阈值,且所述摄像头的图像输出模式为所述全像素模式的情况下,所述电子设备显示第三预览界面,包括:
    在所述摄像头的图像输出模式为所述全像素模式的情况下,所述电子设备判断所述感光度是否大于所述第一感光度阈值;
    在所述感光度小于或等于所述第一感光度阈值的情况下,所述电子设备控制所述摄像头的图像输出模式继续保持在所述全像素模式;
    所述电子设备获取所述摄像头在所述全像素模式下输出的所述第三图像,并在所述第三预览界面显示所述第三图像;
    相应的,所述在所述感光度大于或等于所述第二感光度阈值,且所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备显示第四预览界面,包括:
    在所述摄像头的图像输出模式为所述像素合并模式的情况下,所述电子设备判断所述感光度是否小于所述第二感光度阈值;
    在所述感光度大于或等于所述第二感光度阈值的情况下,所述电子设备控制所述摄像头的图像输出模式继续保持在所述像素合并模式;
    所述电子设备获取所述摄像头在所述像素合并模式下输出的所述第四图像,并在所述第四预览界面显示所述第四图像。
  6. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    在每次配置所述摄像头的图像输出模式之后的预设帧数后,所述电子设备再次确定是否切换所述摄像头的图像输出模式;
    或者,在每次配置所述摄像头的图像输出模式之后的预设时长后,所述电子设备再次确定是否切换所述摄像头的图像输出模式;
    其中,所述摄像头的图像输出模式包括所述全像素模式或所述像素合并模式。
  7. 根据权利要求6所述的方法,其特征在于,在所述电子设备再次确定是否切换所述摄像头的图像输出模式之前,还包括:
    所述电子设备获取所述电子设备的运动状态;
    所述电子设备根据所述运动状态,确定所述预设帧数;
    其中,所述运动状态包括静止状态、第一移动状态和第二移动状态,所述第二移动状态的运动参数大于所述第一移动状态的运动参数,所述第一移动状态的运动参数大于所述静止状态的运动参数,所述运动参数包括加速度数据、角速度数据以及速度数据中的至少一者;所述静止状态对应的预设帧数为第一帧数,所述第一移动状态对应的预设帧数为第二帧数,所述第二移动状态对应的预设帧数为第三帧数,所述第一帧数、所述第二帧数和所述第三帧数中的至少两者不同。
  8. 根据权利要求7所述的方法,其特征在于,所述电子设备获取所述电子设备的运动状态,包括:
    在每次配置所述摄像头的图像输出模式之后,所述电子设备获取一次所述电子设备的运动状态;
    相应的,所述在每次配置所述摄像头的图像输出模式之后的预设帧数后,所述电子设备再次确定是否切换所述摄像头的图像输出模式,包括:
    在每次配置所述摄像头的图像输出模式之后的第一时刻,所述电子设备判断所述 感光度是否满足预设条件;所述第一时刻与配置所述摄像头的图像输出模式的时刻之间的时间间隔,等于所述运动状态对应的预设帧数;
    在所述感光度满足所述预设条件的情况下,所述电子设备切换所述摄像头的图像输出模式;
    在所述感光度不满足所述预设条件的情况下,所述电子设备保持所述摄像头的图像输出模式不变。
  9. 根据权利要求7所述的方法,其特征在于,所述电子设备获取所述电子设备的运动状态,包括:
    所述电子设备实时获取所述电子设备的运动状态;
    相应的,所述在每次配置所述摄像头的图像输出模式之后的预设帧数后,所述电子设备再次确定是否切换所述摄像头的图像输出模式,包括:
    在每次配置所述摄像头的图像输出模式之后的第二时刻,所述电子设备判断所述感光度是否满足预设条件;所述第二时刻为所述运动状态保持不变的帧数达到所述运动状态对应的预设帧数的时刻;
    在所述感光度满足所述预设条件的情况下,所述电子设备切换所述摄像头的图像输出模式;
    在所述感光度不满足所述预设条件的情况下,所述电子设备保持所述摄像头的图像输出模式不变。
  10. 根据权利要求7所述的方法,其特征在于,所述电子设备获取所述电子设备的运动状态,包括:
    所述电子设备实时获取所述电子设备的运动状态;
    相应的,所述在每次配置所述摄像头的图像输出模式之后的预设帧数后,所述电子设备再次确定是否切换所述摄像头的图像输出模式,包括:
    在每次配置所述摄像头的图像输出模式之后,当目标帧数达到所述运动状态对应的预设帧数时,所述电子设备判断所述目标帧数内获取的所述感光度是否均满足预设条件;所述目标帧数为所述运动状态保持不变的帧数;
    在所述目标帧数内获取的所述感光度均满足所述预设条件的情况下,所述电子设备切换所述摄像头的图像输出模式;
    在所述目标帧数内存在获取的所述感光度不满足所述预设条件的情况下,所述电子设备保持所述摄像头的图像输出模式不变。
  11. 根据权利要求8至10中任一项所述的方法,其特征在于,在所述摄像头的图像输出模式为所述全像素模式的情况下,当所述感光度大于所述第一感光度阈值时,所述感光度满足所述预设条件,当所述感光度小于或等于所述第一感光度阈值时,所述感光度不满足所述预设条件;
    在所述摄像头的图像输出模式为所述像素合并模式的情况下,当所述感光度小于所述第二感光度阈值时,所述感光度满足所述预设条件,当所述感光度大于或等于所述第二感光度阈值时,所述感光度不满足所述预设条件。
  12. 根据权利要求1所述的方法,其特征在于,所述第一预览界面还包括第一拍摄控件,所述第二预览界面还包括第二拍摄控件;
    在所述电子设备显示第一预览界面之后,还包括:
    所述电子设备响应于对所述第一拍摄控件的第一操作,保存所述第一图像;
    相应的,在所述电子设备显示第二预览界面之后,还包括:
    所述电子设备响应于对所述第二拍摄控件的第二操作,保存所述第二图像;
    其中,所述第二图像的尺寸大于所述第一图像的尺寸。
  13. 根据权利要求1所述的方法,其特征在于,所述相机应用包括多种拍摄模式,所述多种拍摄模式中的至少部分的所述拍摄模式对应的第一感光度阈值不同,和/或,所述多种拍摄模式中的至少部分的所述拍摄模式对应的第二感光度阈值不同。
  14. 根据权利要求1所述的方法,其特征在于,所述摄像头包括图像传感器,所述图像传感器包括像素阵列,所述像素阵列包括多个像素集合,所述多个像素集合中的每个像素集合均包括多个像素单元,所述多个像素单元中的每个像素单元均包括多个像素;每个所述像素单元中的多个像素的颜色均相同,且所述多个像素单元中的至少部分的像素单元为不同颜色的像素单元;
    所述全像素模式下的所述像素阵列的排列方式,与所述像素合并模式下的所述像素阵列的排列方式相同。
  15. 根据权利要求1所述的方法,其特征在于,所述像素合并模式包括四合一像素合并模式,所述四合一像素合并模式用于将相邻的四个同色像素合并为一个像素。
  16. 根据权利要求1所述的方法,其特征在于,所述电子设备还包括相机硬件抽象模块和相机驱动;所述方法还包括:
    所述相机硬件抽象模块配置所述摄像头的图像输出模式;所述摄像头的图像输出模式包括所述全像素模式或所述像素合并模式;
    所述相机硬件抽象模块向所述相机驱动发送所述摄像头的图像输出模式;
    所述相机驱动根据所述摄像头的图像输出模式,驱动所述摄像头以所述摄像头的图像输出模式输出采集到的图像。
  17. 一种电子设备,其特征在于,包括存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于调用所述计算机程序,以执行如权利要求1至16中任一项所述的模式控制方法。
  18. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序或指令,当所述计算机程序或指令被运行时,实现如权利要求1至16中任一项所述的模式控制方法。
  19. 一种计算机程序产品,其特征在于,包括计算机程序,当所述计算机程序被运行时,使得计算机执行如权利要求1至16中任一项所述的模式控制方法。
PCT/CN2024/078621 2023-06-15 2024-02-26 模式控制方法、电子设备、存储介质及程序产品 Ceased WO2024255314A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202310714632.3 2023-06-15
CN202310714632.3A CN119155544A (zh) 2023-06-15 2023-06-15 模式控制方法、电子设备、存储介质及程序产品

Publications (1)

Publication Number Publication Date
WO2024255314A1 true WO2024255314A1 (zh) 2024-12-19

Family

ID=93800493

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/078621 Ceased WO2024255314A1 (zh) 2023-06-15 2024-02-26 模式控制方法、电子设备、存储介质及程序产品

Country Status (2)

Country Link
CN (1) CN119155544A (zh)
WO (1) WO2024255314A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119485054A (zh) * 2024-12-25 2025-02-18 荣耀终端有限公司 图像读出方法、电子设备和计算机可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004289714A (ja) * 2003-03-25 2004-10-14 Mitsubishi Electric Corp 撮像装置及びその制御方法
CN110475066A (zh) * 2019-08-20 2019-11-19 Oppo广东移动通信有限公司 控制方法、成像装置和电子设备
CN113727016A (zh) * 2021-06-15 2021-11-30 荣耀终端有限公司 一种拍摄方法及电子设备
CN115696063A (zh) * 2022-09-13 2023-02-03 荣耀终端有限公司 拍照方法和电子设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011015205A (ja) * 2009-07-02 2011-01-20 Fujifilm Corp デジタルカメラ及び固体撮像素子の駆動方法
CN104243788B (zh) * 2013-06-06 2017-11-21 华为终端(东莞)有限公司 一种获取目标图像的方法及装置
CN105611185B (zh) * 2015-12-18 2017-10-31 广东欧珀移动通信有限公司 图像生成方法、装置及终端设备
CN105578067B (zh) * 2015-12-18 2017-08-25 广东欧珀移动通信有限公司 图像生成方法、装置及终端设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004289714A (ja) * 2003-03-25 2004-10-14 Mitsubishi Electric Corp 撮像装置及びその制御方法
CN110475066A (zh) * 2019-08-20 2019-11-19 Oppo广东移动通信有限公司 控制方法、成像装置和电子设备
CN113727016A (zh) * 2021-06-15 2021-11-30 荣耀终端有限公司 一种拍摄方法及电子设备
CN115696063A (zh) * 2022-09-13 2023-02-03 荣耀终端有限公司 拍照方法和电子设备

Also Published As

Publication number Publication date
CN119155544A (zh) 2024-12-17

Similar Documents

Publication Publication Date Title
EP4224831A1 (en) Image processing method and electronic device
CN109559270B (zh) 一种图像处理方法及电子设备
WO2022262475A1 (zh) 拍摄方法、图形用户界面及电子设备
EP4436198A1 (en) Method for capturing images in video, and electronic device
CN113099146B (zh) 一种视频生成方法、装置及相关设备
US20230043815A1 (en) Image Processing Method and Electronic Device
EP4284009B1 (en) Method for acquiring image, and electronic device
CN115802146B (zh) 一种录像中抓拍图像的方法及电子设备
CN113709355B (zh) 滑动变焦的拍摄方法及电子设备
WO2023160285A9 (zh) 视频处理方法和装置
CN113688019A (zh) 响应时长检测方法及装置
EP4296845A1 (en) Screen projection method and system, and related apparatus
CN115460343B (zh) 图像处理方法、设备及存储介质
WO2023035868A1 (zh) 拍摄方法及电子设备
WO2024153043A1 (zh) 一种投屏方法
WO2022262550A1 (zh) 一种拍摄视频的方法及电子设备
CN119155544A (zh) 模式控制方法、电子设备、存储介质及程序产品
CN117082295B (zh) 图像流处理方法、设备及存储介质
CN116347217B (zh) 图像处理方法、设备及存储介质
CN115484392B (zh) 一种拍摄视频的方法及电子设备
CN115484390B (zh) 一种拍摄视频的方法及电子设备
CN120897125B (zh) 视频处理方法、电子设备、存储介质和程序产品
CN118540576B (zh) 图像处理方法及相关装置
CN115811656B (zh) 一种拍摄视频的方法及电子设备
CN120897125A (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: 24822272

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE