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
- CN202310714632.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-15
- Publication Date
- 2024-12-17
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, switching the image output mode according to the sensitivity threshold, the pixel merging mode is used for low brightness, and the full pixel mode is used for high brightness, so that the image clarity and resolution are improved by merging and rearranging pixels respectively.
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 CN119155544A_ABST
Abstract
Description
Technical Field
[0001] 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
[0002] With the continuous development of electronic technology, electronic devices such as mobile phones and tablet computers have gradually become 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.
[0003] However, under different ambient brightness, the images output by cameras in some electronic devices have a problem of poor clarity, which in turn affects the image quality. Summary of the invention
[0004] The embodiments of the present application provide a mode control method, an electronic device, a storage medium and a program product, which enable a camera to output a captured image in different image output modes under different ambient brightness, thereby improving the clarity of the image output by the camera and thereby improving the image quality.
[0005] In the first aspect, the embodiment of the present application proposes a mode control method, which is applied to an electronic device, wherein the electronic device includes a camera application and a camera, and the method includes: when the camera application is started, the electronic device obtains the sensitivity of the camera; when the sensitivity is greater than a first sensitivity threshold and the image output mode of the camera is a full pixel mode, the electronic device displays a first preview interface, the first preview interface includes a first image, and the first image is an image output by the camera in a pixel merging mode; when the sensitivity is less than a second sensitivity threshold and the image output mode of the camera is a pixel merging mode, the electronic device displays a second preview interface, the second preview interface includes a second image, and the second image is an image output by the camera in a full pixel mode. Among them, the pixel merging mode is used to merge multiple adjacent pixels of the same color into one pixel, and the full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold is not equal to the second sensitivity threshold.
[0006] Thus, when the sensitivity is greater than the first sensitivity threshold, it means that the camera is in a low-brightness environment at this time, and the camera uses the pixel merging mode to output the image it has collected. By merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, the noise of the image can be reduced, the clarity and brightness of the image can be improved, and the image quality can be improved. Moreover, when the sensitivity is less than the second sensitivity threshold, it means that the camera is in a high-brightness environment at this time, and the camera uses the full-pixel mode to output the image it has collected. 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, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, so that the clarity of the image is high, and the image quality is improved.
[0007] In a possible implementation, the first sensitivity threshold is greater than the second sensitivity threshold. In this way, while improving image quality, the ping-pong switching between the full pixel mode and the pixel merging mode of the camera can be reduced, thereby reducing the problem of image flickering on the image displayed by the electronic device caused by the switching of the image output mode of the camera.
[0008] In a possible implementation, after the electronic device obtains the sensitivity of the camera, it also includes: when the sensitivity is less than or equal to the first sensitivity threshold and the image output mode of the camera is the full pixel mode, the electronic device displays a third preview interface, the third preview interface includes a third image, and the third image is the image output by the camera in the full pixel mode; when the sensitivity is greater than or equal to the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, the electronic device displays a fourth preview interface, the fourth preview interface includes a fourth image, and the fourth image is the image output by the camera in the pixel merging mode. In this way, when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the image output mode of the camera is controlled to continue to remain in the full pixel mode to improve the clarity of the image; when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the image output mode of the camera is controlled to continue to remain in the pixel merging mode to improve the clarity of the image and the brightness of the picture.
[0009] In a possible implementation, 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 obtains the first image output by the camera in the pixel merging mode, and displays the first image in 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 in 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.
[0010] In a possible implementation, 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 obtains a 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 a fourth image output by the camera in the pixel merging mode, and displays the fourth image on the fourth preview interface.
[0011] In a possible implementation, the method further includes: 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; or, 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. The image output mode of the camera includes a full pixel mode or a pixel merging mode. In this way, a preset number of frames or a preset time period can be spaced between two adjacent configurations of the image output mode of the camera, thereby reducing the frequency of switching the image output mode of the camera between the pixel merging mode and the full pixel mode, so as to alleviate the problem of screen flickering in the image displayed by the electronic device during the switching process.
[0012] In a possible implementation, before the electronic device determines again whether to switch the image output mode of the camera, it also includes: the electronic device obtains the motion state of the electronic device; the electronic device determines the preset frame number according to the motion state. Wherein, the motion state includes a static state, a first moving state and a second moving state, the motion parameter of the second moving state is greater than the motion parameter of the first moving state, the motion parameter of the first moving state is greater than the motion parameter of the static state, and the motion parameter includes at least one of acceleration data, angular velocity data and speed data; the preset frame number corresponding to the static state is the first frame number, the preset frame number corresponding to the first moving state is the second frame number, and the preset frame number corresponding to the second moving state is the third frame number, and at least two of the first frame number, the second frame number and the third frame number are different. In this way, according to the scenes corresponding to different motion states, different preset frame numbers are matched to increase the smoothness of the image output mode switching process of the camera, further reduce the problem of screen flickering of the image displayed by the electronic device during the switching process of the image output mode of the camera, and make the image displayed by the electronic device more stable.
[0013] In a possible implementation, the electronic device obtains the motion state of the electronic device, including: after each configuration of the image output mode of the camera, the electronic device obtains the motion state of the electronic device once. Accordingly, after a preset number of frames after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, including: at the first moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets the preset conditions, and the time interval between the first moment and the moment of configuring the image output mode of the camera is equal to the preset number of frames corresponding to the motion state; if the sensitivity meets the preset conditions, the electronic device switches the image output mode of the camera; if the sensitivity does not meet the preset conditions, the electronic device keeps the image output mode of the camera unchanged. In this way, the number of times the motion state of the electronic device is obtained can be reduced to reduce the power consumption of the electronic device.
[0014] In a 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 determines again whether to switch the image output mode of the camera, including: at a second moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets a preset condition, and the second moment is the moment when the number of frames in which the motion state remains unchanged reaches a preset number of frames corresponding to the motion state; when the sensitivity meets the preset condition, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged. In this way, the problem of screen flickering in the image displayed by the electronic device during the switching of the image output mode of the camera can be further alleviated, so that the image displayed by the electronic device is more stable.
[0015] In a 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 the preset number of frames after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, including: after each configuration of the image output mode of the camera, when the target frame number reaches the preset frame number corresponding to the motion state, the electronic device determines whether the sensitivity obtained within the target frame number meets the preset condition, and the target frame number is the frame number in which the motion state remains unchanged; if the sensitivity obtained within the target frame number meets the preset condition, the electronic device switches the image output mode of the camera; if the sensitivity obtained within the target frame number does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged. In this way, the problem of screen flickering in the image displayed by the electronic device during the switching process of the image output mode of the camera is further alleviated, so that the image displayed by the electronic device is more stable.
[0016] In a possible implementation, when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition. 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 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.
[0017] In a possible implementation, the first preview interface also includes a first shooting control, and the second preview interface also includes a second shooting control. After the electronic device displays the first preview interface, it also includes: the electronic device saves the first image in response to the first operation on the first shooting control. Correspondingly, after the electronic device displays the second preview interface, it also includes: the electronic device saves the second image in response to the second operation on the second shooting control. The size of the second image is larger than the size of the first image. 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 according to the current sensitivity of the camera.
[0018] In a possible implementation, the camera application includes multiple shooting modes, at least some of the multiple shooting modes correspond to different first sensitivity thresholds, and / or at least some of the multiple shooting modes correspond to different second sensitivity thresholds. In this way, appropriate first sensitivity thresholds and second sensitivity thresholds are selected according to different shooting modes to reduce the problem of screen flickering in the image displayed by the electronic device during the switching of the image output mode of the camera.
[0019] In a possible implementation, the camera includes an image sensor, the image sensor includes a pixel array, the pixel array includes a plurality of pixel sets, each pixel set in the plurality of pixel sets includes a plurality of pixel units, each pixel unit in the plurality of pixel units includes a plurality of pixels; the colors of the plurality of pixels in each pixel unit are the same, and at least some of the plurality of pixel units are pixel units of different colors. The arrangement of the pixel array in the full pixel mode is the same as the arrangement of the pixel array in the pixel merging mode.
[0020] In a possible implementation, the pixel merging mode includes a four-in-one pixel merging mode, and the four-in-one pixel merging mode is used to merge four adjacent pixels of the same color into one pixel.
[0021] In a possible implementation, the electronic device also includes a camera hardware abstraction module and a camera driver. The method also includes: the camera hardware abstraction module configures the image output mode of the camera, the image output mode of the camera includes a full pixel mode or a pixel merging mode; the camera hardware abstraction module sends the image output mode of the camera to the camera driver; the camera driver drives the camera to output the captured image in the image output mode of the camera according to the image output mode of the camera. In this way, the image output mode of the camera is configured by the camera hardware abstraction module, so that the camera outputs the captured image in the corresponding image output mode, and the control method of the image output mode of the camera is relatively simple and easy to implement.
[0022] In a second aspect, an embodiment of the present application proposes an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the processor is used to call the computer program to execute the above-mentioned mode control method.
[0023] 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.
[0024] 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.
[0025] 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 elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 A schematic diagram of the structure of a camera provided in an embodiment of the present application;
[0027] Figure 2 A schematic diagram of pixel merging of a quad-Bayer array of an image sensor provided in an embodiment of the present application;
[0028] Figure 3 A schematic diagram of mosaic rearrangement of a quad-Bayer array of an image sensor provided in an embodiment of the present application;
[0029] Figure 4 A schematic diagram of the hardware system structure of an electronic device provided in an embodiment of the present application;
[0030] Figure 5 A schematic diagram of the software system structure of an electronic device provided in an embodiment of the present application;
[0031] Figure 6 A schematic diagram of an interface for an application scenario provided in an embodiment of the present application;
[0032] Figure 7 A flow chart of a mode control method provided in an embodiment of the present application;
[0033] Figure 8 A schematic diagram of module interaction of a mode control method provided in an embodiment of the present application;
[0034] Fig. 9 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;
[0035] Fig.10A schematic diagram of module interaction of another mode control method provided in an embodiment of the present application;
[0036] Fig.11 A schematic diagram of module interaction during image capture provided by an embodiment of the present application;
[0037] Fig.12 A schematic diagram of the structure of a mode control device provided in an embodiment of the present application;
[0038] Fig.13 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order 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 the same items or similar items with basically the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not necessarily limit them to be different.
[0040] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0041] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" 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: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. 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.
[0042] 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.
[0043] like Figure 1As shown, the camera may include a lens 10 and an image sensor 20 arranged along the optical path direction. The lens 10 may include a plurality of optical lenses stacked along the optical axis direction. The image sensor 20 may also be called a camera sensor (ie, camera sensor).
[0044] The image sensor 20 includes a filter 21 and a photosensitive element 22, wherein the filter 21 is located between the lens 10 and the photosensitive element 22. The light reflected by the object passes through the lens 10 and the filter 21 in sequence and then is projected onto the photosensitive element 22, which converts the light signal into an electrical signal for imaging.
[0045] The pixel array in the traditional image sensor adopts the cross distribution of red, green and blue pixels. With the development of imaging technology and the emergence of more and more high-resolution cameras, a new pixel arrangement technology has emerged. This pixel arrangement technology arranges M adjacent pixels of the same color together to form a pixel with an area M times larger than the original pixel, 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 with an area four times larger than the original pixel.
[0046] In some electronic devices, the camera provided therein may adopt a four-in-one pixel image sensor. Taking the image sensor 20 as a four-in-one pixel image sensor as an example, Figure 2 (a) and Figure 3 As shown in (a) of FIG. 1 , 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.
[0047] It can be seen that the color of the pixel in the first pixel unit 231 is different from the color of the pixel in the second pixel unit 232, the color of the pixel in the third pixel unit 233, and the color of the pixel in the fourth pixel unit 234, that is, the first pixel unit 231 and the second pixel unit 232, the third pixel unit 233 and the fourth pixel unit 234 are pixel units of different colors. The color of the pixel in the second pixel unit 232 is also different from the color of the pixel in the fourth pixel unit 234, that is, the second pixel unit 232 and the fourth pixel unit 234 are pixel units of different colors. The color of the pixel in the third pixel unit 233 is also different from the color of the pixel in the fourth pixel unit 234, that is, the third pixel unit 233 and the fourth pixel unit 234 are pixel units of different colors.
[0048] 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.
[0049] It is understandable that the pixel array of the image sensor in the embodiment of the present application, in addition to using Figure 2 (a) and Figure 3 In addition to the four-Bayer array shown in (a), a nine-Bayer array or a sixteen-Bayer array may also be used. The embodiment of the present application does not limit the specific form of the pixel array of the image sensor.
[0050] When the pixel array of the image sensor is a nine-Bayer array, the pixel array of the image sensor includes a plurality of pixel sets, each pixel set includes four pixel units, each pixel unit may include nine pixels of the same color, and at least some of the four pixel units are pixel units of different colors. When the pixel array of the image sensor is a sixteen-Bayer array, the pixel array of the image sensor includes a plurality of pixel sets, each pixel set includes four pixel units, each pixel unit may include sixteen pixels of the same color, and at least some of the four pixel units are pixel units of different colors.
[0051] Therefore, in an embodiment of the present application, the camera includes an image sensor, the image sensor includes a pixel array, the pixel array of the image sensor includes a plurality of pixel sets, each pixel set in the plurality of pixel sets includes a plurality of pixel units, each pixel unit in the plurality of pixel units includes a plurality of pixels, wherein the colors of the plurality of pixels in each pixel unit are the same, and at least some of the plurality of pixel units are pixel units of different colors.
[0052] It can be understood that the filter 21 may include a single filter array, the filter unit array may include multiple filter unit sets, each filter unit set in the multiple filter unit sets may include multiple filter units, and each filter unit allows the same color of light to pass through. The photosensitive element 22 may include a photosensitive unit array, the photosensitive unit array may include multiple photosensitive unit sets, each photosensitive unit set in the multiple photosensitive unit sets may include multiple photosensitive units, and each photosensitive unit in the multiple photosensitive units includes multiple photosensitive pixels. Moreover, each filter unit in the filter 21 corresponds to each photosensitive unit in the photosensitive element 22 one by one, and the multiple photosensitive pixels in each photosensitive unit are used to receive light filtered by its corresponding filter unit. In this way, the filter unit array and the photosensitive unit array covered by the filter unit array together constitute the pixel array of the image sensor 20. Therefore, each pixel unit in the image sensor 20 can actually include a filter unit and a photosensitive unit covered by the filter unit.
[0053] Taking the image sensor 20 as an image sensor with four-in-one pixels as an example, each filter unit set in the filter 21 may include four filter units, which are respectively a first filter unit, a second filter unit, a third filter unit and a fourth filter unit. The color of the light allowed to pass through by the first filter unit is red, the color of the light allowed to pass through by the second filter unit is green, the color of the light allowed to pass through by the third filter unit is green, 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, which are respectively a first photosensitive unit, a second photosensitive unit, a third photosensitive unit and a fourth photosensitive unit, and each of the four photosensitive units includes four photosensitive pixels. The first filter unit corresponds to the first photosensitive unit, and the first filter unit and the first photosensitive unit it covers together constitute a first pixel unit 231; the second filter unit corresponds to the second photosensitive unit, and the second filter unit and the second photosensitive unit it covers together constitute a second pixel unit 232; the third filter unit corresponds to the third photosensitive unit, and the third filter unit and the third photosensitive unit it covers together constitute a third pixel unit 233; the fourth filter unit corresponds to the fourth photosensitive unit, and the fourth filter unit and the fourth photosensitive unit it covers together constitute a fourth pixel unit 234.
[0054] In a related technology, when a user uses a camera to capture images under different ambient brightness, the camera uses a pixel merging mode (ie, binning mode) to output the captured images.
[0055] When the camera is in pixel merging mode, multiple adjacent pixels of the same color can be merged into one pixel by pixel merging, that is, multiple pixels in each pixel unit are merged into one pixel, and the colors of the multiple pixels in each pixel unit are the same.
[0056] Take the camera in an electronic device using a four-in-one pixel image sensor as an example. Figure 2 As shown in (b) in FIG. 1 , when the camera is in pixel merging mode, four pixels of the same color in each pixel unit are merged into one pixel. Specifically, four red pixels in the first pixel unit 231 are merged into one red pixel, four green pixels in the second pixel unit 232 are merged into one green pixel, four green pixels in the third pixel unit 233 are merged into one green pixel, and four blue pixels in the fourth pixel unit 234 are merged into one blue pixel.
[0057] Therefore, in low-brightness environments, when the camera uses the pixel merging mode to output the image it has captured, by merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, image noise can be reduced, image clarity and brightness can be improved, and image quality can be improved. However, in high-brightness environments, when the camera uses the pixel merging mode to output the image it has captured, the number of pixels included in the image output by the camera is 1 / M times the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is reduced, resulting in a decrease in the resolution of the image, and the clarity of the image is reduced, thereby reducing the image quality.
[0058] In another related technology, when a user uses a camera to capture images under different ambient brightness, the camera uses a full pixel mode (i.e., full size mode) to output the captured images. The full pixel mode may also be called a full size mode.
[0059] When the camera is in full pixel mode, the pixels in the image captured by the image sensor can be rearranged into a Bayer array using a mosaic rearrangement method (i.e., a remosaic method). 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 the colors of adjacent pixels can be different.
[0060] 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 the one red pixel, two green pixels, and one blue pixel are arranged in a 2×2 manner.
[0061] Take the camera in an electronic device using a four-in-one pixel image sensor as an example. Figure 3 As shown in (b), when the camera is in full pixel mode, it converts the image of the four Bayer array captured by the image sensor 20 into an image of the Bayer array. Specifically, the four red pixels in the first pixel unit 231 are rearranged into red pixels, green pixels, green pixels and blue pixels, the four green pixels in the second pixel unit 232 are rearranged into red pixels, green pixels, green pixels and blue pixels, the four green pixels in the third pixel unit 233 are rearranged into red pixels, green pixels, green pixels and blue pixels, and the four blue pixels in the fourth pixel unit 234 are rearranged into red pixels, green pixels, green pixels and blue pixels.
[0062] Therefore, in a high-brightness environment, when the camera uses the full-pixel mode to output the image it has captured, the pixels are rearranged into a Bayer array so that the number of pixels included in the image output by the camera is equal to the number of pixels included in the image sensor, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, making the image clearer and thus improving the image quality. However, in a low-brightness environment, when the camera uses the full-pixel mode to output the image it has captured, the photosensitive area of a single pixel is small, and the image has many noise points, which reduces the clarity of the image and thus reduces the image quality.
[0063] In summary, it can be seen that under different ambient brightness, 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.
[0064] Based on this, the embodiment of the present application provides a mode control method, by obtaining the sensitivity of the camera when starting the camera application; when the sensitivity is greater than the first sensitivity threshold and the image output mode of the camera is the full pixel mode, displaying the first preview interface, the first preview interface includes the first image, the first image is the image output by the camera in the pixel merging mode; when the sensitivity is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, displaying the second preview interface, the second preview interface includes the second image, the second image is the image output by the camera in the full pixel mode. Wherein, the first sensitivity threshold is not equal to the second sensitivity threshold.
[0065] The light sensitivity ordinance (ISO) of a camera is used to measure the sensitivity of the camera to light. The embodiments of the present application may use the light sensitivity of the camera to determine the ambient brightness of the environment in which the camera is located when performing image acquisition. Specifically, when the ambient brightness is lower, the light sensitivity of the camera is higher, the camera is more sensitive to light, and the more light it senses; when the ambient brightness is higher, the light sensitivity of the camera is lower, the camera is less sensitive to light, and the less light it senses.
[0066] Therefore, in the embodiment of the present application, when the sensitivity is greater than the first sensitivity threshold, it means that the camera is in a low-brightness environment at this time, and the camera uses the pixel merging mode to output the image it has collected. By merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel can be increased, the noise of the image can be reduced, the clarity and brightness of the image can be improved, and the image quality can be improved. Moreover, when the sensitivity is less than the second sensitivity threshold, it means that the camera is in a high-brightness environment at this time, and the camera uses the full-pixel mode to output the image it has collected. 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, that is, the number of pixels included in the image output by the camera is large, which can improve the resolution of the image, so that the clarity of the image is high, and the image quality is improved.
[0067] In summary, the embodiment of the present application adjusts the image output mode of the camera according to the different ambient brightness. In a high-brightness environment, the image output mode of the camera is adjusted to the full-pixel mode, and in a low-brightness environment, the image output mode of the camera is adjusted to the pixel merging mode, thereby improving the clarity of the image output by the camera under different ambient brightness, thereby improving the image quality. The image output mode of the camera can also be called the image output specification of the camera.
[0068] The mode control method provided in the embodiment of the present application can be applied to an electronic device with a camera. The electronic device includes a terminal device, which can also be called a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with a wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiment of the present application does not limit the specific technology and specific device form adopted by the electronic device.
[0069] 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.
[0070] Figure 4 The schematic diagram of the structure of the electronic device 400 is shown. The electronic device 400 may include a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, an antenna 1, an antenna 2, a mobile communication module 450, a wireless communication module 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an earphone interface 470D, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495. Among them, the sensor module 480 may include a motion sensor 480A.
[0071] It is understood that the structure illustrated in the embodiment 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 in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0072] The processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0073] 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.
[0074] The processor 410 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 410 is a cache memory. The memory may store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.
[0075] The charging management module 440 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 440 may receive charging input from a wired charger through the USB interface 430. In some wireless charging embodiments, the charging management module 440 may receive wireless charging input through a wireless charging coil of the electronic device 400. While the charging management module 440 is charging the battery 442, it may also power the electronic device through the power management module 441.
[0076] The power management module 441 is used to connect the battery 442, the charging management module 440 and the processor 410. The power management module 441 receives input from the battery 442 and / or the charging management module 440, and supplies power to the processor 410, the internal memory 421, the display screen 494, the camera 493, and the wireless communication module 460. The power management module 441 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 441 can also be set in the processor 410. In other embodiments, the power management module 441 and the charging management module 440 can also be set in the same device.
[0077] 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.
[0078] 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 arranged in the same device as at least some modules of processor 410.
[0079] 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 integrating at least one communication processing module. The wireless communication module 460 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 410. The wireless communication module 460 can also receive the signal to be sent from the processor 410, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0080] 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.
[0081] The electronic device 400 implements the display function through a GPU, a display screen 494, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 410 may include one or more GPUs, which execute program instructions to generate or change display information.
[0082] The display screen 494 is used to display images, display videos, and receive sliding operations, etc. The display screen 494 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 400 may include 1 or N display screens 494, where N is a positive integer greater than 1.
[0083] The electronic device 400 can realize the shooting function through ISP, camera 493, video codec, GPU, display screen 494 and application processor.
[0084] ISP is used to process the data fed back by camera 493. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 493.
[0085] 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 optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 400 may include 1 or N cameras 493, where N is a positive integer greater than 1.
[0086] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 400 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0087] Video codecs are used to compress or decompress digital videos. The electronic device 400 may support one or more video codecs. Thus, the electronic device 400 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0088] NPU is a neural network (NN) computing processor, which can quickly process input information and continuously self-learn by drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain. NPU can realize applications such as intelligent cognition of electronic device 400, such as image recognition, face recognition, voice recognition, text understanding, etc.
[0089] The external memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 400. The external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0090] 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.
[0091] The electronic device 400 can implement audio functions such as music playing and recording through the audio module 470, the speaker 470A, the receiver 470B, the microphone 470C, the headphone jack 470D, and the application processor.
[0092] The motion sensor 480A may include at least one of an acceleration sensor, a gyroscope sensor, and a speed sensor.
[0093] The acceleration sensor can detect the magnitude of the acceleration of the electronic device 400 in various directions (generally three axes), so as to monitor the motion state of the electronic device 400. When the electronic device 400 is stationary, the magnitude and direction of gravity can be detected. The acceleration sensor can also be used to identify the posture of the electronic device, and is applied to applications such as horizontal and vertical screen switching, pedometers, etc.
[0094] 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 shaking of the electronic device 400, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 400 through reverse movement to achieve anti-shake. Gyroscope sensors can also be used for navigation and somatosensory game scenes.
[0095] 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.
[0096] The key 490 includes a power key, a volume key, etc. The key 490 may be a mechanical key or a touch key. The electronic device 400 may receive key input and generate key signal input related to user settings and function control of the electronic device 400.
[0097] 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.
[0098] Indicator 492 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0099] The SIM card interface 495 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 400 by inserting it into the SIM card interface 495 or pulling it out from the SIM card interface 495. The electronic device 400 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 495 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 495 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 495 can also be compatible with different types of SIM cards. The SIM card interface 495 can also be compatible with external memory cards. The electronic device 400 interacts with the network through the SIM card to implement functions such as calls and data communications. 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.
[0100] The software system of the electronic device 400 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device 400.
[0101] Figure 54 is a software structure diagram of the electronic device 400 of the embodiment of the present application. The layered architecture divides the software into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the Android runtime (Androidruntime) and the system library, the hardware abstraction layer and the kernel layer.
[0102] The application layer can include a series of application packages. Figure 5 As shown, the application package may include applications such as camera, settings, and calendar.
[0103] The camera application is an application with the functions of photographing and recording, and the electronic device can respond to the user's operation of opening the camera application to take photos or record videos. It is understandable that the camera application's photo taking and video recording functions can also be called by other applications.
[0104] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0105] Among them, Figure 5 As shown, the application framework layer may also include a camera service, which may be called by a camera application to implement functions such as taking photos or recording videos.
[0106] 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 implement communication between Java and other languages.
[0107] When the entire camera service is running, it can be roughly divided into two parts: the client process and the server process. The binder mechanism is used to implement inter-process communication between the two. The binder mechanism is an interprocess communication (IPC) mechanism. The client process refers to the party that initiates the process request, and the server process refers to the process that is requested to execute the camera service.
[0108] In addition, if Figure 5 As shown, the application framework layer may also include a window manager, a content provider, a resource manager, a view system, and the like.
[0109] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0110] Content providers are used to store and retrieve data and make it accessible to applications. This data can include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0111] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0112] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0113] Android runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.
[0114] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0115] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0116] The system library may 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.
[0117] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0118] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG2, H.262, MP3, AAC, AMR, JPG, PNG, etc.
[0119] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0120] The hardware abstraction layer is an abstract structure between the kernel layer and the Android runtime. The hardware abstraction layer can be a package of the hardware driver of the kernel layer, providing a calling interface for the application framework layer.
[0121] In an embodiment of the present application, the hardware abstraction layer may include a camera hardware abstraction layer (camera HAL). In some embodiments, the camera hardware abstraction module is used to configure the image output mode of the camera according to the sensitivity of the camera. In other embodiments, the camera hardware abstraction module is used to configure the image output mode of the camera according to the sensitivity of the camera and the motion state of the electronic device.
[0122] The kernel layer is a layer between hardware and software. The kernel layer includes at least a camera driver, a sensor driver, and a display driver. In some embodiments, the camera driver is used to control the operation of the camera, the sensor driver is used to control the operation of the motion sensor, and the display driver is used to control the display screen to display images.
[0123] 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.
[0124] 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.
[0125] The following specific embodiments are used to 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, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0126] 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.
[0127] When the user turns on the screen of the electronic device and controls the electronic device to be in an unlocked state, the electronic device may display the following Figure 6The first interface 601 shown in (a) of FIG. The first interface 601 may be the desktop of the electronic device, on which icons of multiple installed applications are displayed, such as a file management application icon, an email application icon, a weather application icon, a calculator application icon, a clock application icon, a recorder application icon, a music application icon, a setting application icon, an address book application icon, a phone application icon, a message application icon, and a camera application icon 6011.
[0128] The user can perform a touch operation on the camera application icon 6011, and the touch operation can be a click operation, a long press operation, etc., so that the electronic device receives the user's touch operation on the camera application icon 6011, and the electronic device starts the camera application in response to the touch operation.
[0129] After the camera application is started, the electronic device may display the following Figure 6 The second interface 602 shown in (b) of FIG. The second interface 602 may be a preview interface provided by a camera application for implementing a shooting function, which includes a preview box 6021, a shooting control 6022, and function controls corresponding to a plurality of shooting modes.
[0130] The preview box 6021 is used to display the image output by the camera in real time. The shooting control 6022 is used to trigger the shooting operation of the electronic device. The functional controls corresponding to the various shooting modes may include night scene mode controls, portrait mode controls, photo mode controls, video mode controls, professional mode controls, and more controls for opening more functions in the camera application.
[0131] 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 in the process of displaying the image output by the camera in real time on the preview interface of the camera application, the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
[0132] Understandably, Figure 6 (a) and Figure 6 The interface shown in (b) is merely an example of a 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 on the embodiments of the present application.
[0133] In another scenario, the user can also call the corresponding interface through a third-party application installed on the electronic device to access the camera application of the electronic device to start the camera application. After the camera application is started, and in the process of displaying the image output by the camera in real time on the preview interface of the camera application, the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
[0134] 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 in the process of displaying the image output by the camera in real time on the preview interface of the camera application, the electronic device can execute the process corresponding to the mode control method provided in the embodiment of the present application.
[0135] 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.
[0136] 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.
[0137] The specific implementation method of the electronic device in the embodiment of the present application controlling the image output mode of the camera is described in detail below.
[0138] For example, Figure 7 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. Figure 7 As shown, the mode control method may specifically include the following steps:
[0139] S701, the electronic device starts a camera application and configures the camera's image output mode to be a full-pixel mode.
[0140] When the user wants to launch the camera app, the user can tap Figure 6 The camera application icon 6011 shown in (a) enables the electronic device to receive a user's touch operation on the camera application icon 6011. The electronic device starts the camera application in response to the touch operation and displays the second interface 602 after the camera application is started.
[0141] It is understandable that there are multiple ways to start the camera application. In addition to the above-mentioned touch operation on the camera application icon 6011 to start the camera application, the camera application can also be started by 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 start the camera application. The specific operation method for starting the camera application is not limited in the embodiment of the present application.
[0142] In the initial state after the electronic device starts the camera application, the electronic device configures the image output mode of the camera to be full pixel mode by default. That is, before configuring the output mode of the camera based on the sensitivity of the camera according to the embodiment of the present application, the image output mode of the camera defaults to full pixel mode.
[0143] The full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method. The mosaic rearrangement method can refer to the above Figure 3 The corresponding description will not be repeated here.
[0144] S702: When the image output mode of the camera is a full-pixel mode, the electronic device determines whether the sensitivity of the camera is greater than a first sensitivity threshold.
[0145] After the electronic device starts the camera application, the electronic device will obtain the sensitivity of the camera in real time to measure the ambient brightness of the environment in which the camera is currently located based on the sensitivity of the camera.
[0146] 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.
[0147] 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.
[0148] S703: When the sensitivity is greater than a first sensitivity threshold, the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode.
[0149] 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 dim, then the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode.
[0150] 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 above Figure 2 The corresponding description will not be repeated here.
[0151] It is understandable that the first sensitivity threshold can be set according to actual conditions. For example, the first sensitivity threshold can be 1400, and when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is greater than 1400, the electronic device switches the image output mode of the camera from the full pixel mode to the pixel merging mode.
[0152] 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.
[0153] After the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode, the camera can output the first image it has captured in the pixel merging mode, and the electronic device can display the first image output by the camera in the pixel merging mode in the first preview interface.
[0154] In the embodiment of the present application, when the image output mode of the camera is the full pixel mode, when the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device can switch the image output mode of the camera from the full pixel mode to the pixel merging mode, and the camera outputs the first image it has collected in the pixel merging mode. By merging multiple adjacent pixels of the same color into one pixel, the light-sensitive area of a single pixel in the first image can be increased, the noise of the first image can be reduced, the clarity and brightness of the first image can be improved, and the image quality of the first image can be improved.
[0155] 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 an image output by the camera in the pixel merging mode.
[0156] After the electronic device executes the above S704, the electronic device may continue to execute the following S707 and subsequent steps.
[0157] 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 remain in the full-pixel mode.
[0158] 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 from full-pixel mode to pixel merger mode. The electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
[0159] 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.
[0160] For example, the first sensitivity threshold may be 1400. When the image output mode of the camera is in full-pixel mode, when the sensitivity of the camera is less than or equal to 1400, the electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
[0161] 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.
[0162] 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.
[0163] In the embodiment of the present application, when the image output mode of the camera is in full pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the electronic device can control the image output mode of the camera to continue to remain in full pixel mode, and the camera outputs the third image it has collected in full pixel mode. 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, the resolution of the third image can be improved, the clarity of the third image is higher, and the image quality of the third image is improved.
[0164] 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 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.
[0165] After the electronic device executes the above S706, the electronic device may continue to execute the above S702 and subsequent steps.
[0166] 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.
[0167] After the electronic device executes the above S704, the image output mode of the camera has been switched from the full pixel mode to the pixel merging mode. Therefore, when the image output mode of the camera is the pixel merging mode, the electronic device can compare the sensitivity of the camera with the second sensitivity threshold to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
[0168] 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.
[0169] 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.
[0170] 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. The electronic device then switches the image output mode of the camera from the pixel merging mode to the full-pixel mode.
[0171] It is understandable that the second sensitivity threshold can be set according to actual conditions. For example, the second sensitivity threshold can be 550. When the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera 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.
[0172] In the embodiment of the present application, the first sensitivity threshold is not equal to the second sensitivity threshold.
[0173] By setting the first sensitivity threshold and the second sensitivity threshold to be unequal, the judgment condition when switching from full-pixel mode to pixel binning mode can be different from the judgment condition when switching from pixel binning mode to full-pixel mode, thereby reducing the ping-pong switching of the camera between full-pixel mode and pixel binning mode, thereby reducing the problem of screen flickering in the image displayed by the electronic device caused by the switching of the camera's image output mode.
[0174] 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.
[0175] After the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode, the camera can output the second image it has captured in the full pixel mode, and the electronic device can display the second image output by the camera in the full pixel mode in the second preview interface.
[0176] In the embodiment of the present application, when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is less than the second sensitivity threshold, the electronic device can switch the image output mode of the camera from the pixel merging mode to the full pixel mode, and the camera outputs the second image it has collected in the full pixel mode. 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, the resolution of the second image can be improved, the clarity of the second image is higher, and the image quality of the second image is improved.
[0177] 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 an image output by the camera in full pixel mode.
[0178] After the electronic device executes the above S709, the electronic device may continue to execute the above S702 and subsequent steps.
[0179] 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.
[0180] 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 dim. At this time, the sensitivity of the camera has not reached the switching condition from the pixel merging mode to the full pixel mode. The electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0181] That is to say, when the image output mode of the camera is the 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 the pixel merging mode to the full pixel mode.
[0182] For example, the second sensitivity threshold may be 550. When the image output mode of the camera is a 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.
[0183] 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.
[0184] 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.
[0185] In the embodiment of the present application, when the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is greater than or equal to the second sensitivity threshold, the electronic device can control the image output mode of the camera to continue to remain in the pixel merging mode, and the camera outputs the fourth image it has collected in the pixel merging mode. By merging multiple adjacent pixels of the same color into one pixel, the photosensitive area of a single pixel in the fourth image can be increased, the noise of the fourth image can be reduced, the clarity and picture brightness of the fourth image can be improved, and the image quality of the fourth image can be improved.
[0186] 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 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.
[0187] After the electronic device executes the above S711, the electronic device may continue to execute the above S707 and subsequent steps.
[0188] 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.
[0189] Since the pixel array of the image sensor is composed of a filter unit array and a photosensitive unit array covered by the filter unit array, and the color of the light received by each pixel unit in the pixel array of the image sensor is determined by the color of the light allowed to pass through by the filter unit in the filter unit array, the pixel array of the image sensor in the full pixel mode is arranged in the same manner as the pixel array of the image sensor in the pixel merging mode, which means that the filter unit array in the full pixel mode is arranged in the same manner as the filter unit array in the pixel merging mode.
[0190] When the camera's image output mode is pixel merging mode, when the camera outputs the captured image, it adds together the electrical signals sensed by adjacent pixels in the pixel array of the image sensor and outputs it in a single pixel mode, which does not change the arrangement of the pixel array of the image sensor.
[0191] Specifically, when the camera is in pixel merging mode, the corresponding pixel merging methods include horizontal merging and vertical merging. Horizontal merging is to add together the electrical signals sensed by pixels in adjacent rows, while vertical merging is to add together the electrical signals sensed by pixels in adjacent columns.
[0192] When the camera's image output mode is full-pixel mode, when the camera outputs the captured image, it can rearrange the pixels in the image captured by the image sensor into a Bayer array through a mosaic rearrangement method implemented by software or hardware. This does not change the arrangement of the pixel array of the image sensor.
[0193] For example, the specific implementation method of the mosaic rearrangement method can be: swapping pixels in the image captured by the image sensor, or calculating a weight ratio based on the distance between a certain pixel and the related pixels around it, and calculating the pixel value of the pixel based on the weight ratio and the pixel values of the related pixels.
[0194] 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.
[0195] The pixel array of the image sensor 20 may be formed as follows: Figure 2 (a) and Figure 3 In the quad-Bayer array shown in (a), when the image output mode of the camera is configured as a pixel merging mode, the pixel merging mode may be a four-in-one pixel merging mode, which is used to merge four adjacent pixels of the same color into one pixel.
[0196] It is understandable that the pixel array of the image sensor in the embodiment of the present application, in addition to using Figure 2 (a) and Figure 3 In addition to the four-Bayer array shown in (a) in FIG. 1 , a nine-Bayer array, a sixteen-Bayer array, etc. may also be used. 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, and the nine-in-one pixel merging mode is used to merge nine adjacent same-color pixels into one 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, and the sixteen-in-one pixel merging mode is used to merge sixteen adjacent same-color pixels into one pixel.
[0197] In some embodiments, the first light sensitivity threshold is greater than the second light sensitivity threshold.
[0198] By setting the first sensitivity threshold to be greater than the second sensitivity threshold, the camera uses the pixel merging mode to output the captured image when the sensitivity of the camera is large enough to improve the clarity and brightness of the image, and the camera uses the full pixel mode to output the captured image when the sensitivity of the camera is small enough to improve the resolution of the image, thereby improving the clarity of the image. In this way, while improving the image quality, the situation of the camera ping-pong switching between the full pixel mode and the pixel merging mode can be reduced, thereby reducing the problem of screen flickering in the image displayed by the electronic device caused by the switching of the camera's image output mode.
[0199] It should be noted that in the above method for controlling the image output mode of the camera, the camera can be a front camera or a rear camera, and the embodiments of the present application do not limit this.
[0200] For ease of understanding, the following Figure 8 The interaction process between the various modules involved in the mode control method provided in the embodiment of the present application is described. In the mode control method, whether to switch the image output mode of the camera is determined according to the sensitivity of the camera.
[0201] like Figure 8 As shown, the electronic device may include a camera application, a camera service, a camera hardware abstraction module, a camera driver, and a camera. Figure 8 As shown, the mode control method may specifically include the following steps:
[0202] S801: The camera application receives a touch operation on a camera application icon by a user.
[0203] S802: In response to a touch operation on a camera application icon, the camera application sends an image preview request to a camera service.
[0204] S803: The camera service sends an image preview request to the camera hardware abstraction module.
[0205] S804, the camera hardware abstraction module sends an image preview request to the camera driver.
[0206] S805: The camera driver sends an image preview request to the camera.
[0207] 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.
[0208] The camera application responds to the touch operation on the camera application icon, starts the camera application, and starts running the camera application on the electronic device. After the camera application is started, the camera application can send an image preview request to the camera service by calling the camera access interface in the application framework layer. The image preview request is used to request to obtain a preview image captured by the camera.
[0209] 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.
[0210] S806: When the camera receives the image preview request, the camera sends the camera sensitivity to the camera driver.
[0211] S807, the camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
[0212] When the camera receives the image preview request, the camera can collect the camera's sensitivity in real time and send the camera's sensitivity to the camera driver, and the camera driver then sends the camera's sensitivity to the camera hardware abstraction module.
[0213] 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.
[0214] After receiving the light sensitivity of the camera, the camera hardware abstract module configures the image output mode of the camera according to the light sensitivity of the camera.
[0215] 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.
[0216] When the image output mode of the camera is in full-pixel mode, when the sensitivity of the camera is less than or equal to the first sensitivity threshold, the 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.
[0217] When the image output mode of the camera is the pixel merging mode, when the sensitivity of the camera is less than the second sensitivity threshold, the camera hardware abstraction module determines that the image output mode of the camera needs to be switched from the pixel merging mode to the full-pixel mode. In this case, the camera hardware abstraction module configures the image output mode of the camera to the full-pixel mode.
[0218] 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.
[0219] The camera hardware abstraction module configures the specific implementation of the camera's image output mode according to the camera's sensitivity. Please refer to the above Figure 7 The corresponding description will not be repeated here.
[0220] S809, the camera hardware abstraction module sends the camera image output mode to the camera driver.
[0221] S810: The camera driver sends the camera's image output mode to the camera.
[0222] S811, the camera outputs the captured preview image according to the image output mode of the camera.
[0223] After the camera hardware abstract module configures the camera's image output mode according to the camera's sensitivity, the camera hardware abstract module sends the camera's image output mode to the camera driver, and the camera driver then sends the camera's image output mode to the camera, so that the camera can output the preview image it has captured according to the camera's image output mode.
[0224] 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.
[0225] In order to facilitate the distinction of the preview images output by the camera under different ambient brightness, the preview images under different scenes may be referred to as the first image, the second image, the third image, and the fourth image, respectively. Specifically, when the image output mode of the camera is switched from the full-pixel mode to the pixel-merging mode, the preview image output by the camera is the first image output by the camera under the pixel-merging mode; when the image output mode of the camera continues to be in the full-pixel mode, the preview image output by the camera is the third image output by the camera under the full-pixel mode; when the image output mode of the camera is switched from the pixel-merging mode to the full-pixel mode, the preview image output by the camera is the second image output by the camera under the full-pixel mode; when the image output mode of the camera continues to be in the pixel-merging mode, the preview image output by the camera is the fourth image output by the camera under the pixel-merging mode.
[0226] It should be noted that when the camera hardware abstraction module determines that the image output mode of the camera needs to be switched, the camera hardware abstraction module sends the switched image output mode to the camera through the camera driver, and when the camera hardware abstraction module determines that the image output mode of the camera does not need to be switched, the camera hardware abstraction module does not need to send the camera's continued image output mode to the camera driver. 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 also send the camera's continued image output mode to the camera through the camera driver.
[0227] In some embodiments, for a scene in which a camera outputs an image captured by the camera in a pixel merging mode, after the camera captures the image, the camera may process the image captured by the camera in a pixel merging manner and output the processed image. In this case, the processed image output by the camera is the image output by the camera in the pixel merging mode.
[0228] Accordingly, for a scene in which the camera outputs the image it has collected in full pixel mode, after collecting the image, the camera can process the image collected by the camera in a mosaic rearrangement manner and output the processed image. At this time, the processed image output by the camera is the image output by the camera in full pixel mode.
[0229] In other embodiments, the arrangement of the pixel array in the image output by the camera may 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 may process the image output by the camera by pixel merging for the scene where the camera's image output mode is pixel merging mode; and the camera hardware abstraction module may process the image output by the camera by mosaic rearrangement for the scene where the camera's image output mode is full pixel mode.
[0230] S812, the camera sends a preview image to the camera driver.
[0231] S813, the camera driver sends a preview image to the camera hardware abstraction module.
[0232] S814, the camera hardware abstraction module sends a preview image to the camera service.
[0233] S815: The camera service sends a preview image to the camera application.
[0234] S816, the camera application displays a preview image.
[0235] After the camera outputs the preview image it has captured according to the camera's image output mode, the camera sends the output preview image to the camera application through the camera driver, the camera hardware abstract module, and the camera service. After receiving the preview image, the camera application can display the preview image on the preview interface.
[0236] In an embodiment of the present application, the camera can continuously output each frame of image it has captured at a certain frame rate, and send each frame of image to the camera application through the camera driver, camera hardware abstraction module and camera service, so that the camera application can display each frame of image in sequence in the preview interface through the display screen.
[0237] In order to facilitate the distinction of the preview interfaces of the preview images output by the camera under different ambient brightness when displayed, the preview interfaces when different preview images are displayed are respectively referred to as the first preview interface, the second preview interface, the third preview interface and the fourth preview interface. Specifically, the preview interface when the first image is displayed is the first preview interface, the preview interface when the second image is displayed is the second preview interface, the preview interface when the third image is displayed is the third preview interface, and the preview interface when the fourth image is displayed is the fourth preview interface.
[0238] In addition, the preview image sent to the camera application may be an image processed by the ISP.
[0239] In some embodiments, after a preset number of frames after each configuration of the image output mode of the camera, the electronic device again determines whether to switch the image output mode of the camera, wherein the image output mode of the camera includes a full pixel mode or a pixel merging mode.
[0240] That is, after the electronic device configures the image output mode of the camera, the time interval between the next determination of whether to switch the image output mode of the camera can be a preset number of frames. Furthermore, configuring the image output mode of the camera can include switching the image output mode of the camera, and controlling the image output mode of the camera to remain unchanged.
[0241] Since the sensitivity of the camera is acquired in real time, the embodiment of the present application can determine the relationship between the sensitivity of the camera and the sensitivity threshold in real time. Moreover, after the preset number of frames after the image output mode of the camera is configured, it is determined whether to switch the image output mode of the camera based on the judgment result of the relationship between the sensitivity of the camera and the sensitivity threshold.
[0242] Alternatively, the embodiment of the present application may also determine the relationship between the camera's sensitivity and a sensitivity threshold after configuring the camera's image output mode and after a preset number of frames, and determine whether to switch the camera's image output mode based on the relationship between the camera's sensitivity and the sensitivity threshold.
[0243] Exemplarily, after the electronic device executes the above S703 and S704, switches the image output mode of the camera from the full pixel mode to the pixel merging mode, and then executes the above S707 after a preset number of frames to determine whether the sensitivity of the camera is less than the second sensitivity threshold. After the electronic device executes the above S705 and S706, controls the image output mode of the camera to remain in the full pixel mode, and then executes the above S702 after a preset number of frames to determine whether the sensitivity of the camera is greater than the first sensitivity threshold. After the electronic device executes the above S708 and S709, switches the image output mode of the camera from the pixel merging mode to the full pixel mode, and then executes the above S702 after a preset number of frames to determine whether the sensitivity of the camera is greater than the first sensitivity threshold. After the electronic device executes the above S710 and S711, controls the image output mode of the camera to remain in the pixel merging mode, and then executes the above S707 after a preset number of frames to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
[0244] It should be noted that the above-mentioned preset frame number can be an empirical value, and different values can be selected according to different modules and complete products. For a certain electronic device, a suitable value can be selected as the preset frame number of the electronic device according to actual product debugging to reduce or solve the problem of screen flickering of the image displayed by the electronic device during the switching process.
[0245] Specifically, for a certain electronic device, the preset frame number may be a preset fixed value, such as the preset frame number may be 200 frames.
[0246] After each configuration of the image output mode of the camera, the camera hardware abstraction module in the electronic device can count the number of frames from zero to determine whether the number of frames reaches the preset number of frames. In some embodiments, the frame rate of the camera capturing images is consistent with the frame rate of the camera application when displaying the images captured by the camera. Therefore, when the electronic device counts the number of frames, the number of frames counted by the electronic device is accumulated by 1 frame for each frame of image captured by the camera; or, when the electronic device counts the number of frames, the number of frames counted by the electronic device is accumulated by 1 frame for each frame of image captured by the camera displayed by the camera application.
[0247] In other embodiments, after a preset time period after each configuration of the image output mode of the camera, the electronic device determines again whether to switch the image output mode of the camera, wherein the image output mode of the camera includes a full pixel mode or a pixel merging mode.
[0248] 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.
[0249] The embodiment of the present application can determine the relationship between the sensitivity of the camera and the sensitivity threshold in real time, and determine whether to switch the image output mode of the camera based on the judgment result of the relationship between the sensitivity of the camera and the sensitivity threshold after a preset time after the image output mode of the camera is configured.
[0250] Alternatively, the embodiment of the present application may also determine the relationship between the camera's sensitivity and a sensitivity threshold after a preset time interval after configuring the camera's image output mode, and determine whether to switch the camera's image output mode based on the relationship between the camera's sensitivity and the sensitivity threshold.
[0251] Exemplarily, after the electronic device executes the above S703 and S704, switches the image output mode of the camera from the full pixel mode to the pixel merging mode, and then executes the above S707 after a preset time interval to determine whether the sensitivity of the camera is less than the second sensitivity threshold. After the electronic device executes the above S705 and S706, controls the image output mode of the camera to remain in the full pixel mode, and then executes the above S702 after a preset time interval to determine whether the sensitivity of the camera is greater than the first sensitivity threshold. After the electronic device executes the above S708 and S709, switches the image output mode of the camera from the pixel merging mode to the full pixel mode, and then executes the above S702 after a preset time interval to determine whether the sensitivity of the camera is greater than the first sensitivity threshold. After the electronic device executes the above S710 and S711, controls the image output mode of the camera to remain in the pixel merging mode, and then executes the above S707 after a preset time interval to determine whether the sensitivity of the camera is less than the second sensitivity threshold.
[0252] It should be noted that the above-mentioned preset duration can be an empirical value, and different values can be selected according to different modules and complete products. For a certain electronic device, an appropriate value can be selected as the preset duration of the electronic device according to actual product debugging to reduce or solve the problem of screen flickering of the image displayed by the electronic device during the switching process.
[0253] Specifically, for a certain electronic device, the preset time length may be a preset fixed value, such as the preset time length may be 8 seconds.
[0254] In the above process, after the electronic device configures the image output mode of the camera, the time interval between the next determination of whether to switch the image output mode of the camera can be a preset number of frames, and the preset number of frames can be a fixed value. In another possible implementation, the embodiment of the present application can also determine the preset number of frames according to the motion state of the electronic device, and determine whether to switch the image output mode of the camera based on the preset number of frames.
[0255] One implementation, exemplary, Fig. 9 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. Fig. 9 As shown, the following steps may be specifically included:
[0256] S901, the electronic device obtains the motion parameters collected by the motion sensor in real time.
[0257] 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 static state, a first moving state, and a second moving state.
[0258] 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.
[0259] 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.
[0260] For example, if the motion sensor includes an acceleration sensor, the motion parameter collected by the acceleration sensor includes acceleration data, which includes accelerations in the x-axis, y-axis, and z-axis directions. The electronic device can determine the motion state of the electronic device based on the acceleration data collected by the acceleration sensor.
[0261] Exemplarily, when the acceleration sensor detects that the acceleration data of the electronic device is less than the first acceleration threshold, it is determined that the electronic device is in a stationary state; when the acceleration sensor detects that the acceleration data of the electronic device is greater than or equal to the first acceleration threshold and less than the second acceleration threshold, it is determined that the electronic device is in a first moving state; when the acceleration sensor detects that the acceleration data of the electronic device is greater than or equal to the second acceleration threshold, it is determined that the electronic device is in a second moving state. The second acceleration threshold is greater than the first acceleration threshold, and the first acceleration threshold can be a value close to 0.
[0262] For example, if the motion sensor includes a gyroscope sensor, the motion parameter collected by the gyroscope sensor includes angular velocity data, which includes angular velocities in the x-axis, y-axis, and z-axis directions. The electronic device can determine the motion state of the electronic device based on the angular velocity data collected by the gyroscope sensor.
[0263] Exemplarily, when the gyroscope sensor detects that the angular velocity data of the electronic device is less than the first angular velocity threshold, it is determined that the electronic device is in a stationary state; when the gyroscope sensor detects that the angular velocity data of the electronic device is greater than or equal to the first angular velocity threshold and less than the second angular velocity threshold, it is determined that the electronic device is in a first moving state; when the gyroscope sensor detects that the angular velocity data of the electronic device is greater than or equal to the second angular velocity threshold, it is determined that the electronic device is in a second moving state. The second angular velocity threshold is greater than the first angular velocity threshold, and the first angular velocity threshold may be a value close to 0.
[0264] For example, if the motion sensor includes a speed sensor, the motion parameter collected by the speed sensor includes speed data, which includes speeds in the x-axis, y-axis and z-axis directions. The electronic device can determine the motion state of the electronic device based on the speed data collected by the speed sensor.
[0265] Exemplarily, when the speed sensor detects that the speed data of the electronic device is less than a first speed threshold, it is determined that the electronic device is in a stationary state; when the speed sensor detects that the speed data of the electronic device is greater than or equal to the first speed threshold and less than a second speed threshold, it is determined that the electronic device is in a first moving state; when the speed sensor detects that the speed data of the electronic device is greater than or equal to the second speed threshold, it is determined that the electronic device is 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.
[0266] 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.
[0267] Therefore, according to the above S901 and S902, the electronic device can obtain the motion state of the electronic device in real time.
[0268] S903: The electronic device determines that the preset frame number corresponding to the static state is the first frame number.
[0269] S904: The electronic device determines that the preset frame number corresponding to the first movement state is the second frame number.
[0270] S905: The electronic device determines that the preset frame number corresponding to the second movement state is a third frame number.
[0271] In the 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.
[0272] The first frame number, the second frame number, and the third frame number may be empirical values, and different values may be selected according to different modules and complete products. For a certain electronic device, appropriate values may be selected as the first frame number, the second frame number, and the third frame number according to actual product debugging.
[0273] At least two of the first frame number, the second frame number and the third frame number are different.
[0274] For example, the first frame number corresponding to the static state may be greater than the first frame number corresponding to the first moving state; the first frame number corresponding to the static state may be greater than the third frame number corresponding to the second moving state. By extending the preset frame number in the static state, the smoothness of the switching process of the camera's image output mode can be increased.
[0275] 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.
[0276] 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.
[0277] 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 all meet a preset condition.
[0278] S907, when the sensitivities acquired within the unchanged frame number in the static state all meet the preset conditions, the electronic device switches the image output mode of the camera.
[0279] 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.
[0280] 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.
[0281] If the sensitivity acquired within the number of frames in which the static state remains unchanged is less than the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is relatively stable, and the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the static state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0282] For example, the first frame number corresponding to the static state is 300 frames, and the second sensitivity threshold is 550. After the image output mode of the camera is switched 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 acquired within 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.
[0283] It should be noted that the electronic device can monitor the motion state of the electronic device in real time and obtain the sensitivity of the camera in real time. Moreover, when the image output mode of the camera is the pixel merging mode, the electronic device will compare the sensitivity of the camera with the second sensitivity threshold in real time.
[0284] 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.
[0285] If the sensitivity acquired within the number of frames in which the static state remains unchanged is greater than the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is relatively stable, and the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivity acquired within the number of frames in which the static state remains unchanged is less than or equal to the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the static state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
[0286] 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.
[0287] S910: When the sensitivities acquired within the number of frames in which the first moving state remains unchanged all meet a preset condition, the electronic device switches the image output mode of the camera.
[0288] S911, when the acquired sensitivity does not meet the preset condition within the number of frames in which the first moving state remains unchanged, the electronic device maintains the image output mode of the camera unchanged.
[0289] 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 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.
[0290] If the sensitivity acquired within the number of frames in which the first movement state remains unchanged is less than the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the first movement state remains unchanged is relatively stable, and the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the first movement state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the first movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0291] 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 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.
[0292] 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 image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivities acquired within the number of frames in which the first movement state remains unchanged are less than or equal to the first sensitivity threshold, indicating that the sensitivities acquired within the number of frames in which the first movement state remains unchanged are not very stable, the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
[0293] 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.
[0294] S913, when the sensitivities acquired within the number of frames in which the second moving state remains unchanged all meet the preset conditions, the electronic device switches the image output mode of the camera.
[0295] 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.
[0296] 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.
[0297] If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is less than the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is relatively stable, and the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode. If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is greater than or equal to the second sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0298] 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 a third number of frames, the electronic device determines whether the sensitivity obtained within the number of frames in which the second moving state remains unchanged is greater than the first sensitivity threshold.
[0299] If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is greater than the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is relatively stable, and the electronic device switches the image output mode of the camera from the full-pixel mode to the pixel merging mode. If the sensitivity acquired within the number of frames in which the second movement state remains unchanged is less than or equal to the first sensitivity threshold, it means that the sensitivity acquired within the number of frames in which the second movement state remains unchanged is not very stable, and the electronic device controls the image output mode of the camera to continue to remain in the full-pixel mode.
[0300] It should be noted that the above description is a scenario in which the motion state of the electronic device remains unchanged between each configuration of the camera's image output mode and the next configuration of the camera's image output mode. If the motion state of the electronic device changes 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 motion state after the change.
[0301] 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.
[0302] Wherein, when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition. 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 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.
[0303] Therefore, after configuring the image output mode of the camera each time, the embodiment of the present application jointly determines whether to switch the image output mode of the camera according to the motion state of the electronic device and the sensitivity of the camera. According to the scenes corresponding to different motion states, different preset frame numbers are matched to increase the smoothness of the image output mode switching process of the camera, further reduce the problem of screen flickering of the image displayed by the electronic device during the switching process of the image output mode of the camera, and make the image displayed by the electronic device more stable.
[0304] Another implementation method is that after each configuration of the image output mode of the camera, the electronic device obtains the motion state of the electronic device; the electronic device determines a preset number of frames corresponding to the motion state based on the motion state of the electronic device; at the first moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets the preset conditions, and the time interval between the first moment and the moment of configuring the image output mode of the camera is equal to the preset number of frames corresponding to the motion state; when the sensitivity meets the preset conditions, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset conditions, the electronic device keeps the image output mode of the camera unchanged.
[0305] Wherein, when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition. 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 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.
[0306] In this case, the electronic device does not need to determine the motion state of the electronic device in real time, and the electronic device obtains the motion state of the electronic device once after configuring the image output mode of the camera each time. The specific method of obtaining the motion state of the electronic device can refer to the corresponding description of S901 and S902 above, which will not be repeated here.
[0307] The motion state of the electronic device includes a static state, a first moving state and a second moving state. The preset frame number corresponding to the static state is the first frame number; the preset frame number corresponding to the first moving state is the second frame number; and the preset frame number corresponding to the second moving state is the third frame number.
[0308] 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.
[0309] In the first case, after the electronic device configures the image output mode of the camera to be the pixel merging mode, the electronic device determines whether the sensitivity of the camera is less than the second sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be the pixel merging mode. If the sensitivity of the camera is less than the second sensitivity threshold, the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0310] In the second case, after the electronic device configures the image output mode of the camera to be the full pixel mode, the electronic device determines whether the sensitivity of the camera is greater than the first sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be the full pixel mode. If the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device switches the image output mode of the camera from the full pixel mode to the pixel merging mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the full pixel mode.
[0311] In another implementation method, the electronic device obtains the motion state of the electronic device in real time; the electronic device determines a preset number of frames corresponding to the motion state based on the motion state of the electronic device; at a second moment after each configuration of the image output mode of the camera, the electronic device determines whether the sensitivity meets a preset condition, the second moment being the moment when the number of frames in which the motion state remains unchanged reaches a preset number of frames corresponding to the motion state; when the sensitivity meets the preset condition, the electronic device switches the image output mode of the camera; when the sensitivity does not meet the preset condition, the electronic device keeps the image output mode of the camera unchanged.
[0312] Wherein, when the image output mode of the camera is the full pixel mode, when the sensitivity is greater than the first sensitivity threshold, the sensitivity meets the preset condition, and when the sensitivity is less than or equal to the first sensitivity threshold, the sensitivity does not meet the preset condition. 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 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.
[0313] In this case, the electronic device acquires the motion state of the electronic device in real time. The specific method of acquiring the motion state of the electronic device can refer to the corresponding description of S901 and S902 above, which will not be repeated here.
[0314] The motion state of the electronic device includes a static state, a first moving state and a second moving state. The preset frame number corresponding to the static state is the first frame number; the preset frame number corresponding to the first moving state is the second frame number; and the preset frame number corresponding to the second moving state is the third frame number.
[0315] 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.
[0316] In the first case, after the electronic device configures the image output mode of the camera to be the pixel merging mode, if the motion state of the electronic device has been static 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 of the camera is less than a second sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be the pixel merging mode. If the sensitivity of the camera is less than the second sensitivity threshold, the electronic device switches the image output mode of the camera from the pixel merging mode to the full pixel mode; if the sensitivity is greater than or equal to the second sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in the pixel merging mode.
[0317] In the second case, after the electronic device configures the image output mode of the camera to be in full-pixel mode, if the motion state of the electronic device has been in 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 of the camera is greater than a first sensitivity threshold after the first number of frames after the image output mode of the camera is configured to be in full-pixel mode. If the sensitivity of the camera is greater than the first sensitivity threshold, the electronic device switches the image output mode of the camera from full-pixel mode to pixel merging mode; if the sensitivity is less than or equal to the first sensitivity threshold, the electronic device controls the image output mode of the camera to continue to remain in full-pixel mode.
[0318] It should be noted that the above description is a scenario in which the motion state of the electronic device remains unchanged between each configuration of the camera's image output mode and the next configuration of the camera's image output mode. If the motion state of the electronic device changes 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 determines whether it needs to compare the size relationship between the camera's sensitivity and the sensitivity threshold based on whether the number of frames maintained by the motion state after the change reaches the preset number of frames corresponding to the motion state after the change.
[0319] 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 screen 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.
[0320] For ease of understanding, the following Fig.10 The interaction process between the various modules involved in the mode control method provided in the embodiment of the present application is described. In the 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.
[0321] like Fig.10 As shown, the electronic device may include a camera application, a camera service, a camera hardware abstraction module, a camera driver and a camera, a sensor driver and a motion sensor. Fig.10 As shown, the mode control method may specifically include the following steps:
[0322] S1001: A camera application receives a touch operation on a camera application icon by a user.
[0323] S1002: In response to a touch operation on a camera application icon, the camera application sends an image preview request to a camera service.
[0324] S1003: The camera service sends an image preview request to the camera hardware abstraction module.
[0325] S1004, the camera hardware abstraction module sends an image preview request to the camera driver.
[0326] S1005: The camera driver sends an image preview request to the camera.
[0327] S1006: When the camera receives the image preview request, the camera sends the camera sensitivity to the camera driver.
[0328] S1007, the camera driver sends the camera's light sensitivity to the camera hardware abstraction module.
[0329] It should be noted that the specific implementation of S1001 to S1007 can refer to the specific implementation of S801 to S807 mentioned above, which will not be repeated here.
[0330] S1008, the camera hardware abstraction module sends a motion parameter acquisition request to the sensor driver.
[0331] S1009: The sensor driver sends a motion parameter acquisition request to the motion sensor.
[0332] S1010: The motion sensor sends the collected motion parameters to the sensor driver.
[0333] S1011, the sensor driver sends motion parameters to the camera hardware abstraction module.
[0334] S1012, the camera hardware abstraction module determines the motion state of the electronic device according to the motion parameters.
[0335] In some embodiments, the camera hardware abstract module stores software code for scheduling the motion sensor. After receiving the image preview request, the camera hardware abstract module can call the sensor driver to drive the motion sensor to collect the motion parameters of the electronic device. The motion sensor sends the collected motion parameters to the camera hardware abstract module through the sensor driver.
[0336] The camera hardware abstraction module can determine the motion state of the electronic device according to the motion parameters of the electronic device. The specific implementation method thereof can refer to the description corresponding to the above S902, which will not be repeated here.
[0337] S1013, the camera hardware abstraction module configures the image output mode of the camera according to the sensitivity of the camera and the motion state of the electronic device; the image output mode of the camera includes a full pixel mode or a pixel merging mode.
[0338] After receiving the sensitivity of the camera and determining the motion state of the electronic device, the camera hardware abstract module configures the image output mode of the camera according to the sensitivity of the camera and the motion state of the electronic device.
[0339] It should be noted that the camera hardware abstraction module configures the specific implementation of the camera's image output mode according to the camera's sensitivity and the motion state of the electronic device, which can refer to the above three implementations. Fig. 9The corresponding description is not repeated here. When counting the number of frames whose motion state remains unchanged, the camera hardware abstraction module performs the counting.
[0340] S1014, the camera hardware abstraction module sends the camera image output mode to the camera driver.
[0341] S1015: The camera driver sends the camera's image output mode to the camera.
[0342] S1016: The camera outputs the captured preview image according to the image output mode of the camera.
[0343] S1017, the camera sends a preview image to the camera driver.
[0344] S1018, the camera driver sends a preview image to the camera hardware abstraction module.
[0345] S1019, the camera hardware abstraction module sends a preview image to the camera service.
[0346] S1020, the camera service sends a preview image to the camera application.
[0347] S1021, the camera application displays a preview image.
[0348] It should be noted that the specific implementation of S1014 to S1021 can refer to the specific implementation of S809 to S816 mentioned above, which will not be repeated here.
[0349] In some embodiments, the camera application includes multiple shooting modes, such as night scene mode, portrait mode, photo mode, video mode, and professional mode, etc. Among them, at least some of the shooting modes in the multiple shooting modes correspond to different first sensitivity thresholds, and / or at least some of the shooting modes in the multiple shooting modes correspond to different second sensitivity thresholds.
[0350] 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.
[0351] 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.
[0352] 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.
[0353] For example, Fig.11 The schematic diagram of module interaction during image capture provided by the embodiment of the present application 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. Fig.11 As shown, the following steps may be specifically included:
[0354] S1101, the camera application receives a user's touch operation on a shooting control.
[0355] S1102: In response to a touch operation on a shooting control, the camera application sends an image shooting request to the camera service.
[0356] S1103, the camera service sends an image capture request to the camera hardware abstraction module.
[0357] S1104, the camera hardware abstraction module sends an image capture request to the camera driver.
[0358] S1105: The camera driver sends an image capture request to the camera.
[0359] S1106: The camera sends the acquired image frames to the camera driver according to the image shooting request.
[0360] Exemplarily, 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.
[0361] In response to the touch operation on the shooting control, the camera application sends an image shooting request to the camera service by calling the camera access interface in the application framework layer. The camera service sends the image shooting request to the camera through the camera hardware abstraction module and the camera driver. The camera captures images according to the image shooting request and outputs the captured image frames based on the current image output mode. The image frames output by the camera can be sent to the camera driver.
[0362] S1107, the camera driver sends the image frame to the camera hardware abstraction module.
[0363] S1008, the camera hardware abstraction module sends the image frame to the camera service.
[0364] S1109: The camera service sends the image frame to the camera application.
[0365] S1110, the camera application stores the image frame.
[0366] The camera driver sends the image frames output by the camera to the camera application through the camera hardware abstraction module and the camera service. After receiving the image frames, the camera application can store the image frames in the memory of the electronic device.
[0367] Exemplarily, the preview interface of the camera application may be a first preview interface and a second preview interface, the preview interface when the first image is displayed is the first preview interface, and the preview interface when the second image is displayed is the second preview interface. The shooting control in the first preview interface is referred to as the first shooting control, that is, the first preview interface includes the first shooting control, and the shooting control in the second preview interface is referred to as the second shooting control, that is, the second preview interface includes the second shooting control. The image frame stored in the above process may be the first image or the second image.
[0368] When the electronic device receives the first operation of the user on the first shooting control, the electronic device responds to the first operation on the first shooting control and saves the first image according to the implementation of S1102 to S1110. Correspondingly, when the electronic device receives the second operation of the user on the second shooting control, the electronic device responds to the second operation on the second shooting control and saves the second image according to the implementation of S1102 to S1110.
[0369] The first image is a preview image output by the camera in pixel merging mode, and the second image is a preview image output by the camera in full pixel mode. Therefore, the size of the second image is larger than the size of the first image. 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.
[0370] 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.
[0371] Correspondingly, the size of the third image is also greater than that of the fourth image. The storage space occupied by the third image when stored is also greater than the storage space occupied by the fourth image when stored.
[0372] Taking the example of the related art using full pixel mode under different ambient brightness, the storage space occupied by the images output in low brightness environment and high brightness environment is equal, while the storage space occupied by the images output in low brightness environment of the embodiment of the present application is 1 / 4 of the storage space occupied by the images output in high brightness environment. For example, the storage space occupied by the images output in low brightness environment and high brightness environment of the related art is 9MB, while the storage space occupied by the images output in low brightness environment of the embodiment of the present application can be 2.25MB, and the storage space occupied by the images output in high brightness environment of the embodiment of the present application can also be 9MB.
[0373] 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 it does not start counting again from zero due to the shooting operation.
[0374] 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 camera applications. After the video recording is completed, the camera application saves each frame of the image output by the camera in the form of a video in the electronic device.
[0375] Combined with the above Figures 6 to 11 , the mode control method provided in the embodiment of the present application is described, and the device for executing the above method provided in the embodiment of the present application is described below. Fig.12 As shown, Fig.12 A schematic diagram of the structure of a mode control device provided in an embodiment of the present application. The mode control device may be an electronic device in an embodiment of the present application, or a chip or chip system in an electronic device.
[0376] like Fig.12 As shown, the mode control device 1200 may include: a display unit 1201 and a processing unit 1202. The display unit 1201 is used to support the mode control device 1200 to perform the above display steps; the processing unit 1202 is used to support the mode control device 1200 to perform the above processing steps.
[0377] Specifically, when the camera application is started, the processing unit 1202 is used to obtain the sensitivity of the camera; when the sensitivity is greater than the first sensitivity threshold and the image output mode of the camera is the full pixel mode, the display unit 1201 is used to display the first preview interface, the first preview interface includes the first image, and the first image is the image output by the camera in the pixel merging mode; when the sensitivity is less than the second sensitivity threshold and the image output mode of the camera is the pixel merging mode, the display unit 1201 is used to display the second preview interface, the second preview interface includes the second image, and the second image is the image output by the camera in the full pixel mode. Among them, the pixel merging mode is used to merge multiple adjacent pixels of the same color into one pixel, and the full pixel mode is used to rearrange pixels into a Bayer array using a mosaic rearrangement method; the first sensitivity threshold is not equal to the second sensitivity threshold.
[0378] In a possible implementation, the mode control device 1200 further includes a storage unit 1203. The storage unit 1203 and the processing unit 1202 are connected via a line. The storage unit 1203 may include one or more memories, and the memory may be a device used to store programs or data in one or more devices or circuits. The storage unit 1203 may exist independently and be connected to the processing unit 1202 via a communication bus. The storage unit 1203 may also be integrated with the processing unit 1202.
[0379] The storage unit 1203 can store computer-executable instructions of the method in the electronic device so that the processing unit 1202 executes the method in the above embodiment. The storage unit 1203 can be a register, a cache, or a random access memory (RAM), etc. The storage unit 1203 can be integrated with the processing unit 1202. The storage unit 1203 can be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, and the storage unit 1203 can be independent of the processing unit 1202.
[0380] Fig.13 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. Fig.13 As shown, the chip 1300 includes one or more (including two) processors 1301 , a communication line 1302 and a communication interface 1303 . Optionally, the chip 1300 also includes a memory 1304 .
[0381] In some implementations, the memory 1304 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
[0382] The method described in the above embodiment of the present application can be applied to the processor 1301, or implemented by the processor 1301. The processor 1301 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor 1301 or an instruction in the form of software. The above-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.
[0383] The steps of the method disclosed in the embodiment of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a mature storage medium in the field such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read only memory (EEPROM). The storage medium is located in the memory 1304, and the processor 1301 reads the information in the memory 1304 and completes the steps of the above method in combination with its hardware.
[0384] The processor 1301 , the memory 1304 , and the communication interface 1303 may communicate with each other via the communication line 1302 .
[0385] In the above embodiments, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory, or may be downloaded and installed in the memory in the form of software.
[0386] 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 the 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 a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server, a data center, etc. that includes one or more available media integrated. For example, the available medium can include a magnetic medium (e.g., a floppy disk, a hard disk or a tape), an optical medium (e.g., a digital versatile disc (digital versatile disc, DVD)), or a semiconductor medium (e.g., a solid state drive (solid state disk, SSD)), etc.
[0387] 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.
[0388] The embodiment of the present application provides a chip. The chip includes a processor, and the processor is used to call a computer program in a memory to execute the technical solution in the above embodiment. Its implementation principle and technical effect are similar to those of the above related embodiments, and will not be repeated here.
[0389] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program or instruction. The above method is implemented when the computer program or instruction is executed by the processor. The method described in the above embodiment can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the function can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium that can be accessed by a computer.
[0390] As a possible design, the computer-readable medium may include a compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; the computer-readable medium may include a magnetic disk storage or other magnetic disk storage device. 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 technology (such as infrared, radio and microwave), the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of the medium. Disks and optical discs as used herein include compact discs (CDs), laser discs, optical discs, DVDs, floppy disks and Blu-ray discs, where disks generally reproduce data magnetically, while optical discs reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0391] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0392] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present application in detail. It should be understood that the above are only specific implementation methods of the present application and are not used to limit the protection scope of the present application. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present application should be included in the protection scope of the present application.
Claims
1. A mode control method, 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, characterized in that The first sensitivity threshold is greater than the second sensitivity threshold.
3. The method according to claim 1, 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, 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, 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, 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, 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, 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 a 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 is equal to 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.
9. The method according to claim 7, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
Method and device obtaining target image, and terminal
CN104243788A
Image generation method and device, terminal equipment
CN105578067A
Image generation method and device and terminal device
CN105611185A
Photographing method and electronic equipment
CN115696063A
Digital camera and method for driving solid-state imaging device
JP2011015205A
Cited By
Image reading method, electronic equipment and computer readable storage medium
CN119485054A
