Image zooming and translation method and device and computer readable storage medium

By sampling and calculating the scaling scale and coordinates during the image scaling and translation process, and generating continuous frames, the problem of unsmooth image scaling and translation in the prior art is solved, and the user experience is improved.

CN118917998APending Publication Date: 2024-11-08SUZHOU JABQUS INFO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411027715.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The existing image scaling and translation methods cannot transition with smooth animation effects, causing the image to jump or flicker suddenly during the scaling and translation process, reducing user experience satisfaction.

Method used

By obtaining the initial coordinates of the image, the initial coordinates of the mouse, the preset scaling scale scale and the translation transformation matrix, the target coordinates after scaling and translation are calculated, and sampling them from the start time to the end time of scaling and translation, the scaling of multiple scaling and translation moments is obtained. Scale scale, calculate the image coordinates at each moment, and generate continuous frames to achieve smooth animation effects.

Benefits of technology

Avoid sudden jumps or flickers of images during zooming and panning, improve user experience satisfaction and provide a coherent zooming and panning effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118917998A_ABST
    Figure CN118917998A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and relates to an image scaling and translation method and device and a computer readable storage medium. The method comprises the following steps: acquiring an initial coordinate of a to-be-processed image, an initial coordinate of a mouse, a preset scaling scale, a translation transformation matrix, scaling and translation starting time and ending time; based on the initial coordinate of the to-be-processed image, the initial coordinate of the mouse, a preset scaling scale and a translation transformation matrix, calculating a target coordinate after scaling translation; sampling from the zooming and translation starting time to the zooming and translation ending time to obtain a plurality of zooming and translation moments, and calculating a zooming scale based on each zooming and translation moment, the initial coordinate of the to-be-processed image, the target coordinate after zooming and translation, the zooming and translation starting time and the zooming and translation ending time; and based on the scaling scale of each scaling translation moment, the initial coordinate of the to-be-processed image and the initial coordinate of the mouse, calculating the coordinate of the to-be-processed image at the scaling translation moment to obtain scaling translation continuous frames of the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to an image zooming and translation method, device and computer-readable storage medium. Background Art

[0002] Image zooming and panning is an important technology in image processing. Mouse-based image zooming and panning is usually used in interactive image editing and viewing programs, such as image browsers, image editing software or map browsers. When users control the image zooming and panning through mouse operations, it responds to user operations in real time and instantly updates the zoomed and panned image to meet the user's current usage requirements and enhance the user experience.

[0003] The existing image scaling and translation method represents the current coordinates of the image through a fourth-order matrix, and then combines the fourth-order translation matrix and the scaling matrix to calculate the coordinates of the image after scaling and translation, drives the changes of the screen elements, and thus realizes the image scaling and translation; although this method can achieve the effect of scaling and translation of the image centered on the mouse, this method directly calculates the coordinates of the image after scaling and translation based on the current coordinates of the image, the scaling matrix and the translation matrix, and cannot smoothly process the change process, resulting in a step-like mutation of the screen when the image is scaled and translated, which is not coherent and makes user satisfaction poor.

[0004] In summary, the existing image zooming and panning methods cannot perform transitions with smooth animation effects, resulting in abrupt jumps or flickers of the image during the zooming and panning process, causing eye fatigue and discomfort to the user, and reducing user experience satisfaction. Summary of the invention

[0005] To this end, the technical problem to be solved by the present invention is to overcome the problem that the image zooming and translation methods in the prior art cannot transition with a smooth animation effect, resulting in abrupt jumping or flickering of the image during the zooming and translation process, causing eye fatigue and discomfort to the user, and reducing user experience satisfaction.

[0006] In order to solve the above technical problems, the present invention provides an image zooming and translation method, comprising:

[0007] Get the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the start time and end time of the zoom and translation;

[0008] Based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale and the translation transformation matrix, the target coordinates of the image to be processed after zooming and translation are calculated;

[0009] Sampling is performed during the zooming and translation start time and the end time to obtain a plurality of zooming and translation moments, and based on each zooming and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zooming and translation start time and the end time, the zooming and translation moment is calculated.

[0010] Based on the zoom scale at each zoom and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse, the coordinates of the image to be processed at the zoom and translation moment are calculated;

[0011] Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, zooming and translation continuous frames of the image to be processed are obtained.

[0012] Preferably, the calculation formula of the target coordinates after the image to be processed is scaled and translated is:

[0013]

[0014] Among them, x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate of the image to be processed after scaling and translation; cx represents the initial horizontal coordinate of the mouse; cy represents the initial vertical coordinate of the mouse; s represents the preset scaling scale; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed.

[0015] Preferably, the calculation formula for the scaling scale at the time of scaling and translation is:

[0016] s i =(x,y)+((x ′ ,y ′ )-(x,y))×fn((t i -t) / (t ′ -t)),

[0017] Among them, s i represents the scale of the i-th zooming and translation moment; (x, y) represents the initial coordinates of the image to be processed; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed; (x ′ ,y ′ ) represents the target coordinates of the image to be processed after scaling and translation; x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate after the image to be processed is scaled and translated; fn represents the curve function; t i represents the i-th zoom translation moment; t represents the start time of zoom translation; t ′ Indicates the zoom and pan end time.

[0018] Preferably, the calculation formula for the horizontal coordinate of the image to be processed at the time of zooming and translation is:

[0019] x i =s i ×(x-cx)+cx,

[0020] Among them, x i represents the horizontal coordinate of the image to be processed at the i-th zoom and translation moment; s i represents the scale of the zoom ratio at the i-th zoom and translation moment; x represents the initial horizontal coordinate of the image to be processed; cx represents the initial horizontal coordinate of the mouse;

[0021] The calculation formula of the ordinate of the image to be processed at the time of zooming and translation is:

[0022] y i =s i ×(y-cy)+cy,

[0023] Among them, y i represents the ordinate of the image to be processed at the i-th zoom and translation moment; y represents the initial ordinate of the image to be processed; cy represents the initial ordinate of the mouse.

[0024] Preferably, based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, obtaining zooming and translation continuous frames of the image to be processed includes:

[0025] Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, an animation function of the coordinates of the image to be processed changing with time is obtained;

[0026] The animation function is called at each zooming and translation moment and zooming and translation end time by using the animate function, the target image at each zooming and translation moment and zooming and translation end time is drawn, and the zooming and translation continuous frames of the image to be processed are obtained based on all the target images.

[0027] Preferably, the zoom translation start time is the mouse wheel driving time.

[0028] Preferably, the calculation formula for the zoom translation end time is:

[0029] t ′ =t+t0,

[0030] Among them, t ′ Indicates the end time of zooming and panning; t indicates the start time of zooming and panning; t0 indicates the preset delay time of the animation.

[0031] The present invention also provides an image zooming and translation device, comprising:

[0032] A data acquisition module is used to obtain the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the zoom and translation start time and end time;

[0033] A first coordinate calculation module is used to calculate the target coordinates of the image to be processed after scaling and translation based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset scaling scale and the translation transformation matrix;

[0034] A zoom scale calculation module is used to perform sampling from the start time to the end time of the zoom and translation to obtain multiple zoom and translation moments, and calculate the zoom scale of the zoom and translation moment based on each zoom and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zoom and translation start time and the end time;

[0035] A second coordinate calculation module, for calculating the coordinates of the image to be processed at each zooming and translation moment based on the zooming scale at each zooming and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse;

[0036] The zooming and translation continuous frame acquisition module is used to obtain the zooming and translation continuous frames of the image to be processed based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation.

[0037] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned image zooming and translation method are implemented.

[0038] The image zooming and translation method provided by the present application obtains multiple zooming and translation moments by sampling between the zooming and translation start time and the end time, and calculates the zoom ratio scale of each zooming and translation moment based on each zooming and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zooming and translation start time and the end time, so that the coordinates of the image to be processed at each zooming and translation moment can be calculated, and the picture of the image to be processed in the middle of the zooming and translation process can be obtained by combining the coordinates of the image to be processed at each zooming and translation moment in the zooming and translation process and the target coordinates after the zooming and translation end, and the continuous frames of zooming and translation of the image to be processed are obtained based on these pictures, and the image zooming and translation process is displayed with a smooth animation effect, thereby avoiding abrupt jumping or flickering of the image during the zooming and translation process, and improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] In order to make the content of the present invention more clearly understood, the present invention is further described in detail below according to specific embodiments of the present invention in conjunction with the accompanying drawings, wherein:

[0040] Figure 1 A flow chart of the image zooming and panning method provided in this application;

[0041] Figure 2 Schematic diagram of the image zooming and panning principle provided for this application;

[0042] Figure 3 This is a schematic diagram of the structure of the image zooming and translation device provided in this application. DETAILED DESCRIPTION

[0043] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0044] See also Figure 1 , Figure 1 The present invention provides a flow chart of the image zooming and panning method, which specifically includes:

[0045] S10: Obtaining the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the zoom and translation start time and end time;

[0046] Specifically, the zoom and translation start time is the mouse wheel driving time; the calculation formula for the zoom and translation end time is:

[0047] t ′ =t+t0,

[0048] Among them, t ′ Indicates the end time of zooming and panning; t indicates the start time of zooming and panning; t0 indicates the preset delay time of the animation (i.e. the animation playback time);

[0049] S20: Calculating the target coordinates of the image to be processed after scaling and translation based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset scaling scale and the translation transformation matrix;

[0050] S30: Sampling is performed during the zooming and translation start time and the end time to obtain a plurality of zooming and translation moments, and based on each zooming and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zooming and translation start time and the end time, the zooming and translation moment is calculated.

[0051] S40: Calculating the coordinates of the image to be processed at each zooming and translation moment based on the zooming scale at each zooming and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse;

[0052] S50: Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, continuous zooming and translation frames of the image to be processed are obtained.

[0053] The image zooming and translation method provided by the present application obtains multiple zooming and translation moments by sampling between the zooming and translation start time and the end time, and calculates the zoom ratio scale of each zooming and translation moment based on each zooming and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zooming and translation start time and the end time, so that the coordinates of the image to be processed at each zooming and translation moment can be calculated, and the picture of the image to be processed in the middle of the zooming and translation process can be obtained by combining the coordinates of the image to be processed at each zooming and translation moment in the zooming and translation process and the target coordinates after the zooming and translation end, and the continuous frames of zooming and translation of the image to be processed are obtained based on these pictures, and the image zooming and translation process is displayed with a smooth animation effect, thereby avoiding abrupt jumping or flickering of the image during the zooming and translation process, and improving user satisfaction.

[0054] like Figure 2 The figure shows a schematic diagram of the image zooming and translation principle provided by an embodiment of the present application. In the figure, three rectangles A, B, and C exist in a graphical interface. By driving the mouse wheel, the rectangles in the interface will be scaled proportionally with the cursor as the center. The transformation of zooming and translation along the mouse position in the figure can be described as: the original coordinate system is translated along the xy plane to the mouse position, then zoomed, and finally translated in the opposite direction to the position of the origin of the original view.

[0055] Based on the above principle, the calculation formula of the target coordinates after scaling and translation of the image to be processed is:

[0056]

[0057] Among them, x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate of the image to be processed after scaling and translation; cx represents the initial horizontal coordinate of the mouse; cy represents the initial vertical coordinate of the mouse; s represents the preset scaling scale; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed.

[0058] Specifically, Represents the translation transformation matrix from the mouse coordinates to the view origin, Represents the translation transformation matrix from the view origin to the mouse coordinates; Indicates the center scaling of the graphic. When the preset scaling scale s=1, no scaling is performed. When s>1, the graphic is enlarged. When s<1, the graphic is reduced.

[0059] Furthermore, the change of the zoom ratio scale over time during the image zooming and translation process is calculated based on the curve function. Specifically, the curve function is the effect of animation playback. Different animation playback effects correspond to different curve functions. For example, uniform speed playback, fast first and then slow, and slow first and then fast all correspond to different curve functions.

[0060] Specifically, the calculation formula for the scaling scale at the time of scaling and translation is:

[0061] s i =(x,y)+((x ′ ,y ′ )-(x,y))×fn((t i -t) / (t ′ -t)),

[0062] Among them, s i represents the scale of the i-th zooming and translation moment; (x, y) represents the initial coordinates of the image to be processed; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed; (x ′ ,y ′ ) represents the target coordinates of the image to be processed after scaling and translation; x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate after the image to be processed is scaled and translated; fn represents the curve function; t i represents the i-th zoom translation moment; t represents the start time of zoom translation; t ′ Indicates the zoom and pan end time.

[0063] Furthermore, after calculating the scaling scale at each scaling and translation moment, the coordinates of the image to be processed at each scaling and translation moment can be calculated in combination with the transformer function;

[0064] Specifically, the calculation formula of the horizontal coordinate of the image to be processed at the time of zooming and translation is:

[0065] x i =s i ×(x-cx)+cx,

[0066] Among them, x i represents the horizontal coordinate of the image to be processed at the i-th zoom and translation moment; s i represents the scale of the zoom ratio at the i-th zoom and translation moment; x represents the initial horizontal coordinate of the image to be processed; cx represents the initial horizontal coordinate of the mouse;

[0067] The calculation formula of the ordinate of the image to be processed at the time of zooming and translation is:

[0068] y i =si ×(y-cy)+cy,

[0069] Among them, y i represents the ordinate of the image to be processed at the i-th zoom and translation moment; y represents the initial ordinate of the image to be processed; cy represents the initial ordinate of the mouse.

[0070] The coordinates of the image to be processed at each zooming and translation moment can be used to draw the graphics corresponding to each moment, and the graphics corresponding to all moments can be combined to obtain the zooming and translation continuous frames, which continuously display the zooming and translation process of the image to be processed;

[0071] Specifically, in some embodiments of the present application, the specific implementation steps of step S50 are:

[0072] Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, an animation function of the coordinates of the image to be processed changing with time is obtained;

[0073] The animation function is called at each zooming and translation moment and zooming and translation end time by using the animate function, the target image at each zooming and translation moment and zooming and translation end time is drawn, and the zooming and translation continuous frames of the image to be processed are obtained based on all the target images.

[0074] The present application also provides a program code for the above-mentioned image zooming and translation method:

[0075] 1. Initialize global variables

[0076] Mouse change position (cx, cy);

[0077] Animation execution handle animationId, set to null;

[0078] The start timestamp of the transformation, beginTime, is in milliseconds;

[0079] The relative scale beginRelativeScale at the beginning of the transformation is set to 1;

[0080] The end timestamp of the transformation: endTime;

[0081] The relative scale endRelativeScale at the end of the transformation is set to 1;

[0082] Current relative scale currentRelativeScale, set to 1;

[0083] 2. Bind mouse wheel events to container elements

[0084] Define the mouse wheel event driver function:

[0085] (1) Obtain the scroll wheel change value and calculate the target value deltaY of the zoom scale;

[0086] (2) Set the absolute scaling scale of each element to the current width width / transformation start width startWidth*scaling absolute scaling scale (the previous scale value), so as to iteratively update the scaling scale;

[0087] (3) Record the starting position of each element as the current position coordinate of the element, and record the starting size of each element as the current size of the element;

[0088] (4) Get the current time now;

[0089] (5) Set global state variables:

[0090] Record the current position of the mouse (cx, cy);

[0091] Set the starting relative scale of the transformation beginRelativeScale to 1;

[0092] Set the start time of the transformation to the current time now;

[0093] Set the end relative scale of the transformation endRelativeScale to 1+deltaY;

[0094] Set the end time of the transformation to the current timestamp now + the number of milliseconds of the animation interval animationInterval;

[0095] (6) Check whether there is an animation currently running, that is, determine whether animationId is null; if it is not running, use the platform interface to request to draw the animation frame and save the result returned by the interface to animationId;

[0096] Animation frame drawing function:

[0097] 1. Get the current time iTime;

[0098] 2. Determine the current time iTime and the end time endTime of the transformation;

[0099] If the current time iTime>=the end time endTime of the transformation, the platform interface is used to cancel the animation execution, and animationId is set to null, and the function returns;

[0100] Otherwise, continue with the following steps;

[0101] 3. Calculate the current relative scale currentRelativeScale, the calculation formula is:

[0102] Beginning relative scale beginRelativeScale+(end relative scale endRelativeScale-begin relative scale beginRelativeScale)*curve function fn_curve((current time iTime-start time beginTime) / (end time endTime-start time beginTime));

[0103] 4. Use the current relative scale currentRelativeScale and transform function to calculate the position and size of each element and drive the update;

[0104] 5. Use the platform interface to continue requesting the next frame of animation;

[0105] Based on the image zooming and translation method provided in the above embodiment, the embodiment of the present application also provides an image zooming and translation device, such as Figure 3 As shown, the device specifically includes:

[0106] The data acquisition module 10 is used to acquire the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the zoom and translation start time and end time;

[0107] A first coordinate calculation module 20 is used to calculate the target coordinates of the image to be processed after scaling and translation based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, a preset scaling scale and a translation transformation matrix;

[0108] A zoom scale calculation module 30 is used to perform sampling from the zoom and translation start time to the end time to obtain multiple zoom and translation moments, and calculate the zoom scale of each zoom and translation moment based on the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zoom and translation start time and the end time;

[0109] A second coordinate calculation module 40 is used to calculate the coordinates of the image to be processed at each zooming and translation moment based on the zoom scale at each zooming and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse;

[0110] The zooming and translation continuous frame acquisition module 50 is used to obtain the zooming and translation continuous frames of the image to be processed based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation.

[0111] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned image zooming and translation method are implemented.

[0112] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0113] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0114] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0115] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0116] Obviously, the above embodiments are merely examples for the purpose of clear explanation and are not intended to limit the implementation methods. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived therefrom are still within the scope of protection of the present invention.

Claims

1. A method for image zooming and translation, It is characterized in that include: Get the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the start time and end time of the zoom and translation; Based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale and the translation transformation matrix, the target coordinates of the image to be processed after zooming and translation are calculated; Sampling is performed during the zooming and translation start time and the end time to obtain a plurality of zooming and translation moments, and based on each zooming and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zooming and translation start time and the end time, the zooming and translation moment is calculated. Based on the zoom scale at each zoom and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse, the coordinates of the image to be processed at the zoom and translation moment are calculated; Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, zooming and translation continuous frames of the image to be processed are obtained.

2. The image zooming and translation method according to claim 1, It is characterized in that The calculation formula of the target coordinates after scaling and translation of the image to be processed is: Among them, x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate of the image to be processed after scaling and translation; cx represents the initial horizontal coordinate of the mouse; cy represents the initial vertical coordinate of the mouse; s represents the preset scaling scale; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed.

3. The image zooming and panning method according to claim 1, It is characterized in that The calculation formula for the scaling scale at the time of zooming and translation is: s i =(x,y)+((x ′ ,y ′ )-(x,y))×fn((t i -t) / (t ′ -t)), Among them, s i represents the scale of the i-th zooming and translation moment; (x, y) represents the initial coordinates of the image to be processed; x represents the initial horizontal coordinate of the image to be processed; y represents the initial vertical coordinate of the image to be processed; (x ′ ,y ′ ) represents the target coordinates of the image to be processed after scaling and translation; x ′ Indicates the target horizontal coordinate of the image to be processed after scaling and translation; y ′ represents the target vertical coordinate after the image to be processed is scaled and translated; fn represents the curve function; t i represents the i-th zoom translation moment; t represents the start time of zoom translation; t ′ Indicates the zoom and pan end time.

4. The image zooming and panning method according to claim 1, It is characterized in that The calculation formula of the horizontal coordinate of the image to be processed at the time of zooming and translation is: x i =s i ×(x-cx)+cx, Among them, x i represents the horizontal coordinate of the image to be processed at the i-th zoom and translation moment; s i represents the scale of the zoom ratio at the i-th zoom and translation moment; x represents the initial horizontal coordinate of the image to be processed; cx represents the initial horizontal coordinate of the mouse; The calculation formula of the ordinate of the image to be processed at the time of zooming and translation is: and i =s i ×(y-cy)+cy, Among them, y i represents the ordinate of the image to be processed at the i-th zoom and translation moment; y represents the initial ordinate of the image to be processed; cy represents the initial ordinate of the mouse.

5. The image zooming and panning method according to claim 1, It is characterized in that Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, the zooming and translation continuous frames of the image to be processed are obtained, including: Based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation, an animation function of the coordinates of the image to be processed changing with time is obtained; The animation function is called at each zooming and translation moment and zooming and translation end time by using the animate function, the target image at each zooming and translation moment and zooming and translation end time is drawn, and the zooming and translation continuous frames of the image to be processed are obtained based on all the target images.

6. The image zooming and panning method according to claim 1, It is characterized in that The start time of zooming and panning is the mouse wheel driving time.

7. The image zooming and panning method according to claim 1, It is characterized in that The calculation formula for the zoom and pan end time is: t ′ =t+t 0 , Among them, t ′ Indicates the end time of zooming and panning; t indicates the start time of zooming and panning; t 0 Indicates the animation preset delay time.

8. An image zooming and panning device, It is characterized in that include: A data acquisition module is used to obtain the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset zoom scale, the translation transformation matrix, the zoom and translation start time and end time; A first coordinate calculation module is used to calculate the target coordinates of the image to be processed after scaling and translation based on the initial coordinates of the image to be processed, the initial coordinates of the mouse, the preset scaling scale and the translation transformation matrix; A zoom scale calculation module is used to perform sampling from the start time to the end time of the zoom and translation to obtain multiple zoom and translation moments, and calculate the zoom scale of the zoom and translation moment based on each zoom and translation moment, the initial coordinates of the image to be processed, the target coordinates of the image to be processed after zooming and translation, the zoom and translation start time and the end time; A second coordinate calculation module, for calculating the coordinates of the image to be processed at each zooming and translation moment based on the zooming scale at each zooming and translation moment, the initial coordinates of the image to be processed and the initial coordinates of the mouse; The zooming and translation continuous frame acquisition module is used to obtain the zooming and translation continuous frames of the image to be processed based on the coordinates of the image to be processed at each zooming and translation moment and the target coordinates of the image to be processed after zooming and translation.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image zooming and translation method according to any one of claims 1 to 7 are implemented.