Image shooting method and related equipment
By controlling the camera movement range and anti-shake parameters in the OIS function of electronic devices, the color deviation problem when electronic devices take pictures is solved, and the image quality and user experience are improved.
Patent Information
- Application Number
- CN202311704711.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2043-12-12
AI Technical Summary
When an electronic device captures an image, there is a color deviation between the displayed image and the object to be photographed, which affects the color reduction degree and quality of the image.
By controlling the movement range and anti-shake parameters of the camera in the OIS function of the electronic device, limiting the movement of the lens, and using different OIS modes and gyroscope gain coefficients, the color deviation between the image and the photographed object is reduced.
It effectively improves the color reproduction and quality of the image, improves the user's photography experience, and reduces the color casting problem between the image and the object being photographed.
Smart Images

Figure CN118474530B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to an image capturing method and related equipment. Background Art
[0002] The electronic device may support a camera application, and the user may use the electronic device to take photos or videos of the object being photographed.
[0003] However, in a possible implementation, the color of the image displayed by the electronic device is different from the color of the photographed object. For example, when displaying the preview interface of a camera application, there is a color cast between the image displayed by the electronic device and the photographed object; for another example, when receiving an operation for taking a photo, the electronic device may obtain a captured image, and there is also a color cast between the captured image and the photographed object. Summary of the invention
[0004] The embodiments of the present application provide an image capturing method and related equipment, which relate to the field of terminal technology, and provide a method for reducing the color cast between an image displayed by an electronic device and an actual captured object, thereby improving the color reproduction of the image and improving the quality of the image.
[0005] In the first aspect, the embodiment of the present application proposes an image shooting method, which is applied to an electronic device, and the electronic device supports an optical image stabilization (OIS) function, and the method includes: when the zoom ratio of the electronic device is a first zoom ratio and the anti-shake parameter of the electronic device is a first parameter; controlling the camera of the electronic device to move within a first range; when the zoom ratio of the electronic device is a second zoom ratio and the anti-shake parameter of the electronic device is a first parameter, controlling the camera of the electronic device to move within a second range; the first range is greater than the second range; the first zoom ratio is less than the second zoom ratio. In this way, in the first scenario, the embodiment of the present application limits the movement range of the lens, thereby reducing the color cast between the image displayed by the electronic device and the photographed object, improving the color restoration of the image, improving the image quality, and thus improving the user's photo-taking experience.
[0006] In a possible implementation, before controlling the camera of the electronic device to move in the second range, it also includes: setting the threshold of the anti-shake parameter to a first threshold; wherein the absolute value of the first threshold is less than or equal to the absolute value of the second threshold; the second threshold is the threshold of the anti-shake parameter of the electronic device in the first zoom ratio; the first zoom ratio is less than the preset zoom ratio, and the second zoom ratio is greater than or equal to the preset zoom ratio. In this way, in the first scenario, the electronic device can limit the range of lens movement by limiting the threshold of the anti-shake parameter; reduce lens movement, reduce the color cast between the image displayed by the electronic device and the actual photographed object, improve the degree of image color restoration, improve image quality, and thus improve the user's photo-taking experience.
[0007] In a possible implementation, the anti-shake parameter includes one or more of the following: an offset angle and a compensation value of a motor; wherein the offset angle is the tilt angle of the electronic device when it shakes, and the compensation value of the motor is the range of movement of the motor; the motor is used to drive the position of the camera to move; the threshold of the anti-shake parameter includes one or more of the following: an anti-shake angle and a motor stroke; wherein the anti-shake angle is the maximum offset angle that the electronic device can compensate for the movement of the camera, and the motor stroke is the maximum compensation value that the motor can reach; the anti-shake angle is positively correlated with the movement range of the camera, and the motor stroke is positively correlated with the movement range of the camera. In this way, the threshold of the anti-shake parameter may include the anti-shake angle and the motor stroke, and the electronic device can limit the movement range of the lens by means of the anti-shake angle and / or the motor stroke, reduce the movement of the lens, reduce the color cast between the image displayed by the electronic device and the actual photographed object, improve the color restoration of the image, improve the image quality, and thus improve the user's photo-taking experience.
[0008] In a possible implementation, before controlling the camera of the electronic device to move in the second range, it also includes: setting the gyroscope gain coefficient to the first gyroscope gain coefficient; controlling the camera of the electronic device to move in the second range, including: obtaining the compensation value of the motor based on the first gyroscope gain coefficient, and controlling the camera of the electronic device to move in the second range by the compensation value of the motor; wherein the gyroscope gain coefficient is positively correlated with the compensation value of the motor; the first gyroscope gain coefficient is less than or equal to the second gyroscope gain coefficient; the second gyroscope gain coefficient is the gyroscope gain coefficient of the electronic device in the first zoom ratio. In this way, in the first scenario, the electronic device can limit the range of lens movement by limiting the gyroscope gain coefficient; reduce lens movement, reduce the color cast between the image displayed by the electronic device and the actual photographed object, improve the color restoration of the image, improve the image quality, and thus improve the user's photo-taking experience.
[0009] In a possible implementation, when the zoom ratio of the electronic device is the second zoom ratio and the anti-shake parameter of the electronic device is the second parameter, the camera of the electronic device is controlled to move within a third range; the second parameter is smaller than the first parameter; and the third range is smaller than the second range. In this way, the electronic device can more accurately adjust the movement range of the camera according to the offset angle, and control the movement range of the camera not to exceed the maximum movement range of the first scene; thereby limiting the movement range of the camera, reducing the movement of the lens, reducing the color cast between the image displayed by the electronic device and the actual object being photographed, improving the color restoration of the image, improving the image quality, and thus improving the user's photo-taking experience.
[0010] In a possible implementation, it also includes: turning on the OIS function; the OIS mode is the first OIS mode, in the first OIS mode, the threshold of the anti-shake parameter is the second threshold, and the gyroscope gain coefficient is the second gyroscope gain coefficient; judging whether it is the first scene; the first scene includes a scene of processing a quad image into a remosaic image; when the electronic device is in the first scene, setting the OIS mode to the second OIS mode; setting the threshold of the anti-shake parameter and / or the gyroscope gain coefficient according to the second OIS mode; wherein, in the second OIS mode, the threshold of the anti-shake parameter is the first threshold, and / or the gyroscope gain coefficient is the first gyroscope gain coefficient. In this way, the electronic device can use the second OIS mode provided in the embodiment of the present application through the judgment process of the first scene, in the case where the electronic device may cause color cast on the display, thereby reducing the movement of the lens, reducing the color cast between the image displayed by the electronic device and the actual photographed object, improving the color restoration of the image, improving the image quality, and thus improving the user's photo taking experience.
[0011] In a possible implementation, when the electronic device is in the first scene, the OIS mode is set to the second OIS mode, including: when it is recognized that the zoom ratio is greater than or equal to the preset zoom ratio, and when it is recognized that the brightness value is greater than or equal to the preset brightness, an instruction for indicating the internal zoom of the sensor is obtained; and based on the instruction for indicating the internal zoom of the sensor, the OIS mode is set to the second OIS mode. In this way, the electronic device can more accurately identify the quad raw image output scene according to the instruction for indicating the internal zoom of the sensor.
[0012] In a possible implementation, the instruction for instructing the internal zoom of the sensor includes in sensor zoom; and the second OIS mode includes a zoom mode. In this way, the electronic device can more accurately identify the quad raw image output scene according to the in sensor zoom.
[0013] In a possible implementation, it also includes: when the zoom ratio of the electronic device is the second zoom ratio, the brightness value of the electronic device is the first brightness, and the anti-shake parameter of the electronic device is the first parameter; controlling the camera of the electronic device to move in the second range; when the zoom ratio of the electronic device is the second zoom ratio, the brightness value of the electronic device is the second brightness, and the anti-shake parameter of the electronic device is the first parameter, controlling the camera of the electronic device to move in the first range; the second brightness is less than the first brightness, the second brightness is less than the preset brightness, and the first brightness is greater than or equal to the preset brightness. In this way, the electronic device can display an image with a smaller color difference from the actual photographed object when the zoom ratio condition and the brightness value condition are met; improve the color restoration of the image to obtain a high-quality image; when the zoom ratio condition and / or the brightness value condition are not met, the electronic device can turn on the OIS function again to improve the stability of the imaging, and there will be no color difference problem, and output a high-quality image.
[0014] In a second aspect, an embodiment of the present application provides an electronic device, which may also be referred to as a terminal device, a terminal, a user equipment (UE), a mobile station (MS), a mobile terminal (MT), etc. The electronic device may 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 a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, etc.
[0015] The electronic device comprises: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the method as in the first aspect.
[0016] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.
[0017] In a fourth aspect, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the method of the first aspect.
[0018] In the fifth aspect, an embodiment of the present application provides a chip system, which includes at least one processor and a communication interface, the communication interface and at least one processor are interconnected through lines, and the at least one processor is used to run computer programs or instructions to execute the method of the first aspect.
[0019] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 The arrangement of multiple pixels involved in the embodiments of the present application;
[0021] Figure 2 A possible implementation is a scenario where the electronic device has color cast in the preview scene and the photo shooting scene;
[0022] Figure 3 A schematic diagram of comparing pixel values in two scenarios where the OIS lens is not moved and the lens is moved provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the software structure of an electronic device 100 provided in an embodiment of the present application;
[0025] Figure 6 A schematic diagram of a flow chart of an image capturing method provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of a flow chart of another image capturing method provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of a scene for entering a first scene provided in an embodiment of the present application;
[0028] Fig. 9 A schematic diagram of a lens movement direction provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of a scenario for exiting a first scenario provided in an embodiment of the present application;
[0030] Fig.11A schematic diagram of another scenario of exiting the first scenario provided in an embodiment of the present application;
[0031] Fig.12 An internal interaction flow chart of an image capturing method provided by an embodiment of the present application;
[0032] Fig.13 A schematic diagram of a flow chart of an image capturing method provided in an embodiment of the present application;
[0033] Fig.14 A schematic diagram comparing the first range and the second range is provided for the embodiment of the present application;
[0034] Fig.15 A schematic diagram of the structure of an image capturing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0036] 1) Quad output: A sensor uses four pixels of the same color to be arranged in order, and the four pixels of the same color are sampled at the same time to obtain a photo with four times the sensitivity. For example, Figure 1 Figure a in the figure shows a quad output method. In the RAW image acquired by the electronic device based on the camera, the pixels can be arranged in a quad array. A quad can be understood as: the pixel values in multiple pixel matrices are the same, which can be regarded as a large pixel area. For example, Figure 1 In the figure a, the four pixels of type R are arranged in a 2×2 form; the four pixels of type G are arranged in a 2×2 form; the four pixels of type B are arranged in a 2×2 form. The four pixel areas can satisfy the arrangement rules of the Bayer array of R, G, G, and B. Figure 1 The arrangement of pixels in the figure a in the figure can be called quad-bayer (also called 4cell); it should be noted that the R type pixel can be displayed in red; the G type pixel can be displayed in green; the B type pixel can be displayed in green; Figure 1 In figure a, two groups of G-type pixel points are included. In some embodiments, the green colors displayed by the two groups of G-type pixel points can be the same or different.
[0037] 2) Pixel reconstruction (remosaic) algorithm: The remosaic algorithm can process the pixels arranged in quad form into the pixels arranged in Bayer array by pixel swapping, which can be used to enlarge the reduced image and reconstruct its original resolution while maintaining the details and clarity of the image. For example, Figure 1Figure b shows a remosaic array, where the electronic device can Figure 1 The image processing of the quad array shown in a in FIG is as follows Figure 1 The image of the remosaic array shown in b in FIG. The pixel value of any pixel point is different from the pixel values of the adjacent pixels in the up, down, left, and right directions.
[0038] In possible implementations, electronic devices can perform remosaic processing on images through software or hardware. For hardware processing, the chip in the electronic device can transform the pixel structure through independent image signal processing (ISP), and the sensor can display and output pixel data. In the hardware processing method, the electronic device can capture the image of the Bayer array without software processing. For software processing, the electronic device performs the remosaic algorithm on the image through a software algorithm between the sensor and the ISP.
[0039] 3) Binning: It is an image readout mode that adds the charges induced by adjacent pixels together and reads them out as a pixel. It can convert a quad image into a binned image. For example, the arrangement of pixels in a binning image can be as follows: Figure 1 As shown in Figure c.
[0040] 4) Optical image stabilization (OIS): Based on gyroscope sensor detection and displacement compensation. The gyroscope in the lens detects the tiny movement caused by the electronic device shaking. The electronic device can calculate the displacement that needs to be compensated, and then move the lens in the camera module according to the calculation result to offset the tiny displacement caused by the shaking, thereby effectively overcoming the image blur caused by camera vibration.
[0041] 5) Color cast: Color cast refers to the situation where the hue and saturation of a certain color in a captured image are significantly different from the real image. The image that a user sees on an electronic device is different from the color of the object being photographed.
[0042] 6) Others
[0043] 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, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. 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.
[0044] 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.
[0045] It should be noted that the "at..." in the embodiment of the present application can be the instant when a certain situation occurs, or a period of time after a certain situation occurs, and the embodiment of the present application does not specifically limit this. In addition, the display interface provided in the embodiment of the present application is only an example, and the display interface can also include more or less content.
[0046] The electronic device may support a camera application, and the user may use the electronic device to take photos or videos of the object being photographed.
[0047] However, in a possible implementation, the color of the image displayed by the electronic device is different from the color of the photographed object. For example, there is a color cast between the image displayed by the electronic device and the photographed object.
[0048] Figure 2 A schematic diagram of a color cast scenario in a possible implementation is shown, Figure 2 As shown:
[0049] In the preview scene, the user uses the electronic device to shoot the object. The electronic device displays Figure 2 The interface shown in a is a preview interface of the camera application. In the preview interface, the electronic device displays the image captured by the camera and does not store the image. Figure 2 In the interface shown in a, there is a color difference between the object being photographed in the image displayed by the electronic device and the object being photographed in the actual scene.
[0050] In the shooting scene, Figure 2 In the interface shown in a of FIG. 1 , when the electronic device receives an operation on the shutter button, the electronic device can capture an image of the photographed object and save the image. Subsequently, the electronic device can view the photographed image based on a gallery application (also called an album application). For example, the gallery application interface can be Figure 2In the interface shown in b in FIG. 1 , there is a color difference between the object photographed in the image and the object photographed in the actual scene.
[0051] There is a color cast between the image displayed and / or captured by the camera application of the electronic device and the object being photographed. It has been found that this is because:
[0052] After the electronic device starts the camera application, the electronic device collects the original image through the camera, and the pixels in the original image are arranged in a quad manner. In the shooting scene, the electronic device may be shaken, for example, the shake caused by the user holding the electronic device unsteadily. The OIS module is set in the electronic device to reduce the problem of image blur caused by shaking.
[0053] However, in a possible implementation, the jitter will cause the OIS lens to shift, the light passing through the lens will shift, and the light received by the photosensitive element in the image sensor will change, resulting in differences in the pixel values of the four pixels in any quad. After the software remosaic processing, the color of the processed image will be different from the actual color of the subject.
[0054] Combine the following Figure 3 The causes of the above color cast are further explained.
[0055] An OIS module is provided in the electronic device, such as Figure 3 As shown in FIG. 1 , the OIS module includes a lens 301 and an image sensor 302. When the electronic device does not vibrate, the state of the OIS module may be as follows: Figure 3 As shown in Figure a, the lens 301 is located in the center. After the light enters the lens, it can be imaged at the center of the image sensor 302 and collected by the image sensor 302. The electronic device collects the pixel values of the pixels based on the photosensitive element of the image sensor. The arrangement of the pixels collected by the image sensor can be quad. For example, the pixel value of each pixel can be as follows Figure 3 As shown in Figure c.
[0056] Figure 3 Figure c in the figure shows the arrangement of 16 pixels, where the four pixels in each 2×2 matrix are of the same type and can be regarded as a pixel area. The 16 pixels can include 4 pixel areas, which can be respectively R area (diagonal line filling area), G area (dot filling area), G area (dot filling area) and B (blank area).
[0057] Figure 3 Figure c in Figure 4 also shows the pixel value of each pixel in the 4 pixel area. Figure 3It can be seen from any histogram in Figure c that when the electronic device does not shake, the pixel values obtained by each pixel are uniform. In the original (RAW image format, RAW) image obtained by the electronic device, the pixel values of the four pixels in each pixel area are the same. Subsequently, the electronic device processes the pixels of the quad array through the remosaic algorithm. In the processed image, the pixel values of the four pixels of R, G, G, and B in any two pixel areas are the same, and there will be no color cast in the two pixel areas.
[0058] For example, Figure 1 For example, Figure 1 In the image a, the pixel values of the four R-type pixels are the same; the pixel values of the four G-type pixels are the same; and the pixel values of the four B-type pixels are the same. After remosaic processing, it is converted into Figure 1 Figure b in Figure 2. Figure 1 Take the upper left 2×2 pixel area and the upper right 2×2 pixel area in the b figure as an example, the pixel value of the R pixel point in the upper left pixel area is the same as the pixel value of the R pixel point in the upper right pixel area, the pixel value of the G pixel point in the upper left pixel area is the same as the pixel value of the G pixel point in the upper right pixel area, and the pixel value of the B pixel point in the upper left pixel area is the same as the pixel value of the B pixel point in the upper right pixel area. Therefore, there will be no color cast in the upper left pixel area and the upper right pixel area.
[0059] When the electronic device shakes, the image displayed by the electronic device will be color-shifted. For example, when the electronic device shakes, the OIS module adjusts the position of the lens according to the shaking angle of the electronic device. Figure 3 In the b figure, due to the shaking of the electronic device, the lens moves to the left to reduce the image blur caused by the shaking. After the lens is offset, the light changes the optical path, resulting in a deviation in the light collected by the image sensor based on the photosensitive element.
[0060] For example, in Figure 3 In the d figure, the light received by the photosensitive element is offset to the upper right, and the pixel values obtained by the four pixels in any pixel area are uneven. Figure 3 It can be seen from any histogram in the d image that the pixel values of the four pixels in any pixel area are different. At this time, the quad image is remosaiced; in the processed image, the pixel values of the pixels in any pixel area are different from the pixel values of the same type of pixels in the adjacent pixel area, resulting in color cast between the pixel area and the adjacent pixel area.
[0061] In a possible implementation, a color brightness calibration module may be provided in the electronic device, and the color brightness calibration module may compensate the pixel values of each pixel point in the pixel area so that the pixel values of any pixel point in the pixel area are substantially the same. However, the calibration value in the color brightness calibration module is generally calibrated when the electronic device does not experience jitter, which means that when the electronic device does not experience jitter, the pixel value obtained based on the compensation of the color brightness calibration module is accurate.
[0062] For example, Figure 3 Figure c in the figure can be a display effect obtained when the electronic device does not shake, the OIS does not move the lens, and the color brightness calibration module compensates the pixel value of each pixel. Figure 3 Figure e in the figure can be the display effect obtained when the electronic device does not shake, the OIS does not move the lens, and the color brightness calibration module does not perform pixel value compensation. It can be seen that when the color brightness calibration module does not perform pixel value compensation, the pixel values of the four pixels in any pixel area are also uneven. After the color brightness calibration module compensates for the pixel values, the pixel values of the four pixels in any pixel area are roughly the same. The calibration value of the color brightness calibration module is related to the pixel value compensation of the electronic device when it is not shaking; when the electronic device shakes, the calibration value of the color brightness calibration module cannot accurately compensate for the pixel value in the shaking scene, resulting in color cast.
[0063] From the above analysis, it can be concluded that the cause of color cast is related to the vibration of the electronic device causing the OIS to adjust the lens. It has been found that the movement distance of the lens in the OIS module is positively correlated with the degree of color cast. The movement distance of the lens can be, for example, Figure 3 The distance the center position shown in Figure a moves in other directions. The greater the distance the lens moves, the more obvious the color cast; conversely, the smaller the distance the lens moves, the less obvious the color cast.
[0064] In view of this, an embodiment of the present application provides an image capture method. When the electronic device shakes in a shooting scene, the electronic device reduces the moving distance of the OIS lens, for example, by reducing the moving distance of the motor; the color cast problem between the image obtained by the electronic device and the actual photographed object is weakened, the color reproduction is improved, and the authenticity and image quality of the photo are improved, thereby improving the user's photo-taking experience.
[0065] In order to better understand the embodiments of the present application, the structure of the electronic device in the embodiments of the present application is introduced below:
[0066] Figure 4The structure diagram of the electronic device 100 is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, a subscriber identification module (SIM) card interface 195, and an embedded secure element (eSE) 196. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0067] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 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.
[0068] The electronic device 100 implements the display function through the GPU, the display screen 194 , and the application processor, etc. The display screen 194 is used to display images, videos, etc. In the embodiment of the present application, the electronic device 100 can display the relevant interface of the camera application based on the display screen 194 .
[0069] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0070] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0071] Camera 193 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 for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In an embodiment of the present application, the camera can be used to capture quad raw images.
[0072] The gyro sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 180B. The gyro sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
[0073] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0074] In the embodiment of the present application, the electronic device 100 may collect IMU data through the gyroscope sensor 180B and / or the acceleration sensor 180E, so that the electronic device 100 can use the IMU data to obtain the offset angle of the lens.
[0075] The ambient light sensor 180L is used to sense the brightness of the ambient light. The electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures. The ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in a pocket to prevent accidental touch. In an embodiment of the present application, the ambient light sensor 180L can be used to obtain and report the brightness value; wherein the brightness value can be used as a basis for determining whether to use the second OIS mode in an embodiment of the present application.
[0076] Motor 191 can generate vibration prompts. Motor 191 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 194, motor 191 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. In an embodiment of the present application, motor 191 can be used to drive the lens to move.
[0077] The software system of the electronic device 100 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 100.
[0078] Figure 5 It is a software structure block diagram of the electronic device 100 according to an embodiment of the present application.
[0079] The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may include: application layer (applications), application framework layer (application framework), hardware abstract layer (hardware abstract layer, HAL), kernel layer (kernel) and audio digital signal processor (audio digital signal processor, ADSP); among them, the kernel layer may be called the driver layer.
[0080] The application layer may include a series of application packages.
[0081] like Figure 5 As shown, the application package may include a camera application.
[0082] 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.
[0083] like Figure 5 As shown, the application framework layer may include a camera access interface.
[0084] The camera access interface allows applications to manage the camera and access the camera device, such as managing the camera to capture images.
[0085] The hardware abstraction layer may include multiple library modules, such as a camera management module and an OIS management module. The Android system can load the corresponding library modules for the device hardware, thereby achieving the purpose of the application framework layer accessing the device hardware. In the embodiment of the present application, the OIS management module can be used to manage OIS-related processes, such as initializing the OIS module, setting the OIS mode, etc. The camera management module can be used to manage photo-related processes, such as controlling the camera to capture raw images, processing raw images, etc.; wherein the camera management module may include a remosaic module (this module is not in Figure 5 ), this module can be used to process the quad image into a remosaic image.
[0086] The kernel layer is the layer between hardware and software. The kernel layer is used to drive the hardware to make it work. The kernel layer can contain a camera driver module. The camera driver module can be used to upload the original image collected by the camera to the camera management module.
[0087] The ADSP layer can be used to manage power supply (charge), sensor (sensor) and audio processing modules. The ADSP layer can exchange information with the kernel layer through pmic_glink. In the embodiment of the present application, the ADSP layer may include an OIS driver module; the OIS driver module may be used to set OIS data, calculate the compensation value of the motor, and send the compensation value of the motor. Among them, the OIS driver module may include an OIS algorithm library (ALGO LIB) module.
[0088] The hardware layer may include an OIS module, a camera, and various types of sensors. The OIS module may be used for optical image stabilization. The camera may be used to capture images, and the sensors may be, for example, an accelerometer, a gyroscope, and an ambient light sensor.
[0089] Combine the following Figure 5 The following describes possible implementations of the image capturing method according to the embodiment of the present application.
[0090] The relevant algorithms of the embodiments of the present application may be set in the OIS driver module. For example, when the camera application is started, the camera application calls the camera access interface, and the camera access interface instructs the camera management module to acquire the image through the camera driver module. After the camera captures the original image, it is uploaded to the camera management module through the camera driver module. The camera management module processes the original image and uploads the processed image to the camera application for display.
[0091] After starting the camera application, the camera application can also notify the OIS management module to turn on the OIS function; the OIS management module sends instructions to the OIS driver module to set the OIS data; for example, in the second scenario, instructions related to the first OIS mode are sent; in the first scenario, instructions related to the second OIS mode are sent; the first OIS mode can be an OIS mode commonly used in possible implementations, and the second OIS mode can be an OIS mode provided in an embodiment of the present application.
[0092] The OIS driver module can obtain IMU data from the acceleration sensor and / or gyroscope sensor; when the electronic device shakes, the OIS driver module can calculate the compensation value of the motor and send the compensation value to the OIS module, which adjusts the lens position in the camera according to the compensation value. The electronic device uploads the new original image to the camera application again based on the camera.
[0093] Combine the following Figure 6 An image capturing method provided in an embodiment of the present application is described. Figure 6 A schematic diagram of a process of an image capturing method in an embodiment of the present application is shown. Figure 6 As shown:
[0094] S601: Upon receiving an operation for starting a camera application, the electronic device starts the camera application.
[0095] A camera application is provided in the electronic device. In some embodiments, when the electronic device is not in a lock screen state, the electronic device may start the camera application after receiving an operation on the icon of the camera application on the desktop. In other embodiments, the electronic device is in a lock screen state, and the electronic device may start the camera application after receiving an operation on the icon of the camera application in the lock screen interface. In some further embodiments, the electronic device may enter the camera application based on other applications, such as social applications, video applications, and payment applications, which may support the photo-taking function. In some further embodiments, the electronic device may also start the camera application based on the user's voice information, and the voice information may be, for example, "open the camera". The embodiments of the present application do not limit the manner in which the electronic device starts the camera application.
[0096] After the electronic device starts the camera application, a series of camera-related devices will be turned on to enable the camera application to perform the photo-taking process. For example, the electronic device turns on the OIS function.
[0097] S602: The electronic device turns on the OIS function.
[0098] The OIS function is used to reduce the impact of shaking on image clarity when the electronic device shakes, making the captured image clear and stable.
[0099] The process of enabling the OIS function of an electronic device may include, for example: controlling the OIS module to power on; creating OIS operating resources; sending an initialization message to instruct the OIS module to initialize; obtaining an instruction to set the OIS mode to the first OIS mode; and setting OIS data according to the first OIS mode of the OIS.
[0100] Among them, the first OIS mode can be understood as a possible implementation in which the electronic device applies the OIS module. In the first OIS mode, the electronic device can use the OIS function of the camera application normally. The OIS data may include the anti-shake angle, the motor stroke, the gyro gain coefficient, etc. After the electronic device receives the instruction to set the OIS mode to the first OIS mode, the range of the OIS data can be set according to the first OIS mode.
[0101] Among them, the OIS anti-shake angle can indicate the maximum shake angle that OIS can prevent in the current mode; the motor stroke can be the farthest distance that the motor can push the lens; after obtaining the shake angle, the electronic device needs to convert the angle value into a corresponding stroke value based on the gyroscope gain coefficient.
[0102] After the OIS function is turned on in an electronic device, the OIS module can adjust the position of the lens according to the degree of jitter of the electronic device to improve the stability of imaging.
[0103] S603: The electronic device determines whether it is the first scene.
[0104] The image output scene of the electronic device may be a first scene and a second scene; the first scene may be: in the first scene, when the lens of the OIS module is adjusted with the shaking of the electronic device, the electronic device may have a color cast. The first scene may be called a quadraw image output scene. The second scene may be: in the second scene, when the lens of the OIS module is adjusted with the shaking of the electronic device, the electronic device may not have a color cast.
[0105] It should be noted that in different scenarios, after obtaining the quad image, the electronic device may process the quad image in different ways. For example, in the first scenario, the electronic device may perform remosaic processing on the quad image and output an image in remosaic format; in the second scenario, the electronic device may perform binning processing on the quad image and output an image in binning format.
[0106] The electronic device can determine whether it is in the first scene through scene detection. When the electronic device is in the first scene, the electronic device may be shaken, resulting in color cast on the image displayed by the electronic device after the quad image is converted into a remosaic image (see Figure 2-Figure 3The description of the color cast of the electronic device in the illustrated embodiment is not repeated here.) To reduce the color cast scene, the electronic device may adopt the image capturing method provided in the embodiment of the present application, for example, step S604.
[0107] When the electronic device is in the second scene, the electronic device will not have color cast. This is because:
[0108] After the electronic device obtains the quad image, it can convert the quad image into a binning image. Figure 1 The arrangement of pixels in the binning image shown in Figure c, and Figure 3 From the pixel values of each pixel in Figure c, we can see that the binning image output method superimposes similar pixels of the same type through induced charges. For example, 4 pixels in a 2×2 pixel area are combined into one large pixel. Figure 1 In Figure c, the area of the photosensitive element occupied by one R-type pixel is Figure 3 In the figure d, the areas of the photosensitive element occupied by the four R-type pixels are the same. Figure 3 When the position is shown in Figure b, although Figure 3 There are differences between the pixel values of each pixel in the c figure, but the sum of the photosensitive areas of the four pixels in each 2×2 pixel area is roughly the same. Figure 3 The circular or elliptical area in the d image in the binning image. When the four pixels in the quad image are synthesized into a large pixel in the binning image, the pixel value of the large pixel in the binning image will not be colored. In the second scenario, the electronic device may not start the subsequent operation steps to reduce the algorithm operation pressure and save computing power.
[0109] S604: When the electronic device detects the first scene, the electronic device turns off the OIS function.
[0110] In a feasible solution, the electronic device may turn off the OIS function after detecting the first scenario. In the first scenario, the electronic device does not use the OIS function. When the electronic device turns off the OIS function, the OIS module in the electronic device may Figure 3 As shown in Figure a, the lens 301 is in the center, so that the light from the camera hole through the lens can be imaged in the center of the image sensor. The electronic device can obtain an image without color cast, and the pixel value of each pixel in the image can be, for example, Figure 3 As shown in Figure c. Figure 3 In the c figure, the pixel values of adjacent pixels of the same type are substantially the same, for example, the pixel values of the four pixels of type R are substantially the same; thereby reducing the problem of color cast in images displayed by electronic devices.
[0111] In some embodiments, the process of turning off the OIS function of the electronic device may be, for example: when the first scene is detected, issuing an instruction for instructing to turn off the OIS module; and controlling the OIS module to power off according to the instruction for instructing to turn off the OIS module. The embodiment of the present application does not limit the method and specific instructions for controlling the turning off of the OIS module.
[0112] S605: When the electronic device does not detect the first scene, the electronic device turns on the OIS function.
[0113] When the electronic device does not detect the first scene, the electronic device is in the second scene, and the electronic device can turn on the OIS function again. The electronic device sets the OIS mode to the first OIS mode so that the OIS module can accurately adjust the position of the lens according to the degree of shaking of the electronic device to improve the stability of imaging.
[0114] The process of enabling the OIS function of the electronic device may refer to the relevant description in step S602, which will not be repeated here.
[0115] In this way, the electronic device can choose whether to use the OIS function according to different scenarios; when the electronic device is in the first scenario, the electronic device turns off the OIS function to reduce the color difference between the image displayed by the electronic device and the actual photographed object after the quad image is processed into a remosaic image, thereby improving the color restoration of the image and obtaining a high-quality image; when the electronic device is in the second scenario, the electronic device turns on the OIS function again to improve the stability of imaging, and there will be no color difference problem, thereby outputting a high-quality image.
[0116] Combine the following Figure 7 The image capturing method provided in the embodiment of the present application is described. Figure 7 FIG. 1 shows a flow chart of an image capturing method in an embodiment of the present application. Figure 7 As shown:
[0117] S701: Upon receiving an operation for starting a camera application, the electronic device starts the camera application.
[0118] For this step, please refer to the relevant description in step S601, which will not be repeated here.
[0119] S702: The electronic device turns on the OIS function; the OIS mode is in the first OIS mode.
[0120] For this step, please refer to the relevant description in step S602, which will not be repeated here.
[0121] It is understandable that the initial scene when the electronic device enters the camera application may be the second scene. For example, when the electronic device just opens the camera application, the electronic device may display the following Figure 8 In the interface, the camera mode of the camera application is in the photo mode, and the zoom ratio button 801 shows that the current zoom ratio of the electronic device is in the specification of 1x. The initial image output mode of the electronic device can be a binning image.
[0122] Based on the analysis and description in step S603, in the second scenario, after the electronic device turns on the OIS function, the lens offset in the OIS module will not cause color cast problems between the image displayed by the electronic device and the actual photographed object; therefore, after the electronic device enters the camera application, the OIS module of the electronic device is in the first OIS mode, and the OIS module performs a normal anti-shake function.
[0123] Specifically, the OIS mode is in the first OIS mode. The OIS data includes the anti-shake angle, the motor stroke, and the gyroscope gain coefficient. In the first OIS mode, the value of the anti-shake angle can be a first value, the motor stroke can be a second value, and the gyroscope gain coefficient can be a third value. Among them, the first value can include the first value to the third value. The electronic device can set the OIS data according to the first OIS mode.
[0124] S703: The electronic device determines whether it is the first scene.
[0125] For this step, please refer to the relevant description in step S603, which will not be repeated here.
[0126] In a possible implementation, the electronic device may perform scene detection in the following manner:
[0127] The electronic device obtains a zoom ratio and a brightness value; when the zoom ratio is greater than or equal to a preset zoom ratio, and the brightness value is greater than or equal to a preset brightness, the electronic device determines that it is in the first scene. The zoom ratio can be used to adjust the shooting range of the electronic device and / or adjust the size of the object being photographed in the image, for example Figure 8 The zoom ratio in the interface shown in a is 1x. The brightness value may be related to the ambient light brightness and / or the shooting brightness. The ambient light brightness may be the current ambient brightness, such as day and night, bright light scene and dark light scene, etc. The shooting brightness may be a shooting parameter related to brightness during shooting, such as exposure value, ISO (International Organization for Standardization), etc. The brightness value is positively correlated with the ambient light brightness, and the brightness value is positively correlated with the shooting brightness.
[0128] Exemplarily, the process of detecting the first scene may correspond to the following UI scene:
[0129] Electronic devices display Figure 8 In the interface shown in a in FIG. 8 , the zoom ratio button 801 can display that the current zoom ratio is 1x. At this time, the electronic device can be in the second scene.
[0130] The electronic device is in an environment with a high brightness value, and the electronic device receives a trigger operation of a 2x specification button in the buttons 802 for the zoom ratio, and in response to the trigger operation, the electronic device displays the following Figure 8 The interface shown in b. Figure 8 In the interface shown in b, the object displayed in the electronic device is enlarged accordingly, and the zoom ratio button 802 can display that the current zoom ratio is 2x.
[0131] In electronic equipment Figure 8 The interface shown in a in the figure switches to Figure 8 During the process of the interface shown in b in the figure, the electronic device can detect that the zoom ratio is switched from 1x to 2x; wherein the preset zoom ratio can be, for example, 2x, and when the zoom ratio of the electronic device is 2x, the zoom ratio satisfies the condition of being greater than or equal to the preset zoom ratio; and the brightness value satisfies the condition of being greater than or equal to the preset brightness. At this time, the electronic device can determine that it is currently in the first scene. The embodiments of the present application do not limit the specific values of the preset zoom ratio and the preset brightness.
[0132] Optionally, the electronic device may also adjust the zoom ratio based on other gesture operations. For example, when the electronic device receives an operation of sliding two fingers and the distance between the two fingers gradually increases or decreases, the electronic device may enlarge or reduce the zoom ratio accordingly. For another example, the electronic device may display a sliding bar for the zoom ratio, and when the electronic device receives a sliding operation for a sliding button in the sliding bar, the electronic device may enlarge or reduce the zoom ratio accordingly. The embodiments of the present application are not limited to this.
[0133] In some embodiments, when the electronic device detects that the zoom ratio is greater than or equal to a preset zoom ratio and the brightness value is greater than or equal to a preset brightness, an instruction for indicating zoom may be issued; when the OIS module receives an instruction for indicating zoom, the OIS mode may be switched to a second OIS mode.
[0134] The instruction for indicating zoom may be, for example, in sensor zoom. After receiving the instruction, the electronic device may set the sensor capability in the sensor mode data to in sensor zoom; the subsequent image output mode of the electronic device may be to process the quad image into a remosaic image. At the same time, the OIS module may also receive the instruction and adjust to the corresponding second OIS mode based on the instruction.
[0135] Optionally, the brightness value may be collected based on an ambient light sensor, or the brightness value may be obtained based on shooting parameters, which is not limited in the embodiments of the present application.
[0136] S704: When the electronic device detects the first scene, the OIS mode is set to a second OIS mode.
[0137] The first scene corresponds to the second OIS mode, and the second scene corresponds to the first OIS mode. When the electronic device recognizes that the second scene is switched to the first scene, the OIS mode can be switched from the first OIS mode to the second OIS mode.
[0138] The second OIS mode may be, for example, a zoom mode. After receiving an instruction for instructing zooming, the OIS module may set the OIS mode to zoom. In different OIS modes, the values of the OIS data are different.
[0139] S705: The electronic device sets OIS data based on the second OIS mode, and the absolute value of the OIS data in the second OIS mode is smaller than the absolute value of the OIS data in the first OIS mode.
[0140] In different OIS modes, the OIS data may satisfy the following conditions: in the first OIS mode, the anti-shake angle is a first value, the motor stroke is a second value, and / or the gyroscope gain coefficient is a third value. In the second OIS mode, the anti-shake angle is a fourth value, the motor stroke is a fifth value, and / or the gyroscope gain coefficient is a sixth value.
[0141] Specifically, the absolute value of the first value is greater than or equal to the absolute value of the second value; for example, the absolute value of the first value is greater than or equal to the absolute value of the fourth value, the absolute value of the second value is greater than or equal to the absolute value of the fifth value, and / or the absolute value of the third value is greater than or equal to the absolute value of the sixth value.
[0142] It should be noted that the electronic device can reduce the moving distance of the lens by limiting the OIS data, so that the light entering the lens from the camera hole can be imaged in the center of the image sensor as much as possible, so as to reduce the color difference between the image and the object being photographed.
[0143] For example, Fig. 9 Taking the rear camera that supports OIS as an example, when the electronic device is not shaking, the OIS lens is placed in the center. When the electronic device is shaking, the OIS module can push the lens to move in all directions to compensate for the image blur caused by the shaking.
[0144] In a possible implementation, the stroke of the motor is positively correlated with the moving distance of the lens. The electronic device can reduce the moving distance of the lens by reducing the stroke of the motor.
[0145] It can be understood that the stroke of the motor is the farthest distance the motor can reach. The motor is used to drive the lens to move, so the smaller the stroke value, the smaller the distance the lens can move. Therefore, the movement of the lens can be reduced by limiting the stroke.
[0146] Specifically, the absolute value of the stroke of the motor in the second OIS mode is smaller than the absolute value of the stroke of the motor in the first OIS mode; the absolute value of the fifth value is smaller than the absolute value of the second value. For example, in the first OIS mode, the second value is ±2048; in the second OIS mode, the fifth value is ±1024. Optionally, the absolute value of the fifth value may be 1 / 2 of the absolute value of the second value, or the absolute value of the fifth value may be any value smaller than the absolute value of the second value. This embodiment of the present application is not limited to this.
[0147] In another possible implementation, the anti-shake angle is positively correlated with the moving distance of the lens. The electronic device can reduce the moving distance of the lens by reducing the anti-shake angle. The moving distance of the lens can be reflected by the moving distance of the motor, and the moving distance of the motor (also called the compensation value, code) is related to the anti-shake angle. For example, the compensation value of the motor can satisfy the following formula:
[0148] code = gyrogain × θ × a
[0149] Among them, gyrogain is the gyroscope gain coefficient, θ is the offset angle when jitter occurs, and a is the coefficient.
[0150] It can be seen that the anti-shake angle is positively correlated with the compensation value. The smaller the anti-shake angle, the smaller the maximum value that θ can reach, and the smaller the moving distance of the lens; the larger the anti-shake angle, the larger the maximum value that θ can reach, and the larger the moving distance of the lens.
[0151] Specifically, the absolute value of the anti-shake angle in the second OIS mode is smaller than the absolute value of the anti-shake angle in the first OIS mode; the absolute value of the fourth value is smaller than the absolute value of the first value. For example, in the first OIS mode, the first value is ±2°; in the second OIS mode, the fourth value is ±1°. Optionally, the absolute value of the fourth value may be 1 / 2 of the absolute value of the first value, or the absolute value of the fourth value may be any value smaller than the absolute value of the first value. This embodiment of the present application is not limited to this.
[0152] In another possible implementation, the gyroscope gain coefficient is positively correlated with the moving distance of the lens. The electronic device can reduce the moving distance of the lens by reducing the gyroscope gain coefficient.
[0153] From the calculation formula of the above code, it can be seen that the gyroscope gain coefficient is positively correlated with the moving distance of the lens. The smaller the gyroscope gain coefficient, the smaller the moving distance of the lens; the larger the gyroscope gain coefficient, the larger the moving distance of the lens.
[0154] Specifically, the absolute value of the gyroscope gain coefficient in the second OIS mode is less than the absolute value of the gyroscope gain coefficient in the first OIS mode; the absolute value of the sixth value is less than the absolute value of the third value. Optionally, the absolute value of the sixth value may be 1 / 2 of the absolute value of the third value, or the absolute value of the sixth value may be any value less than the absolute value of the third value. This embodiment of the application is not limited to this.
[0155] It can be understood that the above embodiments provide three methods for reducing the lens movement distance, and the electronic device can reduce the lens movement distance by limiting any of the above OIS data. For example, the value of each OIS data in the second OIS mode is the fourth value, the second value and the third value; or, the value of each OIS data is the first value, the fifth value and the third value; or, the value of each OIS data is the first value, the second value and the sixth value. The electronic device can also reduce the lens movement distance by limiting any two or three of the above OIS data; for example, the value of each OIS data is the fourth value, the fifth value and the third value; or, the value of each OIS data is the fourth value, the second value and the sixth value; or, the value of each OIS data is the first value, the fifth value and the sixth value; or, the value of each OIS data is the fourth value, the fifth value and the sixth value. The embodiments of the present application are not limited to this.
[0156] S706: The electronic device outputs a compensation value of the motor according to the OIS data of the second OIS mode.
[0157] When the electronic device shakes, the electronic device determines whether to compensate for the position of the lens according to the OIS data of the second OIS mode, and calculates a compensation value.
[0158] The electronic device can obtain the compensation value of the motor based on the calculation formula of the code. The offset angle θ is related to the inertial measurement unit (IMU) data. The IMU data can be the data obtained by the electronic device from the gyroscope sensor and / or the acceleration sensor. For example, the IMU data includes the angular velocity in the x-axis direction, the angular velocity in the y-axis direction, and the angular velocity in the z-axis direction; the IMU data can be, for example: gSensor.x, gSensor.y, and gSensor.z.
[0159] The offset angle θ can satisfy the following formula:
[0160]
[0161] The electronic device may also calculate θ based on arcsin and arccos, and this embodiment of the present application does not limit this.
[0162] Taking the anti-shake angle as the fourth value as an example, when the absolute value of the offset angle is less than or equal to the absolute value of the fourth value, the electronic device can calculate the compensation value based on the offset angle. When the absolute value of the offset angle is greater than the absolute value of the fourth value, the electronic device does not compensate for the position of the lens.
[0163] It can be understood that, since the absolute value of the fourth value is smaller than the absolute value of the first value, the angle at which the lens of the electronic device can be offset in the second OIS mode is reduced, for example, the fourth value is ±1°. When the offset angle of the lens is between -1° and 1°, the color cast of the image displayed by the electronic device and the photographed object is less than the color cast threshold; wherein the color cast threshold may be the minimum color difference value that can be distinguished by the human eye. When the offset angle of the lens is less than -1°, or greater than 1°, the offset angle exceeds the threshold, and the electronic device cannot compensate for the lens, so the lens will not be offset, and there will be no color cast between the image of the electronic device and the photographed object.
[0164] Taking the motor stroke as the fifth value as an example, when the absolute value of the compensation value is less than or equal to the absolute value of the fifth value, the electronic device can output the absolute value of the fifth value to the motor driver. When the absolute value of the compensation value is greater than the absolute value of the fifth value, the electronic device does not compensate for the position of the lens.
[0165] It is understandable that, since the absolute value of the fifth value is less than the absolute value of the second value, the distance that the lens of the electronic device can move in the second OIS mode is reduced, for example, the fifth value is ±1024. When the code is between -1024 and 1024, the color cast of the image displayed by the electronic device and the photographed object is less than the color cast threshold. When the code is less than -1024, or greater than 1024, the code exceeds the stroke value of the motor, and the motor cannot move to the position corresponding to the code value, so the electronic device does not compensate for the lens, the lens will not shift, and there will be no color cast between the image of the electronic device and the photographed object.
[0166] Taking the gyroscope gain coefficient as the sixth value as an example, when the offset angle obtained by the electronic device is smaller than the anti-shake angle, the electronic device can use the offset angle to calculate the code value. However, since the absolute value of the sixth value is smaller than the absolute value of the third value, the code value obtained by the electronic device according to the offset angle in the second OIS mode is smaller than the code value obtained by the electronic device according to the same offset angle in the first OIS mode; thereby reducing the code value output by the electronic device, thereby reducing the offset of the lens, and reducing the color difference between the image of the electronic device and the photographed object.
[0167] S707: The electronic device adjusts the lens position based on the compensation value of the motor and obtains an image.
[0168] After the electronic device adjusts the lens position based on the compensation value of the motor, at the lens movement distance, the color cast between the image obtained by the electronic device and the photographed object is not obvious, thereby obtaining a high-quality image with small color cast.
[0169] Optionally, when the electronic device recognizes the first scene, the OIS mode is set to the second OIS mode. If the electronic device fails to recognize the first scene, the OIS mode may be restored to the first OIS mode. The process may be as shown in the following steps:
[0170] After step S707, the method further includes:
[0171] S708: When the electronic device is not in the first scene, the electronic device sets the OIS mode to the first OIS mode.
[0172] The electronic device may switch from the first scene to the second scene, and when the electronic device exits the first scene, the electronic device restores the OIS mode to the first OIS mode.
[0173] Exemplarily, the electronic device is not in the first scenario and may meet the following conditions:
[0174] For example, when the zoom magnification is less than a preset zoom magnification, or the brightness value is less than a preset brightness, the electronic device determines that it is not in the first scene.
[0175] Exemplarily, the process of detecting switching from the first scene to the second scene may correspond to the following UI scene:
[0176] In a possible implementation, in a first scenario, the electronic device displays the following Fig.10 In the interface shown in a of FIG. 1 , the zoom ratio button 1001 shows that the current zoom ratio is 2x, and the brightness value of the image displayed by the electronic device is relatively high. When the electronic device receives a trigger operation for the 1x specification in the zoom ratio button 1001, the electronic device enters the second scene from the first scene, and the electronic device can display Fig.10 The interface shown in b. Fig.10 In the interface shown in b, the zoom ratio button 1002 shows that the current zoom ratio is 1x, and the brightness value of the image displayed by the electronic device is relatively high.
[0177] In another possible implementation, in the first scenario, the electronic device displays Fig.10 In the interface shown in a of FIG. 1 , the zoom ratio button 1001 shows that the current zoom ratio is 2x, and the brightness value of the image displayed by the electronic device is high. When the electronic device receives a trigger operation for the viewing area, the electronic device may display the following Fig.11 The interface shown in a. Fig.11 In the interface shown in a, the zoom button 1101 shows that the current zoom ratio is 2x, and the exposure button 1102 appears at the click position in the viewing area; when the electronic device receives a sliding operation, the electronic device can display Fig.11 The interface shown in b. Fig.11 In the interface shown in b, the brightness of the viewing area is reduced. When the brightness value is less than the preset brightness, the electronic device switches from the first scene to the second scene. The electronic device can recognize that it is not currently in the first scene.
[0178] In another possible implementation, in the first scenario, the electronic device displays Fig.10 In the interface shown in a in the figure, the zoom ratio button 1001 shows that the current zoom ratio is 2x, and the brightness value of the image displayed by the electronic device is relatively high. When the user holds the electronic device and enters an area with darker ambient light, the image displayed by the electronic device becomes darker accordingly. When the brightness value is less than the preset brightness, the electronic device switches from the first scene to the second scene. The electronic device can recognize that it is not currently in the first scene.
[0179] The above scenarios exemplarily illustrate several ways of exiting the first scene, but the embodiments of the present application do not limit the specific scenarios for switching from the first scene to the second scene.
[0180] S709: The electronic device sets OIS data based on the first OIS mode, and the OIS data in the first OIS mode is greater than the OIS data in the second OIS mode.
[0181] For example, the electronic device switches the anti-shake angle from the fourth value to the first value, switches the motor stroke from the fifth value to the second value, and / or switches the gyroscope gain coefficient from the sixth value to the third value.
[0182] In this way, when the electronic device is not in the first scene, the electronic device can normally use the anti-shake function of the OIS module to obtain high-quality images.
[0183] The above embodiments illustrate the image capturing method in the embodiments of the present application. Fig.12 The internal interaction of the electronic device executing the image capturing method in the embodiment of the present application is described. Fig.12 The internal interaction flow chart of the image processing method in the embodiment of the present application is shown as follows: Fig.12 As shown:
[0184] Exemplarily, the electronic device may include an application layer, a hardware abstraction layer, an ADSP layer, and a hardware layer. The application layer may include a camera application, and the camera mode may also be other applications with a camera function. The hardware abstraction layer may include an OIS management module and a camera management module. The ADSP layer includes an OIS driver module; the hardware layer may include an OIS module, a sensor, and a camera.
[0185] S1201: Upon receiving an operation for starting a camera application, the electronic device starts the camera application.
[0186] For step S1201, reference may be made to the relevant description in step S601, which will not be repeated here.
[0187] S1202: The camera application of the electronic device instructs the OIS management module to enable the OIS function, wherein the OIS mode is in the first OIS mode.
[0188] For step S1202, reference may be made to the relevant descriptions in step S602 and / or S702, which will not be repeated here.
[0189] Specifically, the process of enabling the OIS function of an electronic device may be, for example: the power management module controls the power on of the OIS module; the OIS management module creates OIS operation resources; the OIS management module sends an initialization message to the OIS driver module; the OIS driver module is initialized; the OIS management module sends an instruction for indicating the first OIS mode to the OIS driver module; the OIS driver module sets the OIS data according to the instruction for indicating the first OIS mode. Fig.12 This part of the software interaction process is not shown.
[0190] S1203: The OIS management module of the electronic device determines whether it is in the first scene.
[0191] For step S1203, reference may be made to the relevant descriptions in step S603 and / or S703, which will not be repeated here.
[0192] When the electronic device is in the first scene, the electronic device executes step S1204; when the electronic device is not in the first scene, the electronic device does not execute step S1204, and continues to detect the scene of the electronic device until the electronic device is in the first scene.
[0193] Specifically, the electronic device being in the first scenario may include: the OIS management module receives an instruction for instructing zoom, for example, an in sensor zoom instruction.
[0194] S1204: When the OIS management module detects the first scene, the OIS mode is set to a second OIS mode.
[0195] For step S1204, reference may be made to the relevant description in step S704, which will not be repeated here.
[0196] S1205: The OIS management module of the electronic device sends an instruction for indicating the second OIS mode to the OIS driving module.
[0197] S1206: The OIS driving module of the electronic device sets OIS data according to the instruction for indicating the second OIS mode.
[0198] Steps S1205 and S1206 may refer to the relevant description in step S705, which will not be repeated here. The OIS data may be, for example, the anti-shake angle as a fourth value, the motor stroke as a fifth value and / or the gyroscope gain coefficient as a sixth value.
[0199] After the OIS mode is set to the second OIS mode, the electronic device can use the OIS data of the second OIS mode for anti-shake in the first scenario. For example: Steps S1207-S1211:
[0200] S1207: The sensor collects IMU data and uploads the IMU data to the OIS driver module.
[0201] The sensors may be, for example, acceleration sensors and gyroscope sensors.
[0202] S1208. The OIS driving module calculates the offset angle according to the IMU data.
[0203] S1209 : When the offset angle is less than or equal to the anti-shake angle of the second OIS mode, the OIS driving module calculates a compensation value of the motor according to the offset angle.
[0204] S1210: When the compensation value of the motor is less than or equal to the stroke of the motor in the second OIS mode, the OIS driving module sends the compensation value of the motor to the OIS module.
[0205] For steps S1207-S1211, reference may be made to the relevant description in step S706 and will not be repeated here.
[0206] S1211. The OIS module controls the motor to move the lens according to the compensation value of the motor.
[0207] After the OIS module obtains the compensation value of the motor, it controls the motor to push the lens to the position corresponding to the compensation value based on the compensation value to achieve the anti-shake function.
[0208] After the lens in the OIS module is offset, the electronic device may use the lens to obtain an image without color cast or with a color cast less than a color cast threshold, such as steps S1212-S1214.
[0209] S1212: The camera of the electronic device collects a quad image and uploads the quad image to a camera management module.
[0210] S1213: The image processing module of the electronic device processes the quad image to obtain a remosaic image.
[0211] The image processing module may include a remosaic algorithm module, and the image processing module processes the quad image based on the remosaic algorithm module to obtain a remosaic image.
[0212] Among them, since the electronic device executes the above steps S1201-S1211; the pixel values of multiple pixels of the same type in any pixel area in the quad image obtained by the electronic device are substantially the same. For example, the quad image can be presented as follows Figure 3 For the same type of pixels with relatively uniform pixel values, when the electronic device performs remosaic processing on its n×n (for example, 2×2) pixel area, the color cast of the processed image is less than the color cast threshold.
[0213] S1214: The image processing module of the electronic device uploads the remosaic image to the camera application.
[0214] Among them, the camera application can obtain a remosaic image.
[0215] In a possible implementation, the camera application is in a preview scene, and the electronic device can display a remosaic image; wherein the color cast between the object in the preview interface and the actual photographed object is less than a color cast threshold.
[0216] In another possible implementation, the camera application receives an operation for taking a photo, and obtains a remosaic image. The icon of the remosaic image may be displayed in a thumbnail of the camera application interface, wherein the icon of the remosaic image may be the same as the remosaic image reduced in proportion.
[0217] In some embodiments, after capturing the remosaic image, the electronic device may also transfer the remosaic image to a gallery application, and the gallery application saves the remosaic image.
[0218] In this way, in the preview scene of the camera application, the electronic device can display images with color cast less than the color cast threshold; when using the camera application to take photos, images with color cast less than the color cast threshold can also be saved, reducing the color cast between the image of the electronic device and the actual photographed object, improving image quality, and enhancing the user's photo-taking experience.
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0220] Based on the above embodiments, the present application provides an image capturing method. For example, Fig.13 A flowchart of an image capturing method provided in an embodiment of the present application.
[0221] like Fig.13 As shown, the image capturing method may include the following steps:
[0222] S1301: When the zoom ratio of the electronic device is a first zoom ratio and the anti-shake parameter of the electronic device is a first parameter, control the camera of the electronic device to move within a first range.
[0223] The scene shown in step S1301 may correspond to the second scene, for example Figure 8 In the second scenario, the first zoom ratio may correspond to a zoom ratio of 1x, for example, the zoom button 801 indicates that the current zoom ratio is 1x; 1x is less than the preset zoom ratio, and the electronic device may perform, for example, step S702.
[0224] The anti-shake parameters may be an offset angle and a motor compensation value. The camera movement range may be understood as the range within which the electronic device drives the lens to move based on the motor compensation value.
[0225] S1302: When the zoom ratio of the electronic device is the second zoom ratio and the anti-shake parameter of the electronic device is the first parameter, control the camera of the electronic device to move within a second range; the first range is larger than the second range; and the first zoom ratio is smaller than the second zoom ratio.
[0226] The scene shown in step S1302 may correspond to the first scene, for example Figure 8 In the first scenario, the second zoom ratio may correspond to a zoom ratio of 2x, for example, the zoom button 802 indicates that the current zoom ratio is 2x; 2x is greater than or equal to the preset zoom ratio, and the electronic device may perform steps S703-S707, for example.
[0227] By comparing steps S1301 and S1302 , it can be seen that in the first scene, the range in which the camera can move is smaller than the range in which the camera can move in the second scene.
[0228] For example, in Fig.14 middle, Fig.14 Figure a in the figure corresponds to the second scene; Fig.14 Figure b in corresponds to the first scene. Fig.14 In figure a, the dotted circular area can be the maximum range in which the camera can move based on the threshold limit of each anti-shake parameter of the second scene; the distance from the lens shown by the dotted line to the lens shown by the solid line can be the first range of lens movement when the anti-shake parameter is the first parameter.
[0229] Fig.14 In the diagram b, the dotted circular area may be the maximum range of movement of the camera based on the threshold limits of the anti-shake parameters of the first scene; because the threshold of the anti-shake parameter in the second scene is smaller than the threshold of the anti-shake parameter in the first scene, the dotted circular area in the first scene is smaller than the dotted circular area in the second scene. The distance from the lens shown by the dotted line to the lens shown by the solid line may be the second range of movement of the lens when the anti-shake parameter is the first parameter.
[0230] In an embodiment of the present application, the electronic device can reduce the movement range of the lens by limiting the threshold of the anti-shake parameter and / or the gyroscope gain coefficient. Take the case where the gyroscope gain coefficient in the first scene is the first gyroscope gain coefficient, and the gyroscope gain coefficient in the second scene is the second gyroscope gain coefficient as an example. When the electronic device shakes, the electronic device can obtain an offset angle. In the first scene, the electronic device obtains a code based on the offset angle and the first gyroscope gain coefficient; in the second scene, the electronic device obtains a code value based on the offset angle and the second gyroscope gain coefficient; the first gyroscope gain coefficient is less than the second gyroscope gain coefficient, and when the offset angle is the same, the code value of the first scene is less than the code value of the second scene. The smaller the code value, the smaller the distance the motor drives the lens to move, so when the anti-shake parameters are the same, the following occurs. Fig.14 The second scene shown has a first range that is larger than a second range of the first scene.
[0231] In this way, in the first scenario, the embodiment of the present application limits the movement range of the lens, thereby reducing the color cast between the image displayed by the electronic device and the photographed object, improving the color restoration of the image, improving the image quality, and thereby improving the user's photography experience.
[0232] Optionally, before controlling the camera of the electronic device to move within the second range, it also includes: setting the threshold of the anti-shake parameter to a first threshold; wherein the absolute value of the first threshold is less than or equal to the absolute value of the second threshold; the second threshold is the threshold of the anti-shake parameter of the electronic device in the first zoom ratio; the first zoom ratio is less than a preset zoom ratio, and the second zoom ratio is greater than or equal to the preset zoom ratio.
[0233] The anti-shake parameter may correspond to the offset angle and the compensation value of the motor in the above embodiment; the threshold of the anti-shake parameter may correspond to the anti-shake angle and the stroke of the motor in the above embodiment. The first threshold may be understood as: the anti-shake angle is the fourth value and / or the stroke of the motor is the fifth value. The second threshold may be understood as: the anti-shake angle is the first value and / or the stroke of the motor is the second value.
[0234] The principle of limiting the lens movement range by limiting the threshold of the anti-shake parameter can be referred to the relevant description in steps S704-S707, which will not be repeated here.
[0235] In this way, in the first scenario, the electronic device can limit the lens movement range by limiting the threshold of the anti-shake parameter; reducing the lens movement, reducing the color cast between the image displayed by the electronic device and the actual photographed object, improving the image color restoration, improving the image quality, and thereby improving the user's photo-taking experience.
[0236] Optionally, the anti-shake parameters include one or more of the following: an offset angle and a compensation value of a motor; wherein the offset angle is the tilt angle of the electronic device when it shakes, and the compensation value of the motor is the range of movement of the motor; the motor is used to drive the position of the camera to move; the threshold of the anti-shake parameters includes one or more of the following: an anti-shake angle and a stroke of the motor; wherein the anti-shake angle is the maximum offset angle that the electronic device can compensate for the movement of the camera, and the stroke of the motor is the maximum compensation value that the motor can reach; the anti-shake angle is positively correlated with the movement range of the camera, and the stroke of the motor is positively correlated with the movement range of the camera.
[0237] In this way, the threshold of the anti-shake parameter may include the anti-shake angle and the motor stroke. The electronic device can limit the movement range of the lens by means of the anti-shake angle and / or the motor stroke, reduce the lens movement, reduce the color cast between the image displayed by the electronic device and the actual photographed object, improve the image color restoration, improve the image quality, and thereby enhance the user's photo-taking experience.
[0238] Optionally, before controlling the camera of the electronic device to move within the second range, it also includes: setting the gyroscope gain coefficient to a first gyroscope gain coefficient; controlling the camera of the electronic device to move within the second range, including: obtaining a compensation value of the motor based on the first gyroscope gain coefficient, and controlling the camera of the electronic device to move within the second range by the compensation value of the motor; wherein the gyroscope gain coefficient is positively correlated with the compensation value of the motor; the first gyroscope gain coefficient is less than or equal to the second gyroscope gain coefficient; and the second gyroscope gain coefficient is the gyroscope gain coefficient of the electronic device in the first zoom ratio.
[0239] Among them, the first gyroscope gain coefficient can be understood as the gyroscope gain coefficient being the sixth value; the second gyroscope gain coefficient can be understood as the gyroscope gain coefficient being the first value; the principle of limiting the lens movement range by limiting the gyroscope gain coefficient can be referred to the relevant description in steps S704-S707, which will not be repeated here.
[0240] In this way, in the first scenario, the electronic device can limit the lens movement range by limiting the gyroscope gain coefficient; reducing lens movement, reducing the color cast between the image displayed by the electronic device and the actual photographed object, improving the image color restoration, improving image quality, and thereby improving the user's photo-taking experience.
[0241] Optionally, when the zoom ratio of the electronic device is the second zoom ratio and the anti-shake parameter of the electronic device is the second parameter, the camera of the electronic device is controlled to move within a third range; the second parameter is smaller than the first parameter; and the third range is smaller than the second range.
[0242] It is understandable that in the first scenario, when the electronic device receives different offset angles, the electronic device can adjust the position of the camera accordingly according to the offset angle. The anti-shake parameter is positively correlated with the moving range of the lens, for example. The smaller the anti-shake parameter, the smaller the moving range.
[0243] In this way, the electronic device can more accurately adjust the movement range of the camera according to the offset angle, and control the movement range of the camera not to exceed the maximum movement range of the first scene; thereby limiting the movement range of the camera, reducing lens movement, reducing the color cast between the image displayed by the electronic device and the actual photographed object, improving the image color restoration, improving image quality, and thereby improving the user's photo-taking experience.
[0244] Optionally, it also includes: turning on the OIS function; the OIS mode is the first OIS mode, in the first OIS mode, the threshold of the anti-shake parameter is the second threshold, and the gyroscope gain coefficient is the second gyroscope gain coefficient; judging whether it is the first scene; the first scene includes processing the quad image into a remosaic image output scene; when the electronic device is in the first scene, setting the OIS mode to the second OIS mode; setting the threshold of the anti-shake parameter and / or the gyroscope gain coefficient according to the second OIS mode; wherein, in the second OIS mode, the threshold of the anti-shake parameter is the first threshold, and / or the gyroscope gain coefficient is the first gyroscope gain coefficient.
[0245] The process may refer to the relevant descriptions in steps S702-S707, which will not be repeated here.
[0246] In this way, the electronic device can use the second OIS mode provided in the embodiment of the present application through the judgment process of the first scene, when it may cause color cast on the display of the electronic device, thereby reducing lens movement, reducing the color cast between the image displayed by the electronic device and the actual photographed object, improving the image color restoration, improving image quality, and thereby improving the user's photo-taking experience.
[0247] Optionally, when the electronic device is in the first scene, the OIS mode is set to the second OIS mode, including: when it is identified that the zoom ratio is greater than or equal to a preset zoom ratio, and when it is identified that the brightness value is greater than or equal to a preset brightness, obtaining an instruction for indicating internal zoom of the sensor; and setting the OIS mode to the second OIS mode based on the instruction for indicating internal zoom of the sensor.
[0248] In this way, the electronic device can more accurately identify the quadraw output scene according to the instruction for instructing the internal zoom of the sensor.
[0249] Optionally, the instruction for instructing internal zoom of the sensor includes in sensor zoom; and the second OIS mode includes a zoom mode.
[0250] In this way, the electronic device can more accurately identify the quad raw output scene based on the in sensor zoom.
[0251] Optionally, it also includes: when the zoom magnification of the electronic device is a second zoom magnification, the brightness value of the electronic device is a first brightness, and the anti-shake parameter of the electronic device is a first parameter; controlling the camera of the electronic device to move within a second range; when the zoom magnification of the electronic device is a second zoom magnification, the brightness value of the electronic device is a second brightness, and the anti-shake parameter of the electronic device is a first parameter, controlling the camera of the electronic device to move within a first range; the second brightness is less than the first brightness, the second brightness is less than the preset brightness, and the first brightness is greater than or equal to the preset brightness.
[0252] In this way, the electronic device can display an image with a smaller color difference from the actual photographed object when the zoom ratio conditions and the brightness value conditions are met; the image color restoration degree is improved to obtain a high-quality image; when the zoom ratio conditions and / or the brightness value conditions are not met, the electronic device can turn on the OIS function again to improve the stability of the imaging, and there will be no color difference problem, and high-quality images can be output.
[0253] The image capturing method of the embodiment of the present application has been described above, and the device for executing the above image capturing method provided by the embodiment of the present application is described below. Those skilled in the art can understand that the method and the device can be combined and referenced with each other, and the relevant device provided by the embodiment of the present application can execute the steps in the above image capturing method.
[0254] like Fig.15 As shown, the image capture device 1500 can be used in a communication device, a circuit, a hardware component or a chip, and the image capture device includes: a display unit 1501 and a processing unit 1502. The display unit 1501 is used to support the display step performed by the image capture device 1500; the processing unit 1502 is used to support the image capture device 1500 to perform the information processing step.
[0255] In a possible implementation, the image capture device 1500 may also include a communication unit 1503. Specifically, the communication unit is used to support the image capture device 1500 to perform the steps of sending and receiving data. The communication unit 1503 may be an input or output interface, a pin or a circuit.
[0256] In a possible embodiment, the image capture device may further include: a storage unit 1504. The processing unit 1502 and the storage unit 1504 are connected via a line. The storage unit 1504 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 1504 may exist independently and be connected to the processing unit 1502 of the image capture device via a communication line. The storage unit 1504 may also be integrated with the processing unit 1502.
[0257] The storage unit 1504 can store computer-executable instructions of the method in the terminal device so that the processing unit 1502 executes the method in the above embodiment. The storage unit 1504 can be a register, a cache, or a RAM, etc. The storage unit 1504 can be integrated with the processing unit 1502. The storage unit 1504 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 1504 can be independent of the processing unit 1502.
[0258] The image capturing method provided in the embodiment of the present application can be applied to electronic devices with communication functions. The electronic devices include terminal devices, and the specific device form of the terminal devices can refer to the above related descriptions, which will not be repeated here.
[0259] An embodiment of the present application provides a terminal device, which includes: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the terminal device executes the above method.
[0260] The embodiment of the present application provides a chip system, which includes at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected through a line, and the at least one processor is used to run a computer program or instruction to execute the above method. Its implementation principle and technical effect are similar to those of the above-mentioned related embodiments, and will not be repeated here.
[0261] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. The above method is implemented when the computer program 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.
[0262] In one possible implementation, a computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM) or other optical disk storage, disk storage or other magnetic storage devices, or any other medium that is intended to carry or store the required program code in the form of instructions or data structures and can be accessed by a computer. Moreover, any connection is appropriately referred to as a computer-readable medium. For example, if a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL) or wireless technology (such as infrared, radio and microwave) is used to transmit software from a website, server or other remote source, the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technology such as infrared, radio and microwave are included in the definition of medium. Disks and optical disks as used herein include optical disks, laser disks, optical disks, digital versatile disks (DVD), floppy disks and Blu-ray disks, where disks usually reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included in the scope of computer-readable media.
[0263] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed, the computer executes the above method.
[0264] 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 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.
[0265] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solutions of the present invention should be included in the scope of protection of the present invention.
Claims
1. An image capturing method, characterized in that: Applied to an electronic device, the electronic device supports an optical image stabilization (OIS) function, and the method includes: When the zoom ratio of the electronic device is a first zoom ratio and the anti-shake parameter of the electronic device is a first parameter; controlling the camera of the electronic device to move within a first range; When the zoom ratio of the electronic device is the second zoom ratio and the anti-shake parameter of the electronic device is the first parameter, controlling the camera of the electronic device to move within a second range; the first range is larger than the second range; and the first zoom ratio is smaller than the second zoom ratio; Before controlling the camera of the electronic device to move within the second range, the method further includes: Setting the threshold of the anti-shake parameter to a first threshold; Among them, the absolute value of the first threshold is less than or equal to the absolute value of the second threshold; the second threshold is the threshold of the anti-shake parameter of the electronic device in the first zoom ratio; the first zoom ratio is less than a preset zoom ratio, and the second zoom ratio is greater than or equal to the preset zoom ratio.
2. The method according to claim 1, characterized in that The anti-shake parameter includes one or more of the following: an offset angle and a compensation value of a motor; wherein the offset angle is a tilt angle of the electronic device when shaking occurs, and the compensation value of the motor is a range of movement of the motor; the motor is used to drive the position of the camera to move; The threshold value of the anti-shake parameter includes one or more of the following: an anti-shake angle and a motor stroke; wherein the anti-shake angle is the maximum offset angle at which the electronic device can compensate for the movement of the camera, and the motor stroke is the maximum compensation value that the motor can achieve; the anti-shake angle is positively correlated with the movement range of the camera, and the motor stroke is positively correlated with the movement range of the camera.
3. The method according to claim 2, characterized in that Before controlling the camera of the electronic device to move within the second range, the method further includes: Setting the gyroscope gain factor to a first gyroscope gain factor; Controlling a camera of the electronic device to move within a second range includes: obtaining a compensation value of a motor based on the first gyroscope gain coefficient, and controlling the camera of the electronic device to move within a second range by using the compensation value of the motor; Among them, the gyroscope gain coefficient is positively correlated with the compensation value of the motor; the first gyroscope gain coefficient is less than or equal to the second gyroscope gain coefficient; the second gyroscope gain coefficient is the gyroscope gain coefficient of the electronic device in the first zoom ratio.
4. The method according to claim 1, characterized in that When the zoom ratio of the electronic device is the second zoom ratio and the anti-shake parameter of the electronic device is the second parameter, the camera of the electronic device is controlled to move within a third range; the second parameter is smaller than the first parameter; and the third range is smaller than the second range.
5. The method according to claim 3, characterized in that: Also includes: Turning on the OIS function; the OIS mode is a first OIS mode, in which the threshold of the anti-shake parameter is a second threshold, and the gyroscope gain coefficient is the second gyroscope gain coefficient; Determine whether it is a first scene; the first scene includes a scene of processing a quad image into a remosaic image; When the electronic device is in the first scene, setting the OIS mode to a second OIS mode; The threshold of the anti-shake parameter and / or the gyroscope gain coefficient is set according to the second OIS mode; wherein, in the second OIS mode, the threshold of the anti-shake parameter is the first threshold, and / or the gyroscope gain coefficient is the first gyroscope gain coefficient.
6. The method according to claim 5, characterized in that When the electronic device is in the first scene, setting the OIS mode to the second OIS mode includes: When it is recognized that the zoom ratio is greater than or equal to a preset zoom ratio and the brightness value is greater than or equal to a preset brightness, an instruction for instructing internal zooming of the sensor is obtained; The OIS mode is set to the second OIS mode based on the instruction for instructing the intra-sensor zoom.
7. The method according to claim 6, characterized in that The instruction for instructing internal zoom of the sensor includes in sensor zoom; and the second OIS mode includes a zoom mode.
8. The method according to claim 1, characterized in that: Also includes: When the zoom magnification of the electronic device is the second zoom magnification, the brightness value of the electronic device is the first brightness, and the anti-shake parameter of the electronic device is the first parameter; controlling the camera of the electronic device to move within the second range; When the zoom magnification of the electronic device is the second zoom magnification, the brightness value of the electronic device is the second brightness, and the anti-shake parameter of the electronic device is the first parameter, controlling the camera of the electronic device to move within the first range; The second brightness is lower than the first brightness, the second brightness is lower than a preset brightness, and the first brightness is greater than or equal to the preset brightness.
9. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the electronic device performs the method according to any one of claims 1 to 8.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. A chip system, characterized in that: The method comprises at least one processor and a communication interface, wherein the communication interface and the at least one processor are interconnected via a line, and the at least one processor is used to run a computer program or instruction to execute the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises a computer program, which, when being executed, enables a computer to execute the method according to any one of claims 1 to 8.
