Image processing method, device, equipment and storage medium
By adjusting the color texture of the second preview image, the difference between the color texture of the first preview image is smaller than the set threshold, the problem of color jump in the preview image when switching the camera of the mobile terminal is solved, and the shooting experience is improved.
Patent Information
- Application Number
- CN202111371837.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-18
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2041-11-18
AI Technical Summary
When switching the camera on the mobile terminal, the preview image will have a color jump.
The second preview image captured by the second camera is acquired by displaying the first preview image captured by the first camera of the at least two cameras and obtaining the second preview image captured by the second camera in response to the zoom operation. According to the color texture of the first preview image, the color texture of the second preview image is adjusted so that the difference between the color texture of the first preview image is smaller than the set threshold.
It effectively avoids color jumps or pauses caused by zoom operation, improving the user's shooting experience.
Smart Images

Figure CN113891004B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to computer technology, and in particular to an image processing method, apparatus, device and storage medium. Background Art
[0002] With the improvement of the performance of Internet Service Provider (ISP) of mobile terminals, mobile terminals have become one of the main tools for users to shoot videos or photos. In order to improve the playability of shooting and the quality of shooting videos or photos, the number of cameras set on mobile terminals is also increasing. More cameras can also meet the various needs of users, such as normal shooting, wide-angle shooting or telephoto shooting.
[0003] However, when switching the camera on the mobile terminal, the imaging effects vary greatly due to the different aperture sizes of different cameras, which in turn causes the problem of color jumps in the preview image displayed on the mobile terminal. Summary of the invention
[0004] The present application provides an image processing method, apparatus, device and storage medium, which are used to solve the problem that the preview image displayed on the mobile terminal will jump in color when the camera on the mobile terminal is switched.
[0005] In a first aspect, the present application provides an image processing method, which is applied to an electronic device, wherein the electronic device includes at least two cameras, and the image processing method includes: displaying a first preview image captured by a first camera of the at least two cameras, wherein the color texture corresponding to the first preview image is a first color texture; in response to a zoom operation on the first preview image, obtaining a second preview image captured by a second camera corresponding to the zoom operation; adjusting the color texture of the second preview image to a second color texture according to the first color texture, wherein the difference between the first color texture and the second color texture is less than a set threshold, and the set threshold is determined according to the minimum value when the color texture jumps; and displaying the adjusted second preview image.
[0006] In an optional embodiment, adjusting the color texture of the second preview image to a second color texture according to the first color texture includes: inputting the color texture of the second preview image into a target network model to obtain the second color texture, wherein the target network model is used to adjust the color texture of the second preview image to a second color texture whose difference with the first color texture of the first preview image is less than a set threshold; adjusting the second preview image according to the second color texture.
[0007] In another optional embodiment, in response to a zoom operation on the first preview image, before obtaining the second preview image captured by the second camera corresponding to the zoom operation, it also includes: when it is detected that the focusing of the first camera is completed, obtaining the initial image captured by the second camera; determining the first color texture of the first preview image, and the initial color texture of the initial image; using the initial color texture as sample data and the first color texture as label data, and training to obtain a target network model.
[0008] In another optional embodiment, determining the first color texture of the first preview image and the initial color texture of the initial image includes: preprocessing the first preview image to obtain a first target image; preprocessing the initial image to obtain a second target image, the first target image and the second target image including the same field of view information; determining the color texture of the first target image to be the first color texture, and determining the color texture of the second target image to be the initial color texture.
[0009] In another optional embodiment, the initial color texture is used as sample data, and the first color texture is used as label data to train a target network model, including: inputting the initial color texture into the target network model to obtain a training output color texture; adjusting the target network model according to the training output color texture and the first color texture, and obtaining a trained target network model when the training time is equal to a time threshold.
[0010] In another optional embodiment, adjusting the color texture of the second preview image to the second color texture according to the first color texture includes: determining the target object in the second preview image that is the same as that in the first preview image; obtaining the first color texture of the target object in the first preview image; and adjusting the color texture of the target object in the second preview image to the second color texture according to the first color texture.
[0011] In yet another optional embodiment, the image processing method further includes: acquiring performance data of the electronic device; and determining a model structure of the target network model based on the performance data.
[0012] In a second aspect, the present application provides an image processing device, which is applied to an electronic device, wherein the electronic device includes at least two cameras, and the image processing device includes:
[0013] A first display module, used for displaying a first preview image captured by a first camera of the at least two cameras, wherein a color texture corresponding to the first preview image is a first color texture;
[0014] An acquisition module, configured to, in response to a zoom operation on the first preview image, acquire a second preview image captured by a second camera corresponding to the zoom operation;
[0015] an adjustment module, configured to adjust the color texture of the second preview image to a second color texture according to the first color texture, wherein the difference between the first color texture and the second color texture is less than a set threshold value, and the set threshold value is determined according to a minimum value when the color texture jumps;
[0016] The second display module is used to display the adjusted second preview image.
[0017] In an optional embodiment, the adjustment module is specifically used to: input the color texture of the second preview image into the target network model to obtain the second color texture, wherein the target network model is used to adjust the color texture of the second preview image to a second color texture whose difference with the first color texture of the first preview image is less than a set threshold; adjust the second preview image according to the second color texture.
[0018] In an optional embodiment, the image processing device further includes:
[0019] A detection module, used to obtain an initial image captured by the second camera when detecting that the first camera has completed focusing;
[0020] A determination module, configured to determine a first color texture of a first preview image and an initial color texture of an initial image;
[0021] The training module is used to use the initial color texture as sample data and the first color texture as label data to train and obtain a target network model.
[0022] In an optional embodiment, the determination module is specifically used to: preprocess the first preview image to obtain a first target image; preprocess the initial image to obtain a second target image, the first target image and the second target image contain the same field of view information; determine that the color texture of the first target image is the first color texture, and the color texture of the second target image is the initial color texture.
[0023] In an optional embodiment, the training module is specifically used to: input the initial color texture into the target network model to obtain a training output color texture; adjust the target network model according to the training output color texture and the first color texture, and obtain a trained target network model when the training time is equal to a time threshold.
[0024] In an optional embodiment, the adjustment module is specifically used to: determine the target object in the second preview image that is the same as that in the first preview image; obtain the first color texture of the target object in the first preview image; and adjust the color texture of the target object in the second preview image to the second color texture based on the first color texture.
[0025] In an optional embodiment, the image processing device is further used to obtain performance data of the electronic device; and determine the model structure of the target network model according to the performance data.
[0026] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, so that the processor executes the image processing method of the first aspect above.
[0027] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the image processing method of the first aspect is implemented.
[0028] In a fifth aspect, the present application provides a computer program product, which includes computer execution instructions. When a processor executes the computer execution instructions, the image processing method of the first aspect is implemented.
[0029] The image processing method, device, equipment and storage medium provided by the present application include: displaying a first preview image captured by a first camera of at least two cameras, wherein the color texture corresponding to the first preview image is the first color texture; in response to a zoom operation on the first preview image, obtaining a second preview image captured by a second camera corresponding to the zoom operation; adjusting the color texture of the second preview image to the second color texture according to the first color texture, wherein the difference between the first color texture and the second color texture is less than a set threshold, wherein the set threshold is determined according to the minimum value when the color texture jumps; and displaying the adjusted second preview image. The present application can adjust the color texture of the second preview image captured by the second camera after zooming, so that the difference between the adjusted second color texture of the second preview image and the first color texture of the first preview image is small, thereby avoiding jumps or setbacks caused by the zoom operation, thereby improving the user's shooting experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings shown below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0031] Figure 1 An application scenario diagram of an image processing method provided in an embodiment of the present application;
[0032] Figure 2 A flowchart of an image processing method provided by an embodiment of the present application;
[0033] Figure 3 Schematic diagram of the preview image provided in the embodiment of the present application Figure 1 ;
[0034] Figure 4 Schematic diagram of the preview image provided in the embodiment of the present application Figure 2 ;
[0035] Figure 5 A flowchart of another image processing method provided by the present application;
[0036] Figure 6 A schematic diagram of the structure of a neural network provided for this application Figure 1 ;
[0037] Figure 7 A schematic diagram of the structure of a neural network provided for this application Figure 2 ;
[0038] Figure 8 A structural block diagram of an image processing device provided by the present application;
[0039] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided in this application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0041] Figure 1 is a schematic diagram of an application scenario of an image processing method provided by this application. Specifically, Figure 1 The electronic device 10 includes a display interface 11 and a back surface 9, and a plurality of cameras (such as a camera 13, a camera 14, and a camera 15) are arranged on the back surface 9. A preview image captured by one of the cameras is displayed on the display interface 11. In addition, the focal length can be adjusted by touching the display interface 11 to switch the camera, and the adjusted focal length multiple is displayed on the display interface 11 in the form of a focal length mark 111.
[0042] For example, camera 13 is the main camera, camera 14 is the wide-angle camera, and camera 15 is the telephoto camera. After the user touches the camera icon on the desktop of the electronic device 10, the camera homepage is entered, the current focal length multiple is x1 (1 times), and the preview image A captured by the main camera 13 is displayed on the display interface 11. When the focal length multiple is adjusted to x4 (4 times) on the display interface, the preview image B captured by the telephoto camera 15 is displayed on the display interface 11. If the focal length multiple is adjusted to x0.5 (0.5 times) on the display interface, the preview image C captured by the wide-angle camera 14 is displayed on the display interface 11.
[0043] Among them, due to the different aperture sizes of cameras with different focal lengths, the amount of light entering will be different. In addition, there are position differences, which will cause the screen to jump or freeze on the display interface when switching from preview image A to preview image B or preview image C. Specifically, the displacement, brightness and color changes of the preview image pixels will affect the user's shooting experience. Based on this problem, the current method has eliminated the jump of displacement and brightness, and has a good elimination effect. However, due to the complexity and diversity of colors, there is no good correction effect.
[0044] Further, the following three methods are used for color correction, where:
[0045] The first method is to use a 24-color card to determine the difference between the image captured by each camera and the color card under a fixed light source color temperature environment, and specifically use the chromaticity estimation method and the mirror method to correct the image captured by each camera. However, this method can only perform objective tests under fixed scenes, and the adjusted image is also a fixed result, which lacks flexibility.
[0046] The second method is to use a 3D discrimination table to correct the color of the image when the camera is shooting. The third method is to determine whether the camera is shooting a pure color image. If there is a large area of pure color when shooting, the white balance offset coordinate system can be established through the offset between different white balance parameters to adjust the color deviation. Both methods have poor real-time performance and have certain limitations in application.
[0047] Based on the above application scenarios and technical problems, the present application provides an image processing method, which can solve the problem that the preview image displayed on the terminal will change color when switching the camera on the mobile terminal, and has good real-time performance and wide application.
[0048] The technical solution of the present application is described in detail with specific embodiments below. The specific embodiments below can be combined with each other, and the same or similar concepts or processes may be omitted in some embodiments.
[0049] Figure 2The following is a flowchart of the steps of the image processing method provided in this application, such as Figure 3 As shown, the image processing method is applied to an electronic device, the electronic device includes at least two cameras, and the image processing method specifically includes the following steps:
[0050] S201, displaying a first preview image captured by a first camera among at least two cameras.
[0051] The color texture corresponding to the first preview image is the first color texture.
[0052] In an embodiment of the present application, the electronic device includes at least two cameras, wherein the first camera may be a main camera, which is mainly used for taking pictures. Generally speaking, when a user triggers a photo application on the home page, or triggers a photo control on other applications, the preview images displayed on the interface entered are all first preview images captured by the first camera. In addition, the picture observed by the first camera is very close to the picture seen by the human eye, and the image captured by the first camera is more "realistic".
[0053] Furthermore, the first preview image is a first color texture corresponding to the first preview image, which refers to a set of color values (RGB) of each pixel in the first preview image. Furthermore, the first preview image is captured by the first camera within the focal length range corresponding to the first camera.
[0054] For example, refer to Figure 3 , the first camera captures a first preview image 31 at a focal length of 1. The first preview image includes a target object A1 and a target object B1.
[0055] S202: In response to a zoom operation on the first preview image, obtain a second preview image captured by a second camera corresponding to the zoom operation.
[0056] In this application, the second camera refers to a camera with a different focal length from the first camera. The second camera can be a telephoto camera, and the target object photographed by the telephoto camera is more prominent. The second camera can also be a wide-angle camera, and the wide-angle camera can capture more content. In addition, the second camera can also be other cameras such as an ultra-wide-angle camera and a macro camera, which are not limited here.
[0057] The first camera and the second camera have different focal lengths. For the user, the camera can be switched through a zoom operation.
[0058] For example, refer to Figure 3, if the electronic device is provided with three cameras, a main camera, a telephoto camera and a wide-angle camera. Among them, the first camera captures a first preview image 31 at a focal length of 1. The first preview image includes a target object A1 and a target object B1. The user performs a zoom operation by touching the zoom mark 311 or other methods such as a touch screen. When the focal length increases, the target objects A1 and B1 on the display interface gradually increase to the target objects A2 and B2 in the second preview image 32 captured by the second camera (telephoto camera). Among them, if the second preview image 32 is directly displayed (such as Figure 3 ), there will be a problem of color jumping.
[0059] Similarly, the user performs a zoom operation by touching the zoom mark 311 or touching the screen, and when the focal length decreases, the target objects A1 and B1 on the display interface gradually decrease to the target objects A3 and B3 in the second preview image 33 captured by the second camera (wide-angle camera). Figure 3 ), there will also be problems with color jumping.
[0060] Therefore, the present application obtains the second preview image before the second preview image is displayed.
[0061] S203: According to the first color texture, adjust the color texture of the second preview image to a second color texture.
[0062] The difference between the first color texture and the second color texture is smaller than a set threshold, and the set threshold is determined according to a minimum value when a jump occurs in the color texture.
[0063] Reference Figure 4 , the color texture of the second preview image (42 or 43) is adjusted to the second color texture according to the first color texture of the first preview image 41. It can be seen that the second color texture is very little different from the first color texture or has no difference. When the user performs a zoom operation, there will be no color jump problem when switching from the first preview image 41 to the second preview image (42 or 43), thereby improving the user's shooting experience.
[0064] In the embodiment of the present application, adjusting the color texture of the second preview image to the second color texture according to the first color texture is performed in the background.
[0065] S204: Display the adjusted second preview image.
[0066] For example, refer to Figure 4 Finally, the adjusted second preview image (42 or 43) is displayed to the user.
[0067] The image processing method provided in the embodiment of the present application can adjust the color texture of the second preview image captured by the second camera after zooming, so that the difference between the second color texture of the adjusted second preview image and the first color texture of the first preview image is smaller, thereby avoiding jumps or pauses caused by the zoom operation, thereby improving the user's shooting experience.
[0068] Figure 5 A flowchart of another image processing method provided by this application, such as Figure 5 As shown, the image processing method comprises the following steps:
[0069] S501, when it is detected that the first camera has completed focusing, an initial image captured by the second camera is acquired.
[0070] In the embodiment of the present application, when the user touches the camera application and enters the shooting interface, the electronic device will automatically focus, and the automatic focus is for the first camera (main camera), that is, the automatic focus of the first camera. When the electronic device detects that the focus of the first camera is completed, the electronic device obtains the images captured by all cameras on the electronic device in the background, and then displays the first preview image captured by the first camera on the electronic device.
[0071] Exemplarily, the first camera (main camera) captures the first preview image, the wide-angle camera captures an image A, and the telephoto camera captures an image B. Here, the second camera may be a wide-angle camera or a telephoto camera, and the initial image may be image A or image B.
[0072] In addition, the first camera uses the default field of view corresponding to the first camera to capture the first preview image. The second camera uses the default field of view of the second camera to capture the initial image. In addition, the first camera and the second camera may or may not capture images at the same time.
[0073] S502: Display a first preview image captured by a first camera among at least two cameras.
[0074] The color texture corresponding to the first preview image is the first color texture.
[0075] The implementation process of this step is specifically referred to S201, which will not be described in detail here. It should be supplemented that S402 is executed when it is detected that the first camera has completed focusing, and can be executed synchronously or sequentially with obtaining the initial image captured by the second camera, which is not limited here.
[0076] S503: Determine a first color texture of the first preview image and an initial color texture of the initial image.
[0077] Wherein, determining the first color texture of the first preview image and the initial color texture of the initial image includes: preprocessing the first preview image to obtain a first target image; preprocessing the initial image to obtain a second target image, the first target image and the second target image containing the same field of view information; determining the color texture of the first target image to be the first color texture, and the color texture of the second target image to be the initial color texture.
[0078] In the embodiment of the present application, preprocessing the first preview image includes: aligning and correcting the spatial position and brightness of the first preview image using an algorithm. Preprocessing the second preview image includes: aligning and correcting the spatial position and brightness of the second preview image using an algorithm.
[0079] In addition, if the second preview image is an image captured by a telephoto camera, the preprocessing of the first preview image also includes: cropping the first preview image so that the pixel size of the first preview image is the same as the pixel size of the second preview image, and the protected content is the same. If the second preview image is an image captured by a wide-angle camera, the preprocessing of the second preview image also includes: cropping the second preview image so that the pixel size of the second preview image is the same as the pixel size of the first preview image, and the content contained is the same.
[0080] Optionally, after the automatic focusing is completed, the images captured by each camera of the electronic device can be obtained, and then the image with the smallest pixel size is used as a reference to crop the other images into images with the same pixel size and the same content as the reference image.
[0081] For example, the images captured by each camera can be scaled to an image with a pixel size of 320*240 through preprocessing.
[0082] S504, using the initial color texture as sample data and the first color texture as label data, and training to obtain a target network model.
[0083] In an embodiment of the present application, it also includes: acquiring performance data of the electronic device; and determining a model structure of the target network model based on the performance data.
[0084] Specifically, the performance data of the electronic device includes: the performance of the electronic device's CPU, GPU, as well as the size of the program memory, the size of the storage memory, etc.
[0085] The model structure of the target network model is a micro network model (GaN), and the number of convolutional network layers of the micro network model can be determined according to the performance data of the electronic device. When the performance data indicates that the electronic device has better performance, the number of convolutional network layers of the micro network model can be increased. The micro network model includes a generator and a discriminator. For electronic devices with better performance, the generator can use a V-type network. Exemplary reference Figure 6 The V-type network includes N downsampling modules, a conversion module and N upsampling modules. The downsampling modules and the corresponding upsampling modules have a connection relationship. The V-type network is suitable for electronic devices with better performance and can improve the accuracy of the second color texture output by the target network model.
[0086] For electronic devices with normal performance, the model structure of the target network model can select a micro-adversarial neural network model, and the generator of the micro-adversarial neural network model is a flat-bottomed U-shaped network. Figure 7 The structure of the flat-bottomed U-shaped network includes N downsampling modules, a conversion module, and N upsampling modules. Among them, the downsampling module N and the corresponding upsampling module have no connection relationship. The V-shaped network is suitable for electronic devices with normal performance. The reduced connection relationship between the downsampling module N and the corresponding upsampling module can improve the training speed of the target network model.
[0087] In an embodiment of the present application, the first color texture of the first preview image captured by the first camera (main camera) can be used as label data, and the initial color texture of the initial image captured by other second cameras (wide-angle camera or telephoto camera) can be used as training samples to train the target network model, wherein a corresponding target network model can be trained for each second camera.
[0088] In addition, the discriminator is a residual network (resnet). The output of the discriminator can be used to adjust the parameters of the target network model. The target network model is adjusted many times until it meets the convergence requirements or the training time.
[0089] Furthermore, the initial color texture is used as sample data, and the first color texture is used as label data to train a target network model, including: inputting the initial color texture into the target network model to obtain a training output color texture; adjusting the target network model according to the training output color texture and the first color texture, and obtaining a trained target network model when the training time is equal to a time threshold.
[0090] Exemplarily, the initial color texture of the initial image is input into the generator, and the deep basic structure of the initial color texture is obtained by sampling in sequence through each downsampling module. After the deep basic structure is converted by the bottom module, it is sequentially upsampled and restored to the adjusted color texture by the upsampling module. Then the first color texture and the adjusted color texture are input into the discriminator for discrimination, and the difference between the first color texture and the adjusted color texture is determined. If the difference is large, the discriminator outputs the adjustment parameter, adjusts the parameters of the generator, and uses the adjusted generator to continue to input the initial color texture of the initial image into the adjusted generator to obtain the adjusted color texture again. Then the first color texture and the color texture adjusted again are input into the discriminator for discrimination, and the difference between the first color texture and the color texture adjusted again is determined. If the difference is greater than or equal to the set difference threshold, the above steps are executed repeatedly until the difference between the first color texture and the color texture output by the generator is less than the set difference threshold, and the training of the target network model is completed.
[0091] The training of the target network model can be executed in the CPU. Experiments show that if the resolution of the training samples is scaled to 320*240, 100 trainings can be completed within 0.5 seconds.
[0092] In the embodiment of the present application, the training of the target network model is completed between the time after the camera automatically focuses and the time between the user manually zooming, which is usually very short, about 1 second. Therefore, the micro adversarial neural network model used in the present application can complete the training of the target network model in a shorter time.
[0093] Furthermore, in an embodiment of the present application, the time threshold may be set to 1 second, or the time threshold may be determined by obtaining the time between the camera automatically focusing and the user manually zooming in the user history information.
[0094] In addition, each time the camera automatically focuses, S501 to S504 are executed to ensure the real-time performance of the obtained target network model.
[0095] S505: In response to a zoom operation on the first preview image, obtain a second preview image captured by a second camera corresponding to the zoom operation.
[0096] The specific implementation process of this step refers to S202 and will not be repeated here. It should be noted that after the user zooms, the second preview image captured by the second camera may be the same as or different from the initial image captured by the second camera during the training phase. Exemplarily, the focal length of the second camera is x2 (2 times) to x4 (4 times). When the second camera captures the initial image, the focal length used is x2, and when the user zooms, the focal length used can be any one of x2 to x4. If it is x2, the second preview image is the same as the initial image, and if it is x4, the second preview image is different from the initial image.
[0097] S506: Input the color texture of the second preview image into the target network model to obtain a second color texture.
[0098] The target network model is used to adjust the color texture of the second preview image to a second color texture whose difference with the first color texture of the first preview image is less than a set threshold.
[0099] Specifically, the color texture of the second preview image is input into the target network model, and then the second color texture can be directly output. The difference between the second color texture and the first color texture is less than a set threshold.
[0100] In the embodiment of the present application, the trained target network model is used for color texture correction of the second preview image, and the second color texture can usually be input in about 10ms. The solution can support color correction of images or videos shot with 60 frames or more.
[0101] S507: Adjust the second preview image according to the second color texture.
[0102] Wherein, adjusting the second preview image according to the second color texture refers to replacing the color texture of the second preview image with the second color texture
[0103] S508: Display the adjusted second preview image.
[0104] The specific implementation process of this step refers to S204 and will not be repeated here.
[0105] In the embodiment of the present application, the correction of the color texture of the preview image is highly robust, and in any natural scene, the color of the preview image captured by different cameras can be determined and adjusted in real time to unify the color imaging effects of each camera. In addition, the adjustment speed of the target network model and the color texture is fast, which improves the user's shooting experience.
[0106] Figure 8This is a structural block diagram of the image processing device 80 provided in the present application. The image processing device 80 is applied to an electronic device. The electronic device includes at least two cameras. The image processing device 80 includes: a first display module 81, an acquisition module 82, an adjustment module 83 and a second display module 84.
[0107] A first display module 81, used for displaying a first preview image captured by a first camera of at least two cameras, where a color texture corresponding to the first preview image is a first color texture;
[0108] An acquisition module 82 is configured to, in response to a zoom operation on the first preview image, acquire a second preview image captured by a second camera corresponding to the zoom operation;
[0109] An adjustment module 83, configured to adjust the color texture of the second preview image to a second color texture according to the first color texture, wherein the difference between the first color texture and the second color texture is less than a set threshold, and the set threshold is determined according to a minimum value when the color texture jumps;
[0110] The second display module 84 is used to display the adjusted second preview image.
[0111] In an optional embodiment, the adjustment module 83 is specifically used to: input the color texture of the second preview image into the target network model to obtain a second color texture, wherein the target network model is used to adjust the color texture of the second preview image to a second color texture whose difference with the first color texture of the first preview image is less than a set threshold; and adjust the second preview image according to the second color texture.
[0112] In an optional embodiment, the image processing device 80 further includes:
[0113] A detection module (not shown), configured to obtain an initial image captured by a second camera when detecting that the first camera has completed focusing;
[0114] a determination module (not shown), configured to determine a first color texture of the first preview image and an initial color texture of the initial image;
[0115] The training module (not shown) is used to use the initial color texture as sample data and the first color texture as label data to train and obtain a target network model.
[0116] In an optional embodiment, the determination module is specifically used to preprocess the first preview image to obtain a first target image; preprocess the initial image to obtain a second target image, and the first target image and the second target image contain the same field of view information; determine that the color texture of the first target image is the first color texture, and the color texture of the second target image is the initial color texture.
[0117] In an optional embodiment, the training module is specifically used to input the initial color texture into the target network model to obtain the training output color texture; adjust the target network model according to the training output color texture and the first color texture, and obtain the trained target network model when the training time is equal to the time threshold.
[0118] In an optional embodiment, the adjustment module 83 is specifically used to: determine the target object in the second preview image that is the same as that in the first preview image; obtain the first color texture of the target object in the first preview image; and adjust the color texture of the target object in the second preview image to the second color texture based on the first color texture.
[0119] In an optional embodiment, the image processing device is further used to obtain performance data of the electronic device; and determine the model structure of the target network model according to the performance data.
[0120] The image processing device 80 provided in the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0121] Fig. 9 A schematic diagram of the structure of an electronic device provided in this application, such as Fig. 9 As shown, the electronic device 90 includes: a processor 91, a memory 92, a communication interface 93 and a system bus 94. The memory 92 and the communication interface 93 are connected to the processor 91 through the system bus 94 and communicate with each other. The memory 92 is used to store computer execution instructions, and the communication interface 93 is used to communicate with other devices. When the processor 91 executes the above computer execution instructions, the solution of the above embodiment is implemented.
[0122] Should Fig. 9 The system bus mentioned in the specification may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk storage.
[0123] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (NP), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0124] Optionally, the embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by the processor, the electronic device executes the above-mentioned Figure 2 The method of the illustrated embodiment.
[0125] Optionally, the embodiment of the present application further provides a computer program product, on which a computer program is stored, and when the computer program is executed by a processor, the electronic device executes the above Figure 2 The method of the illustrated embodiment.
[0126] In the present application, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship; in the formula, the character " / " indicates that the previous and next associated objects are in a "division" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0127] It is to be understood that the various numerical numbers involved in the embodiments of the present application are only for the convenience of description and are not intended to limit the scope of the embodiments of the present application. In the embodiments of the present application, the size of the sequence number of each process does not mean the order of execution, and 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.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An image processing method, characterized in that: Applied to an electronic device, the electronic device includes at least two cameras, and the image processing method includes: Displaying a first preview image captured by a first camera of the at least two cameras, wherein a color texture corresponding to the first preview image is a first color texture; In response to a zoom operation on the first preview image, acquiring a second preview image captured by a second camera corresponding to the zoom operation; Inputting the color texture of the second preview image into the target network model to obtain a second color texture, wherein the target network model is used to adjust the color texture of the second preview image to a second color texture whose difference with the first color texture is less than a set threshold, and the set threshold is determined according to a minimum value when a jump occurs in the color texture; adjusting the second preview image according to the second color texture; displaying the adjusted second preview image; Before obtaining, in response to a zoom operation on the first preview image, a second preview image captured by a second camera corresponding to the zoom operation, the method further includes: When it is detected that the first camera has completed focusing, acquiring an initial image captured by the second camera; determining the first color texture of the first preview image and an initial color texture of the initial image; The target network model is obtained by training using the initial color texture as sample data and the first color texture as label data.
2. The image processing method according to claim 1, characterized in that: The determining the first color texture of the first preview image and the initial color texture of the initial image includes: Preprocessing the first preview image to obtain a first target image; Preprocessing the initial image to obtain a second target image, wherein the first target image and the second target image contain the same field of view information; It is determined that the color texture of the first target image is the first color texture, and the color texture of the second target image is the initial color texture.
3. The image processing method according to claim 1 or 2, characterized in that: The method of using the initial color texture as sample data and the first color texture as label data to train and obtain the target network model includes: Inputting the initial color texture into a target network model to obtain a training output color texture; The target network model is adjusted according to the training output color texture and the first color texture, and a trained target network model is obtained when the training time is equal to a time threshold.
4. The image processing method according to claim 1 or 2, characterized in that: Also includes: Acquiring performance data of the electronic device; A model structure of the target network model is determined according to the performance data.
5. An image processing device, characterized in that: Applied to an electronic device, the electronic device includes at least two cameras, and the image processing device includes: A first display module, configured to display a first preview image captured by a first camera of the at least two cameras, wherein a color texture corresponding to the first preview image is a first color texture; an acquisition module, configured to, in response to a zoom operation on the first preview image, acquire a second preview image captured by a second camera corresponding to the zoom operation; an adjustment module, configured to input the color texture of the second preview image into a target network model to obtain a second color texture, wherein the target network model is configured to adjust the color texture of the second preview image to a second color texture whose difference from the first color texture is less than a set threshold, wherein the set threshold is determined according to a minimum value when a jump occurs in the color texture; adjusting the second preview image according to the second color texture; A second display module, used for displaying the adjusted second preview image; A detection module, used to obtain an initial image captured by the second camera when detecting that the first camera has completed focusing; A determination module, configured to determine a first color texture of a first preview image and an initial color texture of an initial image; The training module is used to use the initial color texture as sample data and the first color texture as label data to train and obtain a target network model.
6. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the image processing method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the image processing method according to any one of claims 1 to 4 is implemented.
8. A computer program product, characterized in that The computer program product includes computer-executable instructions, and when a processor executes the computer-executable instructions, the image processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
White balance adjusting method and related equipment
CN111314683A