Image shooting method and related equipment
By controlling the lens movement range and the threshold of anti-shake parameters of the electronic device camera, the problem of color cast between the image and the subject being photographed when the electronic device takes an image is solved, and a higher image color restoration and quality are achieved.
Patent Information
- Application Number
- CN202411712148.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-12
- Publication Date
- 2025-06-13
AI Technical Summary
When an electronic device takes an image, the displayed image color is cast with the color of the photographed object, which affects the color restoration and quality of the image.
By controlling the moving range of the lens and the threshold of the anti-shake parameters in the camera of the electronic device, the moving distance of the lens is reduced, thereby reducing the color cast between the image and the object to be photographed.
It improves the color reproduction and quality of the image and improves the user's photography experience.
Smart Images

Figure CN120151650A_ABST
Abstract
Description
[0001] This application is a divisional application. The application number of the original application is 202311704711.2, and the filing date of the original application is December 12, 2023. The entire content of the original application is incorporated herein by reference. Technical Field
[0002] This application relates to the field of terminal technologies, and in particular, to an image capturing method and related devices. Background Art
[0003] An electronic device can support a camera application, and a user can use the electronic device to take pictures, record videos, and perform other activities on an object to be captured.
[0004] However, in a possible implementation, the color of the image displayed by the electronic device is different from the color of the object to be captured. For example, when displaying the preview interface of the camera application, there is a color cast between the image displayed by the electronic device and the object to be captured; for another example, when receiving an operation for taking a picture, the electronic device can obtain a captured image, and there is also a color cast between the captured image and the object to be captured. Summary of the Invention
[0005] Embodiments of this application provide an image capturing method and related devices, which relate to the field of terminal technologies, and provide a method for reducing the color cast between the image displayed by an electronic device and the actual object to be captured, improving the color restoration degree of the image, and improving the quality of the image.
[0006] In a first aspect, embodiments of this application propose an image capturing method applied to an electronic device that supports an optical image stabilization (OIS) function. 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 the 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 a first scenario, embodiments of this application limit the movement range of the lens, thereby reducing the color cast between the image displayed by the electronic device and the object to be captured, improving the color restoration degree of the image, improving the image quality, and further improving the user's photo-taking experience.
[0007] In a possible implementation, before controlling the camera of the electronic device to move within a second range, it further 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 at a 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. In this way, in the first scenario, the electronic device can limit the lens movement range by restricting the threshold of the anti-shake parameter; reduce the lens movement, reduce the color cast between the image displayed on the electronic device and the actual object being photographed, improve the color restoration of the image, improve the image quality, and thus enhance the user's photo-taking experience.
[0008] In a possible implementation, the anti-shake parameter includes one or more of the following: the offset angle and the compensation value of the motor; wherein, the offset angle is the tilt angle when the electronic device shakes, and the compensation value of the motor is the range of movement of the motor; the motor is used to drive the movement of the position of the camera; the threshold of the anti-shake parameter includes one or more of the following: the anti-shake angle and the 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. In this way, the threshold of the anti-shake parameter can include the anti-shake angle and the stroke of the motor, and the electronic device can limit the movement range of the lens by means of the anti-shake angle and / or the stroke of the motor, reduce the lens movement, reduce the color cast between the image displayed on the electronic device and the actual object being photographed, improve the color restoration of the image, improve the image quality, and thus enhance the user's photo-taking experience.
[0009] In a possible implementation, before controlling the camera of the electronic device to move within a second range, it further includes: setting the gyroscope gain coefficient to a first gyroscope gain coefficient; controlling the camera of the electronic device to move within a second range includes: obtaining the 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 through 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 at a first zoom ratio. In this way, in the first scenario, the electronic device can limit the lens movement range by restricting the gyroscope gain coefficient; reduce the lens movement, reduce the color cast between the image displayed on the electronic device and the actual object being photographed, improve the color restoration of the image, improve the image quality, and thus enhance the user's photo-taking experience.
[0010] 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 less than the first parameter; the third range is less than the second range. In this way, the electronic device can more accurately adjust the moving range of the camera according to the offset angle, and control the moving range of the camera not to exceed the maximum moving range of the first scene; thereby limiting the moving range of the camera, reducing the lens movement, reducing the color cast between the image displayed on the electronic device and the actual object being photographed, improving the color restoration degree of the image, improving the image quality, and further improving the user's photographing experience.
[0011] In a possible implementation, it further includes: enabling 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; determining whether it is the first scene; the first scene includes the scene of outputting an image by processing quad images into remosaic images; 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, through the determination process of the first scene, when the electronic device may cause color cast in the display, the second OIS mode provided by the embodiments of the present application is used, thereby reducing the lens movement, reducing the color cast between the image displayed on the electronic device and the actual object being photographed, improving the color restoration degree of the image, improving the image quality, and further improving the user's photographing experience.
[0012] In a possible implementation, 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, obtaining an instruction for indicating internal zoom of the sensor; setting the OIS mode to the second OIS mode based on the instruction for indicating internal zoom of the sensor. In this way, the electronic device can more accurately recognize the quad raw output scene according to the instruction for indicating internal zoom of the sensor.
[0013] In a possible implementation, the instruction for indicating internal zoom of the sensor includes in sensorzoom; the second OIS mode includes the zoom mode. In this way, the electronic device can more accurately recognize the quad raw output scene according to in sensor zoom.
[0014] In a possible implementation, it further 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 within 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 within 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 object being photographed when meeting the zoom ratio condition and the brightness value condition; improve the color restoration degree of the image and obtain a high-quality image; when the electronic device does not meet the zoom ratio condition and / or does not meet the brightness value condition, the electronic device turns on the OIS function again to improve the imaging stability, and there will be no color difference problem at the same time, and a high-quality image is output.
[0015] 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 wireless transceiver function, a virtual reality (VR) electronic device, an augmented reality (AR) electronic device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, and so on.
[0016] The electronic device 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 electronic device executes the method as in the first aspect.
[0017] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method as in the first aspect is implemented.
[0018] Fourthly, an embodiment of the present application provides a computer program product, which includes a computer program. When the computer program runs, it causes a computer to execute the method according to the first aspect.
[0019] Fifthly, an embodiment of the present application provides a chip system, which includes at least one processor and a communication interface. The communication interface and the at least one processor are interconnected by a line, and the at least one processor is configured to run a computer program or instruction to execute the method according to the first aspect.
[0020] 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 obtained by each aspect and the corresponding feasible implementation manners are similar, and will not be elaborated herein. Description of the Drawings
[0021] Figure 1 It is the arrangement mode of multiple pixel points involved in the embodiment of the present application;
[0022] Figure 2 It is the scenario where color cast occurs in the preview scenario and the shooting scenario of the electronic device in a possible implementation;
[0023] Figure 3 It is a schematic diagram of pixel value comparison in two scenarios where the OIS lens does not move and the lens moves provided by the embodiment of the present application;
[0024] Figure 4 It is a schematic structural diagram of an electronic device 100 provided by the embodiment of the present application;
[0025] Figure 5 It is a schematic software structure diagram of an electronic device 100 provided by the embodiment of the present application;
[0026] Figure 6 It is a schematic flowchart of an image shooting method provided by the embodiment of the present application;
[0027] Figure 7 It is a schematic flowchart of another image shooting method provided by the embodiment of the present application;
[0028] Figure 8 It is a schematic diagram of a scenario for entering the first scenario provided by the embodiment of the present application;
[0029] Figure 9 It is a schematic diagram of the lens movement direction provided by the embodiment of the present application;
[0030] Figure 10 It is a schematic diagram of a scenario for exiting the first scenario provided by the embodiment of the present application;
[0031] Figure 11Another scenario diagram for exiting the first scenario provided by the embodiments of the present application;
[0032] Figure 12 An internal interaction flowchart of an image capturing method provided by the embodiments of the present application;
[0033] Figure 13 A flowchart of an image capturing method provided by the embodiments of the present application;
[0034] Figure 14 A comparison diagram of the first range and the second range provided by the embodiments of the present application;
[0035] Figure 15 A structural diagram of an image capturing device provided by the embodiments of the present application. Detailed implementation manners
[0036] To facilitate a clear description of the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:
[0037] 1) Quad output: It is a way that a sensor arranges four same-color pixels in sequence, and the four same-color pixels sample simultaneously to obtain a photo with four times the photosensitivity. For example, Figure 1 Figure a in shows a way of quad output. In the RAW image collected by the electronic device based on the camera, the pixel points can be arranged according to the quad array. Quad can be understood as: the pixel values in multiple pixel point matrices are the same, and can be regarded as a large pixel area. For example, Figure 1 in Figure a in , four pixel points of type R are arranged in a 2×2 form; four pixel points of type G are arranged in a 2×2 form; four pixel points of type B are arranged in a 2×2 form. The 4 pixel areas can satisfy the arrangement rules of the Bayer array of R, G, G, B, Figure 1 the arrangement way of the pixel points in Figure a in can be called quad-bayer (also called 4cell); it should be noted that the pixel points of type R can be displayed as red; the pixel points of type G can be displayed as green; the pixel points of type B can be displayed as green; Figure 1 in Figure a in , there are two groups of pixel points of type G. In some embodiments, the green colors displayed by the two groups of pixel points of type G can be the same or different.
[0038] 2) Pixel reconstruction (remosaic) algorithm: The remosaic algorithm can process the pixel points arranged in quad form into pixel points arranged in a Bayer array through pixel swapping. It can be used to magnify a reduced image and reconstruct its original resolution while maintaining the details and clarity of the image. For example, Figure 1Figure b in [ ] shows a remosaic array, and the electronic device can process the image of the quad array as shown in [ ] Figure 1 a in [ ] into an image of the remosaic array as shown in [ ] Figure 1 b in [ ]. Among them, the pixel value of any pixel point is different from the pixel values of the pixel points adjacent in the up, down, left, and right directions.
[0039] In a possible implementation, the electronic device can perform remosaic processing on the image in a software manner or in a hardware manner. For the hardware processing method, the chip in the electronic device can transform the pixel point structure through an independent image signal process (ISP), and the sensor can display and output pixel point data. In the hardware processing method, the electronic device can capture an image of the bayer array without software processing. For the software processing method, the electronic device performs a remosaic algorithm on the image through a software algorithm between the sensor and the ISP.
[0040] 3) binning: It is an image readout mode that adds the charges sensed by adjacent pixels together and reads them out in the mode of one pixel, and can convert the quad image into a binning output image. For example, the arrangement of pixel points in the binning image can be as shown in [ ] Figure 1 c in [ ].
[0041] 4) Optical image stabilization (OIS): Based on the detection of the gyroscope sensor and displacement compensation. By detecting the minute movement generated by the jitter of the electronic device through the gyroscope inside the lens, the electronic device can calculate the displacement amount that needs to be compensated, and then move the lens in the camera module according to the calculation result to offset the minute displacement generated by the jitter, thereby effectively overcoming the image blur caused by the vibration of the camera.
[0042] 5) Color cast: Color cast means that in the captured image, there are obvious differences in the hue and saturation of a certain color compared with the real image. There is a difference between the image seen by the user on the electronic device and the color of the object being photographed observed.
[0043] 6) Others
[0044] For the convenience of clearly describing 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 represent examples, illustrations, or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" is intended to present relevant concepts in a specific way.
[0045] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the front and back associated objects. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0046] It should be noted that "when... " in the embodiments of the present application can be at the instant when a certain situation occurs or within a period of time after a certain situation occurs. The embodiments of the present application do not make specific limitations on this. In addition, the display interface provided in the embodiments of the present application is only an example, and the display interface can also include more or less content.
[0047] The electronic device can support a camera application, and the user can use the electronic device to take pictures, record videos, and other activities of the object to be photographed.
[0048] However, in a possible implementation, the color of the image displayed by the electronic device is different from the color of the object to be photographed. For example, there is a color cast between the image displayed by the electronic device and the object to be photographed.
[0049] Figure 2 The schematic diagram of the color cast scenario in a possible implementation is shown, as Figure 2 shown:
[0050] In the preview scenario, the user uses the electronic device to photograph the object to be photographed. The electronic device displays Figure 2 the interface shown in a of. This interface is the preview interface of the camera application. In the preview interface, the electronic device displays the picture captured by the camera and does not store the picture. Figure 2 In the interface shown in a of, there is a color difference between the object to be photographed in the image displayed by the electronic device and the object to be photographed in the actual scene
[0051] In the shooting scenario, in Figure 2 the interface shown in a of, when the electronic device receives an operation on the shutter button, the electronic device can capture an image of the object to be photographed and save the image. Subsequently, the electronic device can view the captured image based on the gallery application (also known as the album application). For example, the gallery application interface can be Figure 2The interface shown in b in [reference], in which there is a color difference between the photographed object in the image and the photographed object in the actual scene.
[0052] There is a color cast between the image displayed and / or captured by the camera application of the electronic device and the photographed object. It is found that this is because:
[0053] After the electronic device starts the camera application, the electronic device collects the original image through the camera, and the pixel points in the original image are arranged in a quad manner. In the shooting scene, the electronic device may shake. For example, the shake is caused by the user holding the electronic device unstably. An OIS module is set in the electronic device to reduce the imaging blur problem caused by shake.
[0054] However, in a possible implementation, the shake will cause the lens of the OIS to shift, the light passing through the lens will shift, and the light received by the photosensitive elements in the image sensor will change, resulting in a difference in the pixel values of the four pixel points in any quad. Subsequently, after software remosaic processing, the color of the processed image will be different from the actual color of the photographed object.
[0055] The following will further explain the cause of the above color cast in combination with Figure 3 the above.
[0056] An OIS module is set in the electronic device. As shown in Figure a in [reference], the OIS module includes a lens 301 and an image sensor 302. When there is no shake in the electronic device, the state of the OIS module can be as shown in Figure a in [reference], the lens 301 is in the centered position. 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 based on the pixel values of the pixel points collected by the photosensitive elements of the image sensor, and the arrangement of the pixel points collected by the image sensor can be quad. For example, the pixel values of each pixel point can be as shown in Figure c in [reference]. Figure 3 Figure a in [reference] shows the state of the OIS module when there is no shake in the electronic device. The lens 301 is in the centered position. 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 based on the pixel values of the pixel points collected by the photosensitive elements of the image sensor, and the arrangement of the pixel points collected by the image sensor can be quad. For example, the pixel values of each pixel point can be as shown in Figure c in [reference]. Figure 3 Figure a in [reference] shows the state of the OIS module when there is no shake in the electronic device. The lens 301 is in the centered position. 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 based on the pixel values of the pixel points collected by the photosensitive elements of the image sensor, and the arrangement of the pixel points collected by the image sensor can be quad. For example, the pixel values of each pixel point can be as shown in Figure c in [reference]. Figure 3 Figure c in [reference] shows the arrangement of 16 pixel points. Among them, the four pixel points in each 2×2 matrix are pixel points of the same type and can be regarded as a pixel region. The 16 pixel points can include 4 pixel regions, and the 4 pixel regions can be successively the R region (diagonally filled region), the G region (dot-filled region), the G region (dot-filled region), and the B (blank region).
[0057] Figure 3 Figure c in [reference] also shows the pixel values of each pixel point in the 4 pixel regions. From
[0058] Figure 3 Figure c in [reference] also shows the pixel values of each pixel point in the 4 pixel regions. From Figure 3As can be seen from any histogram in Figure c, when the electronic device does not shake, the pixel values obtained by each pixel point are uniform. In the original (RAW image format, RAW) image obtained by the electronic device, the pixel values of the 4 pixel points in each pixel area are the same. Subsequently, the electronic device processes the pixel points of the quad array through the remosaic algorithm. In the processed image, the pixel values of the four pixel points R, G, G, and B in any two pixel areas are the same, and there is no color cast between the two pixel areas.
[0059] For example, taking Figure 1 as an example, Figure 1 in Figure a, the pixel values of the 4 R-type pixel points are the same; the pixel values of the 4 G-type pixel points are the same; the pixel values of the 4 B-type pixel points are the same. After remosaic processing, it is converted into Figure 1 Figure b. Taking Figure 1 the upper left 2×2 pixel area and the upper right 2×2 pixel area in Figure b 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 is no color cast between the upper left pixel area and the upper right pixel area.
[0060] When the electronic device shakes, the image displayed by the electronic device will have a color cast. Exemplarily, when the electronic device shakes, the OIS module adjusts the position of the lens according to the shaking angle of the electronic device. For example, in Figure 3 Figure b, due to the shaking of the electronic device, the lens moves to the left to reduce the imaging blur caused by the shaking. After the lens shifts, the light changes the optical path, resulting in a deviation in the light collected by the image sensor based on the photosensitive element.
[0061] For example, in Figure 3 Figure d, the light received by the photosensitive element shifts to the upper right, and in any pixel area, the pixel values obtained by the 4 pixel points are not uniform. As can be seen from any histogram in Figure 3 Figure d: the pixel values of the 4 pixel points in any pixel area are different. At this time, when performing remosaic processing on the quad map; in the processed image, the pixel values of the pixel points in any pixel area are different from the pixel values of the same type of pixel points in the adjacent pixel area, resulting in a color cast between the pixel area and the adjacent pixel area.
[0062] In a possible implementation, a color brightness calibration module can be set in the electronic device. The color brightness calibration module can compensate the pixel values of each pixel point in the pixel region so that the pixel values of any pixel point in the pixel region are approximately the same. However, the calibration value in the color brightness calibration module is generally calibrated when the electronic device does not shake. That is, when the electronic device does not shake, the pixel values compensated based on the color brightness calibration module are accurate.
[0063] For example, Figure 3 Figure c in [reference] can be the display effect obtained after the electronic device does not shake, the OIS does not move the lens, and the color brightness calibration module compensates the pixel values of each pixel point. Figure 3 Figure e in [reference] 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 4 pixel points in any pixel region are also uneven. After the color brightness calibration module compensates the pixel values, the pixel values of 4 pixel points in any pixel region are approximately the same. The calibration value of the color brightness calibration module is related to the pixel value compensation when the electronic device does not shake; when the electronic device shakes, the calibration value of the color brightness calibration module cannot accurately compensate the pixel values in the shaking scene, resulting in color cast.
[0064] From the above analysis, it can be concluded that the reason for color cast is related to the OIS adjusting the lens due to the shaking of the electronic device. It has been found that the moving distance of the lens in the OIS module is positively correlated with the degree of color cast. The moving distance of the lens can be, for example, the distance that the lens moves from the Figure 3 center position shown in Figure a in [reference] to other directions. The greater the moving distance of the lens, the more obvious the color cast; conversely, the smaller the moving distance of the lens, the less obvious the color cast.
[0065] In view of this, the embodiment of the present application provides an image shooting method. In the shooting scene, when the electronic device shakes, the electronic device reduces the moving distance of the OIS lens, for example, reduces the moving distance of the motor; weakens the color cast problem between the image obtained by the electronic device and the actual object to be photographed, improves the color restoration degree, improves the authenticity and image quality of the photo, thereby improving the user's photo-taking experience.
[0066] In order to better understand the embodiment of the present application, the structure of the electronic device in the embodiment of the present application will be introduced below:
[0067] Figure 4The structural schematic 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, a headphone 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, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric 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.
[0068] It can be understood that the structure schematically shown in the embodiments 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 those shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0069] The electronic device 100 realizes the display function through a GPU, the display screen 194, and an application processor, etc. The display screen 194 is used to display images, videos, etc. In the embodiments of the present application, the electronic device 100 may display the relevant interface of the camera application based on the display screen 194.
[0070] The electronic device 100 can realize the shooting function through an ISP, the camera 193, a video codec, a GPU, the display screen 194, and an application processor, etc.
[0071] The ISP is used to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, and the light passes through the lens and is transmitted to the camera photosensitive element. The optical signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.
[0072] 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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.
[0077] The motor 191 can generate vibration prompts. The motor 191 can be used for incoming call vibration prompts and also for touch vibration feedback. For example, touch operations on different applications (such as taking pictures, audio playing, etc.) can correspond to different vibration feedback effects. For touch operations on different areas of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving messages, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization. In the embodiments of the present application, the motor 191 can be used to drive the lens to move.
[0078] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservices architecture, or a cloud architecture, etc. In the embodiments of the present application, taking the Android system with a layered architecture as an example, the software structure of the electronic device 100 is exemplarily described.
[0079] Figure 5 It is the software structure block diagram of the electronic device 100 in the embodiments of the present application.
[0080] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system may include: an application layer (applications), an application framework layer (application framework), a hardware abstraction layer (hardware abstract layer, HAL), a kernel layer (kernel), and an audio digital signal processor (audio digital signal processor, ADSP); among them, the kernel layer may be called the driver layer.
[0081] The application layer may include a series of application program packages.
[0082] As Figure 5 shown, the application program package may include a camera application.
[0083] The application framework layer provides application programming interfaces (application programming interfaces, APIs) and programming frameworks for the application programs in the application layer. The application framework layer includes some predefined functions.
[0084] As Figure 5 shown, the application framework layer may include a camera access interface.
[0085] The camera access interface enables the application program to manage the camera and access the camera device. For example, manage the camera to take pictures, etc.
[0086] 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 embodiments of the present application, the OIS management module can be used to manage OIS-related processes, for example, initializing the OIS module, setting the OIS mode, etc. The camera management module can be used to manage the photographing-related processes, for example, controlling the camera to capture the original image, processing the original image, etc.; among them, the camera management module may include a remosaic module (this module is not shown in Figure 5 ), and this module can be used to process the quad image into a remosaic image.
[0087] The kernel layer is the layer between the hardware and the software. The kernel layer is used to drive the hardware so that the hardware works. The kernel layer may include a camera driver module. The camera driver module can be used to upload the original image captured by the camera to the camera management module.
[0088] The ADSP layer can be used to manage modules for power (charge), sensors, and audio processing. The ADSP layer can interact with the kernel layer through pmic_glink for information. In the embodiments of the present application, the ADSP layer may include an OIS driver module; the OIS driver module can be used to set OIS data, calculate the compensation value of the motor, and send down the compensation value of the motor. Among them, the OIS driver module may include an OIS algorithm library (algorithm library, ALGO LIB) module.
[0089] The hardware layer may include an OIS module, a camera, and various types of sensors. The OIS module can be used for optical image stabilization. The camera can be used to capture images, and the sensors can be, for example, an acceleration sensor, a gyroscope sensor, and an ambient light sensor, etc.
[0090] Next, in combination with Figure 5 the possible implementation manners of the image capture method in the embodiments of the present application will be described.
[0091] The related algorithms in the embodiments of the present application can be set in the OIS driver module. Exemplarily, after the camera application is started, the camera application calls the camera access interface, and the camera access interface instructs the camera management module to obtain 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.
[0092] After the camera application is launched, the camera application can also notify the OIS management module to enable the OIS function; the OIS management module issues an instruction to the OIS driver module to set OIS data; for example, in the second scenario, an instruction related to the first OIS mode is issued; in the first scenario, an instruction related to the second OIS mode is issued; the first OIS mode can be a commonly used OIS mode in possible implementations, and the second OIS mode can be an OIS mode provided by the embodiments of the present application.
[0093] The OIS driver module can obtain IMU data from the acceleration sensor and / or the gyroscope sensor; when the electronic device shakes, the OIS driver module can calculate the compensation value of the motor, send the compensation value to the OIS module, and the OIS module adjusts the lens position in the camera according to the compensation value. The electronic device uploads the new raw image to the camera application again based on the camera.
[0094] The following Figure 6 describes an image capturing method provided by the embodiments of the present application. Figure 6 shows a schematic flowchart of an image capturing method in the embodiments of the present application, as Figure 6 shown:
[0095] S601. When receiving an operation for launching the camera application, the electronic device launches the camera application.
[0096] A camera application is set in the electronic device. In some embodiments, when the electronic device is not in the locked screen state, the electronic device can launch the camera application after receiving an operation on the icon of the camera application on the desktop. In other embodiments, when the electronic device is in the locked screen state, the electronic device can launch the camera application after receiving an operation on the icon of the camera application on the locked screen interface. In still other embodiments, the electronic device can enter the camera application based on other applications, and the other applications can be, for example, social applications, video applications, and payment applications, etc., and these applications support the photo-taking function. In still other embodiments, the electronic device can also launch the camera application based on the user's voice information, and the voice information can be, for example, "open the camera". The embodiments of the present application do not limit the manner in which the electronic device launches the camera application.
[0097] After the electronic device launches the camera application, a series of camera-related devices will be turned on so that the camera application can execute the photo-taking process. For example, the electronic device enables the OIS function.
[0098] S602. The electronic device enables the OIS function.
[0099] The OIS function is used to reduce the impact of shaking on the image clarity when the electronic device shakes, so that the captured image is clear and stable.
[0100] The process of the electronic device enabling the OIS function can be, for example: controlling the OIS module to power on; creating OIS running 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.
[0101] Among them, the first OIS mode can be understood as the mode in which the electronic device applies the OIS module in a possible implementation. In the first OIS mode, the electronic device can normally use the OIS function of the camera application. The OIS data can include the anti-shake angle, the travel of the motor, the gyro gain coefficient, etc. After the electronic device obtains the instruction to set the OIS mode to the first OIS mode, it can set the range of the OIS data according to the first OIS mode.
[0102] Among them, the anti-shake angle of the OIS can represent the maximum jitter angle that the OIS can anti-shake in the current mode; the travel of the motor can be the farthest distance that the motor can push the lens; after the electronic device obtains the jitter angle, it needs to convert the angle value into the corresponding travel value based on the gyro gain coefficient.
[0103] After the electronic device enables the OIS function, the OIS module can adjust the position of the lens according to the jitter degree of the electronic device to improve the stability of imaging.
[0104] S603. The electronic device determines whether it is the first scenario.
[0105] The image output scenario of the electronic device can be the first scenario and the second scenario; the first scenario can be: in the first scenario, when the lens of the OIS module is adjusted with the jitter of the electronic device, the electronic device will have a color cast. The first scenario can be called the quadraw image output scenario. The second scenario can be: in the second scenario, when the lens of the OIS module is adjusted with the jitter of the electronic device, the electronic device will not have a color cast.
[0106] It should be noted that in different scenarios, after the electronic device obtains the quad image, it can process the quad image in different ways. For example, in the first scenario, the electronic device can perform remosaic processing on the quad image and output an image in remosaic format; in the second scenario, the electronic device can perform binning processing on the quad image and output an image in binning format.
[0107] The electronic device can determine whether it is in the first scenario through scene detection. When the electronic device is in the first scenario, due to the possible jitter of the electronic device, after converting the quad image into a remosaic image, the image displayed by the electronic device has a color cast (for reference, see Figures 2 - 3(Descriptions related to color cast in the electronic device in the illustrated embodiment are not elaborated here). To reduce color cast scenarios, the electronic device may adopt the image capture method provided in the embodiments of the present application, for example, step S604.
[0108] When the electronic device is in the second scenario, there will be no color cast in the electronic device. The reason is as follows:
[0109] After the electronic device obtains the quad image, it can convert the quad image into a binning image. Combining Figure 1 with the arrangement of pixel points in the binning image shown in Figure c in Figure 3 and the pixel values of each pixel point in Figure c in Figure 1 it can be seen that the out - put method of the binning image superimposes similar pixels of the same type through induced charges. For example, 4 pixel points in a 2×2 pixel area are combined into a large pixel point. Figure 1 In Figure c in Figure 3 the area of the photosensitive element occupied by 1 R - type pixel point is the same as that of Figure 3 in Figure d in Figure 3 the area of the photosensitive element occupied by 4 R - type pixel points. When the OIS lens 301 is in the position shown in Figure b in Figure 3 although there are differences in the pixel values of each pixel point in Figure c in Figure 3 the total photosensitive area of the 4 pixel points in each 2×2 pixel area is roughly the same, and the photosensitive area is, for example, Figure 3 the circular or elliptical area in Figure d in Figure 3 . In the case of combining 4 pixel points in the quad image into 1 large pixel point in the binning image, the pixel value of the large pixel point in the binning image will not have color cast. In the second scenario, the electronic device may not start the subsequent operation steps to reduce the operation pressure of the algorithm and save computing power.
[0110] S604. When the electronic device detects the first scenario, the electronic device turns off the OIS function.
[0111] In a feasible solution, after the electronic device detects the first scenario, it turns off the OIS function. In the first scenario, the electronic device does not use the OIS function. After the electronic device turns off the OIS function, the OIS module in the electronic device can be as shown in Figure a in Figure 3 where the lens 301 is in the centered position, so that the light passing through the lens from the camera hole can be imaged at the center of the image sensor. The electronic device can obtain an image without color cast, and the pixel value of each pixel point in this image can be, for example, Figure 3 as shown in Figure c in Figure 3 In Figure c in Figure 3 the pixel values of adjacent pixels of the same type are generally the same. For example, the pixel values of 4 R - type pixel points are generally the same; thus reducing the problem of color cast in the image displayed by the electronic device.
[0112] In some embodiments, the process of the electronic device turning off the OIS function may be, for example: when the first scenario is detected, issue an instruction for indicating to turn off the OIS module; control the power-down of the OIS module according to the instruction for indicating to turn off the OIS module. The embodiments of the present application do not limit the manner and specific instruction for controlling the OIS module to turn off.
[0113] S605. When the electronic device does not detect the first scenario, the electronic device turns on the OIS function.
[0114] When the electronic device does not detect the first scenario, the electronic device is in the second scenario, 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 jitter degree of the electronic device to improve the stability of imaging.
[0115] The process of the electronic device turning on the OIS function can refer to the relevant description in step S602, which will not be elaborated here.
[0116] In this way, the electronic device can select 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 object being photographed after processing the quad image into a remosaic image; improve the color restoration degree of the image and obtain 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, and then output a high-quality image.
[0117] Next, in combination with Figure 7 The image shooting method provided by the embodiments of the present application will be described. Figure 7 The flowchart of the image shooting method in the embodiments of the present application is shown, as Figure 7 shown:
[0118] S701. When receiving an operation for starting the camera application, the electronic device turns on the camera application.
[0119] This step can refer to the relevant description in step S601, which will not be elaborated here.
[0120] S702. The electronic device turns on the OIS function; the OIS mode is in the first OIS mode.
[0121] This step can refer to the relevant description in step S602, which will not be elaborated here.
[0122] It can be understood that the initial scenario when the electronic device enters the camera application can be the second scenario. For example, when the electronic device just opens the camera application, the electronic device can display an interface as shown in Figure 8 Figure a. In this interface, the camera mode of the camera application is in the photo mode, and the zoom ratio button 801 shows that the zoom ratio of the current electronic device is at the 1x specification. The initial image output mode of the electronic device can be the binned image.
[0123] Based on the analysis and description in step S603, in the second scenario, after the electronic device enables the OIS function, the lens shift in the OIS module will not cause a color cast problem between the image displayed by the electronic device and the actual object being photographed; 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 the normal anti-shake function.
[0124] Specifically, the OIS mode is in the first OIS mode. The OIS data includes the anti-shake angle, the stroke of the motor, and the gyroscope gain coefficient, etc. In the first OIS mode, the value of the anti-shake angle can be the first value, the stroke of the motor can be the second value, and the gyroscope gain coefficient can be the 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.
[0125] S703. The electronic device determines whether it is the first scenario.
[0126] This step can refer to the relevant description in step S603 and will not be elaborated here.
[0127] In a possible implementation, the electronic device can perform scene detection in the following manner:
[0128] The electronic device obtains the zoom ratio and the brightness value; when the zoom ratio is greater than or equal to the preset zoom ratio and the brightness value is greater than or equal to the preset brightness, the electronic device determines that it is in the first scenario. Among them, 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 Figure a is 1x. The brightness value can be related to the ambient light brightness and / or the shooting brightness. The ambient light brightness can be the current ambient brightness, such as day and night, bright light scene and dark light scene, etc.; the shooting brightness can be the shooting parameters related to brightness during shooting, such as the exposure value, the international organization for standardization (ISO), etc.; the brightness value is positively correlated with the ambient light brightness, and the brightness value is positively correlated with the shooting brightness.
[0129] Exemplarily, the process of detecting the first scenario can correspond to the following UI scenario:
[0130] The electronic device displays the interface as shown in Figure 8 a in the figure. In this interface, 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 scenario.
[0131] The electronic device is in an environment with a relatively high brightness value, and the electronic device receives a trigger operation on the 2x specification button in the zoom ratio button 802. In response to this trigger operation, the electronic device displays the interface as shown in Figure 8 b in the figure. In the interface shown in Figure 8 b in the figure, the object displayed in the electronic device is correspondingly enlarged, and the zoom ratio button 802 can display that the current zoom ratio is 2x.
[0132] When the electronic device switches from the interface shown in Figure 8 a in the figure to the interface shown in Figure 8 b in the figure, the electronic device can detect that the zoom ratio switches from 1x to 2x; among them, the preset zoom ratio can be, for example, 2x. 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 scenario. The specific values of the preset zoom ratio and the preset brightness are not limited in the embodiments of the present application.
[0133] Optionally, the electronic device can also adjust the zoom ratio based on other gesture operations. For example, when the electronic device receives an operation of two-finger sliding and the distance between the two fingers gradually becomes larger or smaller, the electronic device can correspondingly enlarge or reduce the zoom ratio. Another example is that the electronic device can display a slider for the zoom ratio. When the electronic device can receive a sliding operation on the sliding button in the slider, the electronic device can correspondingly enlarge or reduce the zoom ratio. The embodiments of the present application do not limit this.
[0134] In some embodiments, when the electronic device detects that the zoom ratio is greater than or equal to the preset zoom ratio and the brightness value is greater than or equal to the preset brightness, an instruction for indicating zoom can be issued; when the OIS module receives the instruction for indicating zoom, the OIS mode can be switched to the second OIS mode.
[0135] Among them, the instruction for indicating zoom can be, for example, in sensor zoom. After receiving this instruction, the electronic device can set the sensor capability in the sensor mode data to in sensor zoom; the subsequent image output mode of the electronic device can be to process the quad image into a remosaic image. At the same time, the OIS module can also receive this instruction and adjust to the corresponding second OIS mode based on this instruction.
[0136] Optionally, the brightness value can be based on the ambient light sensor, or it can be obtained based on the shooting parameters. The embodiments of the present application do not limit this.
[0137] S704. When the electronic device detects the first scene, set the OIS mode to the second OIS mode.
[0138] Among them, the first scene corresponds to the second OIS mode, and the second scene corresponds to the first OIS mode. When the electronic device recognizes the switch from the second scene to the first scene, it can switch the OIS mode from the first OIS mode to the second OIS mode.
[0139] The second OIS mode can be, for example, the zoom mode. After the OIS module receives the instruction for indicating zoom, it can set the OIS mode to zoom. In different OIS modes, the values of the OIS data are different.
[0140] S705. The electronic device sets the OIS data based on the second OIS mode, and the absolute value of the OIS data in the second OIS mode is less than the absolute value of the OIS data in the first OIS mode.
[0141] In different OIS modes, the OIS data can meet the following conditions: in the first OIS mode, the anti-shake angle is the first value, the stroke of the motor is the second value, and / or the gyroscope gain coefficient is the third value. In the second OIS mode, the anti-shake angle is the fourth value, the stroke of the motor is the fifth value, and / or the gyroscope gain coefficient is the sixth value.
[0142] 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.
[0143] It should be noted that the electronic device can reduce the moving distance of the lens by restricting the OIS data, so that the light entering the lens from the camera hole can be imaged as much as possible in the center of the image sensor, thereby reducing the chromatic aberration between the image and the object being photographed.
[0144] Exemplarily, Figure 9 Taking the rear camera supporting the OIS function as an example, when the electronic device does not shake, the lens of the OIS is placed in the center. When the electronic device shakes, the OIS module can push the lens to move in all directions to compensate for the imaging blur caused by the shake.
[0145] 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.
[0146] It can be understood that the stroke of the motor is the farthest distance that the motor can reach. The motor is used to push the lens to move. Therefore, the smaller the stroke value, the smaller the distance that the lens can move. Therefore, the movement of the lens can be reduced by restricting the stroke.
[0147] Specifically, the absolute value of the stroke of the motor in the second OIS mode is less than the absolute value of the stroke of the motor in the first OIS mode; the absolute value of the fifth value is less 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 can be 1 / 2 of the absolute value of the second value, and the absolute value of the fifth value can also be any value less than the absolute value of the second value. The embodiments of the present application do not limit this.
[0148] 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. 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:
[0149] code = gyrogain × θ × a
[0150] Where, gyrogain is the gyroscope gain coefficient, θ is the offset angle when shaking occurs, and a is a coefficient.
[0151] 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.
[0152] Specifically, the absolute value of the anti-shake angle in the second OIS mode is less than the absolute value of the anti-shake angle in the first OIS mode; the absolute value of the fourth value is less 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 can be 1 / 2 of the absolute value of the first value, and the absolute value of the fourth value can also be any value less than the absolute value of the first value. The embodiments of the present application do not limit this.
[0153] 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.
[0154] It can be seen from the above calculation formula of the code 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.
[0155] 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 can be 1 / 2 of the absolute value of the third value, and the absolute value of the sixth value can also be any value less than the absolute value of the third value. The embodiments of the present application do not limit this.
[0156] It can be understood that the above embodiments provide three methods for reducing the moving distance of the lens. The electronic device can reduce the moving distance of the lens by restricting any one of the above OIS data. For example, the values of each OIS data in the second OIS mode are the fourth value, the second value, and the third value; or, the values of each OIS data are the first value, the fifth value, and the third value; or, the values of each OIS data are the first value, the second value, and the sixth value. The electronic device can also reduce the moving distance of the lens by restricting any two or three of the above OIS data; for example, the values of each OIS data are the fourth value, the fifth value, and the third value; or, the values of each OIS data are the fourth value, the second value, and the sixth value; or, the values of each OIS data are the first value, the fifth value, and the sixth value; or, the values of each OIS data are the fourth value, the fifth value, and the sixth value. The embodiments of the present application do not limit this.
[0157] S706. The electronic device outputs a compensation value for the motor according to the OIS data of the second OIS mode.
[0158] When the electronic device shakes, the electronic device determines whether to compensate the position of the lens according to the OIS data of the second OIS mode and calculates the compensation value.
[0159] The electronic device can obtain the compensation value of the motor based on the calculation formula of code. Among them, the offset angle θ is related to the inertial measurement unit (IMU) data, and 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, etc.; the IMU data can be, for example: gSensor.x, gSensor.y, and gSensor.z.
[0160] The offset angle θ can satisfy the following formula:
[0161]
[0162] The electronic device can also calculate θ based on arcsin and arccos, and the embodiments of the present application do not limit this.
[0163] 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 the position of the lens.
[0164] It can be understood that since the absolute value of the fourth value is less than the absolute value of the first value, in the second OIS mode, the angle by which the lens of the electronic device can be offset is reduced. For example, the fourth value is ±1°. When the offset angle of the lens is between -1° and 1°, the color cast between the image displayed by the electronic device and the photographed object is less than the color cast threshold; among them, the color cast threshold can be the minimum color difference value that the human eye can distinguish. 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 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.
[0165] Taking the stroke of the motor 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 drive the output of the motor with the absolute value of the fifth value. When the absolute value of the compensation value is greater than the absolute value of the fifth value, the electronic device does not compensate the position of the lens.
[0166] It can be understood that since the absolute value of the fifth value is less than the absolute value of the second value, the moving distance of the lens of the electronic device is reduced in the second OIS mode. For example, the fifth value is ±1024. When the code is between -1024 and 1024, the color cast between 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. Therefore, the electronic device does not compensate the lens, the lens does not shift, and there will be no color cast between the image of the electronic device and the photographed object.
[0167] Taking the gyroscope gain coefficient as the sixth value as an example, when the offset angle obtained by the electronic device is less than the anti-shake angle, the electronic device can calculate the code value using the offset angle. However, since the absolute value of the sixth value is less than the absolute value of the third value, in the second OIS mode, the code value obtained by the electronic device based on the offset angle is less than the code value obtained by the electronic device based on 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.
[0168] S707. The electronic device adjusts the lens position based on the compensation value of the motor and obtains an image.
[0169] After the electronic device adjusts the lens position based on the compensation value of the motor, at the moving distance of the lens, 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 a small color cast.
[0170] Optionally, when the electronic device recognizes the first scene, it sets the OIS mode to the second OIS mode. Thereafter, if the electronic device does not recognize the first scene, it can restore the OIS mode to the first OIS mode. This process can be shown as the following steps:
[0171] After step S707, it further includes:
[0172] S708. When the electronic device is not in the first scene, the electronic device sets the OIS mode to the first OIS mode.
[0173] The electronic device can switch from the first scene to the second scene. When the electronic device exits the first scene, it will restore the OIS mode to the first OIS mode.
[0174] Exemplarily, the electronic device not being in the first scene can meet the following conditions:
[0175] For example, when the zoom ratio is less than the preset zoom ratio, or the brightness value is less than the preset brightness, the electronic device determines that it is not in the first scene.
[0176] Exemplarily, the process of detecting the switch from the first scenario to the second scenario may correspond to the following UI scenarios:
[0177] In one possible implementation, in the first scenario, the electronic device displays the interface as shown in Figure 10 a in, the zoom ratio button 1001 displays the current zoom ratio as 2x, and the electronic device displays the image with a relatively high brightness value. When the electronic device receives a trigger operation for the 1x specification in the zoom ratio button 1001, the electronic device enters the second scenario from the first scenario, and the electronic device can display Figure 10 the interface shown in b in. In Figure 10 the interface shown in b in, the zoom ratio button 1002 displays the current zoom ratio as 1x, and the electronic device displays the image with a relatively high brightness value.
[0178] In another possible implementation, in the first scenario, the electronic device displays the interface as shown in Figure 10 a in, the zoom ratio button 1001 displays the current zoom ratio as 2x, and the electronic device displays the image with a relatively high brightness value. When the electronic device receives a trigger operation for the shooting area, the electronic device can display the interface as shown in Figure 11 a in. In Figure 11 the interface shown in a in, the zoom button 1101 displays the current zoom ratio as 2x, and an exposure button 1102 appears at the click position in the shooting area; when the electronic device receives a downward sliding operation, the electronic device can display Figure 11 the interface shown in b in. In Figure 11 the interface shown in b in, the brightness of the shooting area decreases. When the brightness value is less than the preset brightness, the electronic device switches from the first scenario to the second scenario. The electronic device can recognize that it is not currently in the first scenario.
[0179] In yet another possible implementation, in the first scenario, the electronic device displays the interface as shown in Figure 10 a in, the zoom ratio button 1001 displays the current zoom ratio as 2x, and the electronic device displays the image with a relatively high brightness value. When the user holds the electronic device and enters an area with relatively dim ambient light, the image displayed by the electronic device becomes correspondingly darker. When the brightness value is less than the preset brightness, the electronic device switches from the first scenario to the second scenario. The electronic device can recognize that it is not currently in the first scenario.
[0180] The above scenarios exemplarily show several ways to exit the first scenario, but the embodiments of the present application do not limit the specific scenarios for switching from the first scenario to the second scenario.
[0181] 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.
[0182] For example, the electronic device switches the anti-shake angle from the fourth value to the first value, switches the stroke of the motor from the fifth value to the second value, and / or switches the gyroscope gain coefficient from the sixth value to the third value.
[0183] In this way, when the electronic device is not in the first scenario, the electronic device can normally use the anti-shake function of the OIS module to obtain high-quality images.
[0184] The above embodiments illustrate the image capturing method in the embodiments of the present application. The following combines Figure 12 to illustrate the internal interaction of the electronic device executing the image capturing method in the embodiments of the present application. Figure 12 shows the internal interaction flowchart of the image processing method in the embodiments of the present application, as Figure 12 shown:
[0185] Exemplarily, the electronic device may include an application layer, a hardware abstraction layer, an ADSP layer, and a hardware layer. Among them, the application layer may include a camera application, and the camera mode may also be other applications with a photographing 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.
[0186] S1201. When receiving an operation for starting the camera application, the electronic device turns on the camera application.
[0187] Step S1201 may refer to the relevant description in step S601, which will not be elaborated here.
[0188] S1202. The camera application of the electronic device instructs the OIS management module to turn on the OIS function. Among them, the OIS mode is in the first OIS mode.
[0189] Step S1202 may refer to the relevant description in step S602 and / or S702, which will not be elaborated here.
[0190] Specifically, the process of the electronic device turning on the OIS function may be, for example: the power management module controls the OIS module to power on; the OIS management module creates OIS running resources; the OIS management module sends an initialization message to the OIS driver module; the OIS driver module performs initialization; the OIS management module sends an instruction for indicating the first OIS mode to the OIS driver module; the OIS driver module sets OIS data according to the instruction for indicating the first OIS mode. Among them, the Figure 12 software interaction process of this part is not shown in the embodiments of the present application.
[0191] S1203. The OIS management module of the electronic device determines whether it is in the first scenario.
[0192] Step S1203 can refer to the relevant descriptions in steps S603 and / or S703, which will not be elaborated here.
[0193] When the electronic device is in the first scenario, the electronic device executes step S1204; when the electronic device is not in the first scenario, the electronic device does not execute step S1204, and continuously detects the scenario of the electronic device until the electronic device is in the first scenario.
[0194] Specifically, the electronic device being in the first scenario may include: the OIS management module receives an instruction for indicating zoom, for example, an in sensor zoom instruction.
[0195] S1204. When the OIS management module detects the first scenario, set the OIS mode to the second OIS mode.
[0196] Step S1204 can refer to the relevant description in step S704, which will not be elaborated here.
[0197] S1205. The OIS management module of the electronic device sends an instruction for indicating the second OIS mode to the OIS driver module.
[0198] S1206. The OIS driver module of the electronic device sets the OIS data according to the instruction for indicating the second OIS mode.
[0199] Steps S1205 and S1206 can refer to the relevant descriptions in step S705, which will not be elaborated here. Among them, the OIS data can be, for example, the anti-shake angle is the fourth value, the stroke of the motor is the fifth value, and / or the gyroscope gain coefficient is the sixth value.
[0200] After setting the OIS mode 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:
[0201] S1207. The sensor collects IMU data and uploads the IMU data to the OIS driver module.
[0202] The sensor can be, for example, an acceleration sensor and a gyroscope sensor.
[0203] S1208. The OIS driver module calculates the offset angle according to the IMU data.
[0204] S1209. When the offset angle is less than or equal to the anti-shake angle of the second OIS mode, the OIS driver module calculates the compensation value of the motor according to the offset angle.
[0205] 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.
[0206] Steps S1207 - S1211 can refer to the relevant descriptions in step S706 and will not be elaborated here.
[0207] S1211. The OIS module controls the motor to push the lens to move according to the compensation value of the motor.
[0208] 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, realizing the anti - shake function.
[0209] After the lens in the OIS module is offset, the electronic device can use the lens to obtain an image with no color cast or a color cast less than the color cast threshold, such as steps S1212 - S1214.
[0210] S1212. The camera of the electronic device captures a quad image and uploads the quad image to the camera management module.
[0211] S1213. The image processing module of the electronic device processes the quad image to obtain a remosaic image.
[0212] The image processing module may include a remosaic algorithm module. The image processing module processes the quad image based on the remosaic algorithm module to obtain a remosaic image.
[0213] Among them, since the electronic device has executed the above steps S1201 - S1211; the pixel values of multiple same - type pixel points in any pixel region of the quad image obtained by the electronic device are generally the same. For example, the quad image may present the effect shown in Figure a in Figure 3 . For the same - type pixel points with relatively uniform pixel values, when the electronic device performs remosaic processing on its n×n (for example: 2×2) pixel region, the color cast of the processed image is less than the color cast threshold.
[0214] S1214. The image processing module of the electronic device uploads the remosaic image to the camera application.
[0215] Among them, the camera application can obtain the remosaic image.
[0216] In a possible implementation, when the camera application is in the preview scene, the electronic device can display the remosaic image; among them, the color cast between the object in the preview interface and the actual object to be photographed is less than the color cast threshold.
[0217] In another possible implementation, when the camera application receives an operation for taking a photo, the camera application obtains a remosaic image. An icon of the remosaic image can be displayed in the thumbnail of the camera application interface, where the icon of the remosaic image can be the same as the remosaic image scaled down proportionally.
[0218] In some embodiments, after capturing a remosaic image, the electronic device can also transfer the remosaic image to the gallery application, and the gallery application saves the remosaic image.
[0219] In this way, in the preview scene of the camera application, the electronic device can display an image with a color cast less than the color cast threshold; when taking a photo using the camera application, an image with a 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 object being photographed, improving the image quality, and enhancing the user's photo-taking experience.
[0220] 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 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. Moreover, the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for users to choose to authorize or refuse.
[0221] Based on the above embodiments, the embodiments of this application provide an image capture method. Exemplarily, Figure 13 FIG. is a schematic flowchart of an image capture method provided by an embodiment of this application.
[0222] As Figure 13 shown, the image capture method may include the following steps:
[0223] S1301. When the zoom ratio of the electronic device is the first 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 first range.
[0224] The scenario shown in step S1301 may correspond to a second scenario, such as Figure 8 the scenario shown in interface a in. In the second scenario, the first zoom ratio may correspond to a zoom ratio of 1x. For example, the zoom button 801 shows that the current zoom ratio is 1x; 1x is less than the preset zoom ratio, and the electronic device can execute, for example, step S702.
[0225] The anti-shake parameter may be the offset angle and the compensation value of the motor. The moving range of the camera can be understood as the range within which the electronic device pushes the lens to move based on the compensation value of the motor.
[0226] 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 the second range; the first range is greater than the second range; the first zoom ratio is less than the second zoom ratio.
[0227] The scenario shown in step S1302 can correspond to the first scenario, for example Figure 8 the scenario shown in the interface shown in b in. In the first scenario, the second zoom ratio can correspond to a zoom ratio of 2x. For example, the zoom button 802 shows that the current zoom ratio is 2x; 2x is greater than or equal to the preset zoom ratio, and the electronic device can execute steps S703 - S707, for example.
[0228] It can be seen from the comparison of steps S1301 and S1302 that in the first scenario, the range within which the camera can move is smaller than that in the second scenario.
[0229] For example, in Figure 14 in Figure 14 Figure a corresponds to the second scenario; Figure 14 Figure b corresponds to the first scenario. Figure 14 In Figure a in, the dashed circular area can be the maximum range within which the camera can move restricted by the thresholds of the anti-shake parameters based on the second scenario; the distance from the lens shown by the dashed 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.
[0230] Figure 14 In Figure b in, the dashed circular area can be the maximum range within which the camera can move restricted by the thresholds of the anti-shake parameters based on the first scenario; since in the second scenario, the threshold of the anti-shake parameter is less than that in the first scenario, in the first scenario, the dashed circular area is smaller than that in the second scenario. The distance from the lens shown by the dashed line to the lens shown by the solid line can be the second range of lens movement when the anti-shake parameter is the first parameter.
[0231] In the embodiments of the present application, the electronic device can reduce the moving range of the lens by restricting the threshold of the anti-shake parameter and / or the gyroscope gain coefficient. Taking the gyroscope gain coefficient in the first scenario as the first gyroscope gain coefficient and the gyroscope gain coefficient in the second scenario as the second gyroscope gain coefficient as an example. When the electronic device shakes, the electronic device can obtain an offset angle. In the first scenario, the electronic device obtains a code based on the offset angle and the first gyroscope gain coefficient; in the second scenario, 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. In the case of the same offset angle, the code value in the first scenario is less than the code value in the second scenario. The smaller the code value, the smaller the distance the motor drives the lens to move. Therefore, in the case of the same anti-shake parameters, there will be a scenario where Figure 14 as shown in the first range of the second scenario is larger than the second range of the first scenario.
[0232] In this way, in the first scenario of the embodiments of the present application, the moving range of the lens is restricted, thereby reducing the color cast between the image displayed on the electronic device and the object being photographed, improving the color restoration of the image, improving the image quality, and further improving the user's photographing experience.
[0233] Optionally, before controlling the camera of the electronic device to move within the second range, it further 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.
[0234] The anti-shake parameter can correspond to the offset angle and the compensation value of the motor in the above embodiments; the threshold of the anti-shake parameter can correspond to the anti-shake angle and the stroke of the motor in the above embodiments. The first threshold can be understood as: the anti-shake angle is a fourth value and / or the stroke of the motor is a fifth value. The second threshold can be understood as: the anti-shake angle is a first value and / or the stroke of the motor is a second value.
[0235] The principle of restricting the moving range of the lens by restricting the threshold of the anti-shake parameter can refer to the relevant descriptions in steps S704 - S707, which will not be elaborated here.
[0236] In this way, in the first scenario, the electronic device can restrict the moving range of the lens by restricting the threshold of the anti-shake parameter; reduce the lens movement, reduce the color cast between the image displayed on the electronic device and the actual object being photographed, improve the color restoration of the image, improve the image quality, and further improve the user's photographing experience.
[0237] Optionally, the anti-shake parameters include one or more of the following: the offset angle and the compensation value of the motor; wherein, the offset angle is the tilt angle when the electronic device shakes, and the compensation value of the motor is the range of movement of the motor; the motor is used to drive the movement of the position of the camera; the thresholds of the anti-shake parameters include one or more of the following: the anti-shake angle and the 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.
[0238] In this way, the thresholds of the anti-shake parameters can include the anti-shake angle and the stroke of the motor. The electronic device can limit the movement range of the lens by means of the anti-shake angle and / or the stroke of the motor, reduce the movement of the lens, reduce the color cast between the image displayed by the electronic device and the actual object being photographed, improve the color restoration degree of the image, improve the image quality, and thus improve the user's photo-taking experience.
[0239] Optionally, before controlling the camera of the electronic device to move within the second range, it further includes: setting the gyroscope gain coefficient to the first gyroscope gain coefficient; controlling the camera of the electronic device to move within 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 within the second range through 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.
[0240] 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 restricting the movement range of the lens by restricting the gyroscope gain coefficient can refer to the relevant descriptions in steps S704 - S707, which will not be elaborated here.
[0241] In this way, in the first scenario, the electronic device can limit the movement range of the lens by restricting the gyroscope gain coefficient; reduce the movement of the lens, reduce the color cast between the image displayed by the electronic device and the actual object being photographed, improve the color restoration degree of the image, improve the image quality, and thus improve the user's photo-taking experience.
[0242] 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, control the camera of the electronic device to move within the third range; the second parameter is less than the first parameter; the third range is less than the second range.
[0243] It can be understood 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.
[0244] In this way, the electronic device can more accurately adjust the moving range of the camera according to the offset angle, and control the moving range of the camera not to exceed the maximum moving range of the first scenario; thereby limiting the moving range of the camera, reducing the lens movement, 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.
[0245] Optionally, it further includes: turning on the OIS function; the OIS mode is the first OIS mode, in the first OIS mode, the threshold value of the anti-shake parameter is the second threshold value, and the gyroscope gain coefficient is the second gyroscope gain coefficient; determining whether it is the first scenario; the first scenario includes the output scenario of processing quad images into remosaic images; when the electronic device is in the first scenario, setting the OIS mode to the second OIS mode; setting the threshold value 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 value of the anti-shake parameter is the first threshold value, and / or the gyroscope gain coefficient is the first gyroscope gain coefficient.
[0246] Among them, this process can refer to the relevant descriptions in steps S702 - S707, and will not be elaborated here.
[0247] In this way, the electronic device can, through the determination process of the first scenario, use the second OIS mode provided by the embodiments of the present application in the case where the electronic device may display color cast, thereby reducing the lens movement, 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.
[0248] Optionally, when the electronic device is in the first scenario, setting the OIS mode to the second OIS mode includes: when it is recognized that the zoom ratio is greater than or equal to the preset zoom ratio, and it is recognized that the brightness value is greater than or equal to the preset brightness, obtaining an instruction for indicating internal zoom of the sensor; based on the instruction for indicating internal zoom of the sensor, setting the OIS mode to the second OIS mode.
[0249] In this way, the electronic device can more accurately recognize the quadraw output scenario according to the instruction for indicating internal zoom of the sensor.
[0250] Optionally, the instruction for indicating internal zoom of the sensor includes "in sensor zoom"; the second OIS mode includes the "zoom" mode.
[0251] In this way, the electronic device can more accurately identify the quad raw image scene based on "in sensor zoom".
[0252] Optionally, it further 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 within 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 within 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.
[0253] In this way, the electronic device can display an image with a smaller color difference from the actual object to be photographed under the conditions of meeting the zoom ratio condition and the brightness value condition, improve the color restoration degree of the image, and obtain a high-quality image. When the electronic device does not meet the zoom ratio condition and / or does not meet the brightness value condition, the electronic device turns on the OIS function again to improve the imaging stability, and there will be no color difference problem, and a high-quality image is output.
[0254] The image capture method of the embodiments of the present application has been described above. Next, the apparatus for executing the above image capture method provided by the embodiments of the present application will be described. Those skilled in the art can understand that the method and the apparatus can be combined and cited with each other, and the relevant apparatus provided by the embodiments of the present application can execute the steps in the above image capture method.
[0255] As Figure 15 shown, the image capture apparatus 1500 can be used in a communication device, a circuit, a hardware component or a chip. The image capture apparatus includes: a display unit 1501 and a processing unit 1502. Among them, the display unit 1501 is used to support the steps of display executed by the image capture apparatus 1500; the processing unit 1502 is used to support the steps of information processing executed by the image capture apparatus 1500.
[0256] In a possible implementation, the image capture apparatus 1500 may also include a communication unit 1503. Specifically, the communication unit is used to support the steps of data sending and data receiving executed by the image capture apparatus 1500. Among them, the communication unit 1503 may be an input or output interface, a pin or a circuit, etc.
[0257] In a possible embodiment, the image capturing device may further include: a storage unit 1504. The processing unit 1502 and the storage unit 1504 are connected by a line. The storage unit 1504 may include one or more memories, and the memory may be a device or a component in one or more devices or circuits for storing programs or data. The storage unit 1504 may exist independently and be connected to the processing unit 1502 included in the image capturing device through a communication line. The storage unit 1504 may also be integrated with the processing unit 1502.
[0258] The storage unit 1504 may 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 may be a register, a cache, or a RAM, etc. The storage unit 1504 may be integrated with the processing unit 1502. The storage unit 1504 may 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 may be independent of the processing unit 1502.
[0259] The image capturing method provided by the embodiments of the present application can be applied to an electronic device with a communication function. The electronic device includes a terminal device, and the specific device form of the terminal device and the like can refer to the above relevant description, which will not be elaborated here.
[0260] The embodiments of the present application provide 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.
[0261] The embodiments of the present application provide a chip system, which includes at least one processor and a communication interface. The communication interface and the at least one processor are interconnected by a line, and the at least one processor is used to run a computer program or instruction to execute the above method. The implementation principle and technical effect are similar to those of the above relevant embodiments, which will not be elaborated here.
[0262] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the above method is implemented. The methods described in the above embodiments can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. If implemented in software, the functions can be stored as one or more instructions or codes on a computer-readable medium or transmitted on a computer-readable medium. The computer-readable medium may include a computer storage medium and a communication medium, and may also include any medium that can transfer a computer program from one place to another. The storage medium may be any target medium accessible by a computer.
[0263] In one possible implementation, the computer-readable medium may include RAM, ROM, compact disc read-only memory (CD-ROM), or other optical disc storage, magnetic disk storage, or any other medium target to carry or store the required program code in the form of instructions or data structures and be accessible by a computer. Moreover, any connection is properly termed a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of the medium. As used herein, disk and optical disc include optical disc, laser disc, optical disc, Digital Versatile Disc (DVD), floppy disk, and Blu-ray disc, where disks typically reproduce data magnetically, while optical discs utilize lasers to optically reproduce data. Combinations of the above should also be included within the scope of computer-readable media.
[0264] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is run, it causes the computer to execute the above method.
[0265] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable devices to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing devices generate means for implementing the functions specified in one Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.
[0266] The above specific implementation manners further elaborate on the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above are only specific implementation manners of the present invention and are not used to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included within the protection scope of the present invention.
Claims
1. An image capture method, characterized in that, applied to an electronic device, the electronic device includes a camera, and the method includes: Receiving a user operation, and the electronic device starts a camera application; After starting the camera application, the electronic device turns on the optical image stabilization (OIS) function; After turning on the OIS function, the electronic device enters a first image output scenario; When the electronic device is in the first image output scenario, the OIS mode is the first OIS mode; The electronic device switches from the first image output scenario to a second image output scenario; When the electronic device is in the second image output scenario, the OIS mode is the second OIS mode.
2. The method according to claim 1, characterized in that, The camera further includes a motor; When the OIS mode is the first OIS mode, the stroke of the motor is a first value; When the OIS mode is the second OIS mode, the stroke of the motor is a second value, wherein the absolute value of the first value is greater than the absolute value of the second value.
3. The method according to claim 2, characterized in that, When the OIS mode is the first OIS mode, the anti-shake angle of the camera is a third value; When the OIS mode is the second OIS mode, the anti-shake angle of the camera is a fourth value, wherein the absolute value of the third value is greater than the absolute value of the fourth value.
4. The method according to claim 3, characterized in that, When the OIS mode is the first OIS mode, the gyroscope gain coefficient of the camera is a fifth value; When the OIS mode is the second OIS mode, the gyroscope gain coefficient of the camera is a sixth value, wherein the absolute value of the fifth value is greater than the absolute value of the sixth value.
5. The method according to any one of claims 1-3, characterized in that, When the electronic device is in the first image output scenario, the electronic device outputs an image in the binning format; When the electronic device is in the second image output scenario, the electronic device outputs an image in the remosaic format.
6. The method according to any one of claims 1-3, characterized in that, After starting the camera application, the electronic device displays a preview interface; When the electronic device is in the first image output scenario, the zoom ratio of the preview interface is a first zoom ratio; When the electronic device is in the second image output scenario, the zoom ratio of the preview interface is a second zoom ratio, wherein the first zoom ratio is less than the second zoom ratio.
7. The method according to claim 5, characterized in that, When the electronic device is in the first image output scenario, the current ambient brightness is a first brightness value; When the electronic device is in the second image output scenario, the current ambient brightness is a second brightness value, wherein the first brightness value is less than the second brightness value.
8. An electronic device, characterized in that, including: A processor and a memory; The memory stores computer execution instructions; The processor executes the computer-executable instructions stored in the memory, such that the electronic device executes the method according to any one of claims 1-7.
9. A computer-readable storage medium storing a computer program, wherein, when the computer program is executed by a processor, the method according to any one of claims 1-7 is implemented.
10. A chip system, wherein, comprising at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is configured to run a computer program or instructions to execute the method according to any one of claims 1-7.