CN111986088B - Image processing method, device, storage medium and terminal equipment - Google Patents

Image processing method, device, storage medium and terminal equipment Download PDF

Info

Publication number
CN111986088B
CN111986088B CN202010883178.0A CN202010883178A CN111986088B CN 111986088 B CN111986088 B CN 111986088B CN 202010883178 A CN202010883178 A CN 202010883178A CN 111986088 B CN111986088 B CN 111986088B
Authority
CN
China
Prior art keywords
image
screen
screenshot
data
original image
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010883178.0A
Other languages
Chinese (zh)
Other versions
CN111986088A (en
Inventor
沈佳照
林孙豪
陈润成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202010883178.0A priority Critical patent/CN111986088B/en
Publication of CN111986088A publication Critical patent/CN111986088A/en
Application granted granted Critical
Publication of CN111986088B publication Critical patent/CN111986088B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4092Image resolution transcoding, e.g. client/server architecture

Abstract

The application provides an image processing method, an image processing device, a storage medium and terminal equipment, wherein the method comprises the following steps: acquiring an original image; scaling the original image according to the size of the screen to obtain a scaled image; screenshot is carried out on the zoomed image displayed in the screen, and first screenshot data are obtained; controlling the zoomed image to move at least once, and respectively capturing images updated in the screen to obtain at least one second capturing data; and splicing the first screenshot data and at least one second screenshot data to obtain a screenshot image corresponding to the original image. According to the method and the device, the shortest side of the original image is zoomed to be the same as the shortest side of the screen, and the image stitching processing is combined, so that the zoomed image can be completely captured in the direction of the longest side, and therefore the whole zoomed image can be completely captured. In addition, the definition of the screenshot image can be ensured.

Description

Image processing method, device, storage medium and terminal equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to an image processing method, an image processing device, a storage medium, and a terminal device.
Background
The screen capture is a common function of the intelligent terminal equipment, and refers to a function of saving display content on a terminal screen as an image. In the process of using the intelligent terminal equipment, when the user encounters the content of interest, the content can be stored in a screenshot mode.
In the existing screen capture mode, the whole screen capture is usually performed, that is, after receiving a screen capture instruction of a user, the display content of the whole screen is captured.
The existing screen capturing mode needs that the content to be captured can be displayed on the screen completely, however, when the size of the content to be captured is larger than that of the screen, the existing screen capturing mode cannot completely capture the content to be captured, so that the problem of incomplete content capturing exists.
Disclosure of Invention
The application provides an image processing method, an image processing device, a storage medium and terminal equipment, which are used for solving the problem that the prior art cannot capture the content with a larger size.
In one aspect, the present application provides an image processing method, including:
acquiring an original image;
according to the size of the screen, scaling the original image to obtain a scaled image, wherein the length of a first edge of the scaled image is the same as the length of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is larger than the size of the screen;
screenshot is carried out on the zoomed image displayed in the screen, and first screenshot data are obtained;
controlling the zoomed image to move at least once, and respectively capturing images updated in the screen to obtain at least one second capturing data;
and splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image.
In another aspect, the present application provides an image processing apparatus, including:
the acquisition module is used for acquiring an original image;
the scaling module is used for scaling the original image according to the size of the screen to obtain a scaled image, the length of a first edge of the scaled image is the same as that of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is larger than that of the screen;
the screenshot module is used for screenshot the zoomed image displayed in the screen to obtain first screenshot data;
the screenshot module is also used for controlling the zoomed image to move at least once and screenshot the updated image in the screen respectively to obtain at least one second screenshot data;
and the splicing module is used for splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image.
In another aspect, the present application provides a terminal device, including:
a processor, a memory, a display;
the memory is used for storing programs and data, and the processor calls the programs stored in the memory to execute the image processing method.
In another aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are configured to implement the above-described image processing method.
The application provides an image processing method, an image processing device, a storage medium and terminal equipment, wherein the method comprises the following steps: acquiring an original image; according to the size of the screen, scaling the original image to obtain a scaled image, wherein the length of a first edge of the scaled image is the same as the length of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is larger than that of the screen; screenshot is carried out on the zoomed image displayed in the screen, and first screenshot data are obtained; controlling the zoomed image to move at least once, and respectively capturing images updated in the screen to obtain at least one second capturing data; and splicing the first screenshot data and at least one second screenshot data to obtain a screenshot image corresponding to the original image. According to the method and the device, the shortest side of the original image is zoomed to be the same as the shortest side of the screen, so that the zoomed image can be completely captured in the shortest side direction, in addition, the zoomed image can be completely captured in the longest side direction by moving the captured along the longest side direction and combining with image splicing, and therefore the fact that the zoomed image can be completely captured in the longest side direction is guaranteed. In addition, the original image is not completely scaled to the screen range, so that the definition of the screenshot image can be ensured.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic diagram of an image processing method according to an embodiment of the present application;
fig. 2 is an exemplary diagram of performing an enlarging process on an original image in the embodiment of the present application;
fig. 3 is an exemplary diagram of performing reduction processing on an original image in the embodiment of the present application;
FIG. 4 is a schematic diagram of an image obtained after a scaling process in an embodiment of the present application;
FIG. 5 is an example diagram of multiple screenshots in an embodiment of the present application;
FIG. 6 is another exemplary diagram of multiple screenshots in an embodiment of the present application;
fig. 7 is a schematic diagram of an image processing apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Specific embodiments of the present disclosure have been shown by way of the above drawings and will be described in more detail below. These drawings and the written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the disclosed concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the embodiments of the present application, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or system comprising such elements.
In the existing screenshot mode, on the premise that the screen can completely and clearly display the content to be screenshot, the screenshot is carried out on the display content of the whole screen, so that the corresponding image of the content to be screenshot is obtained.
For example, when the size of the screen is 1280×720, if the size of the content to be captured is the same as the size of the screen, that is, the content to be captured can be completely and clearly displayed on the screen, a captured image containing the content to be captured can be obtained through capturing, and the size of the captured image is 1280×720.
However, if the size of the content to be captured is different from the size of the screen, for example 3126×828, the content to be captured cannot be displayed on the screen completely; in addition, if the content to be captured is forcedly compressed, although the content to be captured can be completely displayed, the definition of the image is reduced, and the display is unclear.
Therefore, when the size of the content to be captured is different from the size of the screen, the existing screen capturing mode cannot perform complete and clear capturing processing on the content to be captured.
The image processing method, device, storage medium and terminal equipment provided by the application aim to solve the technical problems in the prior art.
After an original image to be captured is acquired, scaling is carried out on the original image, so that the length of the shortest side of the image after scaling is the same as that of the shortest side of a screen. At this time, the length of the longest side of the image after the zooming process is greater than the length of the longest side of the screen, so that a moving screenshot mode along the direction of the longest side is adopted to obtain first screenshot data and at least one second screenshot data, and finally the first screenshot data and the at least one second screenshot data are subjected to image stitching to obtain a screenshot image corresponding to the original image. Compared with the prior art, the method and the device have the advantages that the shortest side of the original image is zoomed to be the same as the shortest side of the screen, so that the zoomed image can be completely captured in the shortest side direction, in addition, the zoomed image can be completely captured in the longest side direction by moving the captured along the longest side direction and combining with image splicing, and therefore the fact that the whole zoomed image can be completely captured is guaranteed. In addition, the original image is not completely scaled to the screen range, so that the definition of the screenshot image can be ensured.
It should be noted that, when the size of the content to be captured is different from the size of the screen, the method further includes the situation that the length ratio of the content to be captured to the screen is the same as or different from the width ratio of the content to be captured to the screen. For the case that the length ratio and the width ratio are the same, for example, the screen size is a×b, the size of the content to be captured is 3a×3b, the length ratio and the width ratio are both 3, and after the content to be captured is scaled, the image after the scaling treatment can be displayed on the screen completely. For example, when the length ratio and the width ratio are different, the size of the screen is a×b, the size of the content to be captured is 5a×3b, and the length ratio and the width ratio are different, after scaling the content to be captured by using 3 as the scaling ratio, the size of the image after scaling is (5/3 a) ×b, at this time, the width of the image after scaling is the same as the width of the screen, that is, the width of the image after scaling is b, that is, the image after scaling can be completely displayed in the wide direction, but the length (5/3 a) of the image after scaling is greater than the length (b) of the size of the screen, that is, the image after scaling cannot be completely displayed in the long direction, so that the image after scaling cannot be completely displayed on the screen. Therefore, the technical scheme of the application can be particularly suitable for the content to be shot with different sizes and screen sizes and different length ratios and width ratios.
The following describes the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems in detail with specific embodiments. The following embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
It may be appreciated that the processing steps of the image processing method in the present application may be implemented by a terminal device, and in particular, may be implemented by a terminal device capable of performing a screenshot.
In some embodiments, an image processing method is provided.
Fig. 1 is a schematic diagram of an image processing method according to an embodiment of the present application, as shown in fig. 1, the method mainly includes the following steps:
s100, acquiring an original image.
The original image is an image containing contents to be captured, the size of the original image is different from that of the screen, and the length ratio and the width ratio of the original image to the screen are different. The original image is specifically an image after resolution adaptation is completed, and when resolution adaptation is performed, adaptation may be performed specifically by using a slow_all rule.
S200, scaling the original image according to the size of the screen to obtain a scaled image, wherein the length of a first side of the scaled image is the same as the length of a corresponding second side in the screen, the first side is the side with the shortest length in all sides of the scaled image, and the size of the scaled image is larger than the size of the screen.
When the size of the original image is different from the size of the screen and the length ratio and the width ratio are different, the original image cannot be displayed completely and clearly on the screen, so that the original image is first scaled to obtain a scaled image, so that the length of a first edge of the scaled image is the same as the length of a corresponding second edge in the screen, that is, the length of the shortest edge of the scaled image is the same as the length of the shortest edge of the screen.
In addition, since the length ratio and the width ratio of the original image to the screen are different, after the scaling process is performed on the original image, although the shortest side of the image after the scaling process is the same as the shortest side of the screen, the length of the longest side of the image after the scaling process is greater than the length of the longest side of the screen, that is, the size of the image after the scaling process is greater than the size of the screen.
S300, capturing a zoomed image displayed in a screen to obtain first captured data.
After the original image is subjected to scaling processing to obtain a scaled image, the shortest side of the scaled image is the same as the shortest side of the screen, so that the scaled image can completely fill the screen in the shortest side direction.
In addition, since the length of the longest side of the image after the scaling process is longer than the length of the longest side of the screen, the screen cannot completely display the image after the scaling process in the longest side direction, that is, the image after the scaling process includes the first portion displayed within the screen area and the other portion outside the screen area. Therefore, first, a first portion displayed in a screen area is first captured, and first captured data is obtained.
S400, controlling the zoomed image to move at least once, and respectively capturing the updated image in the screen to obtain at least one second capturing data.
After the first screenshot data is obtained, the zoomed image is controlled to move at least once so that other parts outside the screen area are displayed in the screen area, at this time, the image in the screen is updated, and at least one second screenshot data is obtained by screenshot the updated image in the screen, wherein the second screenshot data is the image corresponding to other parts outside the screen area before the image moves.
S500, splicing the first screenshot data and at least one second screenshot data to obtain a screenshot image corresponding to the original image.
After the first screenshot data and the at least one second screenshot data are obtained through screenshot, the first screenshot data and the at least one second screenshot data are spliced to obtain a screenshot image corresponding to the original image.
The embodiment provides an image processing method, which enables an image after zooming to be completely captured in the shortest side direction by zooming the shortest side of an original image to be the same as the shortest side of a screen, and further enables the image after zooming to be completely captured in the longest side direction by moving the captured in the longest side direction in combination with image stitching processing, thereby ensuring that the image after zooming can be completely captured in the whole image after zooming. In addition, the original image is not completely scaled to the screen range, so that the definition of the screenshot image can be ensured.
In some embodiments, scaling the original image according to the size of the screen to obtain a scaled image, including: if the shortest side of the original image is smaller than the shortest side of the screen, amplifying the original image to obtain an amplified image; if the shortest side of the original image is larger than the shortest side of the screen, the original image is subjected to reduction processing, and the reduced image is obtained.
Fig. 2 is an exemplary diagram of an original image subjected to an enlarging process in the embodiment of the present application, as shown in fig. 2, where P1 is the original image, and P1' is an image obtained by the original image subjected to the enlarging process. Since the shortest side of the image P1 is smaller than the shortest side of the screen, the original image P1 is subjected to the enlargement processing such that the shortest side of the image P1 'is the same as the shortest side of the screen in length, thereby enabling the image P1' to completely fill the entire screen in the shortest side direction.
Fig. 3 is an exemplary diagram of performing reduction processing on an original image in the embodiment of the present application, as shown in fig. 3, where P2 is the original image, and P2' is an image obtained after the reduction processing is performed on the original image. Since the shortest side of the image P2 is larger than the shortest side of the screen, the original image P2 is subjected to the reduction process so that the shortest side of the image P2 'is the same as the shortest side of the screen in length, thereby enabling the image P2' to completely fill the entire screen in the shortest side direction.
In this embodiment, the scaling process is performed on the original image according to the size of the screen and the size of the original image, specifically, according to the size relationship between the screen and the shortest side of the original image, so that the scaled image can completely fill the whole screen in the shortest side direction, so as to ensure that the image can be completely displayed in the shortest side direction.
In some embodiments, a process flow of scaling an original image according to the size of a screen to obtain a scaled image is explained.
Fig. 4 is a schematic diagram of an image after the scaling process in the embodiment of the present application, as shown in fig. 4, where the process flow includes:
s210, respectively determining a first ratio between the horizontal length of the original image and the horizontal length of the screen and a second ratio between the vertical length of the original image and the vertical length of the screen according to the size of the screen and the size of the original image;
s220, scaling the original image according to the first ratio and the second ratio to obtain a scaled image.
Specifically, when scaling an original image, a first ratio between the horizontal length of the original image and the horizontal length of the screen and a second ratio between the vertical length of the original image and the vertical length of the screen are determined, and then scaling the original image according to the first ratio and the second ratio, so as to obtain a scaled image.
In this embodiment, by determining a first ratio between the horizontal length of the original image and the horizontal length of the screen and a second ratio between the vertical length of the original image and the vertical length of the screen, and performing scaling processing on the original image according to the first ratio and the second ratio, the precision of the scaling processing may be improved.
In some embodiments, scaling the original image according to the first ratio and the second ratio to obtain a scaled image, including: and scaling the original image according to the minimum value in the first ratio and the second ratio to obtain a scaled image.
Specifically, after a first ratio between the horizontal length of the original image and the horizontal length of the screen and a second ratio between the vertical length of the original image and the vertical length of the screen are obtained, in order to ensure that the length of the shortest side of the scaled image is the same as the length of the shortest side of the screen, a scaling ratio is determined according to the minimum value of the first ratio and the second ratio, and then scaling processing is performed on the original image based on the scaling ratio, so as to obtain the scaled image.
When the original image is subjected to reduction processing, the reduction ratio is the minimum value of the first ratio and the second ratio.
For example, the size of the screen is a×b, the size of the original image is 3a×6b, and since the original shortest side length 3a is larger than the shortest side length a of the screen, it is first determined to perform reduction processing on the original image. Then, the first ratio is calculated to be 6b/b=6, the second ratio is calculated to be 3a/a=3, that is, the second ratio is the minimum value, so that the reduction ratio is 3, the original image is subjected to reduction processing by adopting the reduction ratio of 3, the size of the reduced image is obtained as a×2b, and therefore the shortest side length a of the reduced image is the same as the shortest side length a of the screen.
When the original image is subjected to the enlargement processing, the enlargement ratio is the reciprocal of the minimum value of the first ratio and the second ratio.
For example, the size of the screen is a×b, the size of the original image is 0.5a×4b, and since the original shortest side length 0.5a is smaller than the shortest side length a of the screen, it is first determined to perform the enlargement processing on the original image. Then, the first ratio is calculated to be 4b/b=4, the second ratio is calculated to be 0.5 a/a=0.5, that is, the second ratio is the minimum value, and thus the magnification ratio is the inverse of 0.5, that is, the magnification ratio is 2, so that the original image is subjected to magnification processing with the magnification ratio of 2, and the size of the image subjected to magnification processing is a×8b, so that the shortest side length a of the image subjected to reduction processing is the same as the shortest side length a of the screen.
In this embodiment, when performing scaling processing, the scaling ratio is first determined according to the minimum value in the first ratio and the second ratio, and then scaling processing is performed on the original image based on the scaling ratio, so as to obtain an image after scaling processing, so that the shortest side length of the image after scaling processing is the same as the shortest side length of the screen.
In some embodiments, the first screenshot data and the at least one second screenshot data are each the same size as the screen.
The first screenshot data and the at least one second screenshot data both comprise part of the content of the zoomed image, the first screenshot data and the at least one second screenshot data are images obtained by taking a screenshot of the screen, and therefore, the size of the first screenshot data and the size of the at least one second screenshot data are the same as the size of the screen.
When the screen part displays the zoomed image, the first screenshot data or at least one second screenshot data can be obtained by screenshot the screen. The screenshot principle is specifically as follows: when the screen displays the current content, the screen display current content can be corresponded in a Frame Buffer memory (Frame Buffer) in the form of pixels by performing screenshot operation, the Frame Buffer memory is a direct image of the picture displayed by the screen, and is also called a Bit Map (Bit Map) or a raster, and each storage unit of the Frame Buffer memory corresponds to one pixel on the screen, that is, the whole Frame Buffer memory corresponds to one Frame of image.
Specifically, the display device typically employs a double buffering scheme, i.e., two frame buffers, respectively a font frame buffer and a back frame buffer. When the display device works, the two frame buffers alternately write in image data and display the image data on the display device. For example, first writing the font frame buffer into the image data, then displaying the image data in the font frame buffer by the display device, and simultaneously writing the image data displayed next time into the back frame buffer; then, the display device displays the image data in the back frame buffer, and simultaneously, writes the image data displayed next time into the font frame buffer, so that the steps are repeated, and the display device realizes the display function of the image data.
In this embodiment, the first screenshot data or the at least one second screenshot data may specifically correspond to pixel data in the frame buffer memory, and since the storage size in the frame buffer memory is the same as the screen size, the sizes of the first screenshot data and the at least one second screenshot data are both the same as the screen size.
In some embodiments, after the scaling process is performed on the original image to obtain the scaled image, since the length of the longest edge of the scaled image is greater than the length of the longest edge of the screen, multiple shots are required along the direction of the longest edge, that is, the first screenshot data and at least one second screenshot data are obtained.
Specifically, the method comprises the steps of controlling the zoomed image to move at least once, and respectively capturing the updated image in the screen to obtain at least one second capturing data, wherein the second capturing data comprises the following steps: and (3) controlling the zoomed image to perform the ith movement, and performing screenshot on the updated image in the screen to obtain second screenshot data, and if the zoomed image has an area which is not screenshot, performing i+1 again until the zoomed image does not have the area which is not screenshot.
In this embodiment, by controlling the image after the zooming process to move at least once, the content outside the display area before the movement can be displayed on the screen, so as to update the display content of the screen, so as to capture the updated content. In addition, whether to continue image movement and screen capture processing is determined based on whether an un-captured area exists in the zoomed image, so that the zoomed image can be ensured to have a corresponding captured image, and the finally spliced captured image is ensured to contain all contents of the zoomed image.
In some embodiments, there is no duplicate data between the first screenshot data and the at least one second screenshot data.
Specifically, when the length of the longest side of the image after the scaling process is an integer multiple of the length of the longest side of the screen, it can be considered that the screen can divide the content of the image after the scaling process in integer parts along the direction of the longest side. And for the first screenshot data and all the second screenshot data obtained through integral screenshot, no repeated data exists in the image content of each image, and the screenshot image corresponding to the original image can be obtained by directly performing image stitching on the first screenshot data and all the second screenshot data.
Fig. 5 is an example diagram of performing multiple shots in the embodiment of the present application, as shown in fig. 5, taking a length multiple of 5 as an example, when the length of the longest side of the image after the zooming process is 5 times the length of the longest side of the screen, the image obtained by the 5 shots includes the first shot data T11 and the 4 second shot data T21, T22, T23 and T24, and the content of the image obtained by the 5 shots has no repeated data.
In addition, when the length of the longest side of the image after the scaling process is a non-integer multiple of the length of the longest side of the screen, it is considered that the screen cannot divide the content of the image after the scaling process in integer parts in the direction of the longest side. For the first screenshot data and all the second screenshot data obtained through integral screenshot, the image data size of the last second screenshot data is smaller than the image data sizes of other screenshot data.
Fig. 6 is another illustration of performing multiple shots in the embodiment of the present application, as shown in fig. 6, taking a length multiple of 3.5 as an example, when the length of the longest side of the image after the zooming process is 3.5 times of the length of the longest side of the screen, 4 shots are required, the image obtained by the 4 shots includes first shot data T12 and 3 second shot data T25, T26 and T27, where after the T12, T25 and T26 are obtained by the shots, the size of the remaining non-shot image area is 0.5 times of the screen size, so that the non-shot image area cannot completely fill the screen, at this time, the last second shot data T27 includes an area A1 including the image data and a blank area A2, where the area A1 includes the image data and the area A2 includes no image data. Therefore, the image data size of the second screen shot data T27 is smaller than that of the other screen shot data.
In this embodiment, no repeated data exists between the first screenshot data and the at least one second screenshot data, so that image stitching processing can be directly performed based on the first screenshot data and the at least one second screenshot data to obtain a screenshot image.
In some embodiments, the screenshot image needs to be diverted, e.g., the user is a landscape screenshot when the screenshot is taken and a portrait share when the screenshot is shared with other users. Therefore, in the present embodiment, the image processing method further includes: and rotating pixels in the first screenshot data and the at least one second screenshot data to obtain first rotation data and at least one second rotation data.
Correspondingly, the splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image includes: and splicing the first rotation data and the at least one second rotation data to obtain a screenshot image corresponding to the original image.
Specifically, since the first screenshot data or at least one second screenshot data may specifically correspond to the pixel data in the frame buffer memory, the rotation processing of the image may be implemented by reversing the pixel data in the lateral and longitudinal directions. For example, the pixel data in the frame buffer memory is one-dimensional data, and the pixel data position is normally represented by using frame buffer [ i+j ] where i is a row coordinate and j is a column coordinate. By inverting the pixel data in the horizontal and vertical directions, that is, adjusting the position of the pixel data to be frame buffer [ j+i ] width ], the rotation processing of the image can be realized.
In this embodiment, by rotating the image in the horizontal and vertical directions, the image may be adjusted from the horizontal direction to the vertical direction, or from the vertical direction to the horizontal direction, so as to meet the screenshot sharing requirement of the user.
It should be understood that, although the steps in the flowcharts in the above embodiments are sequentially shown as indicated by arrows, these steps are not necessarily sequentially performed in the order indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily occurring in sequence, but may be performed alternately or alternately with other steps or at least a portion of the other steps or stages.
In one embodiment, an image processing apparatus is provided.
Fig. 7 is a schematic diagram of an image processing apparatus according to an embodiment of the present application, as shown in fig. 7, where the apparatus includes:
an acquisition module 100 for acquiring an original image;
the scaling module 200 is configured to perform scaling processing on the original image according to the size of the screen to obtain a scaled image, where the length of a first edge of the scaled image is the same as the length of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is greater than the size of the screen;
the screenshot module 300 is configured to screenshot the zoomed image displayed in the screen, to obtain first screenshot data;
the screenshot module 300 is further configured to control the scaled image to move at least once, and screenshot the updated image in the screen to obtain at least one second screenshot data;
and the stitching module 400 is configured to stitch the first screenshot data and at least one second screenshot data to obtain a screenshot image corresponding to the original image.
For specific limitations of the image processing apparatus, reference may be made to the above limitations of the image processing method, and no further description is given here. The respective modules in the above-described image processing apparatus may be implemented in whole or in part by software, hardware, and combinations thereof. The above modules may be embedded in hardware or may be independent of a processor in the computer device, or may be stored in software in a memory in the computer device, so that the processor may call and execute operations corresponding to the above modules.
The embodiment provides an image processing apparatus, which enables an image after scaling to be completely captured in a shortest side direction by scaling a shortest side of an original image to be the same as a shortest side of a screen, and further enables the image after scaling to be completely captured in the longest side direction by moving capturing along the longest side direction in combination with image stitching processing, thereby ensuring that the image after scaling can be completely captured in the longest side direction. In addition, the original image is not completely scaled to the screen range, so that the definition of the screenshot image can be ensured.
In one embodiment, a terminal device is improved.
Fig. 8 is a schematic structural diagram of a terminal device provided in an embodiment of the present application, as shown in fig. 8, where the terminal device includes: a processor 111, a memory 112, and a display 113.
The memory 112 is used for storing programs and data, and the processor 111 calls the programs stored in the memory to execute the technical solutions of any of the foregoing method embodiments.
In the above terminal device, the memory and the processor are electrically connected directly or indirectly to realize transmission or interaction of data. For example, the elements may be electrically connected to each other via one or more communication buses or signal lines, such as through a bus connection. The memory stores computer-executable instructions for implementing the data access control method, including at least one software functional module that may be stored in the memory in the form of software or firmware, and the processor executes the software programs and modules stored in the memory to perform various functional applications and data processing.
The Memory may be, but is not limited to, random access Memory (Random Access Memory; RAM), read Only Memory (ROM), programmable Read Only Memory (Programmable Read-Only Memory; PROM), erasable Read Only Memory (Erasable Programmable Read-Only Memory; EPROM), electrically erasable Read Only Memory (Electric Erasable Programmable Read-Only Memory; EEPROM), etc. The memory is used for storing a program, and the processor executes the program after receiving the execution instruction. Further, the software programs and modules within the memory may also include an operating system, which may include various software components and/or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.), and may communicate with various hardware or software components to provide an operating environment for other software components.
The processor may be an integrated circuit chip with signal processing capabilities. The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), and the like. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In one embodiment, a computer-readable storage medium having stored therein computer-executable instructions that, when executed by a processor, are adapted to carry out the steps of the method embodiments of the present application is provided.
Those skilled in the art will appreciate that implementing all or part of the above-described methods may be accomplished by way of a computer program, which may be stored on a non-transitory computer readable storage medium and which, when executed, may comprise the steps of the above-described embodiments of the methods. Any reference to memory, storage, database, or other medium used in the various embodiments provided herein may include non-volatile and/or volatile memory. The nonvolatile memory can include Read Only Memory (ROM), programmable ROM (PROM), electrically Programmable ROM (EPROM), electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous Link DRAM (SLDRAM), memory bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (9)

1. An image processing method, comprising:
acquiring an original image;
according to the size of the screen, scaling the original image to obtain a scaled image, wherein the length of a first edge of the scaled image is the same as the length of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is larger than the size of the screen;
screenshot is carried out on the zoomed image displayed in the screen, and first screenshot data are obtained;
controlling the zoomed image to move at least once, and respectively capturing images updated in the screen to obtain at least one second capturing data;
splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image;
and scaling the original image according to the size of the screen to obtain a scaled image, wherein the scaling comprises the following steps:
according to the size of the screen and the size of the original image, respectively determining a first ratio between the horizontal length of the original image and the horizontal length of the screen and a second ratio between the vertical length of the original image and the vertical length of the screen;
and scaling the original image according to the first ratio and the second ratio to obtain the scaled image.
2. The method of claim 1, wherein the first screenshot data and the at least one second screenshot data are each the same size as the screen.
3. The method according to claim 1, wherein scaling the original image according to the first ratio and the second ratio to obtain the scaled image comprises:
and scaling the original image according to the minimum value in the first ratio and the second ratio to obtain the scaled image.
4. A method according to any of claims 1-3, wherein there is no duplicate data between the first screenshot data and the at least one second screenshot data.
5. A method according to any one of claims 1-3, wherein said controlling the scaled image to move at least once and capturing the updated image in the screen to obtain at least one second captured data includes:
and controlling the zoomed image to perform the ith movement, and performing screenshot on the updated image in the screen to obtain second screenshot data, and if the zoomed image has an area which is not screenshot, re-executing the step i+1 until the zoomed image does not have the area which is not screenshot.
6. A method according to any one of claims 1-3, wherein the method further comprises:
rotating pixels in the first screenshot data and the at least one second screenshot data to obtain first rotation data and at least one second rotation data;
correspondingly, the splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image includes:
and splicing the first rotation data and the at least one second rotation data to obtain a screenshot image corresponding to the original image.
7. An image processing apparatus, comprising:
the acquisition module is used for acquiring an original image;
the scaling module is used for scaling the original image according to the size of the screen to obtain a scaled image, the length of a first edge of the scaled image is the same as that of a corresponding second edge in the screen, the first edge is the edge with the shortest length in all edges of the scaled image, and the size of the scaled image is larger than that of the screen;
the screenshot module is used for screenshot the zoomed image displayed in the screen to obtain first screenshot data;
the screenshot module is also used for controlling the zoomed image to move at least once and screenshot the updated image in the screen respectively to obtain at least one second screenshot data;
the splicing module is used for splicing the first screenshot data and the at least one second screenshot data to obtain a screenshot image corresponding to the original image;
the scaling module is specifically configured to determine a first ratio between a horizontal length of the original image and a horizontal length of the screen and a second ratio between a vertical length of the original image and a vertical length of the screen according to a size of the screen and a size of the original image, respectively;
and scaling the original image according to the first ratio and the second ratio to obtain the scaled image.
8. A terminal device, comprising:
a processor, a memory, a display;
the memory is used for storing programs and data, and the processor calls the programs stored in the memory to execute the image processing method according to any one of the preceding claims 1-6.
9. A computer-readable storage medium, in which computer-executable instructions are stored, which computer-executable instructions, when executed by a processor, are for implementing the image processing method according to any of claims 1-6.
CN202010883178.0A 2020-08-28 2020-08-28 Image processing method, device, storage medium and terminal equipment Active CN111986088B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010883178.0A CN111986088B (en) 2020-08-28 2020-08-28 Image processing method, device, storage medium and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010883178.0A CN111986088B (en) 2020-08-28 2020-08-28 Image processing method, device, storage medium and terminal equipment

Publications (2)

Publication Number Publication Date
CN111986088A CN111986088A (en) 2020-11-24
CN111986088B true CN111986088B (en) 2023-06-30

Family

ID=73440150

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010883178.0A Active CN111986088B (en) 2020-08-28 2020-08-28 Image processing method, device, storage medium and terminal equipment

Country Status (1)

Country Link
CN (1) CN111986088B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113035335A (en) * 2021-04-09 2021-06-25 青岛商汤科技有限公司 Screenshot method and device, electronic equipment and storage medium
CN114222074B (en) * 2021-12-13 2024-01-12 惠州华星光电显示有限公司 Spliced screen driving method and device, server and storage medium
CN114459397B (en) * 2022-03-01 2024-02-20 公安部第一研究所 CT image size measuring method

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8958662B1 (en) * 2014-08-20 2015-02-17 Interactive Memories, Inc. Methods and systems for automating insertion of content into media-based projects
CN106127676A (en) * 2016-06-17 2016-11-16 许之敏 A kind of quick intercepting and the method for the synthesis long sectional drawing of multi-screen
CN108491194A (en) * 2018-01-19 2018-09-04 江苏大学 A method of the network map picture based on the ends Web API intercepts splicing automatically
CN108647069A (en) * 2018-04-16 2018-10-12 腾讯科技(深圳)有限公司 interface display method and device, storage medium and electronic device
CN108920239A (en) * 2018-06-29 2018-11-30 维沃移动通信有限公司 A kind of long screenshotss method and mobile terminal
CN108984091A (en) * 2018-06-27 2018-12-11 Oppo广东移动通信有限公司 Screenshotss method, apparatus, storage medium and electronic equipment
CN110032314A (en) * 2019-03-12 2019-07-19 中国平安人寿保险股份有限公司 A kind of long screenshotss method, apparatus, storage medium and terminal device
CN110045888A (en) * 2019-03-28 2019-07-23 努比亚技术有限公司 A kind of screen interface screenshot processing method and mobile terminal
CN110221888A (en) * 2019-04-28 2019-09-10 中至数据集团股份有限公司 Screenshot processing method, device, readable storage medium storing program for executing and smart machine
CN110475018A (en) * 2019-07-23 2019-11-19 广东以诺通讯有限公司 A kind of mobile phone screenshotss method and system based on map location label
CN110568973A (en) * 2019-09-09 2019-12-13 网易(杭州)网络有限公司 screenshot method, screenshot device, storage medium and terminal equipment
CN111176526A (en) * 2019-12-30 2020-05-19 维沃移动通信有限公司 Picture display method and electronic equipment

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8958662B1 (en) * 2014-08-20 2015-02-17 Interactive Memories, Inc. Methods and systems for automating insertion of content into media-based projects
CN106127676A (en) * 2016-06-17 2016-11-16 许之敏 A kind of quick intercepting and the method for the synthesis long sectional drawing of multi-screen
CN108491194A (en) * 2018-01-19 2018-09-04 江苏大学 A method of the network map picture based on the ends Web API intercepts splicing automatically
CN108647069A (en) * 2018-04-16 2018-10-12 腾讯科技(深圳)有限公司 interface display method and device, storage medium and electronic device
CN108984091A (en) * 2018-06-27 2018-12-11 Oppo广东移动通信有限公司 Screenshotss method, apparatus, storage medium and electronic equipment
CN108920239A (en) * 2018-06-29 2018-11-30 维沃移动通信有限公司 A kind of long screenshotss method and mobile terminal
CN110032314A (en) * 2019-03-12 2019-07-19 中国平安人寿保险股份有限公司 A kind of long screenshotss method, apparatus, storage medium and terminal device
CN110045888A (en) * 2019-03-28 2019-07-23 努比亚技术有限公司 A kind of screen interface screenshot processing method and mobile terminal
CN110221888A (en) * 2019-04-28 2019-09-10 中至数据集团股份有限公司 Screenshot processing method, device, readable storage medium storing program for executing and smart machine
CN110475018A (en) * 2019-07-23 2019-11-19 广东以诺通讯有限公司 A kind of mobile phone screenshotss method and system based on map location label
CN110568973A (en) * 2019-09-09 2019-12-13 网易(杭州)网络有限公司 screenshot method, screenshot device, storage medium and terminal equipment
CN111176526A (en) * 2019-12-30 2020-05-19 维沃移动通信有限公司 Picture display method and electronic equipment

Also Published As

Publication number Publication date
CN111986088A (en) 2020-11-24

Similar Documents

Publication Publication Date Title
CN111986088B (en) Image processing method, device, storage medium and terminal equipment
CN111192356B (en) Method, device, equipment and storage medium for displaying region of interest
US8384738B2 (en) Compositing windowing system
CN110377264B (en) Layer synthesis method, device, electronic equipment and storage medium
CN111798372B (en) Image rendering method, device, equipment and readable medium
CN108537729B (en) Image stepless zooming method, computer device and computer readable storage medium
CN111192352B (en) Map rendering method, map rendering device, computer equipment and storage medium
CN110599564A (en) Image display method and device, computer equipment and storage medium
US20100245607A1 (en) Video processing apparatus
JP2010513956A (en) Post-rendering graphics scaling
CN115237522A (en) Page self-adaptive display method and device
US20040263426A1 (en) Information processing device, window display control method and program
CN113592720B (en) Image scaling processing method, device, equipment and storage medium
CN114691069A (en) Image display adjustment method and device and electronic equipment
CN112634628A (en) Vehicle speed determination method, terminal and storage medium
CN112650460A (en) Media display method and media display device
US9594955B2 (en) Modified wallis filter for improving the local contrast of GIS related images
CN113055592B (en) Image display method and device, electronic equipment and computer readable storage medium
CN115035128A (en) Image overlapping sliding window segmentation method and system based on FPGA
CN111652787B (en) Processing method and device for adding watermark text into picture and computer equipment
CN114529483A (en) Data processing method, device, terminal and readable storage medium
CN112328924A (en) Method, electronic device, medium and system for realizing picture viewer at web end
CN111240541A (en) Interface switching method, electronic equipment and computer readable storage medium
CN110910436A (en) Distance measuring method, device, equipment and medium based on image information enhancement technology
CN116156088B (en) Video image scaling processing system, method, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant