Image processing method and device, storage medium and electronic equipment
By adopting the spatial alignment processing of the main camera and the secondary camera in the electronic device, and controlling the functional status of the camera according to the received instructions, the problem of insufficient stability when switching the camera is solved, and a more stable operation and a better user experience is achieved.
Patent Information
- Application Number
- CN202311239663.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-09-22
AI Technical Summary
Electronic devices lack stability when switching cameras to capture images, resulting in unstable operation.
When switching cameras, the spatial alignment process of the main camera and the secondary camera is adopted, and the state of the main camera and the secondary camera respectively control the state of these functions to be executed or maintained according to the received exposure mode and switching commands of the sensor zoom function.
Through spatial alignment processing and functional state control, the stability of electronic devices when switching cameras is improved, the brightness changes in preview images and the image quality declines are avoided, and the user experience is improved.
Smart Images

Figure CN119697487A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of image processing technology, and in particular relates to an image processing method, device, storage medium and electronic device. Background Art
[0002] With the development of technology, multiple cameras have become a standard configuration of electronic devices. During the shooting process, the electronic device can switch the currently used camera based on the changes in the current shooting scene, and use other functions to improve the shooting effect, so as to shoot images that satisfy the user. However, in the related art, the electronic device is not stable enough when switching cameras to shoot images. Summary of the invention
[0003] The embodiments of the present application provide an image processing method, device, storage medium and electronic device, which can improve the stability of the electronic device when switching cameras to capture images.
[0004] In a first aspect, an embodiment of the present application provides an image processing method, which is applied to an electronic device, wherein the electronic device includes a camera module, the camera module includes a first camera and a second camera, and the first camera and the second camera correspond to different zoom ratio ranges, and the method includes:
[0005] In the process of switching the first camera to the second camera, one of the first camera and the second camera is used as a main camera, and the other is used as a sub-camera, and spatial alignment processing is performed on images captured by the main camera and the sub-camera;
[0006] If an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction;
[0007] If a switching instruction of the working state of the sensor zoom function is received, it is determined that the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0008] If it is determined that the secondary camera needs to switch the working state of the sensor zoom function, controlling the secondary camera to switch the working state of the sensor zoom function;
[0009] If it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.
[0010] In a second aspect, an image processing device provided by an embodiment of the present application is applied to an electronic device, wherein the electronic device includes a camera module, the camera module includes a first camera and a second camera, the first camera and the second camera correspond to different zoom ratio ranges, and the device includes:
[0011] a processing module, configured to, in a process of switching from the first camera to the second camera, use one of the first camera and the second camera as a main camera and the other as a sub-camera, and perform spatial alignment processing on images captured by the main camera and the sub-camera;
[0012] A first control module, configured to control the main camera to execute the exposure mode switching instruction if an exposure mode switching instruction is received, and the auxiliary camera not to execute the exposure mode switching instruction;
[0013] a judgment module, configured to judge whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function if a switching instruction of the working state of the sensor zoom function is received;
[0014] A second control module is used for controlling the secondary camera to switch the working state of the sensor zoom function if it is determined that the secondary camera needs to switch the working state of the sensor zoom function;
[0015] The third control module is used to control the main camera to keep the sensor zoom function in the current working state if it is determined that the main camera needs to switch the working state of the sensor zoom function.
[0016] In a third aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the method provided by the embodiment of the present application.
[0017] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the processor is used to execute the method provided in the embodiment of the present application by calling a computer program stored in the memory.
[0018] In the process of switching the first camera to the second camera in the embodiment of the present application, one of the first camera and the second camera serves as the main camera and the other as the sub-camera, and spatial alignment processing needs to be performed on the images captured by the main camera and the sub-camera; if the brightness of the shooting scene changes greatly during the camera switching process, it will trigger the switching of the exposure mode; and as the zoom ratio is adjusted, it may also trigger the main camera or sub-camera to switch the working state of the sensor zoom function. Therefore, the embodiment of the present application takes into account that during the camera switching process, multiple functional programs may need to be executed concurrently, which may easily introduce control timing problems, resulting in unstable operation of the electronic device during the camera switching process. Therefore, in the embodiment of the present application, during the camera switching process, on the basis of performing spatial alignment processing on the images captured by the main camera and the secondary camera, if an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction. Since the images captured by the main camera and the secondary camera are fused during the spatial alignment processing, wherein the images captured by the main camera account for a larger proportion, the brightness of the fused image is relatively highly matched to the brightness of the current shooting scene. After the camera switching is completed, the brightness of the preview image changes slightly, and the user will not perceive a sudden change in the brightness of the preview image. Furthermore, by not executing the exposure mode switching instruction on the secondary camera, the functional programs that need to be executed concurrently in the process of switching the first camera to the second camera can be reduced, thereby reducing the complexity of timing control and improving the stability of the operation of the electronic device. In addition, the embodiment of the present application takes into account that the sensor zoom function will affect the quality of the camera output image, but during the camera switching process, the user's perception of the quality of the preview image is relatively unobvious. Therefore, if the embodiment of the present application determines that the secondary camera needs to switch the working state of the sensor zoom function, the secondary camera is controlled to switch the working state of the sensor zoom function; if it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.On the one hand, the secondary camera can switch the working state of the sensor zoom function as needed, improve the quality of the image output by the secondary camera, and relatively improve the quality of the preview image during the camera switching process. On the other hand, during the camera switching process, the main camera can execute the exposure mode switching instruction as needed, but does not need to switch the working state of the sensor zoom function, which simplifies the timing control of the main camera; the secondary camera can switch the working state of the sensor zoom function as needed, but does not need to execute the exposure mode switching instruction, which simplifies the timing control of the secondary camera, avoids the concurrency of switching the working state of the sensor zoom function and switching the exposure mode in the same camera, and reduces the functional programs that need to be executed, simplifies the timing control of the electronic device, and avoids the risk of bandwidth overlimit caused by the large amount of data that needs to be processed simultaneously due to the concurrent execution of multiple functional programs during the camera switching process, and avoids the generation of instantaneous high power consumption, so that when the electronic device switches the camera, it can take into account the stability of the operation of the two cameras and the presentation effect of the preview image, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The technical solution and beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.
[0020] Figure 1 This is a first flow chart of the image processing method provided in the embodiment of the present application.
[0021] Figure 2 This is a second flow chart of the image processing method provided in the embodiment of the present application.
[0022] Figure 3 A schematic diagram of the transfer of control rights among the spatial alignment processing module, exposure mode control module, and sensor zoom control module provided in an embodiment of the present application.
[0023] Figure 4 A first structural schematic diagram of an image processing device provided in an embodiment of the present application.
[0024] Figure 5 A second structural schematic diagram of the image processing device provided in an embodiment of the present application.
[0025] Figure 6 A first structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0026] Figure 7 It is another structural schematic diagram of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] Please refer to the drawings, where the same component symbols represent the same components. The principle of the present application is illustrated by implementing it in an appropriate computing environment. The following description is based on the illustrated specific embodiments of the present application, which should not be considered as limiting other specific embodiments of the present application that are not described in detail herein.
[0028] It is understandable that the execution subject of the embodiments of the present application may be an electronic device such as a smart phone or a tablet computer.
[0029] See also Figure 1 , Figure 1 1 is a schematic diagram of a first process flow of an image processing method provided in an embodiment of the present application. The process flow of the image processing method may include:
[0030] In 101, in the process of switching from the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and spatial alignment processing is performed on images captured by the main camera and the sub-camera.
[0031] With the development of technology, the image processing capabilities of electronic devices are getting stronger and stronger, and multiple cameras have become a standard configuration of electronic devices. The camera module of the electronic device can be equipped with at least a first camera and a second camera. For example, the electronic device can be equipped with at least two cameras selected from the group consisting of an ultra-wide-angle camera, a wide-angle camera, a telephoto camera, an ultra-sensitive camera, a periscope telephoto camera, a macro camera, etc.
[0032] The first camera and the second camera have different corresponding zoom ratio ranges. For example, the first camera corresponds to a first zoom ratio range, and the second camera corresponds to a second zoom ratio range. The first zoom range is different from the second zoom ratio range.
[0033] Exemplarily, the electronic device is in a shooting state, the current zoom ratio is in a first zoom ratio range, and the electronic device uses a first image captured by a first camera as a preview image, where the first camera can be any camera in a camera module of the electronic device. It should be noted that when the first camera is turned on, other cameras of the electronic device can be turned off or on.
[0034] In response to an adjustment instruction to adjust the current zoom ratio to the target zoom ratio, the first camera is triggered to switch to the second camera, the current zoom ratio is within the zoom ratio range of the first camera, and the target zoom ratio is within the zoom ratio range of the second camera. For example, when the user adjusts the zoom ratio, after the electronic device receives the adjustment instruction to adjust the current zoom ratio to the target zoom ratio, since the target zoom ratio is within the second zoom ratio range, during the zoom adjustment process, the electronic device can be triggered to switch from the first camera to the second camera to capture an image.
[0035] Exemplarily, the first camera of the camera module is an ultra-wide-angle camera, and the second camera is a wide-angle camera. The correspondence between the two cameras and the zoom ratio is, for example: ultra-wide-angle camera, [0.6x, 1x); wide-angle camera, [1x, 3x). When an adjustment instruction to adjust the zoom ratio from 0.6x to 2.5x is received, the electronic device is triggered to switch the ultra-wide-angle camera to the wide-angle camera to capture images.
[0036] In the process of switching the first camera to the second camera, that is, in the process of adjusting the zoom ratio to the target zoom ratio, one of the first camera and the second camera is used as the main camera and the other is used as the secondary camera. Specifically, when the adjusted zoom ratio is switched from the first zoom ratio to the second zoom ratio, the main camera is switched from the first camera to the second camera, and the secondary camera is switched from the second camera to the first camera. Exemplarily, the current zoom ratio is 0.6x, the target zoom ratio is 2.5x, and before the zoom ratio is adjusted from 0.6X to 1X, the zoom ratio is in the first zoom range [0.6x, 1x), the corresponding ultra-wide-angle camera is the main camera, and the wide-angle camera is the secondary camera; after the zoom ratio is adjusted to 1x, the zoom ratio is in the second zoom range [1x, 3x), the corresponding main camera is switched from the ultra-wide-angle camera to the wide-angle camera, and the secondary camera is switched from the wide-angle camera to the ultra-wide-angle camera.
[0037] In order to enable the electronic device to smoothly switch from the first camera to the second camera and avoid obvious changes in the displayed preview image, the electronic device will perform spatial alignment processing on the images captured by the main camera and the secondary camera during the process of switching from the first camera to the second camera. Specifically, the main camera and the secondary camera of the electronic device are both in the shooting state, and the images captured by the main camera and the secondary camera are aligned in perspective, and the images captured by the main camera and the secondary camera are fused, and the fused image is used as the preview image for transition display, so that the preview image will not have obvious mutations when the first camera and the second camera are switched, and the display effect is more natural.
[0038] In 102, if an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction;
[0039] In 103, if a switch instruction of the working state of the sensor zoom function is received, it is determined whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0040] In 104, if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the secondary camera is controlled to switch the working state of the sensor zoom function;
[0041] In 105 , if it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.
[0042] In the process of switching from the first camera to the second camera, the electronic device can continuously detect the change in brightness of the shooting scene. When the change in brightness of the shooting scene meets the exposure mode switching condition, it can also trigger the switching of the exposure mode, that is, receive the exposure mode switching instruction. Among them, the exposure modes are, for example: 1dol (single exposure), 2dol (long and short exposure), 3dol (long, medium and short exposure), etc., among which 1dol can output a single frame of images with different exposure times; 2dol and 3dol can "quasi-simultaneously" output multiple frames of images with different exposure times, and then fuse the multiple frames of images to obtain a high dynamic range (HDR) image. For example, when the brightness of the shooting scene becomes darker, the exposure mode can be triggered to switch from 1dol to 2dol, 3dol, etc., so that the dark scenes shot can retain more details and improve the quality of the shot images.
[0043] Furthermore, in the process of switching the first camera to the second camera, as the zoom ratio is continuously adjusted, when the adjusted zoom ratio meets the condition for switching the working state of the sensor zoom function, the working state of the sensor zoom function can also be triggered, that is, a switching instruction for the working state of the sensor zoom function will be received, and the working state can be, for example, an on state or an off state. Among them, the sensor zoom function is also the in sensor zoom function. Exemplarily, after receiving an adjustment instruction to adjust the zoom ratio from 0.6x to 2.5x, the zoom ratio is adjusted. When the adjusted zoom ratio is between [0.6x, 1x), the main camera is an ultra-wide-angle camera, and the secondary camera is a wide-angle camera. When the zoom ratio is adjusted to 1x, the main camera is switched to a wide-angle camera, and the secondary camera is an ultra-wide-angle camera. When the zoom ratio continues to be adjusted from 1x to 2x, the wide-angle camera can be triggered to turn on the in sensor zoom function. It is understandable that when the zoom ratio is 2.5x, if the in sensor zoom function of the wide-angle camera is not turned on, the wide-angle camera uses the binning mode to output the original image with a zoom ratio of 1x. The original image needs to be processed 2.5 times by the ISP module or other algorithm modules to output an image with a zoom ratio of 2.5x. When the in sensor zoom function of the wide-angle camera is turned on, the wide-angle camera can output an image with a zoom ratio of 2x. The ISP module only needs to process the image with a 2x perspective by 1.25 times to obtain the final image with a zoom ratio of 2.5x. Therefore, turning on the in sensor zoom function of the wide-angle camera can greatly improve the clarity of the image, especially when the zoom ratio is large, turning on the in sensor zoom function will have a more obvious effect on improving the clarity.
[0044] In the process of switching the first camera to the second camera, as the zoom ratio is adjusted, when the zoom ratio is switched from the first zoom ratio to the second zoom ratio after adjustment, the main camera needs to be switched from the first camera to the second camera, and the sub-camera needs to be switched from the second camera to the first camera. In order to smoothly switch the first camera to the second camera, the images collected by the main camera and the sub-camera need to be spatially aligned; and when the adjusted zoom ratio satisfies the main camera or the sub-camera to turn on or off the sensor zoom function, the main camera or the sub-camera can also be triggered to switch the working state of the sensor zoom function; in addition, the electronic device can also continuously detect the change value of the brightness of the shooting scene, and when the change value of the brightness of the shooting scene meets the exposure mode switching condition, the exposure mode switching can also be triggered. Therefore, in the process of switching cameras, the electronic device may need to execute more functional programs concurrently, and the control complexity is high. In addition, some cameras may not support the concurrent execution of the working states of switching the exposure mode and switching the sensor zoom function, so it is easy to introduce timing problems, resulting in unstable operation of the electronic device in the process of switching cameras.
[0045] The embodiment of the present application takes into account that the switching from the first camera to the second camera is triggered by the user's shooting operation. Therefore, in the process of switching from the first camera to the second camera, it is necessary to ensure that the images captured by the first camera and the second camera are spatially aligned to avoid sudden changes in the preset image; and the switching of the exposure mode can directly affect the brightness of the preview image. If the exposure mode is not switched during the switching from the first camera to the second camera, and the exposure mode is switched after the switching is completed, the user is likely to perceive the sudden change in brightness of the preview image, which is also likely to affect the user's experience. Therefore, in the embodiment of the present application, if an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction. It can be understood that when the images captured by the main camera and the secondary camera are spatially aligned, the images captured by the main camera and the secondary camera will be fused. Among them, the images captured by the main camera account for a larger proportion. Therefore, the brightness of the image after the fusion processing is relatively well matched with the brightness of the current shooting scene. After the camera switching is completed, the brightness of the preview image changes little, and the user will not perceive the sudden change in the brightness of the preview image. Moreover, the secondary camera does not execute the exposure mode switching instruction, which can reduce the functional programs that need to be executed concurrently in the process of switching the first camera to the second camera, thereby reducing the complexity of timing control and improving the stability of the operation of electronic equipment.
[0046] In addition, the embodiments of the present application take into account that the sensor zoom function is essentially an image magnification process, which will affect the quality of the image output by the camera. It is understandable that in the process of switching from the first camera to the second camera, the user's perception of the quality of the preview image is relatively unclear, and when switching the working state of the sensor zoom function, if the crop parameter or the 3A parameter is not switched in time, the frame image of the corresponding camera may also jump. Therefore, in the process of switching from the first camera to the second camera, in the embodiments of the present application, if it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state; if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the secondary camera is controlled to switch the working state of the sensor zoom function. On the one hand, the secondary camera can switch the working state of the sensor zoom function as needed to improve the quality of the image output by the secondary camera, and can relatively improve the quality of the preview image in the process of switching from the first camera to the second camera. On the other hand, in the process of switching from the first camera to the second camera, the main camera can execute the exposure mode switching instruction as needed, but does not need to switch the working state of the sensor zoom function, which simplifies the timing control of the main camera and avoids the impact of switching the working state of the sensor zoom function on the main camera. The secondary camera can switch the working state of the sensor zoom function as needed, but does not need to execute the exposure mode switching instruction, which also simplifies the timing control of the secondary camera.
[0047] Therefore, in the embodiment of the present application, in the process of switching cameras, the concurrency of switching the working state of the sensor zoom function and switching the exposure mode in the same camera is avoided, and the functional programs that need to be executed are reduced, simplifying the timing control of the electronic device, avoiding the risk of bandwidth overlimit due to the large amount of data that needs to be processed simultaneously due to the concurrent execution of multiple functional programs in the process of switching cameras, and avoiding the generation of instantaneous high power consumption, so that when the electronic device switches the camera, it can take into account the stability of the operation of the two cameras and the presentation effect of the preview image, thereby improving the user experience. In addition, even if some cameras do not support the concurrent execution of switching the exposure mode and switching the working state of the sensor zoom function, the image processing method of the embodiment of the present application can also be fully compatible.
[0048] It should be noted that, in the embodiment of the present application, the first camera and the second camera are two cameras of the electronic device with different zoom ratio ranges, and the image processing method of the embodiment of the present application can be applied to the first camera switching to the second camera, and can also be applied to the second camera switching to the first camera. In addition, step 102 and step 103 of the embodiment of the present application have no sequential relationship and can also occur simultaneously.
[0049] In one embodiment, after the first camera switches to the second camera, it is determined whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; if so, the second camera is controlled to switch the working state of the sensor zoom function.
[0050] That is, after the first camera is switched to the second camera, the second camera is in working state, and only the image captured by the second camera is used as the preview image. There is no need to perform spatial alignment processing on the images captured by the first camera and the second camera, and the functional programs required for concurrent control are relatively few. Therefore, after the first camera is switched to the second camera, it can be determined whether the second camera currently needs to switch the working state of the sensor zoom function. If so, the second camera is controlled to switch the working state of the sensor zoom function. Exemplarily, in the process of switching the ultra-wide-angle camera to the wide-angle camera, correspondingly, in the process of adjusting the zoom ratio from 0.6x to 2.5x, even if the zoom ratio is adjusted to greater than 2x, since the wide-angle camera is the main camera, the in sensor zoom function is not switched from the off state to the on state. However, after the ultra-wide-angle camera is switched to the wide-angle camera, the zoom ratio is switched to the target zoom ratio of 2.5x, and the insensor zoom function of the wide-angle camera is switched from the off state to the on state to improve the clarity of the image captured by the wide-angle camera.
[0051] In one embodiment, the exposure mode switching instruction includes a target exposure mode. After the first camera switches to the second camera, it is determined whether the second camera needs to switch the exposure mode based on the target exposure mode and the current exposure mode of the second camera; if so, the exposure mode of the second camera is switched to the target exposure mode.
[0052] That is, although the exposure mode switching instruction is executed on the main camera during the process of switching from the first camera to the second camera, since the main camera is switched from the first camera to the second camera during the camera switching process, when the exposure mode switching instruction is received, the first camera may be the main camera, and the exposure mode switching instruction is executed on the first camera, but the exposure mode switching instruction is not executed on the second camera. When the camera switching is completed, the second camera is in working state, and only the image captured by the second camera is used as the preview image. Therefore, it can be determined again whether the second camera needs to switch the exposure mode. If so, the exposure mode of the second camera is switched to the target exposure mode so that the image captured by the second camera can match the brightness of the shooting scene. For example, in the process of switching the ultra-wide-angle camera to the wide-angle camera, correspondingly, in the process of adjusting the zoom ratio from 0.6x to 2.5x, before the zoom ratio is adjusted from 0.6x to 1x, an exposure mode switching instruction is received, but because the ultra-wide-angle camera is the main camera at this time, the exposure mode switching instruction is executed on the ultra-wide-angle camera, but the exposure mode switching instruction is not executed on the wide-angle camera. However, after the ultra-wide-angle camera is switched to the wide-angle camera, it is determined again whether the current exposure mode of the wide-angle camera matches the target exposure mode. If there is a difference between the current exposure mode and the target exposure mode, for example, the current exposure mode of the wide-angle camera is 1dol and the target exposure mode is 2dol, then the exposure mode of the wide-angle camera can be adjusted to 2dol, so that the image captured by the wide-angle camera can provide more dynamic range and image details.
[0053] In one embodiment, the embodiment of the present application takes into account that when the adjusted zoom ratio is switched from the zoom ratio range of the first camera to the zoom ratio range of the second camera, the main camera is switched from the first camera to the second camera, and the sub-camera is switched from the second camera to the first camera; in order to avoid concurrent switching instructions for switching the exposure mode or switching the working state of the sensor zoom function when switching the main / sub-camera, it is arranged that after the main camera is switched from the first camera to the second camera and the sub-camera is switched from the second camera to the first camera, and after the first camera and the second camera capture a preset number of frames of images, the second camera is controlled to switch the exposure mode or switch the working state of the sensor zoom function, so as to further reduce the functional programs executed concurrently during the switching from the first camera to the second camera, thereby improving the stability of the electronic device.
[0054] In one embodiment, although the exposure mode switching instruction is not executed on the secondary camera during the process of switching from the first camera to the second camera, the secondary camera can adjust the exposure parameter value based on the current exposure mode and the brightness of the shooting scene. Exemplarily, the exposure time can be adjusted appropriately. For example, the secondary camera can maintain the exposure mode as 1dol mode, but can select long exposure or short exposure based on the 1dol mode. For high-brightness shooting scenes, if the main camera is short exposure, then the exposure time of the secondary camera can be appropriately increased, and long exposure can be selected. For darker shooting scenes, especially backlit shooting scenes, the exposure time of the main camera will increase, and the corresponding exposure time of the secondary camera can be reduced accordingly. Therefore, although the secondary camera does not switch the exposure mode, it can also cooperate with the main camera to achieve a display effect close to multi-dol.
[0055] See also Figure 2 , Figure 2 : is a second flow chart of the image processing method provided in the embodiment of the present application. The flow of the image processing method may include:
[0056] In 201, in the process of switching from the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and the spatial alignment processing module performs spatial alignment processing on the images captured by the main camera and the sub-camera.
[0057] The camera module of the electronic device can be equipped with at least a first camera and a second camera. For example, the electronic device can be equipped with at least two cameras selected from the group consisting of an ultra-wide-angle camera, a wide-angle camera, a telephoto camera, an ultra-sensitive camera, a periscope telephoto camera, a macro camera, and the like.
[0058] The first camera and the second camera have different corresponding zoom ratio ranges, for example, the first camera corresponds to a first zoom ratio range, the second camera corresponds to a second zoom ratio range, and the first zoom ratio range is different from the second zoom ratio range. Exemplarily, in response to an adjustment instruction to adjust the current zoom ratio to a target zoom ratio, the first camera is triggered to switch to the second camera, the current zoom ratio is within the zoom ratio range of the first camera, and the target zoom ratio is within the zoom ratio range of the second camera.
[0059] Exemplarily, the first camera of the camera module is an ultra-wide-angle camera, and the second camera is a wide-angle camera. The correspondence between the two cameras and the zoom ratio is: ultra-wide-angle camera, [0.6x, 1x); wide-angle camera, [1x, 3x). For example, when an adjustment instruction to adjust the zoom ratio from 0.6x to 2.5x is received, the electronic device is triggered to switch the ultra-wide-angle camera to the wide-angle camera to capture images. It should be noted that the camera module may also include a third camera, and the third camera is, for example, a telephoto camera. The correspondence between the telephoto camera and the zoom ratio is: telephoto camera, [3x, 10x). For example, when an adjustment instruction to adjust the zoom ratio from 1x to 5x is received, the electronic device is triggered to switch the wide-angle camera to the telephoto camera to capture images, or the camera module may be composed of four or more different cameras, and this application does not limit this.
[0060] In the process of switching the first camera to the second camera, that is, in the process of adjusting the zoom ratio to the target zoom ratio, one of the first camera and the second camera is used as the main camera and the other is used as the secondary camera. Specifically, when the adjusted zoom ratio is switched from the first zoom ratio to the second zoom ratio, the main camera is switched from the first camera to the second camera, and the secondary camera is switched from the second camera to the first camera. Exemplarily, the current zoom ratio is 0.6x, the target zoom ratio is 2.5x, and before the zoom ratio is adjusted from 0.6X to 1X, the zoom ratio is in the first zoom range [0.6x, 1x), the corresponding ultra-wide-angle camera is the main camera, and the wide-angle camera is the secondary camera; after the zoom ratio is adjusted to 1x, the zoom ratio is in the second zoom range [1x, 3x), the corresponding main camera is switched from the ultra-wide-angle camera to the wide-angle camera, and the secondary camera is switched from the wide-angle camera to the ultra-wide-angle camera.
[0061] Among them, the camera module also includes a spatial alignment processing module, an exposure mode control module and a sensor zoom control module. In order to enable the first camera of the electronic device to switch smoothly to the second camera and avoid obvious changes in the displayed preview image, in the process of switching the first camera to the second camera, the spatial alignment processing module will perform spatial alignment processing on the images captured by the main camera and the secondary camera. Specifically, the main camera and the secondary camera are both in the shooting state, and the spatial alignment processing module performs perspective alignment on the images captured by the main camera and the secondary camera, and performs fusion processing on the images captured by the main camera and the secondary camera, and uses the fused image as a preview image for transition display, so that the preview image will not have obvious mutations when the first camera and the second camera are switched, and the display effect is more natural.
[0062] In 202, if an exposure mode switching instruction is received, the spatial alignment processing module controls the exposure mode control module to execute the exposure mode switching instruction for the main camera, and does not execute the exposure mode switching instruction for the secondary camera;
[0063] In 203, if a switch instruction of the working state of the sensor zoom function is received, the spatial alignment processing module determines whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0064] In 204, if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to switch the working state of the sensor zoom function of the secondary camera;
[0065] In 205 , if it is determined that the main camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to keep the sensor zoom function of the main camera in the current working state.
[0066] The electronic device can continuously detect the change in brightness of the shooting scene, and when the change in brightness of the shooting scene meets the exposure mode switching condition, it can also trigger the exposure mode switching. Among them, the exposure modes are: 1dol (single exposure), 2dol (long-short exposure), 3dol (long-medium-short exposure), etc. Among them, 1dol can output a single frame of images with different exposure times; 2dol and 3dol can "quasi-simultaneously" output multiple frames of images with different exposure times, and then fuse the multiple frames of images to obtain a high dynamic range (HDR) image.
[0067] In related technologies, when the change in brightness of the shooting scene meets the exposure mode switching condition, the exposure mode control module of the camera module can receive an exposure mode switching instruction from an upper layer such as a processor, and the exposure mode control module controls the camera currently in working state to switch the exposure mode.
[0068] During the camera switching process, as the zoom ratio is continuously adjusted, if the adjusted zoom ratio meets the conditions for switching the working state of the sensor zoom function, the camera can be triggered to switch the working state of the sensor zoom function, and the working state can be, for example, an on state or an off state. Among them, the sensor zoom function is also the in sensor zoom function. In the related art, the sensor zoom control module determines whether the camera needs to switch the working state of the sensor zoom function, and if so, controls the camera to switch the working state of the sensor zoom function.
[0069] The embodiment of the present application takes into account that when the electronic device switches from the first camera to the second camera, it needs to execute more functional programs concurrently, and the control complexity is high, which easily introduces timing problems, resulting in unstable operation of the electronic device during the camera switching process. Therefore, in the process of camera switching, the embodiment of the present application performs spatial alignment processing on the images captured by the main camera and the secondary camera. If an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction.
[0070] It is understandable that the exposure mode control module cannot distinguish whether it is currently in the process of camera switching, nor can it distinguish the current main camera and the secondary camera. If the exposure mode switching instruction is received during the camera switching process, it can only control the main camera and the secondary camera to execute the exposure switching instruction at the same time. Therefore, in the embodiment of the present application, in the process of switching the first camera to the second camera, if the exposure mode switching instruction is received, the spatial alignment processing module controls the exposure mode control module to execute the exposure mode switching instruction for the main camera, and does not execute the exposure mode switching instruction for the secondary camera. That is, in the process of camera switching, if the exposure mode switching instruction is received, it is the spatial alignment processing module that decides whether the first camera or the second camera executes the exposure mode switching instruction. It is understandable that the spatial alignment processing module works in the process of switching from the first camera to the second camera. The spatial alignment processing module knows the current main camera and the secondary camera, so it can accurately control the exposure mode control module to only execute the exposure mode switching instruction for the main camera, and not execute the exposure mode switching instruction for the secondary camera.
[0071] Furthermore, in the embodiment of the present application, during the process of switching from the first camera to the second camera, if a switching instruction of the working state of the sensor zoom function is received, it is determined whether the main camera or the secondary camera needs to switch the working state of the sensor zoom function; if it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state; if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the secondary camera is controlled to switch the working state of the sensor zoom function.
[0072] It is understandable that the sensor zoom control module cannot distinguish whether the camera that currently needs to switch the sensor zoom function is the main camera or the secondary camera. Therefore, when receiving the switching instruction of the sensor zoom function, no matter whether the main camera or the secondary camera needs to switch the working state of the sensor zoom function, the working state of the sensor zoom function will be switched. It is understandable that in the process of switching the first camera to the second camera, the spatial alignment processing module knows the current main camera and the secondary camera, and the spatial alignment processing module can accurately determine whether the camera that currently needs to switch the sensor zoom function is the main camera or the secondary camera. If the spatial alignment processing module determines that the working state that currently needs to switch the sensor zoom function is the secondary camera, the spatial alignment processing module controls the sensor zoom control module to switch the working state of the sensor zoom function of the secondary camera. If the spatial alignment processing module determines that the working state that currently needs to switch the sensor zoom function is the main camera, the spatial alignment processing module controls the sensor zoom control module to keep the sensor zoom function of the main camera in the current working state.
[0073] Please refer to Figure 3 , Figure 3 A schematic diagram of the transfer of control rights of the spatial alignment processing module, exposure mode control module, and sensor zoom control module provided in the embodiment of the present application. In the process of switching from the first camera to the second camera, the spatial alignment processing module receives the exposure mode switching instruction and the working state switching instruction of the sensor zoom function issued by the upper layer such as the CPU, wherein the exposure switching instruction and the working state switching instruction of the sensor zoom function issued by the upper layer do not need to be targeted at a specific camera, but the spatial alignment processing module determines whether the first camera or the second camera executes the exposure switching instruction or the working state switching instruction of the sensor zoom function according to the distribution of the main camera or the auxiliary camera in the current camera switching process. Therefore, the image processing method of the embodiment of the present application can be decoupled from the upper layer such as the CPU, which is convenient for subsequent transplantation. After the first camera switches to the second camera, the spatial alignment processing module transfers the control right of exposure mode switching to the exposure mode control module, and transfers the control right of working state switching of the sensor zoom function to the sensor zoom control module, so that after the camera switching is completed, the exposure mode control module and the sensor zoom control module control the first camera or the second camera to execute the exposure switching instruction or the working state switching instruction of the sensor zoom function, so that the normal control of the exposure mode and the working state of the sensor zoom function is not affected by the decision of the spatial alignment processing module, which can better ensure the shooting effect when the camera is working normally and meet the user's usage needs.
[0074] In 206, the exposure mode switching instruction includes a target exposure mode. After the first camera is switched to the second camera, the exposure mode control module receives the target exposure mode sent by the spatial alignment processing module and the current exposure mode of the second camera.
[0075] In 207, the exposure mode control module determines whether the second camera needs to switch the exposure mode according to the target exposure mode and the current exposure mode of the second camera;
[0076] In 208 , if yes, the exposure mode control module switches the exposure mode of the second camera to the target exposure mode.
[0077] Although the spatial alignment processing module controls the exposure control module to execute the exposure mode switching instruction on the main camera during the process of switching from the first camera to the second camera, since the main camera is switched from the first camera to the second camera during the camera switching process, when the spatial alignment processing module receives the exposure mode switching instruction, the main camera may be the first camera, and the spatial alignment processing module controls the exposure control module to execute the exposure mode switching instruction on the first camera, but does not execute the exposure mode switching instruction on the second camera. When the camera switching is completed, the second camera is in a working state, and only the image captured by the second camera is used as a preview image. The spatial alignment processing module can return the control right of the exposure mode switching to the exposure mode control module. Specifically, the spatial alignment processing module can cache the exposure mode switching instruction received during the camera switching process, and send the target exposure mode included in the exposure mode switching instruction and the current exposure mode of the second camera to the exposure mode control module. The exposure mode control module determines whether the second camera needs to switch the exposure mode according to the target exposure mode and the current exposure mode of the second camera. If so, the exposure mode control module switches the exposure mode of the second camera to the target exposure mode. For example, in the process of switching the ultra-wide-angle camera to the wide-angle camera, correspondingly, in the process of adjusting the zoom ratio from 0.6x to 2.5x, before the zoom ratio is adjusted from 0.6x to 1x, the spatial alignment processing module receives an exposure mode switching instruction, but because the ultra-wide-angle camera is the main camera at this time, the spatial alignment processing module controls the exposure mode control module to execute the exposure mode switching instruction on the ultra-wide-angle camera, but does not execute the exposure mode switching instruction on the wide-angle camera. After the ultra-wide-angle camera is switched to the wide-angle camera, it can be understood that at this time, if the brightness change value of the shooting scene remains unchanged, the upper layer will no longer send the exposure mode switching instruction to the exposure mode control module. The QI processing module needs to send the target exposure mode in the exposure mode switching instruction and the current exposure mode of the wide-angle camera to the exposure mode control module. The exposure mode control module determines whether the current exposure mode of the wide-angle camera matches the target exposure mode based on the received target exposure mode and the current exposure mode of the wide-angle camera. If the current exposure mode is different from the target exposure mode, for example, the current exposure mode of the wide-angle camera is 1dol and the target exposure mode is 2dol, then the exposure mode of the wide-angle camera can be adjusted to 2dol, so that the image collected by the wide-angle camera can provide more dynamic range and image details, thereby realizing the inspection and update of the exposure mode of the wide-angle camera.
[0078] In 209, after the first camera is switched to the second camera, the sensor zoom control module receives the target zoom ratio and the current working state of the second camera sensor zoom function sent by the spatial alignment processing module;
[0079] In 210, the sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera;
[0080] In 211, if yes, the sensor zoom control module switches the working state of the sensor zoom function of the second camera.
[0081] After the first camera switches to the second camera, the second camera is in working state, and only the image captured by the second camera is used as a preview image for subsequent image shooting. The spatial alignment processing module can return the working state control right of the sensor zoom function to the sensor zoom control module. Specifically, the spatial alignment processing module can send the target zoom ratio and the current working state of the sensor zoom function of the second camera to the sensor zoom control module, and the sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; if so, the sensor zoom control module switches the working state of the sensor zoom function of the second camera. For example, in the process of switching the ultra-wide-angle camera to the wide-angle camera, correspondingly, in the process of adjusting the zoom ratio from 0.6x to 2.5x, even if the zoom ratio is adjusted to greater than 2x, since the wide-angle camera is the main camera, the spatial alignment processing module controls the sensor zoom control module not to switch the insensor zoom function from the off state to the on state. However, after the ultra-wide-angle camera is switched to the wide-angle camera, the zoom ratio is switched to the target zoom ratio of 2.5x, and the sensor zoom control module can switch the insensor zoom function of the wide-angle camera from the off state to the on state to improve the clarity of the image captured by the wide-angle camera, thereby realizing the inspection and update of the working status of the zoom function of the wide-angle camera sensor.
[0082] In one implementation, the embodiment of the present application takes into account that when the brightness change value of the shooting scene reaches a first preset threshold, or the change value of the exposure parameter such as the AE parameter reaches a second preset threshold, the exposure mode switching condition is met, and the exposure mode switching can be triggered. In order to avoid the concurrent execution of switching the working state of the sensor zoom function and switching the exposure mode, resulting in unstable operation of the electronic device, and because the switching of the exposure mode directly affects the brightness and darkness of the image, it is easier for the user to perceive. Therefore, in the embodiment of the present application, the priority of switching the exposure mode is set to be higher than the working state of switching the sensor zoom function. Specifically, the sensor zoom control module obtains the brightness change value and / or the exposure parameter change value of the shooting scene, and determines whether the brightness change value and / or the exposure parameter change value of the shooting scene reaches the exposure mode switching condition; if the exposure mode switching condition is met, the sensor zoom control module determines to keep the sensor zoom function of the second camera in the current working state; if the exposure mode switching condition is not met, the sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera.
[0083] That is, the sensor zoom control module determines that the brightness change value and / or the exposure parameter change value of the shooting scene reaches the exposure mode switching condition, and the exposure mode needs to be switched. The sensor zoom control module keeps the sensor zoom function of the second camera in the current working state. Specifically, if the sensor zoom function is in the on state, it is kept in the on state, and if the sensor zoom function is in the off state, it is kept in the off state until the exposure mode control module completes the switching of the exposure mode of the second camera. The sensor zoom control module determines that the brightness change value and / or the exposure parameter change value of the shooting scene do not reach the exposure mode switching condition, and the exposure mode does not need to be switched, and then it is normally determined whether the second camera needs to switch the working state of the sensor zoom function according to the needs. The embodiment of the present application not only takes the target zoom ratio and the current working state of the sensor zoom function of the second camera as input parameters, but also takes the brightness change value and / or the exposure parameter change value of the shooting scene as input parameters to determine whether to switch the working state of the sensor zoom function, so as to predict the occurrence of the exposure mode switching in advance, avoid the concurrent execution of switching the working state of the sensor zoom function and switching the exposure mode, and improve the stability of the operation of the electronic device.
[0084] See also Figure 4 and Figure 5 , Figure 4 A first structural diagram of an image processing device provided in an embodiment of the present application is shown in FIG. Figure 5The second structural diagram of the image processing device provided in the embodiment of the present application is as follows: The image processing device 300 may include: a processing module 301 , a first control module 302 , a second control module 303 , and a third control module 304 .
[0085] The processing module 301 is used to: in the process of switching from the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and spatial alignment processing is performed on the images collected by the main camera and the sub-camera;
[0086] The first control module 302 is used to: if an exposure mode switching instruction is received, control the main camera to execute the exposure mode switching instruction, and the auxiliary camera does not execute the exposure mode switching instruction;
[0087] The judgment module 303 is used to: if a switching instruction of the working state of the sensor zoom function is received, determine whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0088] The second control module 304 is used to: if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, control the secondary camera to switch the working state of the sensor zoom function;
[0089] The third control module 305 is used to: if it is determined that the main camera needs to switch the working state of the sensor zoom function, control the main camera to keep the sensor zoom function in the current working state
[0090] In one embodiment, the image processing device 300 also includes a receiving module 306, which is used to: in response to an adjustment instruction to adjust the current zoom ratio to a target zoom ratio, trigger switching the first camera to the second camera, the current zoom ratio is within the zoom ratio range of the first camera, and the target zoom ratio is within the zoom ratio range of the second camera.
[0091] In one embodiment, the third control module 305 can be used to: after the first camera switches to the second camera, determine whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; if so, control the second camera to switch the working state of the sensor zoom function.
[0092] In one embodiment, the camera module also includes a spatial alignment processing module, an exposure mode control module and a sensor zoom control module. The spatial alignment processing module includes a processing module 301 and a judgment module 303. The first control module 302 includes an exposure mode control module. The second control module 304 and the third control module 305 include a sensor zoom control module. In the process of switching the first camera to the second camera, one of the first camera and the second camera serves as a main camera and the other serves as a secondary camera. The spatial alignment processing module performs spatial alignment processing on the images captured by the main camera and the secondary camera. If an exposure mode switching instruction is received, the exposure mode control module receives the control instruction of the spatial alignment processing module to control the main camera to execute the exposure mode switching instruction, and does not execute the exposure mode switching instruction for the secondary camera. If a switching instruction of the working state of the sensor zoom function is received, the spatial alignment processing module determines whether the main camera or the secondary camera needs to switch the working state of the sensor zoom function; if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the sensor zoom control module receives the control instruction controlled by the spatial alignment processing module, and switches the working state of the sensor zoom function of the secondary camera; if it is determined that the main camera needs to switch the working state of the sensor zoom function, the sensor zoom control module receives the control instruction controlled by the spatial alignment processing module, and keeps the sensor zoom function of the main camera in the current working state.
[0093] In one embodiment, the exposure mode switching instruction includes a target exposure mode. After the first camera switches to the second camera, the exposure mode control module receives the target exposure mode sent by the spatial alignment processing module and the current exposure mode of the second camera; the exposure mode control module determines whether the second camera needs to switch the exposure mode based on the target exposure mode and the current exposure mode of the second camera; if so, the exposure mode control module switches the exposure mode of the second camera to the target exposure mode.
[0094] In one embodiment, after the first camera switches to the second camera, the sensor zoom control module receives the target zoom ratio and the current working status of the sensor zoom function of the second camera sent by the spatial alignment processing module; the sensor zoom control module determines whether the second camera needs to switch the working status of the sensor zoom function according to the target zoom ratio and the current working status of the sensor zoom function of the second camera; if so, the sensor zoom control module switches the working status of the sensor zoom function of the second camera.
[0095] In one embodiment, the sensor zoom control module obtains the brightness change value and / or the exposure parameter change value of the shooting scene, and determines whether the brightness change value and / or the exposure parameter change value of the shooting scene reaches the exposure mode switching condition; if the exposure mode switching condition is reached, the sensor zoom control module determines to keep the sensor zoom function of the second camera in the current working state; if the exposure mode switching condition is not reached, the sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera.
[0096] For example, the electronic device may be a mobile terminal such as a tablet computer or a smart phone. Figure 6 , Figure 6 A first structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0097] The electronic device 400 may include components such as a memory 401, a processor 402, and a camera module 403. Those skilled in the art will appreciate that Figure 6 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0098] The memory 401 may be used to store applications and data. The applications stored in the memory 401 include executable codes. The applications may be composed of various functional modules. The processor 402 executes various functional applications and data processing by running the applications stored in the memory 401.
[0099] The processor 402 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing applications stored in the memory 401 and calling data stored in the memory 401, thereby monitoring the electronic device as a whole.
[0100] Camera module 403, camera module 403 includes a first camera and a second camera. The first camera and the second camera can be used for video recording and image acquisition. After the image is acquired by the lens, the photosensitive component circuit and the control component in the camera process the image, and then the image is restored by software. The image can be seen through the display screen. The zoom ratio of the first camera and the second camera can be different.
[0101] In this embodiment, the processor 402 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 401 according to the following instructions, and the processor 402 will run the application program stored in the memory 401 to execute:
[0102] In the process of switching from the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and spatial alignment processing is performed on images captured by the main camera and the sub-camera;
[0103] If an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction;
[0104] If a switch instruction of the working state of the sensor zoom function is received, it is determined whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0105] If it is determined that the secondary camera needs to switch the working state of the sensor zoom function, control the secondary camera to switch the working state of the sensor zoom function;
[0106] If it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.
[0107] See also Figure 7 , Figure 7 It is another structural diagram of an electronic device provided in an embodiment of the present application. The electronic device 400 may also include components such as a display screen 404, a control circuit 405, an input unit 406, an audio circuit 407, a sensor 408, and a power supply 409.
[0108] The display screen 404 may be used to display information input by a user or information provided to a user and various graphical user interfaces of the electronic device. These graphical user interfaces may be composed of images, texts, icons, videos and any combination thereof.
[0109] The control circuit 405 is electrically connected to the display screen 404 and is used to control the display screen 404 to display information.
[0110] The input unit 406 can be used to receive input numbers, character information or user feature information (such as fingerprints), and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. The input unit 406 can include a fingerprint recognition module.
[0111] The audio circuit 407 can provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 407 includes a microphone. The microphone is electrically connected to the processor 402. The microphone is used to receive voice information input by the user.
[0112] The sensor 408 is used to collect external environment information. The sensor 409 may include one or more sensors such as an environment brightness sensor, an acceleration sensor, and a gyroscope.
[0113] The power supply 409 is used to supply power to various components of the electronic device 400. In some embodiments, the power supply 409 may be logically connected to the processor 402 through a power management system, so that the power management system can manage charging, discharging, power consumption, and other functions.
[0114] In this embodiment, the processor 402 in the electronic device will load the executable code corresponding to the process of one or more application programs into the memory 401 according to the following instructions, and the processor 402 will run the application program stored in the memory 401 to execute:
[0115] In the process of switching from the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and spatial alignment processing is performed on images captured by the main camera and the sub-camera;
[0116] If an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction;
[0117] If a switch instruction of the working state of the sensor zoom function is received, it is determined whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function;
[0118] If it is determined that the secondary camera needs to switch the working state of the sensor zoom function, control the secondary camera to switch the working state of the sensor zoom function;
[0119] If it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.
[0120] In one embodiment, during the process of switching the first camera to the second camera, one of the first camera and the second camera serves as a main camera and the other serves as a sub-camera, and before spatial alignment processing is performed on the images captured by the main camera and the sub-camera, the processor 402 also executes an adjustment instruction in response to adjusting the current zoom ratio to the target zoom ratio, triggering the switching of the first camera to the second camera, the current zoom ratio is within the zoom ratio range of the first camera, and the target zoom ratio is within the zoom ratio range of the second camera.
[0121] In one embodiment, after controlling the main camera to keep the sensor zoom function in the current working state, the processor 402 also executes, after the first camera switches to the second camera, judging whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; if so, controlling the second camera to switch the working state of the sensor zoom function.
[0122] In one embodiment, the camera module 403 also includes a spatial alignment processing module, an exposure mode control module and a sensor zoom control module. Specifically, the processor 402 also executes, in the process of switching the first camera to the second camera, one of the first camera and the second camera as a main camera, and the other as a sub-camera, so that the spatial alignment processing module performs spatial alignment processing on the images captured by the main camera and the sub-camera; sends an exposure mode switching instruction to the spatial alignment processing module, so that after the spatial alignment processing module receives the exposure mode switching instruction, it controls the exposure mode control module to execute the exposure mode switching instruction on the main camera, and does not execute the exposure mode switching instruction on the sub-camera. Switching instruction; it is also used to send a switching instruction of the working state of the sensor zoom function to the spatial alignment processing module, so that after the spatial alignment processing module receives the switching instruction of the working state of the sensor zoom function, it determines whether the main camera or the secondary camera needs to switch the working state of the sensor zoom function; if it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to switch the working state of the sensor zoom function of the secondary camera; if it is determined that the main camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to keep the sensor zoom function of the main camera in the current working state.
[0123] In the above embodiments, the description of each embodiment has its own emphasis. For the part that is not described in detail in a certain embodiment, please refer to the detailed description of the image processing method above, and will not be repeated here.
[0124] The device control device provided in the embodiment of the present application belongs to the same concept as the image processing method in the above embodiment. Any method provided in the image processing method embodiment can be run on the device control device. The specific implementation process is detailed in the image processing method embodiment and will not be repeated here.
[0125] It should be noted that, for the image processing method of the embodiment of the present application, a person skilled in the art can understand that all or part of the process of implementing the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as a memory, and executed by at least one processor, and the execution process may include the process of the embodiment of the image processing method. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), etc.
[0126] For the device control device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.
[0127] The image processing method, device, storage medium and electronic device provided in the embodiments of the present application are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An image processing method, characterized in that: Applied to an electronic device, the electronic device includes a camera module, the camera module includes a first camera and a second camera, the first camera and the second camera correspond to different zoom ratio ranges, and the method includes: In the process of switching the first camera to the second camera, one of the first camera and the second camera is used as a main camera, and the other is used as a sub-camera, and spatial alignment processing is performed on images captured by the main camera and the sub-camera; If an exposure mode switching instruction is received, the main camera is controlled to execute the exposure mode switching instruction, and the secondary camera does not execute the exposure mode switching instruction; If a switching instruction of the working state of the sensor zoom function is received, it is determined that the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function; If it is determined that the secondary camera needs to switch the working state of the sensor zoom function, controlling the secondary camera to switch the working state of the sensor zoom function; If it is determined that the main camera needs to switch the working state of the sensor zoom function, the main camera is controlled to keep the sensor zoom function in the current working state.
2. The image processing method according to claim 1, characterized in that: In the process of switching the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a sub-camera, and before performing spatial alignment processing on the images captured by the main camera and the sub-camera, the method further includes: In response to an adjustment instruction to adjust the current zoom ratio to a target zoom ratio, triggering switching of the first camera to the second camera, the current zoom ratio is within the zoom ratio range of the first camera, and the target zoom ratio is within the zoom ratio range of the second camera.
3. The image processing method according to claim 2, characterized in that: After controlling the main camera to keep the sensor zoom function in a current working state, the method further includes: After the first camera is switched to the second camera, judging whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; If so, control the second camera to switch the working state of the sensor zoom function.
4. The image processing method according to claim 1, characterized in that: The camera module further includes a space alignment processing module, an exposure mode control module and a sensor zoom control module, and the method further includes: In the process of switching the first camera to the second camera, one of the first camera and the second camera is used as a main camera and the other is used as a secondary camera, and the spatial alignment processing module performs spatial alignment processing on the images captured by the main camera and the secondary camera; If an exposure mode switching instruction is received, the spatial alignment processing module controls the exposure mode control module to execute the exposure mode switching instruction for the main camera, and does not execute the exposure mode switching instruction for the secondary camera; If a switching instruction of the working state of the sensor zoom function is received, the spatial alignment processing module determines whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function; If it is determined that the secondary camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to switch the working state of the sensor zoom function of the secondary camera; If it is determined that the main camera needs to switch the working state of the sensor zoom function, the spatial alignment processing module controls the sensor zoom control module to keep the sensor zoom function of the main camera in the current working state.
5. The image processing method according to claim 4, characterized in that: The exposure mode switching instruction includes a target exposure mode, and the method further includes: After the first camera switches to the second camera, the exposure mode control module receives the target exposure mode sent by the spatial alignment processing module and the current exposure mode of the second camera; The exposure mode control module determines whether the second camera needs to switch the exposure mode according to the target exposure mode and the current exposure mode of the second camera; If so, the exposure mode control module switches the exposure mode of the second camera to the target exposure mode.
6. The image processing method according to claim 4, characterized in that: The method further comprises: After the first camera is switched to the second camera, the sensor zoom control module receives the target zoom ratio and the current working state of the second camera sensor zoom function sent by the space alignment processing module; The sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera; If so, the sensor zoom control module switches the working state of the sensor zoom function of the second camera.
7. The image processing method according to claim 6, characterized in that: The sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera, including: The sensor zoom control module obtains a brightness change value and / or an exposure parameter change value of a shooting scene, and determines whether the brightness change value and / or the exposure parameter change value of the shooting scene reaches an exposure mode switching condition; If the exposure mode switching condition is met, the sensor zoom control module determines to keep the sensor zoom function of the second camera in the current working state; If the exposure mode switching condition is not met, the sensor zoom control module determines whether the second camera needs to switch the working state of the sensor zoom function according to the target zoom ratio and the current working state of the sensor zoom function of the second camera.
8. An image processing device, characterized in that: Applied to an electronic device, the electronic device includes a camera module, the camera module includes a first camera and a second camera, the first camera and the second camera have different zoom ratio ranges, and the device includes: a processing module, configured to, in a process of switching from the first camera to the second camera, use one of the first camera and the second camera as a main camera and the other as a sub-camera, and perform spatial alignment processing on images captured by the main camera and the sub-camera; A first control module, configured to control the main camera to execute the exposure mode switching instruction if an exposure mode switching instruction is received, and the auxiliary camera not to execute the exposure mode switching instruction; a judgment module, configured to judge whether the main camera or the auxiliary camera needs to switch the working state of the sensor zoom function if a switching instruction of the working state of the sensor zoom function is received; A second control module is used for controlling the secondary camera to switch the working state of the sensor zoom function if it is determined that the secondary camera needs to switch the working state of the sensor zoom function; The third control module is used to control the main camera to keep the sensor zoom function in the current working state if it is determined that the main camera needs to switch the working state of the sensor zoom function.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.
10. An electronic device, comprising a memory, a processor and a camera module, characterized in that: The processor is configured to execute the method according to any one of claims 1 to 7 by calling the computer program stored in the memory.
Citation Information
Patent Citations
Camera switching method and device, electronic equipment and storage medium
CN112995511A
Electronic equipment and method and device for processing image data
CN116582748A
Zoom blurred image acquiring method and device based on terminal device
WO2021073331A1