Image processing method and device, electronic equipment, storage medium and program product
Patent Information
- Application Number
- CN202510329411.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-19
- Publication Date
- 2026-09-22
AI Technical Summary
[0003]传统技术中,当图像传感器在SAT变焦过程中切换到izoom mode时,由于FOV(Field of View,视场角)发生变化,导致图像中心位置偏移,从而出现图像“拐弯”或者跳动,导致变焦的流畅性降低
[0016]The aforementioned image processing method, apparatus, electronic device, storage medium, and program product acquire the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio acquired before the second target zoom ratio; when the current zoom ratio is outside the intelligent zoom ratio range, a target offset processing identifier is determined based on the zoom mode, the first target zoom ratio, and the second target zoom ratio; and the target frame corresponding to the current frame is determined based on the target offset processing identifier. During zooming, the electronic device acquires the zoom mode, the current zoom magnification corresponding to the current frame, the first target zoom magnification, and the second target zoom magnification. It determines whether the current zoom magnification falls within the intelligent zoom magnification range and whether the image sensor has switched to intelligent zoom mode. If the current zoom magnification is outside the intelligent zoom magnification range, it is determined that the image sensor has not yet switched to intelligent zoom mode. If the image sensor has not yet switched to intelligent zoom mode, a target offset identifier is dynamically determined based on the zoom mode, the first target zoom magnification, and the second target zoom magnification. Based on the target offset identifier, it is determined whether to perform offset processing on the current frame. This allows us to obtain the target frame corresponding to the current frame. Compared to continuously offsetting image frames or not offsetting them at all, by dynamically determining the target offset marker, we can offset the current frame in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the shift in the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding "turning" or jumping in the image. It also avoids the movement of the image in the image caused by offsetting the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the image during zooming.
Smart Images

Figure CN122802792A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image processing method, apparatus, electronic device, storage medium, and program product. Background Technology
[0002] Some image sensors in electronic devices support izoom mode, which is an image optimization technology based on sensor zoom. In izoom mode, the image sensor extracts a smaller range of pixel data through sensor crop and directly outputs the magnified image, thereby reducing the image quality loss caused by traditional digital zoom.
[0003] In traditional technology, when the image sensor switches to izoom mode during SAT zoom, the change in FOV (Field of View) causes the image center position to shift, resulting in image "turning" or jumping, which reduces the smoothness of zooming. Summary of the Invention
[0004] This application provides an image processing method, apparatus, electronic device, storage medium, and program product that can improve the smoothness of zooming.
[0005] In a first aspect, this application provides an image processing method, comprising:
[0006] The zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio are obtained; the first target zoom ratio is the target zoom ratio obtained before the second target zoom ratio.
[0007] If the current zoom ratio is outside the intelligent zoom ratio range, a target offset processing identifier is determined based on the zoom method, the first target zoom ratio, and the second target zoom ratio.
[0008] Based on the target offset processing identifier, the target frame corresponding to the current frame is determined.
[0009] Secondly, this application also provides an image processing apparatus, comprising:
[0010] The acquisition module is used to acquire the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio acquired before the second target zoom ratio.
[0011] The determination module is used to determine a target offset processing identifier based on the zoom method, the first target zoom ratio, and the second target zoom ratio when the current zoom ratio is outside the intelligent zoom ratio range;
[0012] The processing module is used to determine the target frame corresponding to the current frame based on the target offset processing identifier.
[0013] Thirdly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in the first aspect.
[0014] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in any one of the first aspects.
[0015] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in any of the first aspects.
[0016] The aforementioned image processing method, apparatus, electronic device, storage medium, and program product acquire the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio acquired before the second target zoom ratio; when the current zoom ratio is outside the intelligent zoom ratio range, a target offset processing identifier is determined based on the zoom mode, the first target zoom ratio, and the second target zoom ratio; and the target frame corresponding to the current frame is determined based on the target offset processing identifier. During zooming, the electronic device acquires the zoom mode, the current zoom magnification corresponding to the current frame, the first target zoom magnification, and the second target zoom magnification. It determines whether the current zoom magnification falls within the intelligent zoom magnification range and whether the image sensor has switched to intelligent zoom mode. If the current zoom magnification is outside the intelligent zoom magnification range, it is determined that the image sensor has not yet switched to intelligent zoom mode. If the image sensor has not yet switched to intelligent zoom mode, a target offset identifier is dynamically determined based on the zoom mode, the first target zoom magnification, and the second target zoom magnification. Based on the target offset identifier, it is determined whether to perform offset processing on the current frame. This allows us to obtain the target frame corresponding to the current frame. Compared to continuously offsetting image frames or not offsetting them at all, by dynamically determining the target offset marker, we can offset the current frame in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the shift in the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding "turning" or jumping in the image. It also avoids the movement of the image in the image caused by offsetting the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the image during zooming. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating an image processing method in one embodiment;
[0019] Figure 2 This is a flowchart illustrating the target offset processing identifier determination step in one embodiment;
[0020] Figure 3 This is a flowchart illustrating the target offset processing identifier determination step in another embodiment;
[0021] Figure 4 This is a schematic diagram of the current frame and the target frame in one embodiment;
[0022] Figure 5 This is a schematic diagram of the image processing flow in one embodiment;
[0023] Figure 6 This is a schematic diagram illustrating the classification of sliding cutting and point cutting methods in one embodiment;
[0024] Figure 7 This is a structural block diagram of an image processing device in one embodiment;
[0025] Figure 8 This is a diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] In one exemplary embodiment, such as Figure 1 As shown, an image processing method is provided. Taking the application of this method to an electronic device as an example, the electronic device can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, smart cars, etc., and portable wearable devices can include smartwatches and smart bracelets, etc. It is understood that this method can also be applied to systems including electronic devices and servers, and implemented through the interaction between the electronic devices and the server. In this embodiment, the method includes steps 102 to 106, wherein:
[0028] Step 102: Obtain the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio obtained before the second target zoom ratio.
[0029] Zooming methods refer to the operation methods for adjusting the focal length during shooting. Zooming methods include, but are not limited to, sliding and tapping methods. Sliding refers to continuous zooming by sliding the zoom control; the operator can slide the zoom bar or zoom dial, etc. Tapping refers to jumping zooms by clicking the zoom control; the zoom control can be a physical control or a virtual control, without restriction. The current frame refers to the image frame at the current moment. The target zoom magnification refers to the zoom magnification sent by the shooting application in the electronic device to the Hardware Abstraction Layer (HAL). It can be understood that the shooting application responds to the operator's zoom operation, obtains the target zoom magnification corresponding to the zoom operation, and sends the target zoom magnification to the HAL. The second target zoom magnification refers to the latest target zoom magnification obtained by the HAL, and the first target zoom magnification refers to the target zoom magnification obtained by the HAL before obtaining the first target zoom magnification. The first target zoom magnification and the second target zoom magnification are the target zoom magnifications obtained by the HAL in two consecutive steps.
[0030] For example, in response to a zoom operation on a zoom control, the electronic device obtains the zoom mode of the zoom operation, obtains the current zoom magnification, obtains the current frame based on the current zoom magnification, obtains the second target zoom magnification recently obtained by the hardware abstraction layer, and obtains the first target zoom magnification obtained by the hardware abstraction layer before the second target zoom magnification.
[0031] In an exemplary embodiment, during image preview or video recording, the electronic device responds to the operator's zoom operation. During zooming, based on a preset time interval, it obtains the current zoom ratio, obtains the current frame based on the current zoom ratio, obtains the second target zoom ratio recently obtained by the hardware abstraction layer, and obtains the first target zoom ratio obtained by the hardware abstraction layer before the second target zoom ratio.
[0032] Step 104: If the current zoom level is outside the intelligent zoom level range, determine the target offset processing identifier based on the zoom mode, the first target zoom level, and the second target zoom level.
[0033] The intelligent zoom range refers to the zoom range that indicates the need to initiate offset processing. This range can be set based on the image sensor's intelligent zoom range. The intelligent zoom range can be equal to or greater than the image sensor's intelligent zoom range. For example, in an electronic device, the image sensor of a telephoto lens uses intelligent zoom at 2X-3X, so the intelligent zoom range can be set to 2X-3X, 1X-3X, or 1X-4X. The offset processing identifier indicates whether offset processing is performed. The target offset processing identifier is the current offset processing identifier, which can be understood as the offset processing identifier determined based on the zoom method obtained in step 102, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio. The target offset processing identifier can be one of a first identifier and a second identifier. The first identifier indicates that offset processing is disabled (no offset processing), while the second identifier indicates that offset processing is enabled (offset processing). The target offset processing identifier is used to indicate whether offset processing is performed. Offset processing refers to the process of adjusting the position of an image to compensate for changes in the field of view. The methods of offset processing are not limited here.
[0034] For example, the electronic device obtains the intelligent zoom magnification range, determines whether the current zoom magnification is within the intelligent zoom magnification range, and if the current zoom magnification is outside the intelligent zoom magnification range, then determines the target offset processing identifier that represents whether offset processing should be performed based on the zoom mode, the first target zoom magnification, and the second target zoom magnification.
[0035] In an exemplary embodiment, if the current zoom level is within the intelligent zoom range, the current offset processing identifier is obtained and determined as the target offset processing identifier. That is, if the current zoom level is within the intelligent zoom range, it indicates that the image sensor has switched to intelligent zoom. If the current offset processing identifier indicates that offset processing is being performed, then offset processing continues; if the current offset processing identifier indicates that offset processing is not being performed, then no offset processing continues. This avoids altering the offset processing causing the image to "turn" or "bounce" in the preview interface, thereby improving the smoothness of zooming.
[0036] Step 106: Determine the target frame corresponding to the current frame based on the target offset processing identifier.
[0037] For example, the electronic device determines the target frame corresponding to the current frame based on the target offset processing identifier.
[0038] In the aforementioned image processing method, during zooming, the electronic device acquires the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio. It determines whether the image sensor has switched to intelligent zoom mode by judging whether the current zoom ratio is within the intelligent zoom ratio range. If the current zoom ratio is outside the intelligent zoom ratio range, it is determined that the image sensor has not yet switched to intelligent zoom mode. If it is determined that the image sensor has not yet switched to intelligent zoom mode, a target offset identifier is dynamically determined based on the zoom mode, the first target zoom ratio, and the second target zoom ratio. Based on the target offset identifier, it is determined whether to perform an image processing step on the current frame. By performing offset processing to obtain the target frame corresponding to the current frame, compared to continuously offsetting image frames or not offsetting image frames at all, by dynamically determining the target offset marker, the current frame can be offset in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the shift in the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding the "turning" or jumping of the image in the picture. It can also avoid the movement of the image in the picture caused by offset processing of the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the picture during zooming.
[0039] In an exemplary embodiment, determining a target offset processing identifier based on the zoom method, a first target zoom ratio, and a second target zoom ratio includes:
[0040] When the zoom mode is a sliding mode, determine the zoom ratio difference between the first target zoom ratio and the second target zoom ratio; compare the zoom ratio difference with the difference threshold; if the zoom ratio difference is greater than the difference threshold, determine the target offset processing identifier based on the zoom ratio difference and the change threshold.
[0041] The zoom ratio difference refers to the difference between the zoom ratio of the first target and the zoom ratio of the second target. The difference threshold is the threshold used to determine the slip-cut type. The change threshold is the threshold used to compare with the zoom ratio difference and determine the target offset processing identifier.
[0042] For example, if the zoom mode is a sliding mode, the electronic device determines the absolute value of the difference between the first target zoom ratio and the second target zoom ratio as the zoom ratio difference value, compares the zoom ratio difference value with the difference threshold, and if the zoom ratio difference value is greater than the difference threshold, then the target offset processing identifier is determined based on the zoom ratio difference value and the difference threshold.
[0043] In an exemplary embodiment, when the zoom magnification difference is greater than a difference threshold, a target offset processing identifier is determined based on the zoom magnification difference and the change threshold. This includes: when the zoom magnification difference is greater than the difference threshold, determining the sliding cut type of the sliding cut as a first type; and when the sliding cut type is determined to be the first type, determining the target offset processing identifier based on the zoom magnification difference and the change threshold. Here, the first type refers to a sliding cut type where the zoom magnification changes rapidly, and the first type can be a fast sliding cut.
[0044] In this embodiment, when the zoom mode is a sliding cut, the difference between the zoom magnification of the first target zoom magnification and the second target zoom magnification is compared with the difference threshold. If the zoom magnification difference is greater than the difference threshold, it indicates that the sliding cut type is a fast sliding cut. When the sliding cut type is a fast sliding cut, the target offset processing identifier is determined by the zoom magnification difference and the difference threshold. That is, for different zoom modes and different sliding cut types, the target offset processing identifier is determined by a method corresponding to the zoom mode and sliding cut type, which improves the accuracy of the target offset processing identifier.
[0045] In one exemplary embodiment, such as Figure 2 As shown, based on the zoom ratio difference and the change threshold, a target offset processing identifier is determined, including at least one of the following:
[0046] Step 202: If the zoom ratio difference is greater than or equal to the change threshold, determine the target offset processing identifier as the first identifier; the first identifier indicates that the offset processing is turned off.
[0047] The first identifier refers to the identifier that indicates that offset processing is turned off, that is, the identifier that offset processing is not performed.
[0048] For example, the electronic device compares the zoom ratio difference with a change threshold. If the zoom ratio difference is greater than or equal to the change threshold, the target offset processing identifier is determined to be the first identifier.
[0049] Step 204: When the zoom ratio difference is less than the change threshold and the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined as the second identifier; the second identifier indicates that offset processing is enabled.
[0050] The second identifier refers to the identifier that indicates the start of offset processing, that is, the identifier for performing offset processing.
[0051] For example, if the zoom ratio difference is less than the change threshold, the electronic device compares the second target zoom ratio with the smart zoom ratio range. If the second target zoom ratio is within the smart zoom ratio range, the target offset processing identifier is determined to be the second identifier.
[0052] This can be understood as follows: before reaching intelligent zoom, if the zoom ratio difference is less than the change threshold and the second target zoom ratio is within the intelligent zoom ratio range, the predicted landing point of this rapid slide cut is also within the intelligent zoom ratio range. At this point, the target offset processing flag is set as the second flag to enable offset processing. This means offset processing is performed before entering intelligent zoom and before the FOV changes. If offset processing is performed during or after the FOV change, it will result in a noticeable sluggishness in the image. For example, if the rapid slide cut eventually stops at 2X-3X, it will switch to intelligent zoom for image output. During zooming, the Wide (wide-angle lens) outputs and crops images in binning mode, therefore offset processing needs to be performed before the FOV changes.
[0053] Step 206: If the zoom ratio difference is less than the change threshold and the second target zoom ratio is outside the smart zoom ratio range, determine the target offset processing identifier as the first identifier.
[0054] For example, if the zoom ratio difference is less than the change threshold, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier.
[0055] For example, the latest target zoom ratio issued by the camera application on the electronic device is the second target zoom ratio, target zoom ratio 2. The most recent target zoom ratio issued before the second target zoom ratio was the first target zoom ratio, target zoom ratio 1. The current zoom ratio of the current frame is zoom ratio, and the smart zoom ratio range is 2X-3X. When target zoom ratio 2 enters the 1X-2X range, and the zoom ratio difference between target zoom ratio 2 and target zoom ratio 1 is greater than or equal to the change threshold, and zoom ratio has not yet entered the 2X-3X range, then the target offset flag is determined to be the first flag bypass. If target zoom ratio 2 subsequently enters the 2X-3X range, and the zoom ratio difference between target zoom ratio 2 and target zoom ratio 1 is still greater than or equal to the change threshold, then the target offset flag is again determined to be the first flag bypass. If target zoom ratio 2 enters the 2X-3X range, and the zoom ratio difference between target zoom ratio 2 and target zoom ratio 1 is greater than or equal to the change threshold, then the target offset flag is again determined to be the first flag bypass. If the zoom ratio difference between the two frames is less than the change threshold, and the current zoom ratio of the current frame has not yet entered the 2X-3X range, then the target offset identifier is determined as the second identifier byshift. If the current zoom ratio of the current frame has already entered the 2X-3X range, then the current offset identifier is determined as the target offset identifier, i.e., the offset identifier remains unchanged. The frame interpolation strategy for determining the current zoom ratio of the current frame should not use a binary search method, in order to utilize a more uniform zoom ratio across the interpolated frames.
[0056] In this embodiment, when the zoom mode is a sliding cut and the sliding cut type is the first type, i.e., a fast sliding cut, if the zoom magnification difference is greater than or equal to the change threshold, it indicates that the zoom magnification changes rapidly and is in the early stage of the fast sliding cut. Since the predicted landing point of this fast sliding cut will not be within the intelligent zoom magnification range, offset processing is not required. Therefore, the target offset processing identifier is determined as the first identifier indicating that offset processing is disabled. If the zoom magnification difference is less than the change threshold, it indicates that the zoom magnification changes slowly and is in the later stage of the fast sliding cut. If the second target zoom magnification is within the intelligent zoom magnification range at this time, and the predicted landing point of this fast sliding cut is within the intelligent zoom magnification range, offset processing needs to be enabled in advance. Therefore, the target offset processing identifier is determined as the second identifier indicating that offset processing is enabled. If the second target zoom magnification is outside the intelligent zoom magnification range at this time, and the predicted landing point of this fast sliding cut is outside the intelligent zoom magnification range, offset processing is not required. Therefore, the target offset processing identifier is determined as the first identifier indicating that offset processing is disabled. By determining the target offset processing identifier using the above method, the current frame can be offset in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the offset of the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding the "turning" or jumping of the image in the picture. It can also avoid the movement of the image in the picture caused by offset processing of the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the picture during zooming.
[0057] In an exemplary embodiment, after determining that the sliding type of the sliding method is a first type, the method further includes:
[0058] If the zoom ratio difference is greater than the difference threshold, obtain the stop sliding flag; obtain the target zoom ratio of the image frame corresponding to the time of obtaining the stop sliding flag; and determine the target offset flag based on the target zoom ratio.
[0059] Here, the stop sliding marker is a marker indicating that the sliding cut has stopped. The target zoom ratio refers to the zoom ratio of the image frame corresponding to the moment the stop sliding marker is acquired.
[0060] For example, when the zoom ratio difference is greater than the difference threshold, the electronic device obtains a stop-slide flag, obtains the target zoom ratio of the image frame corresponding to the time the stop-slide flag is obtained, and determines a target offset flag based on the target zoom ratio.
[0061] In an exemplary embodiment, obtaining a stop sliding indicator when the zoom magnification difference is greater than a difference threshold includes: determining that the sliding type of the sliding method is a first type when the zoom magnification difference is greater than the difference threshold; and obtaining a stop sliding indicator when the sliding type of the sliding method is determined to be the first type.
[0062] In an exemplary embodiment, determining a target offset identifier based on the target zoom ratio includes: if the target zoom ratio is within the intelligent zoom ratio range, then determining the current offset identifier as the target offset identifier; if the target zoom ratio is outside the intelligent zoom ratio range, then determining the target offset identifier based on the upper limit and lower limit of the target zoom ratio and the intelligent zoom ratio range. Here, the upper limit refers to the maximum value of the intelligent zoom ratio range, and the lower limit refers to the minimum value of the intelligent zoom ratio range.
[0063] In an exemplary embodiment, determining a target offset identifier based on the upper and lower limits of the target zoom ratio and the intelligent zoom ratio range includes: determining a first absolute difference between the target zoom ratio and the upper limit, and a second absolute difference between the target zoom ratio and the lower limit; if at least one of the first and second absolute differences is less than an absolute threshold, determining the target offset identifier as the second identifier; if both the first and second absolute differences are greater than the absolute threshold, determining the target offset identifier as the first identifier. Here, the first absolute difference refers to the absolute value of the difference between the target zoom ratio and the upper limit. The second absolute difference refers to the absolute value of the difference between the target zoom ratio and the lower limit. The absolute threshold is a pre-set threshold used for comparison with the first and second absolute differences. If at least one of the first absolute difference and the second absolute difference is less than the absolute threshold, it indicates that the target zoom ratio is close to the intelligent zoom ratio range, and the predicted landing point of this rapid sliding cut is within the intelligent zoom ratio range. If both the first absolute difference and the second absolute difference are greater than the absolute threshold, it indicates that the target zoom ratio is far from the intelligent zoom ratio range, and the predicted landing point of this rapid sliding cut is outside the intelligent zoom ratio range.
[0064] In this embodiment, if the zoom ratio difference is greater than the difference threshold, it indicates that the sliding cut type is a fast sliding cut. In fast sliding cut scenarios, separate tail frame interpolation is usually performed, and the number of interpolated frames is large. After obtaining the stop sliding flag, it indicates that the sliding cut has stopped. The target offset flag is determined based on the target zoom ratio of the image frame corresponding to the time when the stop sliding flag is obtained, which further improves the accuracy of the target offset flag.
[0065] In an exemplary embodiment, after comparing the zoom ratio difference with a difference threshold, the method further includes:
[0066] If the zoom ratio difference is less than or equal to the difference threshold, compare the second target zoom ratio with the intelligent zoom ratio range; if the second target zoom ratio is outside the intelligent zoom ratio range, determine the target offset processing identifier as the first identifier; if the second target zoom ratio is within the intelligent zoom ratio range, determine the target offset processing identifier as the second identifier.
[0067] For example, if the zoom ratio difference is less than or equal to the difference threshold, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier; if the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
[0068] In an exemplary embodiment, when the zoom ratio difference is less than or equal to a difference threshold, comparing the second target zoom ratio with the intelligent zoom ratio range includes: determining that the sliding cut type of the sliding cut method is a second type when the zoom ratio difference is less than or equal to the difference threshold; and comparing the second target zoom ratio with the intelligent zoom ratio range when the sliding cut type is determined to be the second type. Here, the second type refers to a sliding cut type where the zoom ratio changes slowly; the second type can be a slow sliding cut.
[0069] In this embodiment, when the zoom mode is a sliding cut, if the zoom magnification difference is less than or equal to the difference threshold, it indicates that the sliding cut type is a slow sliding cut. For a slow sliding cut, if the second target zoom magnification is outside the intelligent zoom magnification range, the predicted landing point of this slow sliding cut is outside the intelligent zoom magnification range, and offset processing does not need to be enabled. Therefore, the target offset processing identifier is determined as the first identifier indicating that offset processing is disabled. If the second target zoom magnification is within the intelligent zoom magnification range, it is predicted that the landing point of this slow sliding cut will not be within the intelligent zoom magnification range, and offset processing does not need to be enabled. Therefore, the target offset processing identifier is determined as the first identifier indicating that offset processing is disabled, thereby improving the accuracy of the target offset identifier.
[0070] In one exemplary embodiment, such as Figure 3 As shown, based on the zoom method, the zoom magnification of the first target, and the zoom magnification of the second target, the target offset processing identifier is determined, including:
[0071] Step 302: When the zoom mode is point-cut mode, compare the current zoom magnification with the first target zoom magnification.
[0072] For example, when the electronic device determines that the zoom mode is point-cut mode, it compares the current zoom magnification with the first target zoom magnification.
[0073] Step 304: If the current zoom ratio is not equal to the first target zoom ratio, obtain the starting zoom ratio corresponding to the first target zoom ratio; the starting zoom ratio is the zoom ratio of the image frame corresponding to the time when the first target zoom ratio is obtained.
[0074] The initial zoom ratio refers to the zoom ratio of the image frame at the moment when the first target zoom ratio is acquired.
[0075] For example, if the current zoom ratio is not equal to the first target zoom ratio, the electronic device obtains the acquisition time of the first target zoom ratio and determines the starting zoom ratio of the image frame corresponding to the acquisition time.
[0076] In an exemplary embodiment, when the current zoom magnification is not equal to the first target zoom magnification, obtaining the starting zoom magnification corresponding to the first target zoom magnification includes: determining that the point-cutting method is a continuous point-cut when the current zoom magnification is not equal to the first target zoom magnification; and obtaining the starting zoom magnification corresponding to the first target zoom magnification when the point-cutting method is determined to be a continuous point-cut. Here, continuous point-cut means that a new triggering operation has occurred before the previous triggering operation has been completed; it can be understood as the second target zoom magnification being obtained before the first target zoom magnification has been reached.
[0077] Step 306: Determine the target offset processing identifier based on the initial zoom ratio and the second target zoom ratio.
[0078] For example, the electronic device determines the target offset processing identifier based on the relationship between the initial zoom ratio, the second target zoom ratio, and the intelligent zoom ratio range.
[0079] In this embodiment, when the zoom mode is point-cut mode, the current zoom magnification is compared with the first target zoom magnification. If the current zoom magnification is not equal to the first target zoom magnification, it indicates that the point-cut type is continuous point-cut. Then, the target offset processing identifier is determined according to the initial zoom magnification and the second target zoom magnification. That is, for different zoom modes and different point-cut types, the target offset processing identifier is determined by a method corresponding to the zoom mode and point-cut type, which improves the accuracy of the target offset processing identifier.
[0080] In one exemplary embodiment, determining a target offset processing identifier based on an initial zoom ratio and a second target zoom ratio includes:
[0081] If both the initial zoom ratio and the second target zoom ratio are outside the intelligent zoom ratio range, the target offset processing identifier is determined as the first identifier; if at least one of the initial zoom ratio and the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined as the second identifier.
[0082] For example, the electronic device compares the initial zoom ratio with the intelligent zoom ratio range, and compares the second target zoom ratio with the intelligent zoom ratio range. If both the initial zoom ratio and the second target zoom ratio are outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier. If both the initial zoom ratio and the second target zoom ratio are within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier. For example, in a fast point-and-click scenario, the first target zoom ratio is 3X, the zoom ratio of the image frame corresponding to the acquisition time of the first target zoom ratio 3X is 2.5X (i.e., the initial zoom ratio is 2.5X), the current zoom ratio is 2.8X, the second target zoom ratio is 1X, the initial zoom ratio of 2.5X is within the intelligent zoom ratio range of 2X-3X, and the second target zoom ratio of 1X is outside the intelligent zoom ratio range of 2X-3X, then the target offset processing identifier is determined to be the second identifier.
[0083] In this embodiment, by comparing the initial zoom magnification with the intelligent zoom magnification range, and comparing the second target zoom magnification with the intelligent zoom magnification range, if the initial zoom magnification is outside the intelligent zoom magnification range and the second target zoom magnification is outside the intelligent zoom magnification range, it means that the entire zoom process will not pass through the intelligent zoom magnification range, and therefore offset processing does not need to be enabled. Thus, the target offset processing flag is determined as the first flag indicating that offset processing is disabled. If the initial zoom magnification is within the intelligent zoom magnification range, and / or the second target zoom magnification is within the intelligent zoom magnification range, it means that the entire zoom process will pass through the intelligent zoom magnification range, and therefore offset processing needs to be enabled in advance. Thus, the target offset processing flag is determined as the second flag indicating that offset processing is enabled. By determining the target offset processing identifier using the above method, the current frame can be offset in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the offset of the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding the "turning" or jumping of the image in the picture. It can also avoid the movement of the image in the picture caused by offset processing of the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the picture during zooming.
[0084] In an exemplary embodiment, when the zoom mode is a point-to-point zoom mode, after comparing the current zoom magnification with the first target zoom magnification, the method further includes:
[0085] If the current zoom ratio is equal to the first target zoom ratio, compare the second target zoom ratio with the intelligent zoom ratio range; if the second target zoom ratio is outside the intelligent zoom ratio range, determine the target offset processing identifier as the first identifier; if the second target zoom ratio is within the intelligent zoom ratio range, determine the target offset processing identifier as the second identifier.
[0086] For example, if the current zoom ratio is equal to the first target zoom ratio, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier. If the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
[0087] In an exemplary embodiment, when the current zoom ratio equals the first target zoom ratio, comparing the second target zoom ratio with the intelligent zoom ratio range includes: determining that the point-cutting method's point-cutting type is discontinuous point-cutting when the current zoom ratio equals the first target zoom ratio; and comparing the second target zoom ratio with the intelligent zoom ratio range when the point-cutting method's point-cutting type is determined to be discontinuous point-cutting. Here, discontinuous point-cutting means that the next triggering operation occurs only after the previous triggering operation has been completed. This can be understood as the second target zoom ratio being obtained only after the first target zoom ratio has been reached.
[0088] In this embodiment, the current zoom magnification is equal to the first target zoom magnification, indicating that the cut type is discontinuous cut. When the cut type is discontinuous, if the second target zoom magnification is outside the intelligent zoom magnification range, the predicted landing point of this discontinuous cut is outside the intelligent zoom magnification range, and offset processing does not need to be enabled. Therefore, the target offset processing flag is determined as the first flag indicating that offset processing is disabled. If the second target zoom magnification is within the intelligent zoom magnification range, the predicted landing point of this discontinuous cut will not be within the intelligent zoom magnification range, and offset processing does not need to be enabled. Therefore, the target offset processing flag is determined as the first flag indicating that offset processing is disabled, thereby improving the accuracy of the target offset flag.
[0089] In an exemplary embodiment, determining the target frame corresponding to the current frame based on the target offset processing identifier includes:
[0090] If the target offset processing identifier is the first identifier, the current frame is determined as the target frame; if the target offset processing identifier is the second identifier, the current frame is offset to obtain the target frame corresponding to the current frame.
[0091] The target frame refers to the image data that is ultimately used for display.
[0092] For example, when the electronic device determines that the target offset processing identifier is a first identifier, it identifies the current frame as the target frame; when it determines that the target offset processing identifier is a second identifier, it performs offset processing on the current frame to obtain the target frame corresponding to the current frame. For example, a schematic diagram of the current frame and the target frame is shown below. Figure 4 As shown, Figure 4 The left image in the image is the current image corresponding to the current frame before offset processing. The center position of the current image has been offset. Figure 4 The right image in the figure is the target image corresponding to the target frame after offset processing.
[0093] In this embodiment, when the target offset processing identifier is the first identifier, the current frame is directly determined as the target frame, avoiding image movement in the scene caused by offset processing of the current frame when the image sensor does not need to switch to intelligent zoom mode; when the target offset processing identifier is the second identifier, the current frame is offset to obtain the target frame corresponding to the current frame, that is, the current frame is offset in advance to compensate for the offset of the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding the "turning" or jumping of the image in the scene, thereby improving the smoothness of the scene during zoom.
[0094] In one exemplary embodiment, a schematic diagram of the image processing flow is shown below. Figure 5 As shown, it includes:
[0095] During image preview or video recording, the electronic device responds to zoom operations on the zoom control, obtains the zoom mode of the zoom operation, obtains the current zoom magnification, obtains the current frame based on the current zoom magnification, obtains the latest second target zoom magnification obtained by the hardware abstraction layer, and obtains the first target zoom magnification obtained by the hardware abstraction layer before the second target zoom magnification.
[0096] The electronic device acquires the intelligent zoom magnification range and determines whether the current zoom magnification is within the intelligent zoom magnification range. If the current zoom magnification is within the intelligent zoom magnification range, it acquires the current offset processing identifier and determines it as the target offset processing identifier. If the current zoom magnification is outside the intelligent zoom magnification range, it determines the target offset processing identifier, which indicates whether offset processing should be performed, based on the zoom mode, the first target zoom magnification, and the second target zoom magnification.
[0097] If the zoom method is a sliding cut, the electronic device determines the zoom ratio difference as the absolute value of the difference between the first target zoom ratio and the second target zoom ratio. This zoom ratio difference is then compared to a difference threshold. If the zoom ratio difference is greater than the difference threshold, the sliding cut type is determined to be Type I. If the zoom ratio difference is less than or equal to the difference threshold, the sliding cut type is determined to be Type II. A schematic diagram illustrating the classification of sliding cut and point-cut methods is shown below. Figure 6 As shown, the sliding cut type of the sliding cut mode and the point cut type of the point cut mode are determined by the first target zoom magnification, the current zoom magnification, and the second target zoom magnification. The sliding cut type includes the first type (fast sliding cut) and the second type (slow sliding cut), and the point cut type includes continuous point cut and discontinuous point cut.
[0098] When the sliding cut type is the first type, the electronic device compares the zoom ratio difference with the change threshold. If the zoom ratio difference is greater than or equal to the change threshold, the target offset processing identifier is determined to be the first identifier. If the zoom ratio difference is less than the change threshold, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier. If the zoom ratio difference is less than the change threshold, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier.
[0099] After determining that the sliding type of the sliding method is the second type, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier; if the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
[0100] If the zoom mode is point-cut mode, the electronic device compares the current zoom magnification with the first target zoom magnification. If the current zoom magnification is not equal to the first target zoom magnification, the electronic device determines that the point-cut mode is continuous point-cut; if the current zoom magnification is equal to the first target zoom magnification, the electronic device determines that the point-cut mode is discontinuous point-cut.
[0101] When the point-cutting method is continuous point-cutting, the electronic device acquires the acquisition time of the first target zoom ratio, determines the starting zoom ratio of the image frame corresponding to the acquisition time, compares the starting zoom ratio with the intelligent zoom ratio range, and compares the second target zoom ratio with the intelligent zoom ratio range. If the starting zoom ratio is outside the intelligent zoom ratio range and the second target zoom ratio is outside the intelligent zoom ratio range, then the target offset processing identifier is determined to be the first identifier; if the starting zoom ratio is within the intelligent zoom ratio range and / or the second target zoom ratio is within the intelligent zoom ratio range, then the target offset processing identifier is determined to be the second identifier.
[0102] When the point cutting type is non-continuous point cutting, the electronic device compares the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier. If the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
[0103] When the electronic device determines that the target offset processing identifier is the first identifier, it determines the current frame as the target frame; when it determines that the target offset processing identifier is the second identifier, it performs offset processing on the current frame to obtain the target frame corresponding to the current frame.
[0104] Start zooming; resume image preview or video recording after zooming is complete.
[0105] The above solution primarily optimizes the determination of offset processing indicators for fast sliding cuts and continuous point cuts, specifically improving the decision-making logic for whether offset processing should be performed. This enhances the accuracy of offset processing indicator determination, significantly reducing issues like abnormal curves or jitter in the center of objects during zooming, particularly noticeable in continuous point cuts and fast sliding cuts. Comparative analysis shows that using this solution reduces abnormal curves and jitter in these two scenarios by 80%, substantially improving the smoothness of the image during zooming.
[0106] In the aforementioned image processing method, during zooming, the electronic device acquires the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio. It determines whether the image sensor has switched to intelligent zoom mode by judging whether the current zoom ratio is within the intelligent zoom ratio range. If the current zoom ratio is outside the intelligent zoom ratio range, it is determined that the image sensor has not yet switched to intelligent zoom mode. If it is determined that the image sensor has not yet switched to intelligent zoom mode, a target offset identifier is dynamically determined based on the zoom mode, the first target zoom ratio, and the second target zoom ratio. Based on the target offset identifier, it is determined whether to perform an image processing step on the current frame. By performing offset processing to obtain the target frame corresponding to the current frame, compared to continuously offsetting image frames or not offsetting image frames at all, by dynamically determining the target offset marker, the current frame can be offset in advance when the image sensor needs to switch to intelligent zoom mode. This compensates for the shift in the image center position caused by the image sensor switching to intelligent zoom mode, thereby reducing or avoiding the "turning" or jumping of the image in the picture. It can also avoid the movement of the image in the picture caused by offset processing of the current frame when the image sensor does not need to switch to intelligent zoom mode, thus improving the smoothness of the picture during zooming.
[0107] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0108] Based on the same inventive concept, this application also provides an image processing apparatus for implementing the image processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more image processing apparatus embodiments provided below can be found in the limitations of the image processing method described above, and will not be repeated here.
[0109] In one exemplary embodiment, such as Figure 7 As shown, an image processing apparatus is provided, including: an acquisition module 702, a determination module 704, and a processing module 706, wherein:
[0110] The acquisition module 702 is used to acquire the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio acquired before the second target zoom ratio.
[0111] The determination module 704 is used to determine the target offset processing identifier based on the zoom method, the first target zoom ratio, and the second target zoom ratio when the current zoom ratio is outside the intelligent zoom ratio range.
[0112] The processing module 706 is used to determine the target frame corresponding to the current frame based on the target offset processing identifier.
[0113] In an exemplary embodiment, the determining module is further configured to: determine the zoom ratio difference between the first target zoom ratio and the second target zoom ratio when the zoom mode is a sliding mode; compare the zoom ratio difference with a difference threshold, and if the zoom ratio difference is greater than the difference threshold, determine a target offset processing identifier based on the zoom ratio difference and the difference threshold.
[0114] In an exemplary embodiment, the determining module 704 is further configured to: determine the target offset processing identifier as a first identifier when the zoom ratio difference is greater than or equal to a change threshold; the first identifier indicates that the offset processing is turned off; determine the target offset processing identifier as a second identifier when the zoom ratio difference is less than the change threshold and the second target zoom ratio is within the intelligent zoom ratio range; the second identifier indicates that the offset processing is turned on; and determine the target offset processing identifier as the first identifier when the zoom ratio difference is less than the change threshold and the second target zoom ratio is outside the intelligent zoom ratio range.
[0115] In an exemplary embodiment, the determining module 704 is further configured to: obtain a stop sliding flag when the zoom ratio difference is greater than a difference threshold; obtain the target zoom ratio of the image frame corresponding to the time of obtaining the stop sliding flag; and determine a target offset flag based on the target zoom ratio.
[0116] In an exemplary embodiment, the determining module 704 is further configured to: compare the second target zoom ratio with the intelligent zoom ratio range when the zoom ratio difference is less than or equal to the difference threshold; determine the target offset processing identifier as the first identifier when the second target zoom ratio is outside the intelligent zoom ratio range; and determine the target offset processing identifier as the second identifier when the second target zoom ratio is within the intelligent zoom ratio range.
[0117] In an exemplary embodiment, the determining module 704 is further configured to: when the zoom mode is a point-cut mode, compare the current zoom ratio with the first target zoom ratio; when the current zoom ratio is not equal to the first target zoom ratio, obtain the starting zoom ratio corresponding to the first target zoom ratio; the starting zoom ratio is the zoom ratio of the image frame corresponding to the time when the first target zoom ratio is obtained; and determine the target offset processing identifier based on the starting zoom ratio and the second target zoom ratio.
[0118] In an exemplary embodiment, the determining module 704 is further configured to: determine the target offset processing identifier as a first identifier when both the initial zoom magnification and the second target zoom magnification are outside the intelligent zoom magnification range; and determine the target offset processing identifier as a second identifier when at least one of the initial zoom magnification and the second target zoom magnification is within the intelligent zoom magnification range.
[0119] In an exemplary embodiment, the determining module 704 is further configured to: compare the second target zoom ratio with the intelligent zoom ratio range when the current zoom ratio is equal to the first target zoom ratio; determine the target offset processing identifier as the first identifier when the second target zoom ratio is outside the intelligent zoom ratio range; and determine the target offset processing identifier as the second identifier when the second target zoom ratio is within the intelligent zoom ratio range.
[0120] In an exemplary embodiment, the processing module 706 is further configured to: determine the current frame as the target frame when the target offset processing identifier is a first identifier; and perform offset processing on the current frame to obtain the target frame corresponding to the current frame when the target offset processing identifier is a second identifier.
[0121] Each module in the aforementioned image processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0122] In one exemplary embodiment, an electronic device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 8As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements an image processing method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the electronic device, or external keyboards, touchpads, or mice, etc.
[0123] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0124] In one embodiment, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0125] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0126] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0127] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0128] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0129] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0130] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: The zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio are obtained; the first target zoom ratio is the target zoom ratio obtained before the second target zoom ratio. If the current zoom ratio is outside the intelligent zoom ratio range, a target offset processing identifier is determined based on the zoom method, the first target zoom ratio, and the second target zoom ratio. Based on the target offset processing identifier, the target frame corresponding to the current frame is determined.
2. The method according to claim 1, characterized in that, The step of determining the target offset processing identifier based on the zoom method, the first target zoom ratio, and the second target zoom ratio includes: When the zoom mode is a sliding mode, the zoom ratio difference between the first target zoom ratio and the second target zoom ratio is determined; Compare the zoom ratio difference with the difference threshold; If the zoom ratio difference is greater than the difference threshold, a target offset processing identifier is determined based on the zoom ratio difference and the change threshold.
3. The method according to claim 2, characterized in that, The determination of the target offset processing identifier based on the zoom ratio difference and the change threshold includes at least one of the following: If the zoom ratio difference is greater than or equal to the change threshold, the target offset processing identifier is determined to be a first identifier; the first identifier indicates that the offset processing is turned off. If the zoom ratio difference is less than the change threshold and the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier; the second identifier indicates that offset processing is enabled. If the zoom ratio difference is less than the change threshold and the second target zoom ratio is outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier.
4. The method according to claim 2, characterized in that, The method further includes: If the zoom ratio difference is greater than the difference threshold, a stop-slide indicator is obtained; Obtain the target zoom ratio of the image frame corresponding to the acquisition time of the stop sliding flag; Based on the target zoom ratio, determine the target offset identifier.
5. The method according to claim 2, characterized in that, The method further includes: If the zoom ratio difference is less than or equal to the difference threshold, compare the second target zoom ratio with the intelligent zoom ratio range. If the second target zoom ratio is outside the range of the intelligent zoom ratio, the target offset processing identifier is determined to be the first identifier; If the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
6. The method according to claim 1, characterized in that, The step of determining the target offset processing identifier based on the zoom method, the first target zoom ratio, and the second target zoom ratio includes: When the zoom mode is point-to-point, compare the current zoom ratio with the first target zoom ratio; If the current zoom ratio is not equal to the first target zoom ratio, the starting zoom ratio corresponding to the first target zoom ratio is obtained; the starting zoom ratio is the zoom ratio of the image frame corresponding to the time when the first target zoom ratio is obtained. Based on the initial zoom ratio and the second target zoom ratio, a target offset processing identifier is determined.
7. The method according to claim 6, characterized in that, The step of determining the target offset processing identifier based on the initial zoom ratio and the second target zoom ratio includes: When both the initial zoom ratio and the second target zoom ratio are outside the intelligent zoom ratio range, the target offset processing identifier is determined to be the first identifier; If at least one of the initial zoom ratio and the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
8. The method according to claim 6, characterized in that, The method further includes: When the current zoom ratio is equal to the first target zoom ratio, compare the second target zoom ratio with the intelligent zoom ratio range; If the second target zoom ratio is outside the range of the intelligent zoom ratio, the target offset processing identifier is determined to be the first identifier; If the second target zoom ratio is within the intelligent zoom ratio range, the target offset processing identifier is determined to be the second identifier.
9. The method according to claim 1, characterized in that, Determining the target frame corresponding to the current frame based on the target offset processing identifier includes: If the target offset processing identifier is the first identifier, the current frame is determined as the target frame; When the target offset processing identifier is the second identifier, the current frame is offset to obtain the target frame corresponding to the current frame.
10. An image processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire the zoom mode, the current zoom ratio corresponding to the current frame, the first target zoom ratio, and the second target zoom ratio; the first target zoom ratio is the target zoom ratio acquired before the second target zoom ratio. The determination module is used to determine a target offset processing identifier based on the zoom method, the first target zoom ratio, and the second target zoom ratio when the current zoom ratio is outside the intelligent zoom ratio range; The processing module is used to determine the target frame corresponding to the current frame based on the target offset processing identifier.
11. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.