Image processing method, device, electronic device and storage medium

By determining and adjusting the YUV image parameter value when switching between smart mode and non-smart mode, the problem of excessively abrupt change in image parameter value is solved, and the smooth transition of preview images and the improvement of user experience is achieved.

CN115243023BActive Publication Date: 2025-02-07SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210863238.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-20
Publication Date
2025-02-07
Estimated Expiration
2042-07-20

AI Technical Summary

Technical Problem

When the camera application switches between smart mode and non-smart mode, the change in image parameter values ​​is too abrupt, affecting the user experience.

Method used

By determining the difference in YUV image parameter value before and after the target switching event, and determining the target smooth frame number based on the correspondence between the pre-stored difference size and the smooth frame number. Then, the image parameter value in the target smoothing frame number is adjusted in turn so that the change amount of parameter value between adjacent YUV images is lower than the set threshold value.

Benefits of technology

It realizes a smooth transition of preview image display effects when switching camera application mode, improving user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115243023B_ABST
    Figure CN115243023B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which can achieve a smooth transition of the display effect within a specified smooth frame number when the camera application switches between the smart mode and the non-smart mode, thereby improving the user experience. Among them, the image processing method includes: determining the target difference between the image parameter values ​​of the YUV images generated before / after the target switching event; determining the corresponding target smooth frame number based on the correspondence between the difference in the image parameter values ​​of the YUV images before / after the switching event and the smooth frame number stored in advance; sequentially adjusting the image parameter value of the first YUV image within the target smooth frame number after the target switching event, so that the change in the image parameter value between adjacent YUV images in the second YUV image before the target mode switching event, the first YUV image, and the third YUV image after the target smooth frame number after the target switching event is lower than the set threshold.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to an image processing method, device, electronic device and storage medium. [Background technology]

[0002] Currently, camera applications usually have two shooting modes, namely, smart mode and non-smart mode, and different adjustments are made for the two shooting modes. That is, when in the two shooting modes, the image parameter values ​​of the images generated for the same scene are different.

[0003] In the prior art, when a camera application switches between the smart mode and the non-smart mode, the image parameter values ​​before the mode switch will be directly changed to the image parameter values ​​after the mode switch. When the image parameter values ​​between the two shooting modes differ greatly, the display effect of the image in the preview screen of the camera application will change abruptly, thereby affecting the user experience. [Summary of the invention]

[0004] The embodiments of the present application provide an image processing method, device, electronic device and storage medium, which can enable a camera application to achieve a smooth transition of display effects within a specified smooth frame number when switching between smart mode and non-smart mode, thereby improving the user experience.

[0005] In a first aspect, an embodiment of the present invention provides an image processing method, the method comprising:

[0006] If it is determined that the camera application has a target switching event between the smart mode and the non-smart mode, determine a target difference between image parameter values ​​of the YUV image generated before the target switching event and after the target switching event;

[0007] Based on the pre-stored correspondence between the difference in image parameter values ​​of the YUV images before and after the switching event and the number of smoothed frames, determine the target number of smoothed frames corresponding to the target difference;

[0008] The image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event are adjusted in sequence, so that in the second YUV image generated before the target mode switching event, the first YUV image, and the third YUV image generated after the target switching event and located after the target smoothing frame number, the change amount of the image parameter value between adjacent YUV images is lower than the set threshold.

[0009] In the embodiment of the present application, for some common scenes, it will be adjusted in the smart mode and the non-smart mode respectively, so that the images generated in different modes have different image parameter values. Therefore, when the camera application switches between the smart mode and the non-smart mode, the difference in the image parameter values ​​in the current two modes can be known, so as to determine the corresponding target smooth frame number. Then in the subsequent process, the image parameter value of the first YUV image generated within the above-mentioned target smooth frame number can be adjusted in sequence, so that the change in the image parameter value between the second YUV image and the first YUV image generated before the mode switching, and between the first YUV image and the third YUV image generated after the target smooth frame number is small, then the change in the image in the preview screen of the camera after the mode switching will be relatively mild, that is, a smooth transition of the display effect of the preview image when the mode is switched is achieved, thereby improving the user experience.

[0010] Optionally, when the target switching event is switching from the non-intelligent mode to the intelligent mode, sequentially adjusting the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event includes:

[0011] Determining a target positive adjustment amount corresponding to the target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0012] Based on the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0013] In an embodiment of the present application, when a switch occurs from a non-intelligent mode to an intelligent mode, based on the characteristic that the image parameter value of the YUV image increases after the target switching event from the non-intelligent mode to the intelligent mode, the image parameter value of the i-th frame in the first YUV image can be adjusted sequentially within the target smoothing frame number based on the target positive adjustment amount, so that before the target switching event occurs, the image parameter value of the i-th frame in the first YUV image is increased compared to the image parameter value of the second YUV image generated before the target switching event.

[0014] Optionally, adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target positive adjustment amount includes:

[0015] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target positive value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0016] In an embodiment of the present application, when switching from non-intelligent mode to intelligent mode occurs, the image parameter value of the second YUV image generated before the target switching event is used as a reference, and the image parameter value of the i-th frame in the first YUV image is obtained based on the target positive adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is increased compared to the image parameter value of the second YUV image generated before the target switching event.

[0017] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0018]

[0019] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0020] In an embodiment of the present application, within the target smoothing frame number, the image parameter value of the i-th frame in the first YUV image can be obtained based on the image parameter value of the second YUV image generated before the target switching event and the sum of the product of the positive adjustment amount and a certain constant, so that the image parameter value of the i-th frame in the first YUV image is increased compared to the image parameter value of the second YUV image generated before the target switching event.

[0021] Optionally, adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target positive adjustment amount includes:

[0022] Based on the image parameter value of the i-1th frame in the first YUV image and the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0023] In an embodiment of the present application, when switching from non-intelligent mode to intelligent mode occurs, the image parameter value of the i-1th frame in the first YUV image is taken as a reference, and the image parameter value of the i-th frame in the first YUV image is obtained based on the target positive value adjustment amount, so that the image parameter value of the i-1th frame in the first YUV image is increased compared with the image parameter value of the i-1th frame in the first YUV image. Since the image parameter value of the i-1th frame in the first YUV image can be considered to be increased compared with the image parameter value of the second YUV image generated before the target switching event, the image parameter value of the i-th frame in the first YUV image can be considered to be increased compared with the image parameter value of the second YUV image generated before the target switching event.

[0024] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0025]

[0026] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k1 represents the target positive value adjustment amount; and X represents the target smoothing frame number.

[0027] In an embodiment of the present application, within the target smoothing frame number, the image parameter value of the i-th frame in the first YUV image can be obtained based on the image parameter value of the i-1-th frame in the first YUV image and the sum of the product of the positive adjustment amount and a constant, so that the image parameter value of the i-th frame in the first YUV image is increased compared to the image parameter value of the i-1-th frame in the first YUV image.

[0028] Optionally, when the target switching event is switching from the intelligent mode to the non-intelligent mode, sequentially adjusting the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event includes:

[0029] Determining a target negative adjustment amount corresponding to the target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0030] Based on the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0031] In an embodiment of the present application, when a switch occurs from an intelligent mode to a non-intelligent mode, based on the characteristic that the image parameter value of the YUV image decreases after the target switching event from the non-intelligent mode to the intelligent mode, the image parameter value of the i-th frame in the first YUV image can be adjusted sequentially within the target smoothing frame number based on the target negative value adjustment amount, so that before the target switching event occurs, the image parameter value of the i-th frame in the first YUV image is reduced compared to the image parameter value of the second YUV image generated before the target switching event.

[0032] Optionally, adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount includes:

[0033] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0034] In an embodiment of the present application, when switching from intelligent mode to non-intelligent mode occurs, the image parameter value of the second YUV image generated before the target switching event is used as a reference, and the image parameter value of the i-th frame in the first YUV image is obtained based on the target negative value adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is reduced compared to the image parameter value of the second YUV image generated before the target switching event.

[0035] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0036]

[0037] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k2 represents the target negative value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0038] In an embodiment of the present application, within the target smoothing frame number, the image parameter value of the i-th frame in the first YUV image can be obtained based on the image parameter value of the second YUV image generated before the target switching event and the sum of the product of the negative adjustment amount and a constant, so that the image parameter value of the i-th frame in the first YUV image is reduced compared to the image parameter value of the second YUV image generated before the target switching event.

[0039] Optionally, adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount includes:

[0040] Based on the image parameter value of the i-1th frame in the first YUV image and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0041] In an embodiment of the present application, when the intelligent mode is switched to the non-intelligent mode, the image parameter value of the i-1th frame in the first YUV image is taken as a reference, and the image parameter value of the i-th frame in the first YUV image is obtained based on the target negative value adjustment amount, so that the image parameter value of the i-1th frame in the first YUV image is reduced compared with the image parameter value of the i-1th frame in the first YUV image. Since the image parameter value of the i-1th frame in the first YUV image can be considered to be reduced compared with the image parameter value of the second YUV image generated before the target switching event, the image parameter value of the i-1th frame in the first YUV image can be considered to be reduced compared with the image parameter value of the second YUV image generated before the target switching event.

[0042] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0043]

[0044] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k2 represents the target negative value adjustment amount; and X represents the target smoothing frame number.

[0045] In an embodiment of the present application, within the target smoothing frame number, the image parameter value of the i-th frame in the first YUV image can be obtained based on the image parameter value of the i-1-th frame in the first YUV image and the sum of the product of the negative adjustment amount and a constant, so that the image parameter value of the i-th frame in the first YUV image is reduced compared to the image parameter value of the i-1-th frame in the first YUV image.

[0046] In a second aspect, an embodiment of the present application provides an image processing device, the device comprising:

[0047] A first determining unit is used to determine a target difference between image parameter values ​​of a YUV image generated before and after the target switching event occurs if it is determined that a target switching event between a smart mode and a non-smart mode exists in the camera application;

[0048] A second determining unit is used to determine a target smoothing frame number corresponding to the target difference value based on a pre-stored correspondence between a difference value of an image parameter value of a YUV image before / after a switching event and a smoothing frame number;

[0049] The adjusting unit is used to sequentially adjust the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event, so that the change amount of the image parameter values ​​between adjacent YUV images in the second YUV image generated before the target mode switching event, the first YUV image, and the third YUV image generated after the target switching event and located after the target smoothing frame number is lower than a set threshold.

[0050] Optionally, when the target switching event is switching from the non-intelligent mode to the intelligent mode, the adjusting unit includes:

[0051] A first adjustment value determination subunit, configured to determine a target positive adjustment amount corresponding to the target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0052] The first parameter value adjustment subunit is used to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target positive adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0053] Optionally, the first parameter value adjustment subunit is specifically used to:

[0054] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target positive value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0055] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0056]

[0057] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0058] Optionally, the first parameter value adjustment subunit is specifically used to:

[0059] Based on the image parameter value of the i-1th frame in the first YUV image and the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0060] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0061]

[0062] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k1 represents the target positive value adjustment amount; and X represents the target smoothing frame number.

[0063] Optionally, the adjustment unit includes:

[0064] A second adjustment amount determination subunit, configured to determine a target negative adjustment amount corresponding to the target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0065] The second parameter value adjustment subunit is used to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0066] Optionally, the second parameter value adjustment subunit is specifically used to:

[0067] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0068] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0069]

[0070] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k2 represents the target negative value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0071] Optionally, the second parameter value adjustment subunit is specifically used to:

[0072] Based on the image parameter value of the i-1th frame in the first YUV image and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0073] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0074]

[0075] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-th frame in the first YUV image; k2 represents the target negative value adjustment amount; and X represents the target smoothing frame number.

[0076] In a third aspect, an embodiment of the present invention provides an electronic device, comprising at least one processor and a memory connected to the at least one processor, wherein the at least one processor is used to implement the steps of the method described in any embodiment of the first aspect when executing a computer program stored in the memory.

[0077] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method as described in any embodiment of the first aspect.

[0078] It should be understood that the second to fourth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be described in detail.

Brief Description of the Drawings

[0079] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0080] Figure 1 A flowchart of an image processing method provided in an embodiment of the present application;

[0081] Figure 2 A schematic diagram of changes in image parameter values ​​of a YUV image when a non-intelligent mode is converted to an intelligent mode provided in an embodiment of the present application;

[0082] Figure 3 A schematic diagram of changes in image parameter values ​​of a YUV image when an intelligent mode is converted to a non-intelligent mode provided in an embodiment of the present application;

[0083] Figure 4 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;

[0084] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. [Specific implementation method]

[0085] In order to better understand the technical solution of this specification, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0086] It should be clear that the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.

[0087] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit this specification. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.

[0088] With the emergence of scene intelligent recognition shooting modes, when switching between non-intelligent mode and intelligent mode, the camera can automatically identify the currently previewed scene and adjust the camera's image parameter values ​​according to the currently recognized scene, making shooting closer to the simple and convenient intelligent shooting needs. However, due to the switching between non-intelligent mode and intelligent mode, the transition of the preview image appears abrupt, and it is necessary to achieve a smooth effect when switching between non-intelligent mode and intelligent mode to enhance the user experience.

[0089] The inventor of the present application has found through research that when the camera application switches between the smart mode and the non-smart mode, the image parameter values ​​before the mode switch will be directly changed to the image parameter values ​​after the mode switch. When the image parameter values ​​between the two shooting modes differ greatly, the display effect of the image in the preview screen of the camera application will change abruptly, thereby affecting the user experience.

[0090] In view of this, an embodiment of the present application provides an image processing method, which, for some common scenes, is adjusted in the smart mode and the non-smart mode respectively, so that the images generated in different modes have different image parameter values. Therefore, when the camera application switches between the smart mode and the non-smart mode, the difference in the image parameter values ​​in the current two modes can be known, thereby determining the corresponding target smooth frame number. Then in the subsequent process, the image parameter value of the first YUV image generated within the above-mentioned target smooth frame number can be adjusted in sequence, so that the change in the image parameter value between the second YUV image generated before the mode switching and the first YUV image, and between the first YUV image and the third YUV image generated after the target smooth frame number is small, then the change in the image in the preview screen of the camera after the mode switching will be relatively mild, that is, a smooth transition of the display effect of the preview image when the mode is switched is achieved, thereby improving the user experience.

[0091] The following is an introduction to the technical solution provided by the embodiment of the present application in conjunction with the accompanying drawings. Figure 1 The embodiment of the present invention provides an image processing method, which is applied to a terminal. The method flow is described as follows:

[0092] Step 101: If it is determined that a target switching event between a smart mode and a non-smart mode occurs in the camera application, a target difference between image parameter values ​​of a YUV image generated before and after the target switching event occurs is determined.

[0093] The smart mode of the camera application means that the currently photographed scene will be recognized. If the current scene is judged to be a preset scene, a scene image of a specific style will be generated; the non-intelligent mode of the camera application means that the photographed scene will not be recognized. Regardless of the current scene, a scene image of a conventional style is generated. This means that even in the same scene, the image parameter values ​​of the scene image generated by the camera application in the smart mode are different from the image parameter values ​​of the scene image generated by the camera application in the non-intelligent mode, and there is even a situation where the image parameter values ​​of the scene images generated in different modes of the same scene differ greatly. Therefore, in an embodiment of the present application, in order to avoid obvious changes in the display effect of the images generated before and after the mode switching, the image parameter values ​​of some of the generated images can be adjusted after the mode switching. Prior to this, it is necessary to first determine how big the difference between the image parameter values ​​before and after the mode switching is, so as to determine how many image parameter values ​​need to be adjusted.

[0094] As a possible implementation, when the terminal determines that the camera application has a target switching event between the smart mode and the non-smart mode, the terminal can determine the target difference between the image parameter value of the YUV image generated before the target switching event occurs and the image parameter value of the YUV image generated after the target switching event occurs. Here, the image parameter value of the YUV image includes at least one of the parameter value of brightness, the parameter value of contrast, the parameter value of saturation, and the parameter value of hue, or a combination of multiple values, which is not particularly limited here.

[0095] It should be understood that the terminal determines that the target switching event can be considered to include the following four situations: first, in the initial state, the camera application is in the smart mode, and then the user turns off the smart mode, at this time it can be considered that the camera application has undergone a mode switch; second, in the initial state, the camera application is in the non-smart mode, and then the user turns on the smart mode, at this time it can be considered that the camera application has undergone a mode switch; third, in the initial state, the camera application is in the smart mode, if an unrecognized scene appears during mobile shooting, then it will switch to the non-smart mode, at this time it can be considered that the camera application has undergone a mode switch; fourth, in the initial state, the smart mode of the camera application is turned on, but the current scene is not recognized, then it can be considered that it is in the non-smart mode at this time, and when a recognizable scene appears during the movement, it will switch to the smart mode, at this time it can be considered that the camera application has undergone a mode switch. The following uses specific examples to illustrate the mode switching caused by the third and fourth situations.

[0096] For example, in the initial state, the smart mode of the camera application is on, and the current scene is identified as a green plant scene. During the movement of the terminal, certain scenes that the camera application cannot recognize may appear. At this time, it can be considered that the camera application automatically switches to non-smart mode, that is, although it is in smart mode, it uses the shooting parameters of the non-smart mode. The above process can be considered to be a mode switch caused by the third situation mentioned above; if during the movement of the terminal, a new scene is identified as a food scene, then the camera application can automatically switch to smart mode. The above process can be considered to be a mode switch caused by the fourth situation mentioned above.

[0097] Step 102: Based on the pre-stored correspondence between the difference in image parameter values ​​of the YUV images before / after the switching event and the number of smoothed frames, determine a target number of smoothed frames corresponding to the target difference.

[0098] In an embodiment of the present application, after determining the actual difference in the image parameter values ​​of the images generated before and after the mode switching, it is possible to determine how many images' image parameter values ​​need to be adjusted based on the size of the actual difference, so that the display effect of the images generated after the mode switching can transition more smoothly.

[0099] As a possible implementation mode, the terminal can be considered to have pre-stored the correspondence between the difference in image parameter values ​​of the YUV image generated before / after the switching event and the number of smoothed frames, thereby determining the target number of smoothed frames corresponding to the target difference between the image parameter values ​​of the YUV image generated before / after the target switching event when the target switching event currently occurs.

[0100] It should be understood that the frequency of the camera application in the terminal when generating images can be considered to be constant. If the image parameter value is adjusted based on a fixed adjustment amount for each frame of generated image, then the number of smooth frames required during adjustment can be considered to be positively correlated with the difference in the image parameter value of the YUV image generated before / after the switching event. It can be seen that when the target difference is larger, the target smooth frame number is also larger; conversely, when the target difference is smaller, the target smooth frame number is also smaller.

[0101] Step 103: sequentially adjust the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event, so that the change in the image parameter values ​​between adjacent YUV images in the second YUV image, the first YUV image generated before the target mode switching event, and the third YUV image generated after the target switching event and located after the target smoothing frame number is lower than the set threshold.

[0102] In an embodiment of the present application, after a target switching event occurs, after the number of image frames that require image parameter value adjustment, the image parameter values ​​of the generated images within the above number of image frames can be adjusted, so that the difference between the image parameter values ​​of adjacent images in the images generated before the target switching event, the images generated within the above number of image frames, and the images generated after the above number of image frames can become smaller, so that the transition in display effect can be smoother, thereby improving the user experience.

[0103] As a possible implementation method, the terminal can sequentially adjust the image parameter values ​​of the first YUV image within the target smooth frame number generated after the target switching event, so that the change in the image parameter values ​​between adjacent YUV images in the second YUV image, the first YUV image generated before the target switching event, and the third YUV image generated after the target switching event and located after the target smooth frame number is lower than the set threshold.

[0104] Considering that the target switching event can be switching from intelligent mode to non-intelligent mode, or from non-intelligent mode to intelligent mode, and different switching sequences have different adjustment mechanisms for the image parameter values ​​of the first YUV image within the target smooth frame number. The following describes in detail how to adjust the image parameter values ​​of the first YUV image within the target smooth frame number under different switching sequences.

[0105] Switching sequence 1: The target switching event is switching from non-intelligent mode to intelligent mode.

[0106] Taking into account that when the non-intelligent mode is switched to the intelligent mode, the image parameter value of the generated YUV image increases, therefore, in an embodiment of the present application, a positive value can be used as an adjustment amount to adjust the image parameter values ​​of the image generated within the target smooth frame number in sequence, so that the image parameter value of the image generated within the target smooth frame number is increased compared to the image parameter value of the image generated before the target switching event.

[0107] As a possible implementation, the terminal may be considered to have pre-stored a correspondence between the mode switching sequence and the positive / negative adjustment amount. When it is determined that the current target switching event is switching from the non-intelligent mode to the intelligent mode, the target positive adjustment amount corresponding to the current switching sequence may be determined. On this basis, the image parameter value of the i-th frame in the generated first YUV image may be adjusted based on the target positive adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0108] See also Figure 2 , is a schematic diagram of the change of image parameter values ​​of a YUV image when a non-intelligent mode is converted into an intelligent mode provided by an embodiment of the present application. Figure 2 It can be seen that within the target smoothing frame number, in the mode switching from the non-intelligent mode to the intelligent mode, the image parameter value is smoothed by the image parameter value of the second YUV image generated before the target switching event, and the image parameter value of the third YUV image generated after the target switching event and located after the target smoothing frame number is obtained in an incremental manner. When the mode switching from the non-intelligent mode to the intelligent mode occurs, the changes in the image in the preview screen of the camera achieve a smooth effect.

[0109] How to adjust the image parameter value of the i-th frame in the first YUV image based on the target positive adjustment amount is described in detail below.

[0110] Adjustment method 1: The terminal can use the image parameter value of the second YUV image generated before the target switching event as a reference, and obtain the image parameter value of the i-th frame in the first YUV image based on the target positive adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is increased compared to the image parameter value of the second YUV image generated before the target switching event.

[0111] At this time, the calculation formula corresponding to the adjustment sequence - China adjustment method - is: i represents the i-th frame within the target smoothing frame number; W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0112] For example, when a mode switch occurs from non-intelligent mode to intelligent mode, the target smoothing frame number is determined according to the corresponding relationship between the difference (+20) of the image parameter value of the YUV image generated in the mode switch from non-intelligent mode (set the image parameter value to 3) to intelligent mode (set the image parameter value to 23) and the smoothing frame number. If the target smoothing frame number set in the mode switch is 4, if the value of k1 is +20, the calculation formula for the first frame is The value of Y1 is 4, and the image parameter value of the first frame in the first YUV image obtained at this time is 8 Calculation formula for frame 2 The value of Y2 is 3, and the image parameter value of the second frame in the first YUV image obtained at this time is 13 Calculation formula for frame 3 The value of Y3 is 2. At this time, the image parameter value of the third frame in the first YUV image obtained is 18 Calculation formula for frame 4 The value of Y3 is 1, and the image parameter value of the 4th frame in the first YUV image obtained at this time is 23

[0113] Adjustment method two: the terminal takes the image parameter value of the i-1th frame in the first YUV image as a reference, and obtains the image parameter value of the i-th frame in the first YUV image based on the target positive adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is increased compared with the image parameter value of the i-1th frame in the first YUV image. Since the image parameter value of the i-1th frame in the first YUV image can be considered to be increased compared with the image parameter value of the second YUV image generated before the target switching event, the image parameter value of the i-th frame in the first YUV image can be considered to be increased compared with the image parameter value of the second YUV image generated before the target switching event.

[0114] At this time, the calculation formula corresponding to the adjustment method 2 in the adjustment sequence 1 is: W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k1 represents the target positive value adjustment amount; and X represents the target smoothing frame number.

[0115] For example, when a mode switch occurs from a non-intelligent mode to an intelligent mode, the target smoothing frame number is determined according to the correspondence between the difference (20) of the image parameter value of the YUV image generated in the mode switch from the non-intelligent mode (the image parameter value is set to 23) to the intelligent mode (the image parameter value is set to 3) and the smoothing frame number. If the target smoothing frame number set in the mode switch is 4, and if the value of k1 is 20, the calculation formula for the first frame is: The image parameter value of the first frame in the first YUV image obtained at this time is 8 The calculation formula for the second frame is: The image parameter value of the second frame in the first YUV image obtained at this time is 13 The calculation formula for the third frame is: The image parameter value of the third frame in the first YUV image obtained at this time is 18 The calculation formula for the 4th frame is: The image parameter value 3 of the 4th frame in the first YUV image obtained at this time

[0116] Switching sequence 2: The target switching event is switching from the intelligent mode to the non-intelligent mode.

[0117] Taking into account that when the intelligent mode is switched to the non-intelligent mode, the image parameter value of the generated YUV image is reduced, therefore, in an embodiment of the present application, a negative value can be used as an adjustment amount to adjust the image parameter values ​​of the images generated within the target smooth frame number in sequence, so that the image parameter value of the image generated within the target smooth frame number is reduced compared to the image parameter value of the image generated before the target switching event.

[0118] As a possible implementation, the terminal may be considered to have pre-stored a correspondence between the mode switching sequence and the positive / negative adjustment amount. When it is determined that the current target switching event is switching from the intelligent mode to the non-intelligent mode, the target negative adjustment amount corresponding to the current switching sequence may be determined. On this basis, the image parameter value of the i-th frame in the generated first YUV image may be adjusted based on the target negative adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0119] See also Figure 3 , is a schematic diagram of the change of image parameter values ​​of a YUV image when the intelligent mode is converted to the non-intelligent mode provided by an embodiment of the present application. Figure 3 It can be seen that within the target smoothing frame number, in the mode switching from the intelligent mode to the non-intelligent mode, the image parameter value is smoothed by the image parameter value of the second YUV image generated before the target switching event, and the image parameter value of the third YUV image generated after the target smoothing frame number is obtained in a decreasing manner. When the mode switching from the intelligent mode to the non-intelligent mode occurs, the changes in the image in the preview screen of the camera achieve a smooth effect.

[0120] How to adjust the image parameter value of the i-th frame in the first YUV image based on the target positive adjustment amount is described in detail below.

[0121] Adjustment method 1: The terminal can use the image parameter value of the second YUV image generated before the target switching event as a reference, and obtain the image parameter value of the i-th frame in the first YUV image based on the target negative adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is reduced compared to the image parameter value of the second YUV image generated before the target switching event.

[0122] At this time, the calculation formula corresponding to adjustment method 1 in switching sequence 2 is: i represents the i-th frame within the target smoothing frame number; W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k2 represents the target negative value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0123] For example, when a mode switch occurs from the smart mode to the non-smart mode, the target smoothing frame number is determined according to the corresponding relationship between the difference (-20) of the image parameter value of the YUV image generated in the mode switch from the smart mode (set the image parameter value to 23) to the non-smart mode (set the image parameter value to 3) and the smoothing frame number. If the target smoothing frame number set in the mode switch is 4, if the value of k1 is -20, the calculation formula for the first frame is The value of Y1 is 4, and the image parameter value of the first frame in the first YUV image obtained at this time is 18 Calculation formula for frame 2 The value of Y2 is 3, and the image parameter value of the second frame in the first YUV image obtained at this time is 13 Calculation formula for frame 3 The value of Y3 is 2. At this time, the image parameter value of the third frame in the first YUV image is 8 Calculation formula for frame 4 The value of Y3 is 1. At this time, the image parameter value of the 4th frame in the first YUV image is 3.

[0124] Adjustment method two: the terminal takes the image parameter value of the i-1th frame in the first YUV image as a reference, and obtains the image parameter value of the i-th frame in the first YUV image based on the target negative value adjustment amount, so that the image parameter value of the i-th frame in the first YUV image is reduced compared with the image parameter value of the i-1th frame in the first YUV image. Since the image parameter value of the i-1th frame in the first YUV image can be considered to be reduced compared with the image parameter value of the second YUV image generated before the target switching event, the image parameter value of the i-th frame in the first YUV image can be considered to be reduced compared with the image parameter value of the second YUV image generated before the target switching event.

[0125] At this time, the calculation formula corresponding to the adjustment method 2 in the switching sequence 2 is: W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k2 represents the target negative value adjustment amount; and X represents the target smoothing frame number.

[0126] For example, when a mode switch occurs from non-intelligent mode to intelligent mode, the target smoothing frame number is determined based on the corresponding relationship between the difference (-20) of the image parameter value of the YUV image generated in the mode switch from intelligent mode (set image parameter value to 23) to intelligent mode (set image parameter value to 3) and the smoothing frame number. If the target smoothing frame number set in the mode switch is 4, if the value of k1 is -20, the calculation formula for the first frame is The image parameter value of the first frame in the first YUV image obtained at this time is 18 The calculation formula for the second frame is: The image parameter value of the second frame in the first YUV image obtained at this time is 13 The calculation formula for the third frame is: The image parameter value of the third frame in the first YUV image obtained at this time is 8 The calculation formula for the 4th frame is: The image parameter value 3 of the 4th frame in the first YUV image obtained at this time

[0127] See also Figure 4 Based on the same inventive concept, the application embodiment also provides an image processing device, which includes: a first determination unit 201, a second determination unit 202 and an adjustment unit 203.

[0128] The first determining unit 201 is used to determine a target difference between image parameter values ​​of a YUV image generated before and after the target switching event if it is determined that a target switching event between a smart mode and a non-smart mode exists in the camera application;

[0129] The second determining unit 202 is used to determine the target smoothing frame number corresponding to the target difference value based on the pre-stored correspondence between the difference value of the image parameter value of the YUV image before / after the switching event and the smoothing frame number;

[0130] The adjusting unit 203 is used to sequentially adjust the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event, so that the change amount of the image parameter values ​​between adjacent YUV images in the second YUV image and the first YUV image generated before the target mode switching event occurs, and the third YUV image generated after the target switching event and located after the target smoothing frame number is lower than the set threshold.

[0131] Optionally, when the target switching event is switching from a non-intelligent mode to an intelligent mode, the adjusting unit 203 includes:

[0132] A first adjustment value determination subunit, configured to determine a target positive adjustment amount corresponding to a target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0133] The first parameter value adjustment subunit is used to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target positive value adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0134] Optionally, the first parameter value adjustment subunit is specifically used for:

[0135] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target positive value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0136] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0137]

[0138] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0139] Optionally, the first parameter value adjustment subunit is specifically used for:

[0140] Based on the image parameter value of the i-1th frame in the first YUV image and the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0141] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0142]

[0143] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the first YUV image at the i-1th frame; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number.

[0144] Optionally, the adjusting unit 203 includes:

[0145] A second adjustment amount determination subunit is used to determine a target negative adjustment amount corresponding to a target switching event based on a pre-stored correspondence between a mode switching sequence and a positive / negative adjustment amount;

[0146] The second parameter value adjustment subunit is used to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

[0147] Optionally, the second parameter value adjustment subunit is specifically used for:

[0148] Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0149] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0150]

[0151] W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k2 represents the target negative value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

[0152] Optionally, the second parameter value adjustment subunit is specifically used for:

[0153] Based on the image parameter value of the i-1th frame in the first YUV image and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

[0154] Optionally, a calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows:

[0155]

[0156] W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k2 represents the target negative value adjustment amount; and X represents the target smoothing frame number.

[0157] See also Figure 5 Based on the same inventive concept, the embodiment of the present application further provides an electronic device 100, which may include at least one processor, and the at least one processor is used to execute a computer program stored in a memory to implement the embodiment of the present application. Figure 1 The steps of the image processing method are shown.

[0158] Optionally, the processor may specifically be a central processing unit, a specific ASIC, or one or more integrated circuits for controlling program execution.

[0159] Optionally, the electronic device 100 may further include a memory connected to at least one processor, and the memory may include ROM, RAM, and disk storage. The memory is used to store data required by the processor when it is running, that is, it stores instructions that can be executed by at least one processor. At least one processor executes the instructions stored in the memory to execute the following steps: Figure 1 The method shown in the figure. Wherein, the number of memories is one or more.

[0160] The physical devices corresponding to the first determining unit 201, the second determining unit 202 and the adjusting unit 203 may all be the aforementioned processors. Figure 1 Therefore, for the functions that can be realized by each functional module in the electronic device, please refer to Figure 1 The corresponding description in the illustrated embodiment will not be repeated here.

[0161] The electronic device 100 may be a smart electronic device such as a smart phone or a tablet computer, and this embodiment does not limit the form of the electronic device.

[0162] Instance, Figure 5 Taking a smart phone as an example, a schematic diagram of the structure of the electronic device 100 is shown. Figure 5 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0163] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0164] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0165] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0166] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0167] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0168] The charging management module 140 is used to receive charging input from a charger.

[0169] The power management module 141 is used to connect the battery 142 , the charging management module 140 and the processor 110 .

[0170] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0171] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor.

[0172] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.

[0173] The ISP is used to process data fed back by the camera 193 .

[0174] The camera 193 is used to capture still images or videos.

[0175] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0176] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0177] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

[0178] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121, and / or instructions stored in a memory provided in the processor.

[0179] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0180] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals.

[0181] The speaker 170A, also called a "horn", is used to convert audio electrical signals into sound signals.

[0182] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals.

[0183] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals.

[0184] The earphone interface 170D is used to connect a wired earphone and can be a USB interface 130 or a 3.5 mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0185] Buttons 190 include a power button, a volume button, and the like.

[0186] Motor 191 can generate vibration prompts.

[0187] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

[0188] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some embodiments, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0189] The present application also provides a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are executed on a computer, the computer executes Figure 1 The method described.

[0190] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. An image processing method, characterized in that: The method comprises: If it is determined that the camera application has a target switching event between the smart mode and the non-smart mode, determine a target difference between image parameter values ​​of the YUV image generated before the target switching event and after the target switching event; Based on the pre-stored correspondence between the difference in image parameter values ​​of the YUV images before and after the switching event and the number of smoothed frames, determine the target number of smoothed frames corresponding to the target difference; Sequentially adjusting the image parameter values ​​of the first YUV image within the target smoothing frame number generated after the target switching event, so that the changes in the image parameter values ​​of the adjacent YUV images in the second YUV image, the first YUV image, and the third YUV image generated after the target switching event and located after the target smoothing frame number are lower than the set threshold; Wherein, sequentially adjusting the image parameter value of the first YUV image within the target smoothing frame number generated after the target switching event includes: When the target switching event is switching from the non-intelligent mode to the intelligent mode, based on the pre-stored correspondence between the mode switching sequence and the positive / negative adjustment amount, determining the target positive adjustment amount corresponding to the target switching event; Based on the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted, where i is a positive integer not less than 1 and not more than the target smoothing frame number; or When the target switching event is switching from the intelligent mode to the non-intelligent mode, based on the pre-stored correspondence between the mode switching sequence and the positive / negative adjustment amount, determining the target negative adjustment amount corresponding to the target switching event; Based on the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

2. The method according to claim 1, characterized in that Adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target positive adjustment amount includes: Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target positive value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

3. The method according to claim 2, characterized in that The calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows: W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

4. The method according to claim 1, characterized in that: Adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target positive adjustment amount includes: Based on the image parameter value of the i-1th frame in the first YUV image and the target positive adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

5. The method according to claim 4, characterized in that The calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows: W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k1 represents the target positive value adjustment amount; X represents the target smoothing frame number.

6. The method according to claim 1, characterized in that Adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount includes: Based on the image parameter value of the second YUV image generated before the target switching event occurs and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

7. The method according to claim 6, characterized in that The calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows: W i represents the image parameter value of the i-th frame in the first YUV image; V represents the image parameter value of the second YUV image; k2 represents the target negative value adjustment amount; X represents the target smoothing frame number; Y i The value of is negatively correlated with i.

8. The method according to claim 1, characterized in that Adjusting the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount includes: Based on the image parameter value of the i-1th frame in the first YUV image and the target negative value adjustment amount, the image parameter value of the i-th frame in the generated first YUV image is adjusted.

9. The method according to claim 8, characterized in that The calculation formula for adjusting the image parameter value of the i-th frame in the generated first YUV image is as follows: W i represents the image parameter value of the i-th frame in the first YUV image; W i-1 represents the image parameter value of the i-1th frame in the first YUV image; k2 represents the target negative value adjustment amount; and X represents the target smoothing frame number.

10. An image processing device, characterized in that: The device comprises: A first determining unit is used to determine a target difference between image parameter values ​​of a YUV image generated before and after the target switching event occurs if it is determined that a target switching event between a smart mode and a non-smart mode exists in the camera application; A second determining unit is used to determine a target smoothing frame number corresponding to the target difference value based on a pre-stored correspondence between a difference value of an image parameter value of a YUV image before / after a switching event and a smoothing frame number; an adjusting unit, sequentially adjusting the image parameter value of the first YUV image within the target smoothing frame number generated after the target switching event, so that the change amount of the image parameter value between adjacent YUV images in the second YUV image generated before the target switching event, the first YUV image, and the third YUV image generated after the target switching event and located after the target smoothing frame number is lower than a set threshold; The adjustment unit comprises: A first adjustment value determination subunit, when the target switching event is switching from the non-intelligent mode to the intelligent mode, is used to determine the target positive adjustment amount corresponding to the target switching event based on a pre-stored correspondence between the mode switching sequence and the positive / negative adjustment amount; A first parameter value adjustment subunit is configured to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target positive value adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number; or A second adjustment value determination subunit, when the target switching event is switching from the intelligent mode to the non-intelligent mode, is used to determine the target negative adjustment amount corresponding to the target switching event based on a pre-stored correspondence between the mode switching sequence and the positive / negative adjustment amount; The second parameter value adjustment subunit is used to adjust the image parameter value of the i-th frame in the generated first YUV image based on the target negative value adjustment amount, where i is a positive integer not less than 1 and not more than the target smoothing frame number.

11. An electronic device, characterized in that: The electronic device comprises at least one processor and a memory connected to the at least one processor, and the at least one processor is configured to implement the steps of the method according to any one of claims 1 to 9 when executing a computer program stored in the memory.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Image processing method and related equipment

    CN113674258A

  • Camera shooting parameter determination method and neural network model training method

    CN114339022A