Mode control method, electronic device, storage medium, and program product
By switching the image output mode according to the camera sensitivity in electronic devices, the problem of poor camera image clarity at different ambient brightness is solved, image quality is improved and picture flicker is reduced.
Patent Information
- Application Number
- PCT/CN2024/078621
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-06-15
- Filing Date
- 2024-02-26
- Publication Date
- 2024-12-19
AI Technical Summary
The images output by the camera in electronic devices at different ambient brightness have poor definition, which affects the image quality.
By obtaining the camera's sensitivity when starting the camera application, switching the camera's image output mode according to the sensitivity threshold, using pixel merging mode for low brightness, and using full pixel mode for high brightness to improve the sharpness and resolution of the image.
Improve the image clarity and resolution of the camera output under different ambient brightness, reduce the picture flickering problem caused by switching image output mode, and improve the overall image quality.
Smart Images

Figure CN2024078621_19122024_PF_FP_ABST
Abstract
Description
Mode control method, electronic device, storage medium and program product
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on June 15, 2023, application number 202310714632.3, and application name “Mode control method, electronic device, storage medium and program product”, all contents of which are incorporated by reference into this application. Technical Field
[0002] 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. Background Art
[0003] With the continuous development of electronic technology, electronic devices such as mobile phones and tablet computers have gradually become more common tools in people's daily life and work. At present, some electronic devices are provided with cameras to provide users with photo or video recording functions based on the cameras.
[0004] However, under different ambient brightness conditions, the images output by cameras in some electronic devices have a problem of poor clarity, which in turn affects the image quality.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a mode control method, electronic device, storage medium and program product, which enable the camera to output the captured image in different image output modes under different ambient brightness, thereby improving the clarity of the image output by the camera and thus improving the image quality.
[0007] In a first aspect, an embodiment of the present application provides a mode control method, which is applied to an electronic device, the electronic device including a camera application and a camera, the method comprising: when the camera application is activated, the electronic device obtains the sensitivity of the camera; when the sensitivity is greater than a first sensitivity threshold and the camera's image output mode is full-pixel mode, the electronic device displays a first preview interface, the first preview interface including a first image, the first image being the image output by the camera in pixel-binning mode; when the sensitivity is less than a second sensitivity threshold and the camera's image output mode is pixel-binning mode, the electronic device displays a second preview interface, the second preview interface including a second image, the second image being the image output by the camera in full-pixel mode. The pixel-binning mode is used to merge multiple adjacent pixels of the same color into a single pixel, and the full-pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold and the second sensitivity threshold are not equal.
[0008] Thus, when the sensitivity is greater than the first sensitivity threshold, indicating that the camera is currently operating in a low-light environment, the camera uses pixel binning mode to output the captured image. By merging multiple adjacent pixels of the same color into a single pixel, the photosensitive area of each pixel is increased, image noise is reduced, and image clarity and brightness are improved, thereby enhancing image quality. Furthermore, when the sensitivity is less than the second sensitivity threshold, indicating that the camera is currently operating in a high-light environment, the camera uses full-pixel mode to output the captured image. By rearranging the pixels into a Bayer array, the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor. In other words, the image output by the camera includes a larger number of pixels, which can increase the image resolution, resulting in higher image clarity and thus improved image quality.
[0009] In one possible implementation, the first sensitivity threshold is greater than the second sensitivity threshold. This improves image quality while reducing the ping-pong switching between the full-pixel mode and the pixel-binning mode, thereby reducing the problem of image flickering on the electronic device caused by switching the camera's image output mode.
[0010] In one possible implementation, after the electronic device obtains the camera's sensitivity, the electronic device further includes: when the sensitivity is less than or equal to a first sensitivity threshold and the camera's image output mode is full-pixel mode, the electronic device displays a third preview interface, the third preview interface including a third image, the third image being the image output by the camera in full-pixel mode; and when the sensitivity is greater than or equal to a second sensitivity threshold and the camera's image output mode is pixel-binning mode, the electronic device displays a fourth preview interface, the fourth preview interface including a fourth image, the fourth image being the image output by the camera in pixel-binning mode. Thus, when the camera's image output mode is full-pixel mode, when the camera's sensitivity is less than or equal to the first sensitivity threshold, the camera's image output mode is controlled to remain in full-pixel mode to improve image clarity; and when the camera's image output mode is pixel-binning mode, when the camera's sensitivity is greater than or equal to the second sensitivity threshold, the camera's image output mode is controlled to remain in pixel-binning mode to improve image clarity and screen brightness.
[0011] In one possible implementation, when the sensitivity is greater than a first sensitivity threshold and the camera's image output mode is full-pixel mode, the electronic device displays a first preview interface, including: when the camera's image output mode is 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 camera's image output mode from full-pixel mode to pixel binning mode; the electronic device obtains a first image output by the camera in pixel binning mode and displays the first image on the first preview interface. Accordingly, when the sensitivity is less than a second sensitivity threshold and the camera's image output mode is pixel binning mode, the electronic device displays a second preview interface, including: when the camera's image output mode is pixel binning 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 camera's image output mode from pixel binning mode to full-pixel mode; the electronic device obtains a second image output by the camera in full-pixel mode and displays the second image on the second preview interface. In this way, according to the different sensitivities of the camera, 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.
[0012] In one possible implementation, when the sensitivity is less than or equal to a first sensitivity threshold and the camera's image output mode is full-pixel mode, the electronic device displays a third preview interface, including: when the camera's image output mode is 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 camera's image output mode 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 the third preview interface. Accordingly, when the sensitivity is greater than or equal to a second sensitivity threshold and the camera's image output mode is pixel binning mode, the electronic device displays a fourth preview interface, including: when the camera's image output mode is pixel binning 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 camera's image output mode to remain in pixel binning mode; the electronic device obtains a fourth image output by the camera in pixel binning mode and displays the fourth image on the fourth preview interface.
[0013] In one possible implementation, 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 duration 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-binning mode. Thus, a preset number of frames or a preset duration can be spaced between two adjacent configurations of the camera's image output mode, thereby reducing the frequency of switching the camera's image output mode between the pixel-binning mode and the full-pixel mode, thereby alleviating the problem of flickering in the image displayed by the electronic device during the switching process.
[0014] In one possible implementation, before the electronic device again determines whether to switch the camera's image output mode, the process further includes: the electronic device obtaining a motion state of the electronic device; and the electronic device determining a preset frame rate based on the motion state. The motion states include a stationary state, a first moving state, and a second moving state, wherein the motion parameters of the second moving state are greater than the motion parameters of the first moving state, and the motion parameters of the first moving state are greater than the motion parameters of the stationary state, and the motion parameters include at least one of acceleration data, angular velocity data, and velocity data. The preset frame rate corresponding to the stationary state is a first frame rate, the preset frame rate corresponding to the first moving state is a second frame rate, and the preset frame rate corresponding to the second moving state is a third frame rate, wherein at least two of the first frame rate, the second frame rate, and the third frame rate are different. In this way, by matching different preset frame rates to the scenes corresponding to different motion states, the smoothness of the camera's image output mode switching process is increased, further reducing the problem of flickering in the image displayed by the electronic device during the camera's image output mode switching process, and making the image displayed by the electronic device more stable.
[0015] In one possible implementation, an electronic device obtains the motion state of the electronic device, including: each time after configuring the image output mode of a 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 again determines 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 a preset condition, the time interval between the first moment and the moment of configuring the image output mode of the camera being equal to the preset number of frames corresponding to the motion state; if the sensitivity meets the preset condition, the electronic device switches the image output mode of the camera; if the sensitivity does not meet the preset condition, the electronic device maintains 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, thereby reducing the power consumption of the electronic device.
[0016] In one possible implementation, 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 again determines 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 the preset conditions, the second moment being the moment when the number of frames in which the motion state remains unchanged reaches 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 problem of flickering of the image displayed by the electronic device during the switching of the image output mode of the camera can be further alleviated, making the image displayed by the electronic device more stable.
[0017] In one possible implementation, 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 again determines 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 conditions, and the target frame number is the number of frames in which the motion state remains unchanged; if the sensitivity obtained within the target frame number meets the preset conditions, 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 conditions, the electronic device keeps the image output mode of the camera unchanged. In this way, the problem of flickering of the image displayed by the electronic device during the switching of the image output mode of the camera is further alleviated, so that the image displayed by the electronic device is more stable.
[0018] In one possible implementation, when the camera's image output mode is full-pixel mode, when the sensitivity is greater than a 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. When the camera's image output mode is pixel binning mode, when the sensitivity is less than a 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.
[0019] In one possible implementation, the first preview interface further includes a first shooting control, and the second preview interface further includes a second shooting control. After the electronic device displays the first preview interface, the electronic device further includes: saving the first image in response to a first operation on the first shooting control. Correspondingly, after the electronic device displays the second preview interface, the electronic device further includes: saving the second image in response to a second operation on the second shooting control. The size of the second image is larger than the size of the first image. In this way, in the shooting scenario of the camera application, the camera can also output the corresponding image in the corresponding image output mode based on the current sensitivity of the camera.
[0020] In one possible implementation, a camera application includes multiple shooting modes, at least some of which correspond to different first sensitivity thresholds, and / or at least some of which correspond to different second sensitivity thresholds. Thus, appropriate first and second sensitivity thresholds are selected based on different shooting modes to mitigate flickering in images displayed by the electronic device when switching between image output modes of the camera.
[0021] In one possible implementation, a camera includes an image sensor, the image sensor includes a pixel array, the pixel array includes multiple pixel sets, each pixel set in the multiple pixel sets includes multiple pixel units, and each pixel unit in the multiple pixel units includes multiple pixels; the multiple pixels in each pixel unit have the same color, and at least some of the multiple pixel units have different colors. The arrangement of the pixel array in full pixel mode is the same as the arrangement of the pixel array in pixel binning mode.
[0022] In a possible implementation, 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.
[0023] In one possible implementation, the electronic device further includes a camera hardware abstraction module and a camera driver. The method further includes: the camera hardware abstraction module configuring the camera's image output mode, where the camera's image output mode includes a full-pixel mode or a pixel-binning mode; the camera hardware abstraction module sending the camera's image output mode to the camera driver; and the camera driver, based on the camera's image output mode, driving the camera to output captured images in the camera's image output mode. Thus, by configuring the camera's image output mode through the camera hardware abstraction module, the camera outputs captured images in the corresponding image output mode. Controlling the camera's image output mode is relatively simple and easy to implement.
[0024] In a second aspect, an embodiment of the present application proposes an electronic device, comprising 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.
[0025] In a third aspect, 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.
[0026] In a fourth aspect, 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.
[0027] The possible implementation methods of the second to fourth aspects have effects similar to those of the first aspect and the possible designs of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] FIG1 is a schematic structural diagram of a camera provided in an embodiment of the present application;
[0029] FIG2 is a schematic diagram of pixel merging of a quad-Bayer array of an image sensor according to an embodiment of the present application;
[0030] FIG3 is a schematic diagram of mosaic rearrangement of a quad-Bayer array of an image sensor according to an embodiment of the present application;
[0031] FIG4 is a schematic diagram of the hardware system structure of an electronic device provided in an embodiment of the present application;
[0032] FIG5 is a schematic diagram of the software system structure of an electronic device provided in an embodiment of the present application;
[0033] FIG6 is a schematic diagram of an interface of an application scenario provided by an embodiment of the present application;
[0034] FIG7 is a flow chart of a mode control method provided in an embodiment of the present application;
[0035] FIG8 is a schematic diagram of module interaction of a mode control method provided in an embodiment of the present application;
[0036] FIG9 is a flowchart of switching the image output mode of a camera according to the motion state of an electronic device according to an embodiment of the present application;
[0037] FIG10 is a schematic diagram of module interaction of another mode control method provided in an embodiment of the present application;
[0038] FIG11 is a schematic diagram of module interaction during image capture according to an embodiment of the present application;
[0039] FIG12 is a schematic structural diagram of a mode control device provided in an embodiment of the present application;
[0040] FIG13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0041] To facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first chip and the second chip are merely used to distinguish different chips and do not limit their order. Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or execution order, and the words "first" and "second" do not necessarily mean that they are different.
[0042] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0043] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B 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 items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0044] Currently, some electronic devices are provided with cameras. When a user uses the electronic device, the camera in the electronic device can be used to take photos or videos.
[0045] As shown in FIG1 , 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.
[0046] The image sensor 20 includes a filter 21 and a photosensitive element 22. The filter 21 is located between the lens 10 and the photosensitive element 22. Light reflected from the subject passes through the lens 10 and the filter 21 before being projected onto the photosensitive element 22. The photosensitive element 22 converts the light signal into an electrical signal to form an image.
[0047] The pixel array in a traditional image sensor uses a cross-distribution of red, green, and blue pixels. However, with the development of imaging technology and the emergence of more and more high-resolution cameras, a new pixel arrangement technique has emerged. This pixel arrangement technique arranges M adjacent pixels of the same color together to form a pixel that is M times larger than the original pixel area, where M is an integer greater than 1. For example, M can be equal to 4, which means that four adjacent pixels of the same color are arranged together to form a pixel that is four times larger than the original pixel area.
[0048] In some electronic devices, the cameras provided therein may employ a four-in-one pixel image sensor. Taking an image sensor 20 as an example, as shown in FIG2(a) and FIG3(a), the pixel array of the image sensor 20 includes a plurality of pixel sets 23, each of which includes four pixel units, namely 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, and the fourth pixel unit 234 includes four blue (B) pixels.
[0049] It can be seen that the color of the pixels in the first pixel unit 231 is different from the color of the pixels in the second pixel unit 232, the color of the pixels in the third pixel unit 233, and the color of the pixels 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 pixels in the second pixel unit 232 is also different from the color of the pixels 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 pixels in the third pixel unit 233 is also different from the color of the pixels 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.
[0050] When the image sensor 20 is an image sensor with four-in-one pixels, the pixel array of the image sensor 20 may be referred to as a quad Bayer array.
[0051] It can be understood that the pixel array of the image sensor in the embodiment of the present application, in addition to adopting the four-Bayer array as 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.
[0052] When the pixel array of the image sensor is a nine-Bayer array, the pixel array of the image sensor includes multiple 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. When the pixel array of the image sensor is a sixteen-Bayer array, the pixel array of the image sensor includes multiple 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.
[0053] Therefore, in an embodiment of the present application, a 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 of the plurality of pixel sets includes a plurality of pixel units, each of the plurality of pixel units includes a plurality of pixels, wherein the plurality of pixels in each pixel unit have the same color, and at least some of the plurality of pixel units have different colors.
[0054] It is understood that the filter 21 may include a single filter array, the filter element array may include multiple filter element sets, each of the multiple filter element sets may include multiple filter elements, and each filter element allows light of the same color to pass through. The photosensitive element 22 may include a photosensitive element array, the photosensitive element array may include multiple photosensitive element sets, each of the multiple photosensitive element sets may include multiple photosensitive elements, and each of the multiple photosensitive elements may include multiple photosensitive pixels. Furthermore, each filter element in the filter 21 corresponds one-to-one to each photosensitive element in the photosensitive element 22, and the multiple photosensitive pixels in each photosensitive element are configured to receive light filtered by its corresponding filter element. Thus, the filter element array and the photosensitive element array covered by the filter element array together constitute the pixel array of the image sensor 20. Therefore, each pixel element in the image sensor 20 actually includes a filter element and the photosensitive elements covered by the filter element.
[0055] Taking the image sensor 20 as an example of a four-in-one pixel image sensor, each filter unit set in the filter 21 may include four filter units, namely the first filter unit, the second filter unit, the third filter unit and the 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, and the color of the light allowed to pass through by the fourth filter unit is blue; and each photosensitive unit set in the photosensitive element 22 may include four photosensitive units, namely the first photosensitive unit, the second photosensitive unit, the third photosensitive unit and the 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.
[0056] In a related technology, when a user uses a camera to capture images under different ambient brightness levels, the camera uses a pixel merging mode (ie, binning mode) to output the captured images.
[0057] When the camera is in pixel merging mode, multiple adjacent pixels of the same color can be merged into one pixel through 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.
[0058] Taking a camera in an electronic device using a four-in-one pixel image sensor as an example, as shown in FIG2(b), when the camera is in pixel binning mode, the four pixels of the same color in each pixel unit are merged 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.
[0059] Therefore, in low-light environments, when a camera uses pixel binning mode to output its captured image, it combines multiple adjacent pixels of the same color into a single pixel, thereby increasing the light-sensitive area of each pixel, reducing image noise, and improving image clarity and brightness, thereby enhancing image quality. However, in high-light environments, when a camera uses pixel binning mode to output its captured image, 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. In other words, the number of pixels included in the image output by the camera is reduced, resulting in a lower resolution, reduced image clarity, and thus reduced image quality.
[0060] In another related technology, when a user uses a camera to capture images under different ambient brightness levels, the camera outputs the captured images in full-pixel mode (i.e., full-size mode). The full-pixel mode can also be called full-size mode.
[0061] When the camera is in full-pixel mode, it can use a remosaic method to rearrange the pixels in the image captured by the image sensor into a Bayer array. When the pixels in the image output by the camera are in a Bayer array, each pixel in the image corresponds to a channel signal of only one color, and adjacent pixels can have different colors.
[0062] In some embodiments, 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, red pixels may account for 25% of all pixels, and blue pixels may account for 25% of all pixels. That is, each pixel unit in the Bayer array may 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 pattern.
[0063] Taking a camera in an electronic device using a four-in-one pixel image sensor as an example, as shown in FIG3(b), when the camera is in full-pixel mode, it converts a four-Bayer array image captured by the image sensor 20 into a Bayer array image. Specifically, the four red pixels in the first pixel unit 231 are rearranged into a red pixel, a green pixel, a green pixel, and a blue pixel, respectively; the four green pixels in the second pixel unit 232 are rearranged into a red pixel, a green pixel, a green pixel, and a blue pixel, respectively; the four green pixels in the third pixel unit 233 are rearranged into a red pixel, a green pixel, a green pixel, and a blue pixel, respectively; and the four blue pixels in the fourth pixel unit 234 are rearranged into a red pixel, a green pixel, a green pixel, and a blue pixel, respectively.
[0064] Therefore, in high-brightness environments, when a camera uses full-pixel mode to output its captured image, it rearranges the pixels into a Bayer array, making the number of pixels in the image output by the camera equal to the number of pixels in the image sensor. This means that the image output by the camera includes more pixels, which can improve the image resolution, resulting in higher image clarity and, consequently, improved image quality. However, in low-brightness environments, when a camera uses full-pixel mode to output its captured image, the photosensitive area of each pixel is smaller, resulting in higher image noise, which reduces image clarity and, consequently, image quality.
[0065] In summary, it can be seen that under different ambient brightness levels, if the camera always uses pixel merging mode or full pixel mode, the image output by the camera will have poor clarity, which will affect the image quality.
[0066] Based on this, an embodiment of the present application provides a mode control method, which obtains the camera's sensitivity when a camera application is started; when the sensitivity is greater than a first sensitivity threshold and the camera's image output mode is full-pixel mode, displays a first preview interface, which includes a first image, which is the image output by the camera in pixel-binning mode; when the sensitivity is less than a second sensitivity threshold and the camera's image output mode is pixel-binning mode, displays a second preview interface, which includes a second image, which is the image output by the camera in full-pixel mode. The first sensitivity threshold and the second sensitivity threshold are not equal.
[0067] The light sensitivity ordinance (ISO) of a camera is used to measure its sensitivity to light. In embodiments of the present application, the camera's light sensitivity can be used to determine the ambient brightness of the environment in which the camera is capturing images. Specifically, when the ambient brightness is low, the camera's light sensitivity is high, the camera is more sensitive to light, and it senses more light. When the ambient brightness is high, the camera's light sensitivity is low, the camera is less sensitive to light, and it senses less light.
[0068] Therefore, in the embodiments of the present application, when the sensitivity is greater than the first sensitivity threshold, indicating that the camera is currently in a low-brightness environment, the camera uses a pixel-binning mode to output the captured image. By merging multiple adjacent pixels of the same color into a single pixel, the photosensitive area of a single pixel is increased, image noise is reduced, and image clarity and brightness are improved, thereby enhancing image quality. Furthermore, when the sensitivity is less than the second sensitivity threshold, indicating that the camera is currently in a high-brightness environment, the camera uses a full-pixel mode to output the captured image. By rearranging the pixels into a Bayer array, the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor. In other words, the image output by the camera includes a larger number of pixels, which can improve the image resolution, resulting in higher image clarity and thus improved image quality.
[0069] In summary, the embodiments of the present application adjust the camera's image output mode according to the ambient brightness. In high-brightness environments, the camera's image output mode is adjusted to full-pixel mode, and in low-brightness environments, the camera's image output mode is adjusted to pixel-binning mode, thereby improving the clarity of the image output by the camera under different ambient brightness levels and thereby improving image quality. The camera's image output mode can also be referred to as the camera's image output specification.
[0070] The mode control method provided in the embodiment of the present application can be applied to electronic devices with cameras. Electronic devices include terminal devices, which can also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. The electronic devices can be mobile phones, smart TVs, wearable devices, tablet computers (Pad), computers with wireless transceiver functions, virtual reality (VR) electronic devices, augmented reality (AR) electronic devices, wireless terminals in industrial control (industrial control), wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of the present application do not limit the specific technologies and specific device forms adopted by the electronic devices.
[0071] In order to better understand the embodiments of the present application, the structure of the electronic device according to the embodiments of the present application is introduced below.
[0072] 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 494, and a subscriber identification module (SIM) card interface 495. The sensor module 480 may include a motion sensor 480A.
[0073] It should be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 400. In other embodiments of the present application, the electronic device 400 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0074] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0075] 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.
[0076] Processor 410 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 410 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 410. If processor 410 needs to use the instruction or data again, it can retrieve it from the memory. This avoids duplicate accesses, reduces processor 410 latency, and thus improves system efficiency.
[0077] The charging management module 440 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 440 can receive charging input from the wired charger via the USB interface 430. In some wireless charging embodiments, the charging management module 440 can receive wireless charging input via the wireless charging coil of the electronic device 400. While charging the battery 442, the charging management module 440 can also provide power to the electronic device via the power management module 441.
[0078] 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 provides power to the processor 410, the internal memory 421, the display 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 count, and battery health status (leakage, impedance). In some other embodiments, the power management module 441 can also be provided in the processor 410. In other embodiments, the power management module 441 and the charging management module 440 can also be provided in the same device.
[0079] 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.
[0080] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. 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. In some embodiments, at least some functional modules of mobile communication module 450 may be provided in the same device as at least some modules of processor 410.
[0081] The wireless communication module 460 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 400. The wireless communication module 460 can be one or more devices that integrate at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 410. The wireless communication module 460 can also receive the signal to be sent from the processor 410, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0082] In some embodiments, 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.
[0083] Electronic device 400 implements display functionality through a GPU, display screen 494, and an application processor. The GPU is a microprocessor for image processing that connects display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 410 may include one or more GPUs that execute program instructions to generate or modify display information.
[0084] Display screen 494 is used to display images, videos, and receive sliding operations. 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), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 400 may include one or N display screens 494, where N is a positive integer greater than one.
[0085] The electronic device 400 can realize the shooting function through the ISP, camera 493, video codec, GPU, display screen 494 and application processor.
[0086] The ISP processes data fed back by camera 493. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 493.
[0087] 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. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 400 may include 1 or N cameras 493, where N is a positive integer greater than 1.
[0088] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 400 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0089] Video codecs are used to compress or decompress digital video. Electronic device 400 may support one or more video codecs. This allows electronic device 400 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0090] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 400, such as image recognition, face recognition, voice recognition, and text comprehension.
[0091] 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 via the external memory interface 420 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0092] 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. Among them, 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. In addition, 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 (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.
[0093] The electronic device 400 can implement audio functions such as music playback and recording through the audio module 470, the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
[0094] The motion sensor 480A may include at least one of an acceleration sensor, a gyroscope sensor, and a speed sensor.
[0095] The accelerometer can detect the magnitude of the electronic device 400's acceleration in all directions (generally three axes), thereby monitoring the motion of the electronic device 400. When the electronic device 400 is stationary, it can detect the magnitude and direction of gravity. The accelerometer can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0096] The gyroscope sensor can be used to determine the motion posture of the electronic device 400. In some embodiments, the angular velocity of the electronic device 400 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor, so that the motion state of the electronic device 400 can be monitored. 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 electronic device 400 shaking, 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. The gyroscope sensor can also be used for navigation and somatosensory game scenes.
[0097] 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.
[0098] Keys 490 include a power button, a volume button, and the like. Keys 490 may be mechanical keys or touch-sensitive keys. Electronic device 400 may receive key inputs and generate key signal inputs related to user settings and function control of electronic device 400.
[0099] 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. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For 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.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0100] Indicator 492 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0101] 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 or removing it 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. In some embodiments, 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.
[0102] The software system of the electronic device 400 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture, etc. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software structure of the electronic device 400 .
[0103] Figure 5 is a block diagram of the software structure 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 divisions of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: the application layer, the application framework layer, the Android runtime and system libraries, the hardware abstraction layer, and the kernel layer.
[0104] The application layer may include a series of application packages. As shown in Figure 5, the application package may include applications such as camera, settings, and calendar.
[0105] The camera application is an application with the function of taking pictures and recording videos. The electronic device can respond to the user's operation of opening the camera application to take pictures or record videos. It is understandable that the camera application's photo and video functions can also be called by other applications.
[0106] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0107] As shown in FIG5 , the application framework layer may further include a camera service, which may be called by a camera application to implement functions such as taking photos or recording videos.
[0108] In some embodiments, 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 enable communication between Java and other languages.
[0109] The entire camera service is roughly divided into two parts during runtime: the client process and the server process. The binder mechanism enables inter-process communication between the two processes. The binder mechanism is an inter-process communication (IPC) mechanism. The client process is the one that initiates the process request, and the server process is the one that is requested to execute the camera service.
[0110] In addition, as shown in FIG5 , the application framework layer may also include a window manager, a content provider, a resource manager, a view system, and the like.
[0111] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0112] Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0113] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0114] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0115] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0116] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0117] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0118] 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.
[0119] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0120] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG2, H.262, MP3, AAC, AMR, JPG, PNG, etc.
[0121] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing. The 2D graphics engine is a drawing engine for 2D drawing.
[0122] The Hardware Abstraction Layer (HAL) is an abstract structure between the kernel layer and the Android runtime. It encapsulates the kernel layer's hardware drivers and provides a calling interface for the application framework layer.
[0123] In embodiments of the present application, the hardware abstraction layer may include a camera hardware abstraction layer (HAL). In some embodiments, the HAL is configured to configure the camera's image output mode based on the camera's light sensitivity. In other embodiments, the HAL is configured to configure the camera's image output mode based on the camera's light sensitivity and the motion state of the electronic device.
[0124] The kernel layer is the layer between hardware and software. It includes at least a camera driver, a sensor driver, and a display driver. In some embodiments, the camera driver controls the camera, the sensor driver controls the motion sensor, and the display driver controls the display screen's image display.
[0125] The hardware may be a camera, a motion sensor, a display screen, etc. In the embodiment of the present application, the camera may be a front camera or a rear camera.
[0126] It should be noted that although the embodiments of the present application are described using the Android system, the principles of the mode control method are also applicable to electronic devices with operating systems such as iOS or Windows.
[0127] The following specific embodiments describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.
[0128] For ease of understanding, 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.
[0129] When a user turns on the screen of an electronic device and controls the electronic device to be in an unlocked state, the electronic device may display a 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 settings application icon, an address book application icon, a phone application icon, a messaging application icon, and a camera application icon 6011.
[0130] The user can perform a touch operation on the camera application icon 6011, which 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 responds to the touch operation to start the camera application.
[0131] After the camera application is started, the electronic device may display a 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, which includes a preview box 6021, a shooting control 6022, and function controls corresponding to various shooting modes.
[0132] 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 enabling more functions in the camera application.
[0133] Therefore, in the embodiment of the present 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 the image output by the camera is displayed 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.
[0134] It can be understood that the interface shown in (a) of Figure 6 and (b) of Figure 6 is merely an example of the user interface in the process of launching a camera application by touching the camera application icon of an electronic device, and does not constitute a limitation of the embodiments of the present application.
[0135] In another scenario, the user can also access the electronic device's camera application by calling a corresponding interface through a third-party application installed on the electronic device to launch the camera application. After the camera application is launched and the image output by the camera is displayed in real time on the preview interface of the camera application, the electronic device can execute the corresponding process of the mode control method provided in the embodiments of the present application.
[0136] In another scenario, when the camera application switches from background operation to foreground operation, the camera application can be started. After the camera application is started, and the image output by the camera is displayed 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.
[0137] Among them, 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.
[0138] It should be noted that when the camera application switches from foreground operation to background operation, it is not necessary to execute the process corresponding to the mode control method provided in the embodiment of the present application.
[0139] The following describes in detail the specific implementation method of the electronic device in the embodiment of the present application controlling the image output mode of the camera.
[0140] For example, 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. Referring to FIG7 , the mode control method can specifically include the following steps:
[0141] S701: The electronic device starts a camera application and configures the camera's image output mode to be a full-pixel mode.
[0142] When the user wants to start the camera application, the user can click the camera application icon 6011 as shown in (a) in 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.
[0143] It is understood that there are multiple ways to launch the camera application. In addition to the above-mentioned touch operation on the camera application icon 6011 to launch the camera application, the camera application can also be launched through voice triggering or sliding triggering. For example, 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 launch the camera application. The specific operation method for launching the camera application is not limited in the embodiments of the present application.
[0144] In the initial state after the camera application is launched, the electronic device defaults to configuring the camera's image output mode to full-pixel mode. That is, before configuring the camera's output mode based on the camera's sensitivity as provided in the embodiments of the present application, the camera's image output mode defaults to full-pixel mode.
[0145] The full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method. The mosaic rearrangement method can be referred to the description corresponding to FIG3 above, and will not be repeated here.
[0146] S702: When the image output mode of the camera is the full-pixel mode, the electronic device determines whether the sensitivity of the camera is greater than a first sensitivity threshold.
[0147] After the electronic device starts the camera application, the electronic device will obtain the camera's sensitivity in real time to measure the ambient brightness of the camera's current environment based on the camera's sensitivity.
[0148] Since the image output mode of the camera defaults to full-pixel mode in the initial state of the electronic device after starting the camera application, when the image output mode of the camera is full-pixel mode, 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.
[0149] When the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device sequentially executes the following S703 and S704; and when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the electronic device sequentially executes the following S705 and S706.
[0150] S703: 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-binning mode.
[0151] When 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 dark, then the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode.
[0152] 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 FIG2 above, and will not be repeated here.
[0153] It is understood that the first sensitivity threshold can be set according to actual conditions. For example, the first sensitivity threshold can be 1400. When the camera's image output mode is full-pixel mode, when the camera's sensitivity is greater than 1400, the electronic device switches the camera's image output mode from full-pixel mode to pixel binning mode.
[0154] S704: 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.
[0155] After the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode, the camera can output the first image it captures 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.
[0156] In the embodiment of the present application, when the camera's image output mode is full-pixel mode, when the camera's sensitivity is greater than a first sensitivity threshold, the electronic device can switch the camera's image output mode from full-pixel mode to pixel-binning mode, whereupon the camera outputs a captured first image in pixel-binning mode. By merging multiple adjacent pixels of the same color into a single pixel, the photosensitive area of a single pixel in the first image can be increased, reducing noise in the first image, improving the clarity and brightness of the first image, and thereby enhancing the image quality of the first image.
[0157] Therefore, according to the above S702 to S704, when the sensitivity of the camera is greater than the first sensitivity threshold and the image output mode of the camera is the full-pixel mode, the electronic device displays a first preview interface; the first preview interface includes a first image, which is the image output by the camera in the pixel merging mode.
[0158] After the electronic device executes the above S704, the electronic device may continue to execute the following S707 and subsequent steps.
[0159] S705: 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 maintain the full-pixel mode.
[0160] When 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 when switching from full-pixel mode to pixel merging mode. The electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
[0161] That is to say, when the image output mode of the camera is full-pixel mode, when 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.
[0162] For example, the first sensitivity threshold may be 1400. When the image output mode of the camera is full-pixel mode, when the sensitivity of the camera is less than or equal to 1400, the electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
[0163] S706, 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.
[0164] After the electronic device controls the camera's image output mode to continue to remain in full-pixel mode, 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.
[0165] In an embodiment of the present application, when the camera's image output mode is in full-pixel mode, and the camera's sensitivity is less than or equal to a first sensitivity threshold, the electronic device can control the camera's image output mode to remain in full-pixel mode, whereupon the camera outputs a third image captured in full-pixel mode. By rearranging the pixels into a Bayer array, 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. This improves the resolution of the third image, resulting in higher clarity and, consequently, enhanced image quality.
[0166] Therefore, according to the above S702, S705 and S706, when the sensitivity of the camera is less than or equal to the first sensitivity threshold and the image output mode of the camera is 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 full-pixel mode.
[0167] After the electronic device executes the above S706, the electronic device may continue to execute the above S702 and subsequent steps.
[0168] S707: When the image output mode of the camera is the pixel merging mode, the electronic device determines whether the sensitivity of the camera is less than a second sensitivity threshold.
[0169] After the electronic device executes S704 above, the camera's image output mode has been switched from full-pixel mode to pixel-binning mode. Therefore, when the camera's image output mode is pixel-binning mode, the electronic device can compare the camera's sensitivity with the second sensitivity threshold to determine whether the camera's sensitivity is less than the second sensitivity threshold.
[0170] When 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.
[0171] S708: 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.
[0172] When 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, then the electronic device switches the image output mode of the camera from pixel merging mode to full pixel mode.
[0173] It is understood that the second sensitivity threshold can be set according to actual conditions. For example, the second sensitivity threshold can be 550. When the camera's image output mode is pixel binning mode, when the camera's sensitivity is less than 550, the electronic device switches the camera's image output mode from pixel binning mode to full pixel mode.
[0174] In the embodiment of the present application, the first sensitivity threshold is not equal to the second sensitivity threshold.
[0175] By setting the first sensitivity threshold and the second sensitivity threshold to be unequal, the judgment conditions when switching from full-pixel mode to pixel merging mode can be different from the judgment conditions when switching from pixel merging mode to full-pixel mode, thereby reducing the situation where the camera performs ping-pong switching between full-pixel mode and pixel merging mode, and thereby reducing the problem of image flickering displayed on the electronic device during the switching of the camera's image output mode.
[0176] S709: 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.
[0177] After the electronic device switches the image output mode of the camera from pixel merging mode to full-pixel mode, the camera can output the second image it has captured 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.
[0178] In an embodiment of the present application, when the camera's image output mode is pixel binning mode, and the camera's sensitivity is less than a second sensitivity threshold, the electronic device can switch the camera's image output mode from pixel binning mode to full-pixel mode, whereupon the camera outputs the captured second image in full-pixel mode. By rearranging the pixels into a Bayer array, 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. This improves the resolution of the second image, resulting in higher clarity and, consequently, enhanced image quality.
[0179] Therefore, according to the above S707 to S709, when the sensitivity of the camera is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, the electronic device displays a second preview interface; the second preview interface includes a second image, and the second image is the image output by the camera in full-pixel mode.
[0180] After the electronic device executes the above S709, the electronic device may continue to execute the above S702 and subsequent steps.
[0181] S710: 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.
[0182] When 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 dark. At this time, the sensitivity of the camera has not reached the switching condition from pixel merging mode to full pixel mode, so the electronic device controls the image output mode of the camera to continue to remain in pixel merging mode.
[0183] That is to say, when the image output mode of the camera is pixel merging mode, when 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 pixel merging mode to full pixel mode.
[0184] For example, the second sensitivity threshold may be 550. 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 550, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0185] S711, 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.
[0186] After the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode, 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.
[0187] In the embodiment of the present application, when the camera's image output mode is pixel-binning mode, when the camera's sensitivity is greater than or equal to a second sensitivity threshold, the electronic device can control the camera's image output mode to remain in pixel-binning mode, whereupon the camera outputs a fourth image captured by the camera in pixel-binning mode. By merging multiple adjacent pixels of the same color into a single pixel, the photosensitive area of a single pixel in the fourth image can be increased, reducing noise in the fourth image, improving the clarity and brightness of the fourth image, and thereby enhancing the image quality of the fourth image.
[0188] Therefore, according to the above S707, S710 and S711, 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 the fourth preview interface; the fourth preview interface includes the fourth image, and the fourth image is the image output by the camera in the pixel merging mode.
[0189] After the electronic device executes the above S711, the electronic device may continue to execute the above S707 and subsequent steps.
[0190] In the embodiment of the present application, 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.
[0191] Since the pixel array of an image sensor is composed of a filter array and a photosensitive array covered by the filter array, and the color of light received by each pixel in the image sensor's pixel array is determined by the color of light allowed to pass through by the filter array, the pixel array of an image sensor in full-pixel mode is arranged in the same manner as the pixel array of an image sensor in pixel-binning mode. This also means that the filter array in full-pixel mode is arranged in the same manner as the filter array in pixel-binning mode.
[0192] When the camera's image output mode is pixel merging mode, when the camera outputs the image it has captured, it adds together the electrical signals sensed by adjacent pixels in the image sensor's pixel array and outputs it in a single-pixel mode. It does not change the arrangement of the image sensor's pixel array.
[0193] Specifically, when the camera is in pixel binning mode, the corresponding pixel binning methods include horizontal binning and vertical binning. Horizontal binning adds the electrical signals sensed by pixels in adjacent rows, while vertical binning adds the electrical signals sensed by pixels in adjacent columns.
[0194] When the camera's image output mode is full-pixel mode, when outputting the image it has captured, the camera 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.
[0195] For example, the specific implementation method of the mosaic rearrangement method can be: exchanging 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.
[0196] In some embodiments, 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.
[0197] 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. When the image output mode of the camera is configured as a pixel merging mode, 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.
[0198] It is understood that 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 FIG2(a) and FIG3(a). When the pixel array of the image sensor adopts a nine-Bayer array, the pixel merging mode includes a nine-in-one pixel merging mode, which is used to merge nine adjacent pixels of the same color into a single pixel. When the pixel array of the image sensor adopts a sixteen-Bayer array, the pixel merging mode includes a sixteen-in-one pixel merging mode, which is used to merge sixteen adjacent pixels of the same color into a single pixel.
[0199] In some embodiments, the first light sensitivity threshold is greater than the second light sensitivity threshold.
[0200] By setting the first sensitivity threshold to be greater than the second sensitivity threshold, the camera only uses pixel binning mode to output the captured image when the camera's sensitivity is sufficiently high, thereby improving image clarity and brightness. When the camera's sensitivity is sufficiently low, the camera only uses full-pixel mode to output the captured image, thereby improving image resolution and, in turn, image clarity. This improves image quality while reducing the camera's ping-pong switching between full-pixel mode and pixel binning mode, thereby mitigating the problem of flickering in images displayed on electronic devices caused by switching between the camera's image output modes.
[0201] It should be noted that, in the above method for controlling the image output mode of a camera, the camera may be a front camera or a rear camera, and this embodiment of the present application does not limit this.
[0202] For ease of understanding, the interaction process between the various modules involved in the mode control method provided in the embodiment of the present application is described below in conjunction with Figure 8. In this mode control method, whether to switch the image output mode of the camera is determined based on the sensitivity of the camera.
[0203] As shown in Figure 8, the electronic device may include a camera application, a camera service, a camera hardware abstraction module, a camera driver, and a camera. Referring to Figure 8, the mode control method may specifically include the following steps:
[0204] S801: The camera application receives a user's touch operation on the camera application icon.
[0205] S802 : In response to a touch operation on a camera application icon, the camera application sends an image preview request to a camera service.
[0206] S803: The camera service sends an image preview request to the camera hardware abstraction module.
[0207] S804: The camera hardware abstraction module sends an image preview request to the camera driver.
[0208] S805: The camera driver sends an image preview request to the camera.
[0209] For example, a camera application icon may be displayed on the desktop of the electronic device. When a user wants to use the camera application, 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.
[0210] In response to a touch operation on the camera application icon, the camera application launches the camera application and begins running on the electronic device. After the camera application launches, 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 a preview image captured by the camera.
[0211] 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.
[0212] S806: When the camera receives the image preview request, the camera sends the camera sensitivity to the camera driver.
[0213] S807: The camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
[0214] When the camera receives an image preview request, the camera can collect the camera's sensitivity in real time and send the camera's sensitivity to the camera driver. The camera driver then sends the camera's sensitivity to the camera hardware abstraction module.
[0215] S808, 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.
[0216] After receiving the camera's light sensitivity, the camera hardware abstraction module configures the camera's image output mode according to the camera's light sensitivity.
[0217] Specifically, when the image output mode of the camera is full-pixel mode, when the sensitivity of the camera is greater than the first sensitivity threshold, 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.
[0218] When the image output mode of the camera is full-pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, 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.
[0219] When the image output mode of the camera is pixel merging mode, when the sensitivity of the camera is less than the second sensitivity threshold, the camera hardware abstraction module determines that the image output mode of the camera needs to be switched from pixel merging mode to full-pixel mode. In this case, the camera hardware abstraction module configures the image output mode of the camera to full-pixel mode.
[0220] 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 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.
[0221] The specific implementation method of the camera hardware abstraction module configuring the camera's image output mode according to the camera's sensitivity can be referred to the corresponding description of Figure 7 above, which will not be repeated here.
[0222] S809: The camera hardware abstraction module sends the camera's image output mode to the camera driver.
[0223] S810: The camera driver sends the camera's image output mode to the camera.
[0224] S811: The camera outputs the preview image it has captured according to the image output mode of the camera.
[0225] After the camera hardware abstraction module configures the camera's image output mode according to the camera's sensitivity, the camera hardware abstraction module sends the camera's image output mode to the camera driver. 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 collected according to the camera's image output mode.
[0226] Therefore, according to the above S810 and S811, 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.
[0227] In order to facilitate the distinction between the preview images output by the camera under different ambient brightness levels, the preview images under different scenarios may be referred to as the first image, the second image, the third image, and the fourth image, respectively. Specifically, when the camera's image output mode switches from full-pixel mode to pixel-binning mode, the preview image output by the camera is the first image output by the camera under pixel-binning mode; when the camera's image output mode remains in full-pixel mode, the preview image output by the camera is the third image output by the camera under full-pixel mode; when the camera's image output mode switches from pixel-binning mode to full-pixel mode, the preview image output by the camera is the second image output by the camera under full-pixel mode; when the camera's image output mode remains in pixel-binning mode, the preview image output by the camera is the fourth image output by the camera under pixel-binning mode.
[0228] It should be noted that only when the camera hardware abstraction module determines that the camera's image output mode needs to be switched will the camera hardware abstraction module send the switched image output mode to the camera via the camera driver. However, when the camera hardware abstraction module determines that the camera's image output mode does not need to be switched, the camera hardware abstraction module may not send the camera's image output mode to the camera driver. Alternatively, when the camera hardware abstraction module determines that the camera's image output mode does not need to be switched, the camera hardware abstraction module may send the camera's image output mode to the camera via the camera driver.
[0229] In some embodiments, for scenarios where the camera outputs an image captured in pixel binning mode, after capturing the image, the camera may process the image captured by the camera using pixel binning and output the processed image. In this case, the processed image output by the camera is the image output by the camera in pixel binning mode.
[0230] Accordingly, in scenarios where the camera outputs its captured image in full-pixel mode, after capturing the image, the camera can process the captured image using a mosaic rearrangement method and output the processed image. In this case, the processed image output by the camera is the image output by the camera in full-pixel mode.
[0231] In other embodiments, the arrangement of the pixel array in the image output by the camera can be consistent with the pixel array of the image sensor. In this case, after the camera sends the output image to the camera hardware abstraction module through the camera driver, the camera hardware abstraction module can process the image output by pixel binning for scenarios where the camera's image output mode is pixel binning; and can process the image output by mosaic reordering for scenarios where the camera's image output mode is full pixel mode.
[0232] S812: The camera sends a preview image to the camera driver.
[0233] S813: The camera driver sends a preview image to the camera hardware abstraction module.
[0234] S814, the camera hardware abstraction module sends the preview image to the camera service.
[0235] S815: The camera service sends the preview image to the camera application.
[0236] S816: The camera application displays a preview image.
[0237] After the camera outputs the captured preview image according to its image output mode, it sends the preview image to the camera application through the camera driver, the camera hardware abstraction module, and the camera service. After receiving the preview image, the camera application can display it on the preview interface.
[0238] In an embodiment of the present application, the camera can continuously output each frame of image it captures 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.
[0239] To facilitate differentiation between the preview interfaces of the preview images output by the camera under different ambient brightness levels, the preview interfaces when displaying different preview images are referred to as the first preview interface, the second preview interface, the third preview interface, and the fourth preview interface, respectively. Specifically, the preview interface when displaying the first image is the first preview interface, the preview interface when displaying the second image is the second preview interface, the preview interface when displaying the third image is the third preview interface, and the preview interface when displaying the fourth image is the fourth preview interface.
[0240] In addition, the preview image sent to the camera application may be an image processed by the ISP.
[0241] In some embodiments, 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, wherein the camera's image output mode includes a full pixel mode or a pixel binning mode.
[0242] That is, the time interval between the electronic device configuring the camera's image output mode and the next determination of whether to switch the camera's image output mode can be a preset number of frames. Furthermore, configuring the camera's image output mode can include switching the camera's image output mode and controlling the camera's image output mode to remain unchanged.
[0243] Because the camera's light sensitivity is acquired in real time, embodiments of the present application can determine the relationship between the camera's light sensitivity and the light sensitivity threshold in real time. Furthermore, after a preset number of frames have passed since the camera's image output mode was configured, a determination is made based on the determination of the relationship between the camera's light sensitivity and the light sensitivity threshold to determine whether to switch the camera's image output mode.
[0244] Alternatively, the embodiment of the present application can also determine the relationship between the camera's sensitivity and the 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.
[0245] Exemplarily, after executing S703 and S704 above and switching the camera's image output mode from full-pixel mode to pixel binning mode, the electronic device executes S707 above after a preset number of frames to determine whether the camera's sensitivity is less than the second sensitivity threshold. After executing S705 and S706 above and controlling the camera's image output mode to remain in full-pixel mode, the electronic device executes S702 above after a preset number of frames to determine whether the camera's sensitivity is greater than the first sensitivity threshold. After executing S708 and S709 above and switching the camera's image output mode from pixel binning mode to full-pixel mode, the electronic device executes S702 above after a preset number of frames to determine whether the camera's sensitivity is greater than the first sensitivity threshold. After executing S710 and S711 above and controlling the camera's image output mode to remain in pixel binning mode, the electronic device executes S707 above after a preset number of frames to determine whether the camera's sensitivity is less than the second sensitivity threshold.
[0246] It should be noted that the above-mentioned preset frame rate can be an empirical value, which can be selected differently based on different modules and complete products. For a specific electronic device, an appropriate value can be selected as the preset frame rate based on actual product debugging to alleviate or resolve the problem of image flickering during the switching process.
[0247] Specifically, for a certain electronic device, the preset number of frames may be a fixed value set in advance, such as 200 frames.
[0248] After each configuration of the camera's image output mode, the camera hardware abstraction module in the electronic device can count the number of frames from zero to determine whether the number of frames has reached the preset number of frames. In some embodiments, the frame rate at which the camera captures images is consistent with the frame rate at which the camera application displays 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 one for each frame 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 one for each frame captured by the camera by the camera application.
[0249] In other embodiments, after a preset time period after each configuration of the camera's image output mode, the electronic device again determines whether to switch the camera's image output mode, wherein the camera's image output mode includes a full pixel mode or a pixel binning mode.
[0250] That is to say, 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.
[0251] The embodiment of the present application can determine the relationship between the sensitivity of the camera and the sensitivity threshold in real time, and only after a preset time after the image output mode of the camera is configured, 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.
[0252] Alternatively, the embodiment of the present application can also determine the relationship between the camera's sensitivity and the sensitivity threshold 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 after a preset time interval.
[0253] Exemplarily, after executing S703 and S704 above and switching the camera's image output mode from full-pixel mode to pixel binning mode, the electronic device executes S707 above after a preset time interval to determine whether the camera's sensitivity is less than the second sensitivity threshold. After executing S705 and S706 above and controlling the camera's image output mode to remain in full-pixel mode, the electronic device executes S702 above after a preset time interval to determine whether the camera's sensitivity is greater than the first sensitivity threshold. After executing S708 and S709 above and switching the camera's image output mode from pixel binning mode to full-pixel mode, the electronic device executes S702 above after a preset time interval to determine whether the camera's sensitivity is greater than the first sensitivity threshold. After executing S710 and S711 above and controlling the camera's image output mode to remain in pixel binning mode, the electronic device executes S707 above after a preset time interval to determine whether the camera's sensitivity is less than the second sensitivity threshold.
[0254] It should be noted that the above-mentioned preset duration can be an empirical value, which can be selected according to different modules and complete products. For a specific electronic device, an appropriate value can be selected as the preset duration based on actual product debugging to reduce or solve the problem of image flickering during the switching process.
[0255] Specifically, for a certain electronic device, the preset time length may be a pre-set fixed value, such as 8 seconds.
[0256] In the above process, the time interval between the electronic device configuring the camera's image output mode and the next determination of whether to switch the camera's image output mode can be a preset number of frames, which can be a fixed value. In another possible implementation, the embodiment of the present application can also determine the preset number of frames based on the motion state of the electronic device, and determine whether to switch the camera's image output mode based on the preset number of frames.
[0257] In one exemplary implementation, 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:
[0258] S901: The electronic device obtains motion parameters collected by the motion sensor in real time.
[0259] S902: 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 stationary state, a first moving state, and a second moving state.
[0260] 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.
[0261] In an embodiment of the present application, 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.
[0262] For example, if the motion sensor includes an accelerometer, the motion parameters collected by the accelerometer include acceleration data, which includes acceleration along the x-axis, y-axis, and z-axis. The electronic device can determine the motion state of the electronic device based on the acceleration data collected by the accelerometer.
[0263] For example, when the acceleration sensor detects that the acceleration data of the electronic device is less than a first acceleration threshold, the electronic device is determined to be 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 a second acceleration threshold, the electronic device is determined to be in a first moving state; and when the acceleration sensor detects that the acceleration data of the electronic device is greater than or equal to the second acceleration threshold, the electronic device is determined to be 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.
[0264] For example, if the motion sensor includes a gyroscope, the motion parameters collected by the gyroscope include angular velocity data, which includes angular velocities along the x-axis, y-axis, and z-axis. The electronic device can determine the motion state of the electronic device based on the angular velocity data collected by the gyroscope.
[0265] For example, when the gyroscope sensor detects that the angular velocity data of the electronic device is less than a first angular velocity threshold, the electronic device is determined to be 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 a second angular velocity threshold, the electronic device is determined to be in a first moving state; and when the gyroscope sensor detects that the angular velocity data of the electronic device is greater than or equal to a second angular velocity threshold, the electronic device is determined to be 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.
[0266] For example, if the motion sensor includes a velocity sensor, the motion parameters collected by the velocity sensor include velocity data, which includes 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 velocity data collected by the velocity sensor.
[0267] For example, when the speed sensor detects that the speed data of the electronic device is less than a first speed threshold, the electronic device is determined to be 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 and less than a second speed threshold, the electronic device is determined to be in a first moving state; and when 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 a 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.
[0268] It should be noted that 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.
[0269] Therefore, according to the above S901 and S902, the electronic device can obtain the motion state of the electronic device in real time.
[0270] S903: The electronic device determines that the preset number of frames corresponding to the static state is a first number of frames.
[0271] S904: The electronic device determines that the preset number of frames corresponding to the first movement state is a second number of frames.
[0272] S905: The electronic device determines that the preset number of frames corresponding to the second movement state is a third number of frames.
[0273] In an embodiment of the present application, the electronic device is pre-set with preset frame numbers corresponding to different motion states. When 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; when the electronic device determines that its motion state is a first moving state, the electronic device determines that the preset frame number corresponding to the first moving state is a second frame number; when the electronic device determines that its motion state is a second moving state, the electronic device determines that the preset frame number corresponding to the second moving state is a third frame number.
[0274] The first, second, and third frame rates can be empirical values, which can be selected based on different modules and complete products. For a specific electronic device, appropriate values can be selected as the first, second, and third frame rates based on actual product debugging.
[0275] At least two of the first frame number, the second frame number, and the third frame number are different.
[0276] For example, the first frame rate corresponding to the static state can be greater than the first frame rate corresponding to the first moving state; and the first frame rate corresponding to the static state can be greater than the third frame rate corresponding to the second moving state. By extending the preset frame rate in the static state, the smoothness of the camera's image output mode switching process can be improved.
[0277] Therefore, according to the above S903 to S905, the electronic device can determine the preset number of frames corresponding to the motion state according to the motion state.
[0278] After the electronic device executes the above S903, 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.
[0279] S906 , after configuring the image output mode of the camera each time, when the number of frames in which the static state remains unchanged reaches a first number of frames, the electronic device determines whether the sensitivities obtained within the number of frames in which the static state remains unchanged meet a preset condition.
[0280] S907 , when the sensitivities acquired within the number of frames remaining unchanged in the static state all meet the preset conditions, the electronic device switches the image output mode of the camera.
[0281] S908 , when the acquired sensitivity does not meet the preset condition within the number of frames that remain unchanged in the static state, the electronic device maintains the image output mode of the camera unchanged.
[0282] In the first case, after 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 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 less than the second sensitivity threshold.
[0283] If the sensitivities acquired within the number of frames in which the camera remains stationary are all less than the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the camera remains stationary are relatively stable, the electronic device switches the camera's image output mode from the pixel binning mode to the full-pixel mode. If the sensitivities acquired within the number of frames in which the camera remains stationary are greater than or equal to the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the camera remains stationary are not stable, the electronic device controls the camera's image output mode to continue to remain in the pixel binning mode.
[0284] For example, the first frame number corresponding to the static state is 300 frames, and the second sensitivity threshold is 550. After the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode, if the motion state of the electronic device has been static for 300 consecutive frames and the sensitivity obtained in the 300 consecutive frames is less than 550, the electronic device switches the image output mode of the camera from the pixel merging mode to the full-pixel mode.
[0285] It should be noted that the electronic device can monitor the motion state of the electronic device in real time and obtain the camera's light sensitivity in real time. Moreover, when the camera's image output mode is pixel binning mode, the electronic device will compare the camera's light sensitivity with the second sensitivity threshold in real time.
[0286] In the second case, after 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.
[0287] If the sensitivities acquired within the number of frames in which the camera remains stationary are all greater than the first sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the camera remains stationary are relatively stable, the electronic device will switch the camera's image output mode from full-pixel mode to pixel binning mode. If the sensitivities acquired within the number of frames in which the camera remains stationary are less than or equal to the first sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the camera remains stationary are not stable, the electronic device will control the camera's image output mode to continue to remain in full-pixel mode.
[0288] S909, after each configuration of the image output mode of the camera, when the number of frames in which the first movement state remains unchanged reaches a second number of frames, 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.
[0289] S910: When the sensitivities acquired within the number of frames in which the first movement state remains unchanged all meet a preset condition, the electronic device switches the image output mode of the camera.
[0290] S911: When the acquired sensitivity does not meet a preset condition within the number of frames in which the first movement state remains unchanged, the electronic device maintains the image output mode of the camera unchanged.
[0291] In the first case, after 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 always 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.
[0292] If the sensitivities acquired within the number of frames in which the first movement state remains unchanged are all less than the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the first movement state remains unchanged are relatively stable, the electronic device switches the camera's image output mode from the pixel binning mode to the full-pixel mode. If the sensitivities acquired within the number of frames in which the first movement state remains unchanged are greater than or equal to the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the first movement state remains unchanged are not stable, the electronic device controls the camera's image output mode to continue to remain in the pixel binning mode.
[0293] In the second case, after 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 always 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.
[0294] If the sensitivities acquired within the number of frames in which the first movement state remains unchanged are all greater than the first sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the first movement state remains unchanged are relatively stable, the electronic device switches the camera's image output mode from full-pixel mode to pixel binning 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 stable, the electronic device controls the camera's image output mode to continue to remain in full-pixel mode.
[0295] S912, after each configuration of the image output mode of the camera, when the number of frames in which the second movement state remains unchanged reaches a third number of frames, 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.
[0296] S913: When the sensitivities acquired within the number of frames in which the second movement state remains unchanged meet a preset condition, the electronic device switches the image output mode of the camera.
[0297] S914: When the acquired sensitivity does not meet the preset condition within the number of frames in which the second moving state remains unchanged, the electronic device maintains the image output mode of the camera unchanged.
[0298] In the first case, after 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.
[0299] If the sensitivities acquired within the number of frames in which the second movement state remains unchanged are all less than the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the second movement state remains unchanged are relatively stable, the electronic device switches the camera's image output mode from the pixel binning mode to the full-pixel mode. If the sensitivities acquired within the number of frames in which the second movement state remains unchanged are greater than or equal to the second sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the second movement state remains unchanged are not stable, the electronic device controls the camera's image output mode to continue to remain in the pixel binning mode.
[0300] In the second case, after 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 the 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.
[0301] If the light sensitivity acquired within the number of frames in which the second movement state remains unchanged is greater than the first sensitivity threshold, indicating that the light sensitivity acquired within the number of frames in which the second movement state remains unchanged is relatively stable, the electronic device switches the camera's image output mode from full-pixel mode to pixel binning mode. If the light 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, indicating that the light sensitivity acquired within the number of frames in which the second movement state remains unchanged is not stable, the electronic device controls the camera's image output mode to continue to remain in full-pixel mode.
[0302] It should be noted that the above description applies to a scenario where the electronic device's motion state 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 electronic device's motion state changes between the configuration of the camera's image output mode and the next configuration of the camera's image output mode, and the motion state before the change does not meet the conditions corresponding to the reconfiguration of the camera's image output mode, the electronic device determines whether it meets the conditions corresponding to the reconfiguration of the camera's image output mode based on the changed motion state.
[0303] In summary, after each configuration of the camera's image output mode, 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 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.
[0304] Specifically, when the camera's image output mode is full-pixel mode, when the sensitivity is greater than a 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. When the camera's image output mode is pixel binning mode, when the sensitivity is less than a 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.
[0305] Therefore, after each configuration of the camera's image output mode, the embodiment of the present application determines whether to switch the camera's image output mode based on the electronic device's motion state and the camera's sensitivity. Different preset frame rates are matched to the scenes corresponding to different motion states to increase the smoothness of the camera's image output mode switching process, further reducing the problem of flickering in the image displayed by the electronic device during the camera's image output mode switching process, and making the image displayed by the electronic device more stable.
[0306] Another implementation method is that after each time the image output mode of the camera is configured, the electronic device obtains the motion state of the electronic device; the electronic device determines the preset number of frames corresponding to the motion state based on the motion state of the electronic device; at the first moment after each time the image output mode of the camera is configured, 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.
[0307] Specifically, when the camera's image output mode is full-pixel mode, when the sensitivity is greater than a 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. When the camera's image output mode is pixel binning mode, when the sensitivity is less than a 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.
[0308] In this case, the electronic device does not need to determine the motion state of the electronic device in real time. Instead, the electronic device obtains the motion state of the electronic device once each time the camera's image output mode is configured. The specific method for obtaining the motion state of the electronic device can refer to the corresponding description of S901 and S902 above and will not be repeated here.
[0309] The motion state of the electronic device includes a stationary state, a first moving state, and a second moving state. The preset frame number corresponding to the stationary 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.
[0310] 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.
[0311] In the first scenario, after the electronic device configures the camera's image output mode to the pixel binning mode, the electronic device determines whether the camera's sensitivity is less than a second sensitivity threshold after the first number of frames after the camera's image output mode is configured to the pixel binning mode. If the camera's sensitivity is less than the second sensitivity threshold, the electronic device switches the camera's image output mode from the pixel binning mode to the full-pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the camera's image output mode to remain in the pixel binning mode.
[0312] In the second scenario, after the electronic device configures the camera's image output mode to be full-pixel mode, the electronic device determines whether the camera's sensitivity is greater than a first sensitivity threshold after the first number of frames after the camera's image output mode is configured to be full-pixel mode. If the camera's sensitivity is greater than the first sensitivity threshold, the electronic device switches the camera's image output mode from full-pixel mode to pixel binning mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the camera's image output mode to remain in full-pixel mode.
[0313] In another implementation method, the electronic device obtains the motion state of the electronic device in real time; the electronic device determines the 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 the preset conditions, the second moment being the moment when the number of frames in which the motion state remains unchanged reaches 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.
[0314] Specifically, when the camera's image output mode is full-pixel mode, when the sensitivity is greater than a 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. When the camera's image output mode is pixel binning mode, when the sensitivity is less than a 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.
[0315] In this case, the electronic device obtains the motion state of the electronic device in real 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.
[0316] The motion state of the electronic device includes a stationary state, a first moving state, and a second moving state. The preset frame number corresponding to the stationary 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.
[0317] 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.
[0318] In the first case, after the electronic device configures the camera's image output mode to be pixel-binning mode, if the electronic device remains in a stationary state and the number of frames in which the stationary state remains unchanged reaches a first number of frames, the electronic device determines whether the camera's sensitivity is less than a second sensitivity threshold after the first number of frames after the camera's image output mode is configured to be pixel-binning mode. If the camera's sensitivity is less than the second sensitivity threshold, the electronic device switches the camera's image output mode from pixel-binning mode to full-pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the camera's image output mode to remain in pixel-binning mode.
[0319] In the second case, after the electronic device configures the camera's image output mode to be full-pixel mode, if the electronic device's motion state remains stationary and the number of frames in which the stationary state remains unchanged reaches a first number of frames, the electronic device determines whether the camera's sensitivity is greater than a first sensitivity threshold after the first number of frames after the camera's image output mode is configured to be full-pixel mode. If the camera's sensitivity is greater than the first sensitivity threshold, the electronic device switches the camera's image output mode from full-pixel mode to pixel binning mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the camera's image output mode to remain in full-pixel mode.
[0320] It should be noted that the above description is for 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 between the configuration of the camera's image output mode and the next configuration of the camera's image output mode, 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 will re-determine whether it needs to compare the camera's sensitivity with the sensitivity threshold based on whether the number of frames maintained by the changed motion state reaches the preset number of frames corresponding to the changed motion state.
[0321] In this way, different preset frame numbers are matched according to the scenes corresponding to different motion states to increase the smoothness of the camera's image output mode switching process, further alleviating the problem of flickering in the image displayed by the electronic device during the switching of the camera's image output mode, making the image displayed by the electronic device more stable.
[0322] For ease of understanding, the interaction process between the various modules involved in the mode control method provided in the embodiment of the present application is described below in conjunction with Figure 10. In this mode control method, whether to switch the image output mode of the camera is determined based on the sensitivity of the camera and the motion state of the electronic device.
[0323] As shown in Figure 10, 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. Referring to Figure 10, the mode control method may specifically include the following steps:
[0324] S1001: The camera application receives a user's touch operation on the camera application icon.
[0325] S1002 : In response to a touch operation on a camera application icon, the camera application sends an image preview request to a camera service.
[0326] S1003: The camera service sends an image preview request to the camera hardware abstraction module.
[0327] S1004: The camera hardware abstraction module sends an image preview request to the camera driver.
[0328] S1005: The camera driver sends an image preview request to the camera.
[0329] S1006: When the camera receives the image preview request, the camera sends the camera sensitivity to the camera driver.
[0330] S1007: The camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
[0331] It should be noted that the specific implementation of S1001 to S1007 can refer to the specific implementation of S801 to S807 mentioned above, and will not be repeated here.
[0332] S1008: The camera hardware abstraction module sends a motion parameter acquisition request to the sensor driver.
[0333] S1009: The sensor driver sends a motion parameter acquisition request to the motion sensor.
[0334] S1010: The motion sensor sends the collected motion parameters to the sensor driver.
[0335] S1011: The sensor driver sends motion parameters to the camera hardware abstraction module.
[0336] S1012: The camera hardware abstraction module determines the motion state of the electronic device according to the motion parameters.
[0337] In some embodiments, the camera hardware abstraction module stores software code for scheduling the motion sensor. Upon receiving an image preview request, the camera hardware abstraction module can invoke a sensor driver, which then drives the motion sensor to collect motion parameters of the electronic device. The motion sensor then transmits the collected motion parameters to the camera hardware abstraction module via the sensor driver.
[0338] The camera hardware abstraction module can determine the motion state of the electronic device based on the motion parameters of the electronic device. The specific implementation method can refer to the description corresponding to S902 above, which will not be repeated here.
[0339] S1013, the camera hardware abstraction module configures the camera's image output mode according to the camera's sensitivity and the motion state of the electronic device; the camera's image output mode includes a full-pixel mode or a pixel-binning mode.
[0340] After receiving the camera's light sensitivity and determining the motion state of the electronic device, the camera hardware abstraction module configures the camera's image output mode according to the camera's light sensitivity and the motion state of the electronic device.
[0341] It should be noted that the camera hardware abstraction module configures the camera's image output mode based on the camera's sensitivity and the electronic device's motion state. The three implementations described above can be referenced for details. For example, please refer to the description corresponding to Figure 9 above, which will not be repeated here. Specifically, the camera hardware abstraction module performs the counting of frames with a constant motion state.
[0342] S1014, the camera hardware abstraction module sends the camera's image output mode to the camera driver.
[0343] S1015: The camera driver sends the camera's image output mode to the camera.
[0344] S1016: The camera outputs the preview image it has captured according to the image output mode of the camera.
[0345] S1017: The camera sends a preview image to the camera driver.
[0346] S1018: The camera driver sends a preview image to the camera hardware abstraction module.
[0347] S1019, the camera hardware abstraction module sends a preview image to the camera service.
[0348] S1020: The camera service sends a preview image to the camera application.
[0349] S1021, the camera application displays a preview image.
[0350] It should be noted that the specific implementation of S1014 to S1021 can refer to the specific implementation of S809 to S816 mentioned above, and will not be repeated here.
[0351] In some embodiments, the camera application includes multiple shooting modes, such as night mode, portrait mode, photo mode, video mode, and professional mode. 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.
[0352] For example, 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.
[0353] Specifically, when the camera application sends an image preview request to the camera hardware abstraction module through the camera service, 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.
[0354] 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.
[0355] For example, 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. Referring to FIG11 , the following steps can be specifically included:
[0356] S1101: The camera application receives a user's touch operation on a shooting control.
[0357] S1102 : In response to a touch operation on a shooting control, the camera application sends an image shooting request to the camera service.
[0358] S1103: The camera service sends an image capture request to the camera hardware abstraction module.
[0359] S1104: The camera hardware abstraction module sends an image capture request to the camera driver.
[0360] S1105: The camera driver sends an image capture request to the camera.
[0361] S1106: The camera sends the captured image frames to the camera driver according to the image capture request.
[0362] For example, a shooting control is provided in the preview interface of the camera application. When the user wants to take a picture, 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.
[0363] In response to a touch operation on the capture control, the camera application sends an image capture request to the camera service by calling the camera access interface in the application framework layer. The camera service then sends the image capture request to the camera through the camera hardware abstraction module and the camera driver. The camera captures images based on the image capture request and outputs the captured image frames based on the current image output mode. The image frames output by the camera are then sent to the camera driver.
[0364] S1107: The camera driver sends the image frame to the camera hardware abstraction module.
[0365] S1008 , the camera hardware abstraction module sends the image frame to the camera service.
[0366] S1109: The camera service sends the image frame to the camera application.
[0367] S1110 , the camera application stores the image frame.
[0368] The camera driver sends the image frames output by the camera to the camera application through the camera hardware abstraction module and camera service. After receiving the image frames, the camera application can store the image frames in the memory of the electronic device.
[0369] Exemplarily, the preview interface of a 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, i.e., the first preview interface includes the first shooting control, and the shooting control in the second preview interface is referred to as the second shooting control, i.e., 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.
[0370] When the electronic device receives a first user operation on the first shooting control, the electronic device saves the first image in accordance with the implementation of S1102 to S1110 described above in response to the first operation on the first shooting control. Correspondingly, when the electronic device receives a second user operation on the second shooting control, the electronic device saves the second image in accordance with the implementation of S1102 to S1110 described above in response to the second operation on the second shooting control.
[0371] The first image is the preview image output by the camera in pixel-binning mode, and the second image is the preview image output by the camera in full-pixel mode. Therefore, the size of the second image is larger than that of the first image. For example, the size of the second image is 3840 pixels * 2160 pixels, and the size of the first image is 1920 pixels * 1080 pixels.
[0372] Furthermore, the storage space occupied by the second image when stored is also greater than the storage space occupied by the first image when stored. For example, 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.
[0373] Accordingly, the size of the third image is also larger than that of the fourth image. The storage space occupied by the third image when stored is also larger than the storage space occupied by the fourth image when stored.
[0374] Taking the example of the related art using full-pixel mode under different ambient brightness conditions, the storage space occupied by the images output in low-brightness environments and high-brightness environments is equal, while the storage space occupied by the images output in low-brightness environments of the embodiment of the present application is 1 / 4 of the storage space occupied by the images output in high-brightness environments. For example, the storage space occupied by the images output in low-brightness environments and high-brightness environments of the related art is 9MB, while the storage space occupied by the images output in low-brightness environments of the embodiment of the present application may be 2.25MB, and the storage space occupied by the images output in high-brightness environments of the embodiment of the present application may also be 9MB.
[0375] It should be noted that after the electronic device receives a touch operation on the shooting control, the camera hardware abstraction module continues to count the number of frames and does not start counting again from zero due to the shooting operation.
[0376] It is understandable that the mode control method provided in the embodiment of the present application can also be applied to scenes such as video recording of a camera application. 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.
[0377] The mode control method provided in the embodiment of the present application is described above in conjunction with Figures 6 to 11. The device for executing the above method provided in the embodiment of the present application is described below. As shown in Figure 12, Figure 12 is a schematic diagram of the structure of a mode control device provided in the embodiment of the present application. The mode control device can be an electronic device in the embodiment of the present application, or a chip or chip system within an electronic device.
[0378] As shown in Figure 12, 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 in performing the above display steps; the processing unit 1202 is used to support the mode control device 1200 in performing the above processing steps.
[0379] Specifically, when the camera application is activated, the processing unit 1202 is configured to obtain the camera's sensitivity. When the sensitivity is greater than a first sensitivity threshold and the camera's image output mode is full-pixel mode, the display unit 1201 is configured to display a first preview interface, the first preview interface including a first image, which is the image output by the camera in pixel-binning mode. When the sensitivity is less than a second sensitivity threshold and the camera's image output mode is pixel-binning mode, the display unit 1201 is configured to display a second preview interface, the second preview interface including a second image, which is the image output by the camera in full-pixel mode. The pixel-binning mode is configured to merge multiple adjacent pixels of the same color into a single pixel, and the full-pixel mode is configured to rearrange pixels into a Bayer array using a mosaic rearrangement method. The first sensitivity threshold and the second sensitivity threshold are not equal.
[0380] In one possible implementation, the mode control device 1200 further includes a storage unit 1203. The storage unit 1203 is connected to the processing unit 1202 via a circuit. The storage unit 1203 may include one or more memories, which may be devices in one or more devices or circuits for storing programs or data. The storage unit 1203 may exist independently and be connected to the processing unit 1202 via a communication bus. Alternatively, the storage unit 1203 may be integrated with the processing unit 1202.
[0381] The storage unit 1203 can store computer-executable instructions for 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 type of static storage device that can store static information and instructions. The storage unit 1203 can be independent of the processing unit 1202.
[0382] FIG13 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. As shown in FIG13 , the chip 1300 includes one or more (including two) processors 1301 , a communication circuit 1302 , and a communication interface 1303 . Optionally, the chip 1300 also includes a memory 1304 .
[0383] In some embodiments, the memory 1304 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0384] 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. During the implementation process, the steps of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1301. The above-mentioned 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.
[0385] The steps of the method disclosed in the embodiments of the present application can be directly implemented as being executed by 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 storage medium mature 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 performs the steps of the above method in combination with its hardware.
[0386] The processor 1301 , the memory 1304 , and the communication interface 1303 may communicate with each other via a communication line 1302 .
[0387] In the above embodiment, 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 downloaded and installed in the memory in the form of software.
[0388] The present application embodiment also provides a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can 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 integrations. For example, available media can include magnetic media (e.g., floppy disk, hard disk or tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid state disk (SSD)).
[0389] 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.
[0390] The present embodiment provides a chip. The chip includes a processor configured to invoke a computer program stored in a memory to execute the technical solution of the above embodiment. The implementation principles and technical effects are similar to those of the above-mentioned related embodiments and will not be further described here.
[0391] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program or instructions. When the computer program or instructions are executed by a processor, the above-mentioned method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions 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.
[0392] As a possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; computer-readable media may include magnetic disk storage or other magnetic disk storage devices. Moreover, any connecting line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of 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 within the scope of computer-readable media.
[0393] The present application embodiment is described with reference to the flow chart and / or block diagram according to the method, device (system) and computer program product of the embodiment of the present application.It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processing unit of general-purpose computer, special-purpose computer, embedded processing machine or other programmable data processing equipment to produce a machine, so that the instruction executed by the processing unit of computer or other programmable data processing equipment produces the device for realizing the function specified in one flow chart flow chart or multiple flow charts and / or one block or multiple blocks of block diagram.
[0394] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of this application in detail. It should be understood that the above are only specific implementation methods of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.
Claims
1. A mode control method, It is characterized in that Applied to an electronic device, the electronic device includes a camera application and a camera, the method includes: When the camera application is started, the electronic device obtains the light 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, which 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 the 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 the full pixel mode; Among them, the pixel merging mode is used to merge multiple adjacent same-color pixels into one pixel, and the full-pixel mode is used to rearrange the pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold is not equal to the second sensitivity threshold.
2. The method according to claim 1, It is characterized in that The first sensitivity threshold is greater than the second sensitivity threshold.
3. The method according to claim 1, It is characterized in that After the electronic device obtains the light sensitivity of the camera, the method further 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 an 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 an image output by the camera in the pixel merging mode.
4. The method according to claim 1, It is characterized in that When the sensitivity is greater than the first sensitivity threshold and the image output mode of the camera is the full pixel mode, 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 acquires the first image output by the camera in the pixel merging mode, and displays the first image on the first preview interface; Correspondingly, when the sensitivity is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, 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 on the second preview interface.
5. The method according to claim 3, It is characterized in that 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, 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 acquires the third image output by the camera in the full-pixel mode, and displays the third image on the third preview interface; Correspondingly, 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, 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 the fourth image output by the camera in the pixel merging mode, and displays the fourth image on the fourth preview interface.
6. The method according to claim 1, It is characterized in that The method further comprises: 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; Alternatively, after a preset time period 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 the full pixel mode or the pixel merging mode.
7. The method according to claim 6, It is characterized in that Before the electronic device determines again whether to switch the image output mode of the camera, the method further includes: The electronic device acquires a motion state of the electronic device; The electronic device determines the preset number of frames according to the motion state; Among them, the motion state includes a static state, a first moving state and a second moving state, the motion parameters of the second moving state are greater than the motion parameters of the first moving state, the motion parameters of the first moving state are greater than the motion parameters of the static state, and the motion parameters include at least one of acceleration data, angular velocity data and speed data; the preset frame number corresponding to the static state is a first frame number, the preset frame number corresponding to the first moving state is a second frame number, and the preset frame number corresponding to the second moving state is a third frame number, and at least two of the first frame number, the second frame number and the third frame number are different.
8. The method according to claim 7, It is characterized in that The electronic device obtains the motion state of the electronic device, including: After configuring the image output mode of the camera each time, the electronic device acquires 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 again determines 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 the whether the sensitivity meets a preset condition; 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 condition, the electronic device switches the image output mode of the camera; When the sensitivity does not satisfy the preset condition, the electronic device maintains the image output mode of the camera unchanged.
9. The method according to claim 7, It is characterized in that The electronic device obtains the motion state of the electronic device, including: The electronic device acquires 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 again determines 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; 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 satisfy the preset condition, the electronic device maintains the image output mode of the camera unchanged.
10. The method according to claim 7, It is characterized in that The electronic device obtains the motion state of the electronic device, including: The electronic device acquires 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 again determines 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; the target frame number is the frame number at which the motion state remains unchanged; When the sensitivities acquired within the target number of frames all meet the preset condition, the electronic device switches the image output mode of the camera; When the acquired sensitivity does not satisfy the preset condition within the target frame number, the electronic device maintains the image output mode of the camera unchanged.
11. The method according to any one of claims 8 to 10, It is characterized in that 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 satisfies the preset condition; and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not satisfy the preset condition; When the image output mode of the camera is the pixel merging mode, when the sensitivity is less than the second sensitivity threshold, the sensitivity satisfies the preset condition; when the sensitivity is greater than or equal to the second sensitivity threshold, the sensitivity does not satisfy the preset condition.
12. The method according to claim 1, It is characterized in that The first preview interface further includes a first shooting control, and the second preview interface further includes a second shooting control; After the electronic device displays the first preview interface, the method further includes: The electronic device saves the first image in response to a first operation on the first shooting control; Correspondingly, after the electronic device displays the second preview interface, the method further includes: The electronic device saves the second image in response to a second operation on the second shooting control; The size of the second image is larger than the size of the first image.
13. The method according to claim 1, It is characterized in that The camera application includes multiple shooting modes, at least some of the shooting modes correspond to different first sensitivity thresholds, and / or at least some of the shooting modes correspond to different second sensitivity thresholds.
14. The method according to claim 1, It is characterized in that The camera comprises an image sensor, the image sensor comprises a pixel array, the pixel array comprises a plurality of pixel sets, each of the plurality of pixel sets comprises a plurality of pixel units, each of the plurality of pixel units comprises a plurality of pixels; the plurality of pixels in each of the pixel units have the same color, 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.
15. The method according to claim 1, It is characterized in that 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 same-color pixels into one pixel.
16. The method according to claim 1, It is characterized in that The electronic device further includes a camera hardware abstraction module and a camera driver; the method further includes: The camera hardware abstraction module configures the image output mode of the camera; the image output mode of the camera includes the full pixel mode or the 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.
17. An electronic device, It is characterized in that The invention comprises 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 mode control method according to any one of claims 1 to 16.
18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program or instruction, and when the computer program or instruction is executed, the mode control method according to any one of claims 1 to 16 is implemented.
19. A computer program product, It is characterized in that The invention comprises a computer program, which, when being executed, enables a computer to execute the mode control method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Control method, imaging device and electronic equipment
CN110475066A
Shooting method and electronic equipment
CN113727016A
Photographing method and electronic equipment
CN115696063A
Imaging apparatus and its control method
JP2004289714A
