Image processing method and electronic equipment
By using non-merging mode and cropping methods to process images in high zoom magnification and high illumination scenes, outputting four-dimensional raw data, and performing post-pass processing, the problem of loss of image clarity under high zoom magnification is solved, improving image quality and user experience.
Patent Information
- Application Number
- CN202410789948.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2024-08-23
AI Technical Summary
In high zoom ratio shooting scenarios, using the merge mode to produce pictures will lose image clarity, resulting in poor image quality and affecting the user's shooting experience.
In high zoom magnification and high illumination scenes, non-merging mode and cropping methods are used for image processing, quadra raw data is output, and image clarity is improved through post-pass image processing.
Processing image data through non-merging mode and cropping methods improves the clarity and quality of images at high zoom ratios and improves the user's shooting experience.
Smart Images

Figure CN118540599A
Abstract
Description
[0001] This application is a divisional application. The name of the original application is an image processing method and electronic device. The application number of the original application is 202210178183.0, and the original application date is February 24, 2022. The entire contents of the original application are incorporated into this application by reference. Technical Field
[0002] The present application relates to the field of image processing technology, and in particular, to an image processing method and an electronic device. Background Art
[0003] With the development of smart terminals, the shooting function has become an essential function of smart terminals. Users' demand and experience for shooting (photographing and / or videography) of smart terminals are also increasing. Smart terminals can shoot images by digital zoom. Digital zoom refers to cropping and / or enlarging images through software algorithms.
[0004] Currently, in high-zoom shooting scenarios, if the merge mode is used to output images, image clarity will be lost, resulting in poor image quality and affecting the user's shooting experience. Summary of the invention
[0005] In view of this, the present application provides an image processing method, an electronic device, a computer-readable storage medium and a computer program product, which can improve the clarity of images in high-magnification shooting scenes and help improve the user's shooting experience.
[0006] In a first aspect, an image processing method is provided, comprising:
[0007] Start the camera;
[0008] Get the zoom ratio and ambient illumination of the current shooting environment;
[0009] When the zoom ratio is greater than or equal to the first ratio, and the ambient illumination is greater than or equal to the first brightness threshold, taking photos in the first mode;
[0010] In the first mode, the camera is used to process the collected image signal in a non-merging mode and a cropping manner, and output first image data, where the first image data is in a first image format.
[0011] The first image format is quadra raw.
[0012] The above method can be executed by a terminal device or a chip in the terminal device. Based on the above scheme, the first mode is used to take photos in a high zoom ratio and high illumination scene, and the non-merging mode and cropping method are used to output the image, and the format of the image data is quadra raw, and quadra raw is used for post-path image processing, which helps to improve the image clarity.
[0013] The embodiment of the present application designs a back-end processing flow for the first mode, specifically involving a preview stream, a photo stream, and a thumbnail stream.
[0014] In a possible implementation manner, the first image data is stored in a first cache;
[0015] The method further comprises:
[0016] Receiving a first operation of a user, where the first operation is used to trigger taking a photo;
[0017] In response to the first operation, acquiring the first image data from the first cache;
[0018] Performing Bayer image regeneration (Remosaic) processing on the first image data through a post-processing algorithm module or an ISP first module to obtain second image data, where the second image data adopts a second image format;
[0019] Performing demosaic processing on the second image data through the second ISP module to obtain data in RGB format;
[0020] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a photographed image.
[0021] In the processing of the camera path, compared with sending the first image data to the ISP or the camera for remosaic processing, using the post-processing algorithm module to perform remosaic processing on the first image data can achieve a better noise reduction effect, which is beneficial to improving the clarity of the photographed image.
[0022] In a possible implementation, the method further includes:
[0023] In the thumbnail stream, the first image data is subjected to Bayer image regeneration processing by the first ISP module to obtain data in Bayer format;
[0024] Performing demosaic processing on the Bayer format data through the second ISP module to obtain RGB format data;
[0025] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
[0026] Therefore, the embodiment of the present application also provides a method for processing the thumbnail stream in the first mode, which helps to improve the image quality of the thumbnail.
[0027] In a possible implementation, the method further includes:
[0028] In the preview path of the first mode, the first image data is mosaicked again by the first ISP module to obtain third image data;
[0029] Performing demosaic processing on the third image data through the second ISP module to obtain data in RGB format;
[0030] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and outputs a preview image.
[0031] Therefore, the embodiment of the present application also provides a method for processing the preview stream in the first mode, which helps to improve the quality of the preview image.
[0032] The embodiment of the present application also designs a corresponding photo-taking process based on different zoom ratios and different ambient illuminations.
[0033] In a possible implementation, the method further includes:
[0034] When the zoom ratio is greater than a second ratio and the ambient illumination is less than the first brightness threshold, taking photos in a second mode, wherein the second ratio is less than the first ratio;
[0035] or,
[0036] When the zoom ratio is greater than a second ratio and less than the first ratio, and the ambient illumination is greater than or equal to a first brightness threshold, taking photos in a second mode;
[0037] In the second mode, the camera is used to output the collected image signal in a merging mode and output fourth image data, and the fourth image data is in the second image format.
[0038] Therefore, when the zoom ratio is greater than the second ratio and the scene is low illumination, the second mode is used to take pictures; when the zoom ratio is greater than the second ratio and less than the first ratio and the scene is high illumination, the second mode is also used to take pictures, that is, the camera uses the merge mode to output the picture, which can ensure the sensitivity and help improve the signal-to-noise ratio of the image.
[0039] In a possible implementation, the method further includes:
[0040] In the preview path of the second mode, demosaicing is performed on the fourth image data by the second ISP module to obtain data in RGB format;
[0041] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and performs cropping and up-sampling processing on the data in YUV format to output a preview image.
[0042] In the second mode, the quality of the preview image can be improved through the processing flow.
[0043] In a possible implementation manner, the fourth image data is stored in a first cache, and the method further includes:
[0044] receiving a second operation of the user, where the second operation is used to trigger taking a photo;
[0045] In response to the second operation, acquiring the fourth image data from the first cache;
[0046] Performing image processing on the fourth image data by a post-processing algorithm module or an ISP second module to obtain fifth image data;
[0047] The fifth image data is cropped and up-sampled by the post-processing algorithm module or the ISP third module to output a photographed image.
[0048] In the second mode, the quality of the photographed image can be improved through the above processing flow.
[0049] In a possible implementation, the method further includes:
[0050] In the thumbnail stream, the ISP second module performs a demosaicing process on the data of the fourth image to obtain data in an RGB format;
[0051] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and performs cropping and up-sampling processing on the data in YUV format to output a thumbnail.
[0052] In the second mode, the image quality of the thumbnail can be improved through the above processing flow.
[0053] In a possible implementation, the method further includes:
[0054] When the zoom ratio is equal to the second ratio and the ambient illumination is greater than or equal to the first brightness threshold, taking photos in a third mode, wherein the second ratio is less than the first ratio;
[0055] Alternatively, when the zoom ratio is equal to the second ratio and the ambient illumination is less than the first brightness threshold, taking photos in a third mode;
[0056] In the third mode, the camera is used to output the collected image signal in a merging mode and output sixth image data, and the sixth image data is in the second image format.
[0057] Therefore, when the zoom ratio is equal to the second ratio, the image clarity can meet the needs, so the signal-to-noise ratio factor is given priority. In all scenes where the zoom ratio is equal to the second ratio (high illumination scenes and low illumination scenes), using the third mode to take pictures can improve the signal-to-noise ratio.
[0058] In a possible implementation manner, the sixth image data is stored in a first cache, and the method further includes:
[0059] receiving a third operation of the user, where the third operation is used to trigger taking a photo;
[0060] In response to the third operation, acquiring the sixth image data from the first cache;
[0061] Performing image processing on the sixth image data by a post-processing algorithm module or an ISP second module to obtain seventh image data;
[0062] The seventh image data is subjected to RGB processing or YUV processing through the third ISP module to obtain data in YUV format and output a photographed image.
[0063] In the third mode, the quality of the photographed image can be improved through the above processing flow.
[0064] In a possible implementation, the method further includes:
[0065] In the thumbnail stream, the sixth image data is demosaiced by the second ISP module to obtain data in RGB format;
[0066] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
[0067] In the third mode, the image quality of the thumbnail can be improved through the above processing flow.
[0068] In a possible implementation, the method further includes:
[0069] In the preview path of the third mode, demosaicing is performed on the sixth image data by the second ISP module to obtain data in RGB format;
[0070] The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and outputs a preview image.
[0071] In the third mode, the quality of the preview image can be improved through the processing flow.
[0072] In a second aspect, an electronic device is provided, comprising a unit for executing any one of the methods in the first aspect. The electronic device may be a terminal or a chip in a terminal. The electronic device comprises an input unit, a display unit and a processing unit.
[0073] When the electronic device is a terminal, the processing unit may be a processor, the input unit may be a communication interface, and the display unit may be a graphics processing module and a screen; the terminal may also include a memory for storing computer program code, and when the processor executes the computer program code stored in the memory, the terminal executes any one of the methods in the first aspect.
[0074] When the electronic device is a chip in a terminal, the processing unit may be a logic processing unit inside the chip, the input unit may be an output interface, a pin or a circuit, etc., and the display unit may be a graphics processing unit inside the chip; the chip may also include a memory, which may be a memory inside the chip (for example, a register, a cache, etc.) or a memory located outside the chip (for example, a read-only memory, a random access memory, etc.); the memory is used to store computer program code, and when the processor executes the computer program code stored in the memory, the chip executes any one of the methods of the first aspect.
[0075] In one implementation, the processing unit is used to start the camera; obtain the zoom ratio and ambient illumination value in the current shooting environment; when the zoom ratio is greater than or equal to the first ratio, and the ambient illumination value is greater than or equal to the first brightness threshold, use the first mode to take pictures; in the first mode, the camera is used to process the collected image signal using a non-merging mode and a cropping mode, and output first image data, and the first image data uses a first image format.
[0076] The first image format is quadra raw data.
[0077] In a possible implementation manner, the first image data is stored in a first cache;
[0078] The input unit is used to receive a first operation of a user, where the first operation is used to trigger taking a photo;
[0079] The processing unit is used for acquiring the first image data from the first cache;
[0080] It is also used to call the post-processing algorithm module or the ISP first module to perform Bayer image regeneration (Remosaic) processing on the first image data to obtain second image data, where the second image data adopts a second image format;
[0081] It is also used to call the second ISP module to perform demosaicing on the second image data to obtain data in RGB format;
[0082] It is also used to call the third module of ISP to perform RGB processing or YUV processing on the data in RGB format, obtain data in YUV format, and output the photographed image.
[0083] In a possible implementation manner, the processing unit is further configured to:
[0084] In the thumbnail stream, calling the first ISP module to perform Bayer image regeneration processing on the first image data to obtain data in Bayer format;
[0085] Calling the second ISP module to perform demosaicing on the Bayer format data to obtain RGB format data;
[0086] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
[0087] In a possible implementation manner, the processing unit is further configured to:
[0088] In the preview path of the first mode, calling the first ISP module to perform mosaic processing on the first image data again to obtain third image data;
[0089] Calling the second ISP module to perform demosaicing on the third image data to obtain data in RGB format;
[0090] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a preview image.
[0091] In a possible implementation manner, the processing unit is further configured to:
[0092] When the zoom ratio is greater than a second ratio and the ambient illumination is less than the first brightness threshold, taking photos in a second mode, wherein the second ratio is less than the first ratio;
[0093] or,
[0094] When the zoom ratio is greater than a second ratio and less than the first ratio, and the ambient illumination is greater than or equal to a first brightness threshold, taking photos in a second mode;
[0095] In the second mode, the camera is used to output the collected image signal in a merging mode and output fourth image data, and the fourth image data is in the second image format.
[0096] In a possible implementation manner, the processing unit is further configured to:
[0097] In the preview path of the second mode, calling the ISP second module to perform demosaicing on the fourth image data to obtain data in RGB format;
[0098] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and the data in YUV format is cropped and up-sampled to output a preview image.
[0099] In a possible implementation manner, the fourth image data is stored in a first cache;
[0100] The input unit is used to receive a second operation of the user, where the second operation is used to trigger taking a photo.
[0101] The processing unit is further configured to: in response to the second operation, obtain the fourth image data from the first cache;
[0102] Calling a post-processing algorithm module or an ISP second module to perform image processing on the fourth image data to obtain fifth image data;
[0103] The post-processing algorithm module or the ISP third module is called to crop and up-sample the fifth image data, and output a photographed image.
[0104] In a possible implementation manner, the processing unit is further configured to:
[0105] In the thumbnail stream, calling the second ISP module to perform demosaicing on the data of the fourth image to obtain data in RGB format;
[0106] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and the data in YUV format is cropped and up-sampled to output a thumbnail.
[0107] In a possible implementation manner, the processing unit is further configured to:
[0108] When the zoom ratio is equal to the second ratio and the ambient illumination is greater than or equal to the first brightness threshold, taking photos in a third mode, wherein the second ratio is less than the first ratio;
[0109] Alternatively, when the zoom ratio is equal to the second ratio and the ambient illumination is less than the first brightness threshold, taking photos in a third mode;
[0110] In the third mode, the camera is used to output the collected image signal in a merging mode and output sixth image data, and the sixth image data is in the second image format.
[0111] In a possible implementation, the sixth image data is stored in a first cache, and the input unit is used to receive a third operation of a user, where the third operation is used to trigger taking a photo.
[0112] The processing unit is further configured to: in response to the third operation, obtain the sixth image data from the first cache;
[0113] Calling a post-processing algorithm module or an ISP second module to perform image processing on the sixth image data to obtain seventh image data;
[0114] The third ISP module is called to perform RGB processing or YUV processing on the seventh image data to obtain data in a YUV format and output a photographed image.
[0115] In the third mode, the quality of the photographed image can be improved through the above processing flow.
[0116] In a possible implementation manner, the processing unit is further configured to:
[0117] In the thumbnail stream, calling the second ISP module to perform demosaicing on the sixth image data to obtain data in RGB format;
[0118] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
[0119] In a possible implementation manner, the processing unit is further configured to:
[0120] In the preview path of the third mode, calling the second module of the ISP to perform demosaicing on the sixth image data to obtain data in RGB format;
[0121] The third module of ISP is called to perform RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a preview image.
[0122] According to a third aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program code. When the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect.
[0123] According to a fourth aspect, a computer program product is provided, the computer program product comprising: a computer program code, when the computer program code is executed by an electronic device, the electronic device executes any one of the methods according to the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0124] Figure 1 It is an example diagram of an application scenario of an embodiment of the present application;
[0125] Figure 2 is a schematic diagram of the processing mode of the embodiment of the present application under different zoom ratios and different ambient illuminations;
[0126] Figure 3 is a schematic block diagram of a photographing system according to an embodiment of the present application;
[0127] Figure 4 is a schematic flow chart of a photographing method according to an embodiment of the present application;
[0128] Figure 5 is a schematic block diagram of another photographing system according to an embodiment of the present application;
[0129] Figure 6 is a schematic flow chart of another photographing method according to an embodiment of the present application;
[0130] Figure 7 is a schematic block diagram of another photographing system according to an embodiment of the present application;
[0131] Figure 8 is a schematic flow chart of another photographing method according to an embodiment of the present application;
[0132] Fig. 9 It is a schematic diagram of an architecture of the application of the embodiment of the present application;
[0133] Fig.10 The present invention is a schematic diagram of the structure of an electronic device suitable for the present application. DETAILED DESCRIPTION
[0134] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0135] In the embodiments of the present application, unless otherwise specified, “plurality” may mean two or more than two.
[0136] The embodiments of the present application are applicable to electronic devices, which may be mobile phones, smart screens, tablet computers, wearable electronic devices, vehicle-mounted electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), projectors, and the like.
[0137] The electronic device in the embodiment of the present application is equipped with an image collector (such as a camera).
[0138] The embodiment of the present application does not impose any restriction on the specific type of the electronic device. The image processing method of the embodiment of the present application is described below by taking the electronic device being a mobile phone as an example.
[0139] The following combination Figure 1 Example description of the scenario in . Figure 1 This is an example diagram of an application scenario of an embodiment of the present application.
[0140] like Figure 1 In the mobile phone interface shown in (1), the interface can display multiple applications: application 1, application 2, ..., application 7 and the camera application. The user clicks the camera application and the mobile phone starts the camera. After the camera is running, the mobile phone interface displays the following Figure 1 The interface shown in (2) in the figure. This interface can be called the camera shooting interface. The shooting interface may include a viewfinder 11, a zoom ratio 12 (the default is 1x), an album icon 13, a shooting control 14, and a camera rotation control. The user clicks the shooting control 14 to take a photo. In this interface, the album icon 13 displays thumbnails. The camera rotation control can be used to switch cameras.
[0141] The viewfinder 11 is used to display the preview image during shooting in real time.
[0142] The phone supports digital zoom. When using the shooting function, users can select different zoom ratios by operating on the touch screen.
[0143] As an example, Figure 1 As shown in (2), the user clicks Figure 1 The zoom ratio of (2) is 12, and the interface is displayed as follows Figure 1 In the interface shown in (3), a zoom ratio selection item 15 appears (for example, the highest zoom ratio is 8x and the lowest zoom ratio is 1x). The user drags the zoom ratio 12 upward in the selection item 15 and releases the drag when the zoom ratio is 2x. The interface displays as follows: Figure 1 As shown in (4), the zoom ratio is selected as 2x. Of course, after the zoom ratio is selected, the zoom ratio selection item 15 can be hidden, that is, the selected zoom ratio displayed on the interface is 2x.
[0144] It should be understood that Figure 1 The shooting scene in the embodiment is only a schematic illustration of an application scenario of the present application, which does not constitute a limitation on the embodiments of the present application. In fact, the embodiments of the present application can also be applied to other scenes using cameras, such as recording scenes, video call scenes, video live broadcast scenes, etc.
[0145] It should also be understood that Figure 1 (2) in the figure shows an interface diagram of a user taking a photo in a vertical position of a mobile phone, but the present application is not limited thereto. For example, a user can take a photo in a horizontal position of a mobile phone.
[0146] It should also be understood that Figure 1 The upper and lower limits of the zoom ratio option 15 shown in (3) (i.e., the maximum zoom ratio and the minimum zoom ratio) may depend on the implementation of the mobile phone. Figure 1 The upper and lower limits shown in (3) are only examples, and the embodiments of the present application are not limited thereto.
[0147] It should also be understood that Figure 1 The position of the zoom ratio option 15 shown in (3) in the interface is only an example, and the embodiments of the present application are not limited to this.
[0148] In some embodiments, the camera of the mobile phone includes a Quadra Color Filter Array (Quadra CFA) sensor. The key components of the camera include an optical lens and an image sensor. After the camera is started, the sensor can output a picture based on the collected image signal. In the embodiment of the present application, the way in which the sensor outputs the picture depends on the zoom ratio and ambient illumination of the shooting scene.
[0149] It is understood that the embodiments of the present application do not specifically limit how to start the camera. Figure 1 As shown in (1), the user can launch the camera by clicking the camera application.
[0150] Currently, in high zoom ratio scenarios, sensors usually use binning mode to output images. A high zoom ratio refers to a zoom ratio that meets preset conditions.
[0151] The embodiment of the present application does not specifically limit the definition of a high zoom ratio. In one implementation, a zoom ratio greater than or equal to a zoom ratio threshold may be defined as a high zoom ratio. For example, a zoom ratio greater than or equal to 2x is defined as a high zoom ratio. In another implementation, a zoom ratio falling within a certain zoom ratio interval is defined as a high zoom ratio, etc. For example, a zoom ratio falling within 2x-8x is defined as a high zoom ratio.
[0152] The merge mode is to add the charges sensed by adjacent pixels together and read them out in a pixel mode. The image data output by the merge mode is in Bayer format (bayerraw). For example, in the merge mode, the sensor can sum and average the values of four pixels to obtain the value of one pixel and output it as the processed pixel value.
[0153] The advantage of the merge mode is that it can improve the signal-to-noise ratio in low-light environments and has better sensitivity. However, the merge mode is not suitable for high zoom ratio scenes. Using the merge mode to output images at high zoom ratios will lose image clarity and affect user experience.
[0154] The reason for the loss of clarity is that in the case of digital zoom, the original image (the original image here is the original image obtained by the sensor based on the merge mode) is usually cropped to achieve the change of the digital zoom field of view (FOV), and the above algorithm is used to restore the image resolution. However, for high zoom ratios, as the zoom ratio increases, the area cropped from the original image will become larger, and the loss of resolution or clarity of the original size image obtained by the upsampling algorithm will be more serious.
[0155] In view of this, the embodiments of the present application provide an image processing method and an electronic device. In the image processing method of the embodiments of the present application, in a high zoom ratio and high illumination scene, the sensor uses a non-merging mode and a cropping method to output the image, and the format of the image data is quadra raw data, and quadra raw is used for post-path image processing, which helps to improve the image clarity.
[0156] In addition, the embodiments of the present application design corresponding modes or shooting processes for shooting scenes with different zoom ratios and different ambient illuminations, give full play to the advantages of each component, thereby achieving the purpose of improving image quality in various scenes and enhancing user experience.
[0157] For ease of understanding, before introducing the photographing method of the embodiment of the present application, some terms involved in the embodiment of the present application are first explained.
[0158] Non-binning mode: In non-binning mode, the image is provided with the same resolution as the sensor. The sensor uses non-binning mode to output images, and its image format is quadra raw format, not bayerraw.
[0159] An image signal processor (ISP) is used to process the digital image signal collected by the camera to obtain an image that meets the human eye. The ISP may include multiple submodules, such as an ISP first module, an ISP second module, and an ISP third module.
[0160] To facilitate ISP processing, the quadra raw obtained in the non-merged mode needs to be converted into bayerraw.
[0161] Bayer image regeneration (Remosaic), by rearranging pixels, or in other words, swapping pixels, converts the data in the non-merged mode into standard Bayerraw. In the embodiment of the present application, the Remosaic process can be implemented by a post-processing algorithm module or an ISP first module.
[0162] Demosaic is used to convert Bayer format data into RGB format data. Demosaic can be understood as color interpolation processing, that is, restoring the real-world color that conforms to the color display device from the Bayer data obtained from the sensor.
[0163] Cropping, by cropping the captured image, obtain a view angle corresponding to the zoom factor. Cropping can be achieved through the crop function. For example, the crop function is used to obtain the view angle corresponding to 2x.
[0164] Upsampling means restoring the resolution of the feature map to the resolution of the original image. Upsampling can be achieved by scaling the image. For example, after obtaining the image at 2x, the scale function is used to scale the image at 2x so that the image size is the same as the image size at 1x.
[0165] Ambient illumination refers to the light intensity of the environment in which the user is shooting. The value of ambient illumination can be represented by the following indicators: lighting value (LV), illuminance (lux) or illuminance index value (luxindex), etc.
[0166] LV is used to estimate the ambient brightness, and its specific calculation formula is as follows:
[0167]
[0168] Among them, Exposure is the exposure time, Aperture is the aperture size, Iso is the sensitivity, and Luma is the average value of Y of the image in the XYZ color space.
[0169] In the embodiment of the present application, the format of the image data output in the non-merging mode is named as the first image format. For example, the first image format is quadra raw.
[0170] In the embodiment of the present application, the format of the image data output through the merging mode is named as the second image format. For example, the second image format is bayer raw.
[0171] When the camera is activated, the electronic device can obtain the zoom ratio in the current shooting environment (for example, the user can use Figure 1 The zoom ratio 12 in (2) selects the zoom ratio) and the ambient illumination. For different zoom ratios and different ambient illuminations, the embodiment of the present application provides corresponding processing solutions (for example, the first mode, the second mode, and the third mode). Figure 2 Give a description.
[0172] refer to Figure 2 , Figure 2 It is a schematic diagram of the processing modes corresponding to the embodiment of the present application under different zoom ratios and different ambient illuminations.
[0173] like Figure 2 As shown in the figure, the zoom ratio increases from left to right. Figure 2 In the embodiment, the zoom ratio interval is divided based on the first ratio and the second ratio. The first ratio is greater than the second ratio. The first ratio may be a zoom ratio greater than or equal to 2. For example, the first ratio is 2x and the second ratio is 1x. For another example, the first ratio is 4x and the second ratio is 1x.
[0174] like Figure 2 As shown in the figure, the ambient illumination increases from bottom to top. Figure 2 In the embodiment, the ambient illumination is divided into low illumination (or dark light environment) and high illumination (or bright light environment) based on the first brightness threshold.
[0175] For example, if the ambient illumination is greater than or equal to the first brightness threshold, it is a high illumination scene; if the ambient illumination is less than the first brightness threshold, it is a low illumination scene.
[0176] It should be understood that the situation where the ambient illumination is equal to the first brightness threshold is classified as a high illumination scene, but the embodiment of the present application is not limited thereto. For example, the situation where the ambient illumination is equal to the first brightness threshold can also be classified as a low illumination scene. The following is described with high illumination scenes and low illumination scenes.
[0177] As a possible implementation manner, the ambient illumination may be represented by LV, and accordingly, the first brightness threshold is a first LV value.
[0178] As a possible implementation, the ambient illuminance may be represented by luxindex, and accordingly, the first brightness threshold is the luxindex value, wherein the larger the luxindex value is, the lower the ambient illuminance is; and the smaller the luxindex value is, the higher the ambient illuminance is.
[0179] like Figure 2 As shown, when the zoom ratio is greater than or equal to the first ratio and the ambient illumination is high, the sensor processes the image signal based on the first mode. In the first mode, the sensor uses the non-merge + crop mode to output the image, or in other words, the sensor uses the non-merge mode to process the digital image signal and performs corresponding cropping processing based on the zoom ratio.
[0180] like Figure 2 As shown, when the zoom ratio is greater than the second ratio and less than the first ratio, and the ambient illumination is high, the image signal is processed based on the second mode. In the second mode, the sensor outputs the image in a merged mode.
[0181] like Figure 2 As shown, when the zoom ratio is greater than the second ratio and the ambient illumination is a low illumination scene, the image signal is processed based on the second mode.
[0182] like Figure 2 As shown, in a full illumination scene where the zoom ratio is equal to the second ratio, that is, whether it is a high illumination scene or a low illumination scene, the image signal is processed based on the third mode. In the third mode, the sensor uses the merge mode to output the image.
[0183] It should be noted that the sensor output methods of the second mode and the third mode are the same, both of which are merging modes. The difference lies in the processing of the back channel, which will be described in detail later when introducing the relevant processing flow.
[0184] It is understandable that, for the case where the zoom ratio is less than the second ratio, whether to use Figure 2The processing method of the zoom ratio equal to the second ratio shown in the figure may depend on the specific implementation of the product, and the embodiments of the present application do not specifically limit it. For example, when the zoom ratio selected by the user is greater than 0x and less than 1x, if the electronic device has an ultra-wide-angle camera, it can switch to the ultra-wide-angle camera for processing. For another example, when the zoom ratio selected by the user is greater than 0x and less than 1x, it is also possible not to switch the camera and use Figure 2 The processing method in which the zoom ratio shown is equal to the second ratio.
[0185] The following describes the selection under different zoom ratios and different ambient illumination. Figure 2 The technical effects of the corresponding modes shown in .
[0186] When the zoom ratio is greater than or equal to the first ratio, different modes are used under different ambient illuminations, including: (1) in high-illuminance scenes, image clarity is the priority factor, and using the first mode (the sensor uses the non-merged mode and cropped mode to output images) helps to improve image clarity; (2) in low-illuminance scenes, the signal-to-noise ratio is the priority factor, and using the second mode (the sensor uses the merged mode to output images) helps to improve the signal-to-noise ratio in low-light environments.
[0187] When the zoom ratio is greater than the second ratio and less than the first ratio, the second mode is used under different ambient illumination (the sensor uses the merged mode to output images), which helps to improve the signal-to-noise ratio.
[0188] When the zoom ratio is equal to the second ratio, the third mode is used under different ambient illumination (the sensor uses the merge mode to output images). This is because when the zoom ratio is the second ratio, the image resolution requirements can be met, so the signal-to-noise ratio factor needs to be given priority. The sensor uses the merge mode to output images to help improve the signal-to-noise ratio.
[0189] For scenes with high ambient illumination: (1) When the zoom ratio is greater than or equal to the first ratio, image clarity is the priority factor, and the first mode helps to improve image clarity; (2) When the zoom ratio is greater than the second ratio and less than the first ratio, the second mode (the sensor uses the merged mode to output the image) can be used to improve the signal-to-noise ratio; (3) In scenes where the zoom ratio is equal to the second ratio, there is no loss of clarity, so the third mode (the sensor uses the merged mode to output the image) can be used, which helps to save power consumption.
[0190] For low-light scenes, the sensor uses the merged mode to output images regardless of how the zoom ratio changes, ensuring the sensitivity in dark environments and helping to improve the signal-to-noise ratio.
[0191] In summary, under different digital zoom ratios and different ambient illumination scenarios, the embodiments of the present application design a suitable image output mode or photo-taking process to achieve the purpose of improving image quality.
[0192] Above Figure 2 The three modes mentioned in support the processing flow of preview stream, photo stream and thumbnail stream. Figure 3-Figure 8 The specific processing flow of the image signal in each mode is described in detail.
[0193] The following combination Figure 3 Describe the relevant design of the first mode. Figure 3 FIG. 3 is a schematic block diagram of a photographing system 300 according to an embodiment of the present application. Figure 3 As shown, the camera system 300 includes a decision module, an ISP parameter configuration module, a camera, a first cache, a first image processing module, an ISP first module, an ISP second module, and an ISP third module. The camera includes an optical lens and an image sensor.
[0194] It should be understood that the ISP first module, ISP second module and ISP third module involved in the preview stream, the ISP first module, ISP second module and ISP third module involved in the photo stream, and the ISP first module, ISP second module and ISP third module involved in the thumbnail stream may be partially or fully multiplexed, or may be independent of each other, and the embodiments of the present application are not limited to this.
[0195] For example, the preview stream corresponds to a set of ISP first module, ISP second module and ISP third module; the photo stream corresponds to a set of ISP first module, ISP second module and ISP third module; the thumbnail stream corresponds to a set of ISP first module, ISP second module and ISP third module. For another example, the preview stream, photo stream and thumbnail stream share the same set of ISP first module, ISP second module and ISP third module. For another example, the preview stream and the photo stream reuse the ISP first module, the preview stream corresponds to a set of ISP second module and ISP third module, the photo stream corresponds to a set of ISP second module and ISP third module, the thumbnail stream corresponds to a set of ISP second module and ISP third module, and so on.
[0196] It can be understood that the above descriptions about the ISP first module, the ISP second module and the ISP third module are only example descriptions, and the embodiments of the present application are not limited thereto.
[0197] It can also be understood that the above description of the ISP first module, the ISP second module and the ISP third module is for the following Figure 5 and Figure 7 Also applicable, will not be elaborated below.
[0198] The decision module is used to determine the parameter configuration of each module (including the camera, ISP first module, ISP second module, ISP third module and post-processing algorithm module) according to factors such as zoom ratio and ambient illumination. The relevant parameter configuration of each module can be sent to each module through the ISP parameter configuration module. In other words, the decision module controls or allocates the functions or effects of each module through the ISP parameter configuration module, for example, which ISP modules are enabled or disabled, how the ISP modules process image data, etc.
[0199] As a possible implementation, when the zoom ratio is greater than or equal to the first ratio and the ambient illumination is high, the decision module at least determines the following parameter configurations: the image output mode of the camera (or sensor) is a non-merging + cropping mode (or can also be expressed as Figure 3 The image processing of the ISP first module in the preview stream includes Remosaic processing, the image processing of the post-processing algorithm module or the ISP first module in the photo stream includes Remosaic processing, and the image processing of the ISP first module in the thumbnail stream includes Remosaic processing.
[0200] Optionally, the decision module may also configure other parameters of each ISP module, such as color, brightness effect, zoom ratio, etc., to control the ISP parameter configuration of each ISP module to be consistent.
[0201] In the first mode, the camera is used to collect image signals, and the collected image signals are processed by non-merging mode and cropping to output first image data. The first image data adopts a first image format. The first image format is quadra raw. In other words, the sensor uses a non-merging + cropping method to output images.
[0202] It should be noted that since the image output mode of the sensor here adopts the non-merge mode, compared with the merge mode, the image resolution (or clarity) will not be lost in the non-merge mode. At high zoom ratios (for example, the zoom ratio is greater than or equal to the first ratio), the image clarity must be prioritized. Therefore, it is more appropriate to use the non-merge mode to output images at high zoom ratios. In addition, after the image is output in the non-merge mode, it only needs to be cropped to obtain an image of the corresponding field of view angle at a high zoom ratio, without the need to upsample the image.
[0203] For example, assuming the resolution of the sensor is 50M (or 50 million pixels) and the zoom ratio is 2x, then after the sensor uses the non-merged mode to output the image, it needs to cut the field of view (FOV) by 2x to get a 12.5M image.
[0204] The first cache is used to store the first image data output by the camera, so that the data of the photographing frame can be obtained from the first cache immediately after the photographing command is triggered.
[0205] The first image processing module is used to process the image data of the photographing channel. The first image processing module includes a post-processing algorithm module, an ISP first module, an ISP second module and an ISP third module.
[0206] The post-processing algorithm module can be used to process the image offline in the camera mode to improve the image effect. For example, the post-processing algorithm module is used to perform one or more of the following processing on the image: multi-frame fusion noise reduction processing, multi-frame HDR processing, etc.
[0207] like Figure 3 As shown, in the first mode, for the preview stream, the data stream passes through the ISP first module, the ISP second module and the ISP third module. Among them, the ISP first module is used to perform Remosaic processing on the first image data. The ISP second module is used to perform Bayer domain processing and output RGB format data. The ISP third module is used to perform RGB domain or YUV domain processing and output YUV format data.
[0208] The following will describe the further processing functions that the ISP first module, ISP second module, and ISP third module can include. Here is a unified explanation. When the ISP first module, ISP second module, and ISP third module are enabled, the following description of the further processing functions of the ISP first module, ISP second module, and ISP third module is also applicable to other modes (the second mode and the third mode below) or other channels (photographing stream, thumbnail stream). Where the ISP first module, ISP second module, and ISP third module appear below, their further processing functions will not be repeated.
[0209] Optionally, the ISP first module also includes one or more of the following processing: binning, HDR fusion, etc.
[0210] Optionally, the ISP second module also includes one or more of the following processing: bad pixel correction (BPC), black level correction (BLC), lens shade correction (LSC), automatic white balance (AWB), Bayer domain noise reduction (NR), Demosaic, etc.
[0211] Optionally, the third module of ISP also includes one or more of the following processing: color correction (CC), YUV domain noise reduction NR, color enhancement (CE), sharpening, tone mapping, etc.
[0212] like Figure 3 As shown, in the first mode, for the photo stream, the data stream passes through the first cache and the first image processing module. There are also multiple ways for the internal data flow in the first image processing module. The embodiment of the present application does not specifically limit the processing of the first image data after it is sent to the first image processing module. Inside the first image processing module, the decision module can select which modules the data stream passes through, or which modules it does not pass through.
[0213] Figure 3 FIG. 2 shows two directions of data flow in the first image processing module. A possible implementation is as follows: Figure 3 As shown, after the first image data obtained from the first cache is sent to the first image processing module, it is first sent to the post-processing algorithm module, that is, it does not pass through the ISP first module, but the post-processing algorithm module performs remosaic processing on the first image data, and then passes through the ISP second module and the ISP third module. Among them, the ISP second module and the post-processing algorithm module are connected by a two-way arrow (i.e., two-way interaction); the ISP third module and the post-processing algorithm module are connected by a two-way arrow.
[0214] For example, after the first image data is remosaiced by the post-processing algorithm module, it can be sent to the ISP second module for processing. Then, after the processing by the ISP second module is completed, the image data can be returned to the post-processing algorithm module for processing, or it can be transmitted to the ISP third module for processing. Then, after the processing by the post-processing algorithm module is completed, it can be sent to the ISP third module for processing. Finally, after the processing by the ISP third module is completed, it is returned to the post-processing algorithm module for further processing, which helps to improve the image quality.
[0215] Since the noise model is not destroyed when the first image data (in the quadra raw format) is sent to the post-processing algorithm module, the post-processing algorithm module can perform noise reduction processing based on the first image data. In this way, a better noise reduction effect can be achieved through the noise modeling method. Compared with sending the first image data to the ISP or the camera for remosaic processing, this can achieve a better noise reduction effect, which is conducive to improving the clarity of the photographed image and improving the user's shooting experience.
[0216] Another possible implementation is Figure 3 As shown, after the first image data is sent to the first image processing module, it is first transmitted to the first ISP module. The first ISP module performs remosaic processing on the first image data; then, the image data processed by the first ISP module is sent to the post-processing algorithm module; after the post-processing algorithm module processes, the processed image data can be transmitted to the second ISP module, and after the processing by the second ISP module is completed, the image data can be returned to the post-processing algorithm module for processing, or transmitted to the third ISP module for processing; then, after the processing by the post-processing algorithm module is completed, the image data can be sent to the third ISP module for processing, and finally, after the processing by the third ISP module is completed, it is returned to the post-processing algorithm module for further processing, which helps to improve the image quality.
[0217] like Figure 3 As shown, in the first mode, for the thumbnail stream, the data stream passes through the first cache, the ISP first module, the ISP second module and the ISP third module. Among them, the ISP first module is used to perform Remosaic processing on the first image data, and the format of the obtained image data is Bayerraw. The image data in the bayerraw format obtained after processing by the ISP first module can be further processed by the ISP second module and the ISP third module. The ISP second module is used to perform Bayer domain processing and output data in RGB format. The ISP third module is used to perform processing in the RGB domain or the YUV domain and output data in the YUV format.
[0218] It should be noted that, since thumbnails must ensure the priority output speed, the thumbnail stream has lower image clarity requirements than the photo stream. Therefore, for the thumbnail stream, there is no need to process the image through the post-processing algorithm module.
[0219] The embodiment of the present application designs a processing flow of the back path for the first mode, specifically involving the preview stream, the photo stream, and the thumbnail stream. Figure 4 Describe the adoption Figure 3 The photographing process of the photographing system 300 is shown.
[0220] Figure 4FIG. 2 shows a schematic flow chart of a method for photographing in the first mode. Figure 4 As shown, the photographing method of the first mode includes the following steps:
[0221] Step 401 : For a collected image signal, first image data is obtained through a non-merging mode and cropping process, where the first image data adopts a first image format.
[0222] Specifically, the sensor outputs the collected image signal in a non-merged mode, and crops the image based on the quadra raw format (for example, through a crop function) to obtain a quadra raw image.
[0223] Step 402: after obtaining the first image data, the first image data is sent to a preview path, and at the same time, the first image data is stored in a first cache.
[0224] The first buffer is used to store the data of the photographing frame. After the photographing command is triggered, the data of the photographing frame can be obtained from the first buffer and returned to the user.
[0225] For example, the first buffer is the zero shutter lag (ZSL) buffer. The ZSL buffer is used to store the image data directly output by the sensor. In ZSL mode, when the photo command is issued, the system will select the image data of the corresponding frame from the ZSL buffer and send it to the photo stream and thumbnail stream for processing.
[0226] Step 403-1, remosaic processing is performed on the first image data through the ISP first module to obtain third image data, and the third image data is sent to the ISP second module. The third image data adopts the second image format (bayerraw).
[0227] That is to say, the image format output by the sensor is in quadra raw format, and after being processed by the first module of ISP, an image in bayerraw format is obtained.
[0228] Step 403 - 2 , performing demosaicing processing on the third image data through the second ISP module to obtain data in RGB format.
[0229] Step 403-3: Perform RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format and output a preview image.
[0230] The above steps 403-1 to 403-3 describe the workflow of the preview stream in the first mode. Through the above process, the image quality of the preview image can be improved.
[0231] Step 404: receiving a first operation of the user, where the first operation is used to trigger taking a photo.
[0232] The first operation is a photo taking command. The embodiment of the present application does not specifically limit the specific form of the first operation. For example, the first operation is to manually click the shooting control, or the first operation is to control the mobile phone to take a photo by voice, or the first operation is to start the photo taking function at a scheduled time (for example, automatically take a photo after 3 seconds). Figure 1 The operation of the shooting control 14 is shown in FIG.
[0233] Step 405: In response to the first operation, obtain first image data from a first cache.
[0234] After receiving the photographing command, it is necessary to retrieve the image frame corresponding to the photographing timestamp from the first cache, for example, the data of the image frame is the first image data.
[0235] Step 406-1: Perform remosaic processing on the first image data through a post-processing algorithm module to obtain second image data. The second image data adopts a second image format (bayerraw).
[0236] Step 406-2, performing demosaic processing on the second image data through the second ISP module to obtain data in RGB format;
[0237] Step 406-3, performing RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format and output a photographed image.
[0238] The above steps 404 to 406-3 describe the workflow of the photo stream in the first mode. In the processing of the photo channel, compared with sending the first image data to the ISP or the camera for remosaic processing, using the post-processing algorithm module to perform remosaic processing on the first image data can achieve a better noise reduction effect, which is conducive to improving the clarity of the photographed image.
[0239] In addition, in the photo-taking path, the Remosaic processing can also be performed by the ISP first module. Optionally, the above step 406-1 can also be replaced by: performing Remosaic processing on the first image data through the ISP first module to obtain second image data. The second image data adopts a second image format (bayerRaw). Correspondingly, steps 406-2 and 406-3 can also be adjusted accordingly. For example, step 406-2 is replaced by: performing image processing on the second image data through the post-processing algorithm module, and sending the image data processed by the post-processing algorithm module to the ISP second module for processing; step 406-3 is replaced by: processing the image data output by the ISP second module through the ISP third module, and outputting a photographed image. The specific processing method of the image data by the post-processing algorithm module, the ISP second module or the ISP third module is not limited, and reference can be made to the previous description.
[0240] Step 407 - 1 : In the thumbnail stream, the first image data is subjected to remosaic processing by the first ISP module to obtain data in the Bayer format.
[0241] Step 407-2, performing demosaicing processing on the Bayer format data through the second ISP module to obtain RGB format data;
[0242] Step 407 - 3 , performing RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format and output a thumbnail.
[0243] The above steps 404, 405, 407-1 to 407-3 describe the workflow of the thumbnail stream in the first mode. The above steps are helpful to improve the image quality of the thumbnail.
[0244] The following combination Figure 5 Describe the relevant design of the second mode. Figure 5 It is a schematic block diagram of a photographing system 500 according to an embodiment of the present application. Figure 5 The camera system 500 and Figure 3 The contents of the photographing system 300 in the second mode are the same. The modules included in the photographing system 500 are not described in detail here. The difference between the second mode and the first mode lies in at least the following aspects: on the one hand, the sensor outputs the image in a different way, specifically, in the second mode, the sensor outputs the image in a merged mode; on the other hand, in the second mode, the ISP third module or the post-processing algorithm module needs to perform cropping and upsampling based on the zoom ratio.
[0245] As a possible implementation method, in the following two situations: (1) the zoom ratio is greater than the second ratio and less than the first ratio, and the ambient illumination is high illumination; (2) the zoom ratio is greater than the second ratio, and the ambient illumination is low illumination, the decision module at least determines the following parameter configurations: the image output mode of the camera is a merge mode, the image processing of the third module of the ISP in the preview path includes cropping and upsampling, and the image processing of the post-processing algorithm module or the third module of the ISP in the photo taking path includes cropping and upsampling.
[0246] It should be noted that, in order to improve the signal-to-noise ratio (or ensure better sensitivity in low light), the sensor in the second mode uses the merge mode to output the image to obtain the fourth image data, and the fourth image data uses the second image format. The second image format is bayerraw. After obtaining the fourth image data, the fourth image data is sent to the preview path, and at the same time, the fourth image data is stored in the first cache. The description of the first cache can refer to the previous description, which is not repeated here.
[0247] For example, in low light conditions with a zoom ratio greater than 1x, in order to improve the signal-to-noise ratio, the sensor uses the merge mode to output the image and obtain the Bayer raw. In addition, the image needs to be cropped according to the zoom ratio to obtain the field of view corresponding to the zoom ratio. Finally, the size of the output image (preview image or photo image) should be consistent with the size of 1x, so the cropped image needs to be upsampled.
[0248] Similarly, the second mode also involves the processing flow of preview stream, photo stream and thumbnail stream. Figure 5 The data trend in is illustrated with an example.
[0249] Figure 5 The data direction of the preview stream is Figure 3 The data direction of the preview stream is the same as that of Figure 5 In the ISP, the first module does not need to process the image data obtained from the sensor, or the image data will be transmitted to the second module of the ISP after passing through the first module of the ISP; and the third module of the ISP is used to crop and upsample the image to ensure that the resolution of the preview image remains unchanged.
[0250] Figure 5 The data flow of the photo stream in Figure 3 The data flow of the photo stream is the same. Figure 5 and Figure 3 The first image processing module in includes the same modules. Similarly, Figure 5 There are also multiple ways for the internal data flow in the first image processing module. The difference between the two is at least that in Figure 5In the post-processing algorithm module or the third module of ISP, the processing includes cropping and upsampling to ensure that the resolution of the photographed image remains unchanged.
[0251] like Figure 5 As shown, in the second mode, for the thumbnail stream, the data stream passes through the first cache, the ISP second module and the ISP third module. The reason why the data stream does not need to pass through the ISP first module here is that the format of the image data obtained from the first cache is the second image format, namely Bayerraw, so there is no need for the ISP first module to process to obtain the Bayerraw image. In addition, the thumbnail stream here is processed offline, so the ISP second module and the ISP third module can be called to process the image. In addition, the ISP third module is used to crop and upsample the image to ensure that the resolution of the thumbnail image remains unchanged.
[0252] The present application embodiment designs a back-end processing flow for the second mode, specifically involving preview stream, photo stream, and thumbnail stream. Figure 6 Describe the adoption Figure 5 The photographing process of the photographing system 500 is shown.
[0253] Figure 6 FIG. 4 is a schematic flow chart of a photographing method in the second mode. Figure 6 As shown, the photographing method of the second mode includes the following steps:
[0254] Step 601: The collected image signal is processed in a merging mode to obtain fourth image data, wherein the fourth image data adopts a second image format, which is Bayerraw.
[0255] That is, the sensor uses the merge mode to output the bayerraw image, such as the fourth image data. The fourth image data can be sent to the preview path for processing, and can also be stored in the first cache for subsequent photo path call.
[0256] Step 602: after obtaining the fourth image data, send the fourth image data to a preview path, and store the fourth image data in a first cache.
[0257] The description of the first cache can be found in the previous text and will not be repeated here.
[0258] Step 603-1, performing demosaicing processing on the fourth image data through the second ISP module to obtain data in RGB format;
[0259] Step 603-2: Perform RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format, and perform cropping and up-sampling processing on the data in YUV format to output a preview image.
[0260] The above steps 603-1 to 603-2 describe the workflow of the preview stream in the second mode. Through the above steps, the quality of the preview image in the second mode can be improved.
[0261] Step 604: receiving a second operation of the user, where the second operation is used to trigger taking a photo.
[0262] The second operation is a photo taking command. The description of the second operation can refer to the description of the first operation above, and will not be repeated here.
[0263] Step 605: In response to the second operation, obtain fourth image data from the first cache.
[0264] Step 606-1, performing image processing on the fourth image data through a post-processing algorithm module or an ISP second module to obtain fifth image data.
[0265] For example, the fourth image data is processed in the Bayer domain by the post-processing algorithm module or the ISP second module to obtain data in RGB format. It can be understood that the post-processing algorithm module or the ISP second module can also perform other image processing, which is specifically described in the previous text and will not be repeated here.
[0266] Step 606-2: perform cropping and up-sampling processing on the fifth image data through a post-processing algorithm module or the third module of the ISP, and output a photographed image.
[0267] Optionally, the post-processing algorithm module or the ISP third module may also perform RGB domain or YUV domain processing on the fifth image data.
[0268] The above steps 604 to 606-2 describe the workflow of the photo taking flow in the second mode. Through the above steps, the quality of the photo taking images in the second mode can be improved.
[0269] Step 607-1, performing demosaic processing on the data of the fourth image through the second ISP module to obtain data in RGB format;
[0270] Step 607-2: Perform RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format, and perform cropping and up-sampling processing on the data in YUV format to output a thumbnail.
[0271] The above steps 607 - 1 to 607 - 2 describe the workflow of the thumbnail stream in the second mode. Through the above steps, the quality of the thumbnails in the second mode can be improved.
[0272] The following combination Figure 7 Describe the relevant design of the third mode. Figure 7 It is a schematic block diagram of a photographing system 700 according to an embodiment of the present application. Figure 7 The camera system 700 and Figure 5 The contents of the photographing system 500 in FIG. 7 are the same. The modules included in the photographing system 700 are not described in detail here. The difference between the third mode and the second mode is at least in the following aspects: in the third mode, the ISP third module or the post-processing algorithm module does not need to perform cropping and up-sampling processing based on the zoom ratio.
[0273] As a possible implementation, in all scenes (including high illumination scenes and low illumination scenes) where the zoom ratio is equal to the second ratio, the decision module at least determines the following parameter configuration: the image output mode of the camera is a merge mode.
[0274] like Figure 7 As shown, the sensor uses the merge mode to output the image to obtain the sixth image data, and the sixth image data uses the second image format (bayerraw). After obtaining the sixth image data, the sixth image data is sent to the preview path, and at the same time, the sixth image data is stored in the first cache. The description of the first cache can refer to the previous description, which is not repeated here.
[0275] For example, the second magnification is 1x. There is no loss of resolution in the 1x scene, so the resolution requirement of the image can be met and the clarity of the output image is guaranteed. In addition, since the merge mode can improve the image signal-to-noise ratio and improve the image effect in low-light scenes, the merge mode can be used to output the image in the 1x full scene, and the image has a better signal-to-noise ratio.
[0276] Similarly, the third mode also involves the processing flow of preview stream, photo stream and thumbnail stream. Figure 7 The data trend in is illustrated with an example.
[0277] Figure 7 The data direction of the preview stream is Figure 5 The data direction of the preview stream is the same as that of Figure 7 In the ISP third module, there is no need to crop and upsample the image.
[0278] Figure 7 The data flow of the photo stream in Figure 5 The data flow of the photo stream is the same. Figure 7 and Figure 5 The first image processing module in includes the same modules. Similarly, Figure 5 There are also multiple ways for the internal data flow in the first image processing module. The difference between the two is at least that in Figure 7 In the process, the post-processing algorithm module or the third module of ISP does not need to perform cropping and up-sampling on the image.
[0279] Figure 7 The data flow of thumbnail images in Figure 5 The thumbnail stream in follows the same direction. Figure 7 In the example, the data stream passes through the first cache, the second ISP module, and the third ISP module. The reason why the data stream does not need to pass through the first ISP module is that the format of the image data obtained from the first cache is the second image format, namely Bayerraw, so there is no need for the first ISP module to process it to obtain Bayerraw. In addition, the thumbnail stream here is processed offline, so the second ISP module and the third ISP module can be called to process the image. Moreover, the third ISP module does not need to crop and upsample the image.
[0280] The present application embodiment designs a post-path processing flow for the third mode, specifically involving preview stream, photo stream, and thumbnail stream. Figure 8 Describe the adoption Figure 7 The photo taking process of the photo taking system 700 is shown.
[0281] Figure 8 FIG. 4 shows a schematic flow chart of a photographing method in the third mode. Figure 8 As shown, the photographing method of the third mode includes the following steps:
[0282] Step 801: The collected image signal is processed in a merging mode to obtain sixth image data, wherein the sixth image data adopts a second image format, which is Bayerraw.
[0283] Step 802: after obtaining the sixth image data, sending the sixth image data to a preview path, and storing the sixth image data in a first cache.
[0284] Step 803-1, performing demosaic processing on the sixth image data through the second ISP module to obtain data in RGB format;
[0285] Step 803-2: Perform RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format and output a preview image.
[0286] The above steps 803 - 1 to 803 - 2 describe the workflow of the preview stream in the third mode. Through the above steps, the quality of the preview image in the third mode can be improved.
[0287] Step 804: receiving a third operation of the user, where the third operation is used to trigger taking a photo.
[0288] The third operation is a photo taking command. The description of the third operation can refer to the description of the first operation above, and will not be repeated here.
[0289] Step 805: In response to the third operation, obtain sixth image data from the first cache.
[0290] Step 806-1, performing image processing on the sixth image data through a post-processing algorithm module or an ISP second module to obtain seventh image data.
[0291] For example, the sixth image data is processed in the Bayer domain by the post-processing algorithm module or the ISP second module to obtain data in RGB format. It can be understood that the post-processing algorithm module or the ISP second module can also perform other image processing, which is specifically described in the previous text and will not be repeated here.
[0292] Step 806-2: Perform RGB processing or YUV processing on the seventh image data through the third ISP module to obtain data in YUV format and output a photographed image.
[0293] The above steps 804 to 808-2 describe the workflow of the photo taking flow in the third mode. Through the above steps, the quality of the photo taking images in the third mode can be improved.
[0294] Step 807-1, performing demosaic processing on the sixth image data through the second ISP module to obtain data in RGB format;
[0295] Step 807 - 2 , performing RGB processing or YUV processing on the data in RGB format through the third module of ISP to obtain data in YUV format and output a thumbnail.
[0296] The above steps 807 - 1 to 807 - 2 describe the workflow of the thumbnail stream in the third mode. Through the above steps, the quality of the thumbnails in the third mode can be improved.
[0297] In the above three modes, the sensor output mode may be a merge mode or a non-merge + crop mode. The conversion between sensor output modes does not require stopping the flow; and the size and bit width of the image input to the ISP module remain unchanged, so that the ISP hardware does not need to stop the flow, thereby achieving seamless switching between the three modes. Stopping the flow means that the ISP hardware stops the data flow and then restarts the data flow processing. Stopping the flow on the interface may cause the screen to appear black or white, or the screen to freeze, which is not good for the user experience, so it is necessary to avoid stopping the flow.
[0298] It is understandable that the above Figure 3 , Figure 5 and Figure 7 The photographing system shown in is merely an exemplary description, and the embodiments of the present application are not limited thereto.
[0299] It is also understandable that the above Figure 4 , Figure 6 and Figure 8 The process of the photographing method shown in is only an exemplary description and does not limit the protection scope of the embodiments of the present application.
[0300] The following combination Fig. 9 and Fig.10 Describe the software system and hardware architecture used in the embodiments of the present application.
[0301] Fig. 9 It is a schematic diagram of the architecture (including software system and some hardware) of the embodiment of the present application. Fig. 9 As shown, the application architecture is divided into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the application architecture can be divided into five layers, from top to bottom, namely, the application layer, the application framework layer, the hardware abstraction layer HAL, the driver layer, and the hardware layer.
[0302] like Fig. 9 As shown, the application layer includes the camera and the gallery. It can be understood that Fig. 9 The application layer may include other applications, which are not limited in this application. For example, the application layer may include information, alarm clock, weather, stopwatch, compass, timer, flashlight, calendar, Alipay and other applications.
[0303] like Fig. 9 As shown, the application framework layer includes a camera access interface. The camera access interface includes camera management and camera devices. The hardware abstraction layer includes a camera hardware abstraction layer and a camera algorithm library. Among them, the camera hardware abstraction layer includes multiple camera devices. The camera algorithm library includes a post-processing algorithm module and a decision module.
[0304] It should be understood that the decision module can also be placed in other layers. As a possible implementation, the decision module can be placed in the application layer or the application framework layer.
[0305] The driver layer is used to drive hardware resources. The driver layer can include multiple driver modules. Fig. 9 As shown, the driver layer includes camera device driver, digital signal processor driver and graphics processor driver, etc.
[0306] The hardware layer includes sensors, image signal processors, digital signal processors, and graphics processors. Among them, the bed includes multiple sensors, TOF cameras, and multi-spectral sensors. The image signal processor includes ISP module 1, ISP module 2, and ISP module 3.
[0307] For example, the user can click on the camera application. When the user clicks on the camera to take a photo, the photo taking instruction can be sent to the camera hardware abstraction layer through the camera access interface. The camera hardware abstraction layer calls the camera device driver and calls the camera algorithm library. The decision module in the camera algorithm library determines the photo taking mode (such as the first mode, the second mode or the third mode) according to the zoom ratio and the ambient light, and sends the configured parameters (including the sensor image output mode, the parameter configuration of each ISP module, and the parameter configuration of the post-processing algorithm module) to the camera hardware abstraction layer. The camera hardware abstraction layer sends the parameters configured by the decision module to the camera device driver. The camera device driver sends the configuration parameters sent by the camera hardware abstraction layer to the hardware layer, for example, sends the sensor image output mode to the sensor, and sends the parameter configuration of each ISP module to the image signal processor. The sensor outputs the image based on the sensor image output mode. The image signal processor performs corresponding processing based on the parameter configuration of each ISP module. The camera algorithm library is also used to send digital signals to the digital signal processor driver in the driver layer so that the digital signal processor driver calls the digital signal processor in the hardware layer for digital signal processing. The digital signal processor can return the processed digital signal to the camera algorithm library through the digital signal processor driver. The camera algorithm library is also used to send digital signals to the graphics processor driver in the driver layer so that the graphics processor driver calls the graphics processor in the hardware layer to process the digital signal. The graphics processor can return the processed graphic data to the camera algorithm library through the graphics processor driver.
[0308] In addition, the image output by the image signal processor can be sent to the camera device driver. The camera device driver can send the image output by the image signal processor to the camera hardware abstraction layer. The camera hardware abstraction layer can send the image to the post-processing algorithm module for further processing, or send the image to the camera access interface. The camera access interface can send the image returned by the camera hardware abstraction layer to the camera.
[0309] The above describes in detail the software system used in the embodiment of the present application. Fig.10 The hardware system of the electronic device 1000 is described.
[0310] Fig.10 A structural schematic diagram of an electronic device 1000 suitable for the present application is shown.
[0311] The electronic device 1000 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0312] It should be noted that Fig.10 The structure shown does not constitute a specific limitation on the electronic device 1000. In other embodiments of the present application, the electronic device 1000 may include Fig.10 The electronic device 1000 may include more or fewer components than those shown. Fig.10 A combination of some of the components shown, or the electronic device 1000 may include Fig.10 Subcomponents of some of the components shown. For example, Fig.10 The illustrated proximity light sensor 180G may be optional. Fig.10 The components shown may be implemented in hardware, software, or a combination of software and hardware.
[0313] The processor 110 may include one or more processing units. For example, the processor 110 may include at least one of the following processing units: an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and a neural-network processing unit (NPU). Different processing units may be independent devices or integrated devices.
[0314] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0315] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0316] In some embodiments, the processor 110 may include one or more interfaces. For example, the processor 110 may include at least one of the following interfaces: an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM interface, and a USB interface.
[0317] Fig.10The connection relationship between the modules shown is only a schematic illustration and does not constitute a limitation on the connection relationship between the modules of the electronic device 1000. Optionally, the modules of the electronic device 1000 may also adopt a combination of multiple connection modes in the above embodiments.
[0318] The charging management module 140 is used to receive power from the charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive current from the wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive electromagnetic waves through the wireless charging coil of the electronic device 1000 (the current path is shown as a dotted line). While the charging management module 140 is charging the battery 142, it can also power the electronic device 1000 through the power management module 141.
[0319] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the display screen 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, and battery health status (e.g., leakage, impedance). Optionally, the power management module 141 can be set in the processor 110, or the power management module 141 and the charging management module 140 can be set in the same device.
[0320] The wireless communication function of the electronic device 1000 can be implemented through components such as the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
[0321] The electronic device 1000 can realize the display function through the GPU, the display screen 194 and the application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs, which execute program instructions to generate or change display information.
[0322] The display screen 194 can be used to display images or videos. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a mini light-emitting diode (Mini LED), a micro light-emitting diode (Micro LED), a micro OLED (Micro OLED) or a quantum dot light emitting diode (QLED). In some embodiments, the electronic device 1000 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0323] The electronic device 1000 can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor.
[0324] 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 is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can perform algorithm optimization on the noise, brightness and color of the image. The ISP can also optimize the exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0325] The 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 to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard red green blue (RGB), YUV or other format. In some embodiments, the electronic device 1000 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0326] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 1000 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0327] Video codecs are used to compress or decompress digital videos. The electronic device 1000 may support one or more video codecs. Thus, the electronic device 1000 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0328] NPU is a processor that draws on the structure of biological neural networks, such as the transmission mode between neurons in the human brain to quickly process input information, and can also continuously self-learn. Through NPU, the electronic device 1000 can realize intelligent cognition and other functions, such as image recognition, face recognition, voice recognition and text understanding.
[0329] The electronic device 1000 can implement audio functions, such as music playing and recording, through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0330] The distance sensor 180F is used to measure the distance. The electronic device 1000 can measure the distance by infrared or laser. In some embodiments, for example, in a shooting scene, the electronic device 1000 can use the distance sensor 180F to measure the distance to achieve fast focusing.
[0331] The ambient light sensor 180L is used to sense the ambient light brightness. The electronic device 1000 can adaptively adjust the brightness of the display screen 194 according to the perceived ambient light brightness. 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 1000 is in a pocket to prevent accidental touches.
[0332] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 1000 can use the collected fingerprint characteristics to realize functions such as unlocking, accessing application locks, taking photos, and answering calls.
[0333] The touch sensor 180K is also called a touch control device. The touch sensor 180K can be set on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, which is also called a touch control screen. The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor 180K can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be set on the surface of the electronic device 1000 and set at a different position from the display screen 194.
[0334] The key 190 includes a power key and a volume key. The key 190 can be a mechanical key or a touch key. The electronic device 1000 can receive a key input signal and implement a function related to the case input signal.
[0335] Motor 191 can generate vibration. Motor 191 can be used for incoming call reminders and can also be used for touch feedback. Motor 191 can generate different vibration feedback effects for touch operations acting on different applications. Motor 191 can also generate different vibration feedback effects for touch operations acting on different areas of the display screen 194. Different application scenarios (for example, time reminders, receiving messages, alarm clocks, and games) can correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0336] In some embodiments, the processor 110 may start the camera; obtain the zoom ratio and the ambient illumination value in the current photographing environment; and determine a corresponding photographing process according to the zoom ratio and the ambient illumination value.
[0337] In one possible implementation, when the zoom ratio is greater than or equal to the first ratio and the ambient illumination value is greater than or equal to the first brightness threshold, the processor 110 controls the camera to take pictures in a first mode; in the first mode, the camera is used to process the collected image signal in a non-merging mode and a cropping mode, and output first image data, which uses a first image format.
[0338] It can be understood that the image processing method of the embodiment of the present application can be applied to Fig.10 In the electronic device shown in , the specific implementation steps can refer to the introduction of the method embodiment above, which will not be repeated here.
[0339] From the above, it can be seen that in high zoom ratio and high illumination scenes, the first mode is used to take pictures, and the non-merging mode and cropping method are used to output the image. The format of the image data is quadra raw, and quadra raw is used for post-path image processing, which helps to improve image clarity.
[0340] The present application also provides a computer program product, which, when executed by a processor, implements the method described in any method embodiment of the present application.
[0341] The computer program product can be stored in a memory, and is finally converted into an executable target file that can be executed by a processor after preprocessing, compiling, assembling and linking.
[0342] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a computer, the method described in any method embodiment of the present application is implemented. The computer program can be a high-level language program or an executable target program.
[0343] The computer-readable storage medium may be a volatile memory or a nonvolatile memory, or may include both a volatile memory and a nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DR RAM).
[0344] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described devices and equipment and the technical effects produced can refer to the corresponding processes and technical effects in the aforementioned method embodiments, and will not be repeated here.
[0345] In several embodiments provided in the present application, the disclosed systems, devices and methods can be implemented in other ways. For example, some features of the method embodiments described above can be ignored or not performed. The device embodiments described above are merely schematic, and the division of units is only a logical function division. There may be other division methods in actual implementation, and multiple units or components may be combined or integrated into another system. In addition, the coupling between the units or the coupling between the components may be direct coupling or indirect coupling, and the above coupling includes electrical, mechanical or other forms of connection.
[0346] It should be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0347] In addition, the terms "system" and "network" are often used interchangeably in this article. The term "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0348] In short, the above is only a preferred embodiment of the technical solution of this application, and is not intended to limit the protection scope of this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application should be included in the protection scope of this application.
Claims
1. An image processing method, It is characterized in that The method is applied to an electronic device, wherein the electronic device includes a camera, and the method includes: Starting the camera; Acquire a zoom factor and a first parameter, where the first parameter is used to characterize ambient illumination; When the zoom ratio is a second ratio, the camera outputs image data in a third mode during the process in which the first parameter increases from a first value to a second value; After the zoom ratio is switched from the second ratio to the first ratio, the camera switches to the first mode to output image data; In the process of the first parameter decreasing from the second value to the first value, the camera switches from the first mode to the second mode to output image data, and the first magnification is greater than the second magnification; The first value is less than a first threshold, the second value is greater than or equal to the first threshold, the second mode and the third mode are merged binning modes, and the first mode is different from the binning mode.
2. The method according to claim 1, It is characterized in that The first magnification is 2, and the second magnification is 1.
3. The method according to claim 1 or 2, It is characterized in that The method further comprises: The first parameter is a light intensity index value luxindex; a larger value of the luxindex indicates a lower ambient illumination.
4. The method according to any one of claims 1 to 3, It is characterized in that The camera outputs image data in the second mode or the third mode, specifically including: The charges induced by adjacent elements are added together and the image data is read out in a pixel mode.
5. The method according to any one of claims 1 to 4, It is characterized in that The size of the image data output by the camera in the first mode is smaller than the size of the camera resolution.
6. The method according to any one of claims 1 to 5, It is characterized in that In the first mode, the camera outputs first image data, the first image data adopts a first image format, and the first image format is a quadra raw format.
7. The method according to any one of claims 1 to 6, It is characterized in that The second image data is obtained through a post-processing algorithm module or an image signal processor ISP, and the second image data adopts a second image format, and the second image format is bayer raw.
8. The method according to any one of claims 1 to 7, It is characterized in that In the process of increasing the zoom ratio from the second ratio to the first ratio, the camera outputs image data in the second mode.
9. The method according to claim 1, It is characterized in that The method further comprises: In the thumbnail stream, the first image data is subjected to a Bayer image regeneration process by the first ISP module to obtain data in a Bayer format; Performing demosaic processing on the Bayer format data through the second ISP module to obtain RGB format data; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
10. The method according to claim 1 or 9, It is characterized in that The method further comprises: In the preview path of the first mode, the first image data is mosaicked again by the first ISP module to obtain third image data; Performing demosaic processing on the third image data through the second ISP module to obtain data in RGB format; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and outputs a preview image.
11. The method according to any one of claims 1 to 8, It is characterized in that The method further comprises: In the preview path of the second mode, a demosaic process is performed on the fourth image data by a second module of an image signal processor ISP to obtain data in an RGB format, wherein the fourth image data is data output by the camera in the second mode; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and performs cropping and up-sampling processing on the data in YUV format to output a preview image.
12. The method according to claim 11, It is characterized in that The fourth image data is stored in the first cache, and the method further includes: receiving a second operation of the user, where the second operation is used to trigger taking a photo; In response to the second operation, acquiring the fourth image data from the first cache; Performing image processing on the fourth image data by a post-processing algorithm module or an ISP second module to obtain fifth image data; The fifth image data is cropped and up-sampled by the post-processing algorithm module or the ISP third module to output a photographed image.
13. The method according to claim 12, It is characterized in that The method further comprises: In the thumbnail stream, the fourth image data is demosaiced by the second ISP module to obtain data in RGB format; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and performs cropping and up-sampling processing on the data in YUV format to output a thumbnail.
14. The method according to claim 1, It is characterized in that The sixth image data is the image data output by the camera in the third mode; The sixth image data is stored in the first cache, and the method further includes: receiving a third operation of the user, where the third operation is used to trigger taking a photo; In response to the third operation, acquiring the sixth image data from the first cache; Performing image processing on the sixth image data by a post-processing algorithm module or an ISP second module to obtain seventh image data; The seventh image data is subjected to RGB processing or YUV processing through the third ISP module to obtain data in YUV format and output a photographed image.
15. The method according to claim 14, It is characterized in that The method further comprises: In the thumbnail stream, the sixth image data is demosaiced by the second ISP module to obtain data in RGB format; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format and output a thumbnail.
16. The method according to claim 14, It is characterized in that The method further comprises: In the preview path of the third mode, demosaicing is performed on the sixth image data by the second ISP module to obtain data in RGB format; The ISP third module performs RGB processing or YUV processing on the data in RGB format to obtain data in YUV format, and outputs a preview image.
17. The method according to any one of claims 1 to 16, It is characterized in that The camera includes a quadrasensor.
18. An electronic device, It is characterized in that The electronic device comprises a processor and a memory, wherein the processor and the memory are coupled, and the memory is used to store a computer program. When the computer program is executed by the processor, the electronic device executes the method according to any one of claims 1 to 17.
19. A chip, It is characterized in that The chip includes a processor, and when the processor executes instructions, the processor performs the method according to any one of claims 1 to 17.
20. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 17.
21. A computer program product, It is characterized in that The invention comprises a computer program which, when being executed, causes a computer to execute the method according to any one of claims 1 to 17.
