CN115291777A - Screen capturing method and device, terminal and readable storage medium - Google Patents
Screen capturing method and device, terminal and readable storage medium Download PDFInfo
- Publication number
- CN115291777A CN115291777A CN202210931548.2A CN202210931548A CN115291777A CN 115291777 A CN115291777 A CN 115291777A CN 202210931548 A CN202210931548 A CN 202210931548A CN 115291777 A CN115291777 A CN 115291777A
- Authority
- CN
- China
- Prior art keywords
- area
- target
- region
- screen
- screen capture
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 61
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 6
- 238000005520 cutting process Methods 0.000 description 6
- 230000000694 effects Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000011218 segmentation Effects 0.000 description 5
- 230000001360 synchronised effect Effects 0.000 description 5
- 230000000903 blocking effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000000873 masking effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000007115 recruitment Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000003190 augmentative effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000008447 perception Effects 0.000 description 1
- 230000002441 reversible effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction 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/04842—Selection of displayed objects or displayed text elements
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The application discloses a screen capture method, a screen capture device, a terminal and a readable storage medium, which belong to the technical field of image processing, wherein the method comprises the following steps: acquiring a screen capture instruction; determining a target area in a display area of the terminal based on the screen capturing instruction and pre-acquired screen capturing indication information; and carrying out screen capture on the target area to obtain a target image.
Description
Technical Field
The application belongs to the technical field of image processing, and particularly relates to a screen capturing method, a screen capturing device, a screen capturing terminal and a readable storage medium.
Background
Currently, when a current page is directly subjected to screen capturing, an obtained screen capturing image includes all information of the whole page, for example, information content information, entertainment content information, notification message information and the like of the current page, which needs to be searched in the screen capturing image to obtain effective information, and the screen capturing experience is poor.
Disclosure of Invention
The embodiment of the application aims to provide a screen capture method, a screen capture device, a terminal and a readable storage medium, which can solve the problem of poor screen capture experience.
In a first aspect, an embodiment of the present application provides a screen capture method, including:
acquiring a screen capture instruction;
determining a target area in a display area of the terminal based on the screen capturing instruction and the screen capturing instruction information acquired in advance;
and carrying out screen capture on the target area to obtain a target image.
In a second aspect, an embodiment of the present application provides a screen capture device, including:
the acquisition module is used for acquiring a screen capture instruction;
the determining module is used for determining a target area in a display area of the terminal based on the screen capturing instruction and the screen capturing instruction information acquired in advance;
and the screen capturing module is used for capturing the screen of the target area to obtain a target image.
In a third aspect, an embodiment of the present application provides a terminal, including a processor and a memory, where the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the method according to the first aspect.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a program or instructions are stored, which when executed by a processor, implement the steps of the method according to the first aspect.
In a fifth aspect, an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, where the communication interface is coupled to the processor, and the processor is configured to execute a program or instructions to implement the method according to the first aspect.
In a sixth aspect, embodiments of the present application provide a computer program product, which is stored in a storage medium and executed by at least one processor to implement the method according to the first aspect.
In the embodiment of the application, based on the screen capturing instruction and the screen capturing indication information acquired in advance, a target area in a display area of the terminal is determined, the screen capturing is performed on the target area to obtain a target image, a current display page of the terminal can be captured according to the screen capturing indication information, the target image conforming to the screen capturing indication information is obtained, and screen capturing experience is improved.
Drawings
Fig. 1 is a schematic flowchart of a screen capture method provided in an embodiment of the present application;
fig. 2 is a second schematic flowchart of a screen capturing method according to an embodiment of the present application;
FIG. 3 is a diagram of one embodiment of a screen shot masking notification;
FIG. 4 is a second schematic diagram of a screen shot masking notification provided in the embodiment of the present application;
FIG. 5 is a schematic diagram of a shielding status bar and a virtual key during screen capture according to an embodiment of the present application;
FIG. 6 is a second schematic diagram of a shielding status bar and a virtual button during screen capture according to an embodiment of the present application;
fig. 7 is a schematic diagram of a key area selected by a screenshot according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a screen capture device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 10 is a second schematic structural diagram of a terminal according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments that can be derived by one of ordinary skill in the art from the embodiments given herein are intended to be within the scope of the present disclosure.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/", and generally means that the former and latter related objects are in an "or" relationship.
The screen capture method provided by the embodiment of the present application is described in detail below with reference to the accompanying drawings through specific embodiments and application scenarios thereof.
Referring to fig. 1, fig. 1 is a schematic flow chart of a screen capturing method according to an embodiment of the present disclosure. As shown in fig. 1, an embodiment in one aspect of the present application provides a screen capture method, which includes the following steps:
The screen capture instruction may be an instruction input by a user to the terminal for triggering screen capture, for example: clicking a screen capturing button of the terminal, triggering specific operation preset for screen capturing, or inputting a screen capturing instruction by voice, and the like, so as to trigger the terminal to capture the screen.
And 102, determining a target area in the display area of the terminal based on the screen capturing instruction and the screen capturing instruction information acquired in advance.
It is understood that the target area is located in a display area currently displayed by the terminal, for example, in all or a part of a display area of the terminal.
And 103, carrying out screen capture on the target area to obtain a target image.
For example, the screen capture indication information may include information that some areas are shielded or reserved during screen capture, a screen capture may shield a status bar area, a button bar area, a popup area of a notification message, and the like, or only a highlight area may be subjected to screen capture. Specifically, the screen capture indication information may include indication information indicating whether to mask the status bar and the button bar during screen capture, indication information indicating whether to mask the notification message during screen capture, indication information indicating whether to frame the highlight region during screen capture, and the like.
Specifically, if the screen capture indication information includes indication information indicating to shield the status bar and the button bar, the status bar area and the button bar area in the display area may be excluded from a target area for screen capture, so as to obtain a target image that does not include the status bar and the button bar; if the screen capture indication information comprises indication information for indicating shielding of the notification message, the notification message area in the display area can be excluded from a target area for screen capture, and a target image which does not comprise a status bar and a key bar is obtained; if the screen capture indication information includes indication information indicating that the frame selects the key region, the key region in the display region may be identified, and the image of the key region may be output as the target image.
In the embodiment of the application, based on the screen capturing instruction and the screen capturing indication information acquired in advance, a target area in a display area of the terminal is determined, the screen capturing is performed on the target area to obtain a target image, a current display page of the terminal can be captured according to the screen capturing indication information, the target image conforming to the screen capturing indication information is obtained, and screen capturing experience is improved.
Optionally, the screen capture indication information includes indication information indicating a shielding target object;
in step 102, determining a target area in a display area of the terminal based on the screen capture instruction and the pre-acquired screen capture instruction information includes:
and shielding a region corresponding to the target object in the display region image to obtain the target region under the condition that the display region comprises the target object based on the screen capturing instruction and the screen capturing indication information acquired in advance.
The target object may be one or more of a status bar, a virtual key, a notification bar, and the like, for example, the status bar of the mobile phone is usually on the top of the display screen area, and the position and size of the area corresponding to the status bar may be determined according to the size and model of the screen of the mobile phone.
When the screen capture instruction information includes instruction information instructing to mask the target object, if the target object is recognized in the display area, the area corresponding to the target object may be masked, and a target image not including the target object may be obtained. In the process of identifying the target object, the area where the target object may appear may be predetermined, so as to specifically identify whether the area where the target object may appear includes the target object. For example, when the target object is a virtual key, a certain bottom area in the display area may be determined as an area where the virtual key may appear, and when it is identified that the virtual key exists in the area, the area is an area corresponding to the virtual key, and the area may be directly shielded.
In this embodiment, based on the screen capture instruction and the screen capture instruction information acquired in advance, when the display area includes the target object, the area corresponding to the target object in the display area is cut to obtain the target area, and the target area can be captured, so that the target image conforming to the screen capture instruction information can be acquired quickly.
Optionally, the display area includes a first area and a second area, and the first area is a pop-up window display area of the terminal;
in step 102, determining a target area in a display area of the terminal based on the screen capture instruction and the pre-acquired screen capture instruction information includes:
acquiring content information of the first area based on the screen capturing instruction and pre-acquired screen capturing indication information;
selecting the second area or the display area as the target area based on a preset rule and content information of the first area.
It is to be understood that the first area corresponds to a pop-up display area, the second area corresponds to a screenshot display area, and the screenshot images of the first area and the second area can be respectively captured in the corresponding areas. The screen capture indication information may include an indication message indicating whether to intelligently select to mask the pop-up notification message, for example, content information of a target category to be masked is preset, so that after the content information of the first area is acquired, the content category of the first area may be determined and compared with the target category to determine whether to mask.
Optionally, the preset rule includes: shielding content information of a target category;
wherein selecting the second area or the display area as the target area based on a preset rule and content information of the first area comprises:
comparing the content information of the first area with the target category;
selecting the second region as the target region if the content information of the first region matches the target category;
selecting the display area as the target area if the content information of the first area does not match the target category.
It should be noted that the screen capture indication information may include indication information indicating whether to use the preset rule, and specifically, for the popup display area, the screen capture indication information may directly indicate whether to mask the popup message, or indicate whether to use the preset rule to identify a category of the popup message to determine whether to mask the popup message. The popup messages belonging to the target category can be shielded through the preset rule, so that the popup messages can be intelligently shielded according to the content information of the popup display area. The target category can be preset or selected by a user, for example, a screen capture is triggered when a pop-up window is notified, such as a take-out message, a logistics message, an internet of things device message and the like, and a corresponding pop-up window message can be captured and used in the scene; some game, information and video live broadcast related message push which is easily shared by users and can be kept in screen shot images; some consumption, transfer, recruitment and other information related to the privacy of the user can delete or hide the notification popup window of the information of the category.
It can be understood that, when the content of the pop-up window display area matches the object type, the second area is selected as the object area, and the obtained object image is an image obtained by intercepting the second area, specifically, the first area and the second area can be respectively intercepted to obtain two images, and the image obtained by intercepting the pop-up window display area (i.e., the first area) is deleted, that is, the image obtained by intercepting the second area is directly used as the object image; under the condition that the content of the popup display area does not match with the target type, the image intercepted by the popup display area can be displayed, namely, the image obtained by the display area can be used as a target image, and the target image can be obtained by splicing the image intercepted by the first area and the image intercepted by the second area.
In this embodiment, the content information of the first region is acquired based on the screen capture instruction information, and the second region or the display region is selected as the target region based on a preset rule and the content information of the first region, so that the target region can be flexibly determined according to the shielding instruction information.
Optionally, after the step 102 of determining the target area in the display area of the terminal based on the screen capturing instruction and the screen capturing instruction information acquired in advance, the method further includes:
zooming background page content of the display area to the target area, the target area being smaller than the display area;
the display area is used for displaying a popup message outside the target area, and the screen capture indication information comprises indication information for shielding the popup message.
Under the condition that no popup message exists, the background page content is all the content of the display area; in the case of a popup message, the content of the display area includes the background page content and the popup message, and a part of the background page content is covered by the popup message.
The target area can be obtained by scaling the display area of the terminal in an equal proportion so as to improve the screen capture effect. Moreover, the scaling can be determined based on the size of the display area of the popup message, so that a sufficiently large area is reserved for normal display of the popup message and acquisition of screenshot content is not affected.
In this embodiment, the display area of the terminal may be divided into an area for displaying the pop-up window message and a target area for displaying the screenshot content, the target image is obtained by zooming the content currently displayed by the terminal to the target area and capturing the image in the target area, the pop-up window message may be normally displayed while the acquisition of the screenshot content is not affected, and the screenshot indication information indicating the screenshot of the pop-up window message is met, so that the screenshot effect is improved.
Optionally, the step 103 of capturing the screen of the target area to obtain a target image includes:
the target area is subjected to screen capture to obtain a first image;
segmenting the first image into a plurality of second regions;
determining at least one second region from the plurality of second regions based on a central region in the first image, the at least one second region including a second region in which the central region is located;
and obtaining the target image based on the at least one second area.
It will be appreciated that the first image may be obtained by capturing a screen of the target area.
The plurality of second regions may be obtained based on an image segmentation algorithm, and specifically, the image may be divided into regions according to features such as gray scale, color, texture, and shape, so that the regions show differences and the regions show similarities, for example, a region growing method based on a region gray scale difference, a segmentation algorithm based on a threshold, a segmentation algorithm based on an edge, a segmentation algorithm based on a region, a segmentation algorithm based on a graph theory, a segmentation algorithm based on a capability functional, and the like.
The screen capture indication information may include indication information indicating a frame to select a highlight area. It will be appreciated that the content that the user screenshot would normally want to share is located near the central region of the display, and thus at least one second region may be determined as a region of interest based on the central region of the first image.
The target image includes the at least one second area, that is, an image corresponding to the at least one second area is in the target image, or an image corresponding to the at least one second area is the target image. In a case where the at least one second region includes only one second region, the target image includes the one second region, and in a case where the at least one second region includes at least two second regions, the target image includes a region obtained by merging the at least two second regions.
The image corresponding to the determined at least one second area may be marked in the target image, for example, a gray mask is applied to an area (which may be understood as a non-emphasized area) outside the at least one second area, or the image corresponding to the at least one second area (which may be understood as an emphasized area) is displayed by using frames with different colors; or directly displaying the image corresponding to the at least one second area as the target image.
Optionally, the determining at least one second region from the plurality of second regions based on the central region of the first image comprises:
determining a target second region of the plurality of second regions based on the central region, the central region being located within the target second region;
and determining the at least one second area based on the target second area, wherein the at least one second area comprises the target second area, the similarity between the gray-scale value information of each of the at least one second area and the gray-scale value information of the target second area is greater than or equal to a preset value, and in the case that the at least one second area is at least two second areas, the at least two second areas are adjacent in sequence in the plurality of second areas.
The gray scale value information may include gray scale value distribution information of each second region, and region merging may be performed according to similarity of the gray scale value distribution information of the second regions.
It is understood that the plurality of areas are adjacent to each other, and for example, the area A1, the area A2 and the area A3 are adjacent to each other, that is, the area A1 is adjacent to the area A2, the area A2 is adjacent to the area A3, and the area A2 is located between the area A1 and the area A3.
As a specific example, the first image may be divided into a plurality of second areas: the area A1 to the area A7, the area A1 to the area A7 are 7 second areas adjacent to each other in sequence, wherein the area A1 is adjacent to the area A2, the area A2 is adjacent to the area A3, the area A3 is adjacent to the area A4, the area A4 is adjacent to the area A5, the area A5 is adjacent to the area A6, the area A6 is adjacent to the area A7, and the central area of the first image is located in the area A4, and the area A4 can be determined as the target second area. In the first image, the region A4 has two adjacent regions: the similarity between the gray-scale value information of the area A3 and the gray-scale value information of the area A4 is greater than a preset value, the similarity between the gray-scale value information of the area A5 and the gray-scale value information of the area A4 is greater than a preset value, the similarity between the gray-scale value information of the area A2 and the gray-scale value information of the area A4 is less than a preset value, the similarity between the gray-scale value information of the area A6 and the gray-scale value information of the area A4 is greater than a preset value, and the similarity between the gray-scale value information of the area A7 and the gray-scale value information of the area A4 is less than a preset value, so that the finally obtained at least one second area comprises the area A3, the area A4, the area A5 and the area A6 which are adjacent in sequence (no matter whether the similarity between the gray-scale value information of the area A1 and the gray-scale value information of the area A4 is less than a preset value).
In the above embodiment, the area A3, the area A4, the area A5, and the area A6 which are adjacent in this order may be merged, and the merged area may be displayed as an emphasized area. For the combination of the area A3, the area A4, the area A5, and the area A6, adjacent areas may be combined first, for example, after the area A4 is determined to be the target second area, the area A3 and the area A5 adjacent to the area A4 are combined to the area A3 to obtain a combined area, and then the area A6 adjacent to the area A5 is combined to the combined area to obtain a combined area of the area A3, the area A4, the area A5, and the area A6, or which areas may be combined may be determined first, for example, according to a similarity between gray value distribution information of each area and gray value distribution information of the area A4 and an adjacent relationship of each area, it is determined that the area A3, the area A4, the area A5, and the area A6 need to be combined, and then the area A3, the area A4, the area A5, and the area A6 are directly combined to obtain a combined area.
In the embodiment, the captured first image can be intelligently selected to obtain the target image, so that the operation steps of a user are reduced, and the screen capture experience is improved.
Optionally, after the screen capturing is performed on the target area in step 103 to obtain the target image, the method further includes:
displaying the target image;
receiving an area selection instruction input by a user for the target image;
and generating a second image based on the target image and the region selection instruction.
In this embodiment, the size or the area of the target image may be adjusted according to the area selection instruction of the user to obtain the second image required by the user, so as to improve the flexibility of screen capturing.
The methods provided herein are exemplified below.
Fig. 2 is a schematic flow chart of a mobile phone screen capturing method provided in the embodiment of the present application, and as shown in fig. 2, the specific steps implemented in the embodiment of the present application are as follows:
step 201: when a user needs to capture a screen in the process of using the mobile phone, the mobile phone receives an operation instruction of triggering the screen capture by the user.
After the mobile phone receives an operation instruction of triggering screen capture by a user, an intelligent screen capture processing engine of the mobile phone takes over the screen capture operation of the mobile phone.
The user can select whether the intelligent screen capture processing engine is used or not, and whether the 'screen capture state bar and virtual key' are shielded, the 'screen capture shield notification' and the 'screen capture automatic selection key area' are started or not can be selected.
Step 202: and judging whether the user turns on the option of shielding the notification during screen capture, if so, intercepting the screen in any mode of prohibiting notification popup. The specific implementation mode is as follows:
mode 1: and (4) carrying out area zooming screen capture, wherein the specific process is as follows.
Step 1a, scaling the screen content to the lower left in an equal ratio, reserving a pop-up window area (namely a notification content area) with the height of x pixels for the upper part (x is the normal pop-up window height of the mobile phone and can be determined according to the model of the mobile phone, the size of the screen of the mobile phone and the like), and displaying the reduced screen content in the screen content area, as shown in fig. 3;
step 1b, only intercepting the content of the zoomed screen area (in a frame corresponding to the screen content area in the figure 3) when the screen intercepts, and not containing the content of the notification content area;
step 1c, the notification message during screen capture can carry out normal popup prompt in a popup area and cannot be captured;
and step 1d, after the screen area content is intercepted, the zooming operation in the step 1a is recovered, the user basically has no perception on the zooming of the screen in the whole process, and the notification content of the terminal to the user is not influenced.
Mode 2: whether the popup area is added or not is intelligently determined, and the specific process is as follows.
Step 2a, when the user triggers screen capture, the mobile phone automatically captures the notification content area and the screen content area respectively, so that two pictures can be obtained, one is the picture of the screen content area without the notification bar, and the other is the picture of the notification content area of the single notification bar, as shown in fig. 4.
Step 2b, determining whether the picture of the notification content area needs to be displayed according to a certain rule, wherein the specific rule can trigger screen capture according to the current user scene, such as taking-out, logistics and pop-up notification of the internet-of-things equipment message, and the corresponding pop-up message generally needs to be captured and used at this time; some games, information and video live broadcast related push are easy to be shared by users and also need to be intercepted and used; some information related to the privacy of the user, such as consumption, account transfer, recruitment and the like, is generally unwilling to share, and the notification pop-up window needs to be hidden.
And 2c, after determining whether the picture in the notification area needs to be displayed according to the step 2b, if the picture does not need to be displayed, only directly using the content in the screen content area, and if the picture needs to be displayed, splicing the picture in the notification area and the picture in the screen content area, as shown in fig. 4.
Mode 3: and blocking the popup window during screen capture, namely temporarily blocking the popup window during screen capture so as to avoid capturing the message content of the notification bar, delaying the display of the message content of the notification bar after screen capture is finished, and avoiding that a user cannot acquire the message content of the notification bar.
Step 203: and capturing the screenshot area determined in the step 202 to generate a screenshot picture.
Step 204: whether a user starts the 'shielding status bar and virtual keys during screen capture' is judged, if yes, the status bar area and the virtual key area are cut off, the cutting range of the status bar area is a 40px height area at the top and a 20px height area at the bottom of the picture (the cutting range can be flexibly determined according to the positions and the sizes of the status bar and the virtual keys of the mobile phone) is shown in fig. 5, and the cut picture is shown in fig. 6.
Step 205: and judging whether the user opens the 'automatic frame selection key area', if so, cutting the screen capture picture by using a specific cutting rule to frame the key area.
The specific cutting rule may be a region growing method based on the regional gray level difference, and the cutting process is as follows:
step a, dividing a screenshot picture into non-overlapping rectangular small regions, wherein the width of each small region is the picture width;
b, finding a central area on the position of the picture, further determining a rectangular small area containing the central area, comparing a gray histogram of the rectangular small area with a gray histogram of an adjacent rectangular small area, and carrying out area combination according to the similarity of gray distribution;
and c, setting a termination criterion, and combining the rectangular small areas in sequence by continuously repeating the step b until the termination criterion is met.
Taking fig. 7 as an example: each arrow in fig. 7 represents a rectangular small area obtained by division according to step a, an area 701 is a central area of a screenshot picture, which is first called a first important area, an area 702 is an area that meets a rule for the first time and is merged into the first important area, which is called a second important area, an area 703 is an area that meets a rule for the second time and is merged into the second important area, which is called a third important area, and areas outside the area 703 meet a termination criterion through calculation, so that the important areas are not expanded, and the third important area is a final important area.
Step 206: after the key area is obtained, a gray mask is printed on the area outside the key area, a user can open a corresponding picture on a mobile phone, the key area is framed and selected in the picture, the user can flexibly adjust the range of the key area, and after the user confirms that no mistake exists, the user clicks to determine that the intelligent screen capturing is completed, and the desired picture is obtained.
According to the screen capture method provided by the embodiment of the application, the execution main body can be the screen capture device, or the control module used for executing the screen capture method in the screen capture device. In the embodiment of the present application, a screen capture device executing a screen capture method is taken as an example, and the screen capture device provided in the embodiment of the present application is described.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a screen capture device according to an embodiment of the present disclosure. As shown in fig. 8, another embodiment of the present application further provides a screen capture apparatus, where the screen capture apparatus 800 includes:
an obtaining module 801, configured to obtain a screen capture instruction;
a determining module 802, configured to determine a target area in a display area of the terminal based on the screen capture instruction and pre-acquired screen capture instruction information;
and a screen capture module 803, configured to capture a screen of the target area to obtain a target image.
Optionally, the screen capture indication information includes indication information indicating a mask target object;
the determining module 802 includes:
and the shielding unit is used for shielding the area corresponding to the target object in the display area to obtain the target area under the condition that the display area comprises the target object based on the screen capturing instruction and the screen capturing indication information acquired in advance.
Optionally, the display area includes a first area and a second area, where the first area is a pop-up window display area of the terminal;
the determining module 802 includes:
a first obtaining unit, configured to obtain content information of the first area based on the screen capture instruction and pre-obtained screen capture instruction information;
a selection unit configured to select the second area or the display area as the target area based on a preset rule and content information of the first area.
Optionally, the screen capture device 800 further includes:
a zooming module, configured to zoom a background page content of the display area to the target area, where the target area is smaller than the display area;
the display area is used for displaying a popup message outside the target area, and the screen capture indication information comprises indication information indicating whether to shield the popup message.
Optionally, the screen capture module 803 further includes:
the second acquisition unit is used for capturing the screen of the target area to obtain a first image;
a dividing unit configured to divide the first image into a plurality of second regions;
a second determining unit, configured to determine at least one second region from the plurality of second regions based on a central region of the first image, where the at least one second region includes a second region where the central region is located;
and the third acquisition unit is used for obtaining the target image based on the at least one second area.
Optionally, the second determining unit includes:
a first determining subunit, configured to determine a target second area in the plurality of second areas based on the central area, where the central area is located within the target second area;
a second determining subunit, configured to determine the at least one second region based on the target second region, where the at least one second region includes the target second region, a similarity between the grayscale value information of each of the at least one second region and the grayscale value information of the target second region is greater than or equal to a preset value, and when the at least one second region is at least two second regions, the at least two second regions are sequentially adjacent to each other in the plurality of second regions.
Optionally, the screen capture apparatus further includes:
the display module is used for displaying the target image;
the receiving module is used for receiving a region selection instruction input by a user based on the target image;
and the generating module is used for generating a second image based on the target image and the region selection instruction.
In the embodiment of the application, a target area in a display area of the terminal is determined based on the screen capturing instruction and the pre-acquired screen capturing indication information, the screen capturing is performed on the target area to obtain a target image, a current display page of the terminal can be captured according to the screen capturing indication information, the target image according with the screen capturing indication information is obtained, and screen capturing experience is improved.
The screen capture device in the embodiment of the present application may be an electronic device, or may be a component in an electronic device, such as an integrated circuit or a chip. The electronic device may be a terminal, or may be a device other than a terminal. For example, the electronic Device may be a Mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic Device, a Mobile Internet Device (MID), an Augmented Reality (AR)/Virtual Reality (VR) Device, a robot, a wearable Device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), and the like, and may also be a Personal Computer (PC), and the like, and the embodiment of the present invention is not limited in particular.
The screen capture device in the embodiment of the application can be a device with an operating system. The operating system may be an Android operating system (Android), an iOS operating system, or other possible operating systems, which is not specifically limited in the embodiments of the present application.
The screen capture device provided in the embodiment of the present application can implement each process implemented in the method embodiment of fig. 1, and is not described here again to avoid repetition.
Optionally, as shown in fig. 9, an embodiment of the present application further provides a terminal 900, which includes a processor 901 and a memory 902, where the memory 902 stores a program or an instruction that can be executed on the processor 901, and when the program or the instruction is executed by the processor 901, the steps of the foregoing screen capturing method embodiment are implemented, and the same technical effect can be achieved, and in order to avoid repetition, details are not repeated here.
It should be noted that the terminal in the embodiment of the present application includes the mobile electronic device and the non-mobile electronic device described above.
Fig. 10 is a schematic hardware structure diagram of a terminal implementing the embodiment of the present application.
The terminal 1000 can include, but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010.
Those skilled in the art will appreciate that terminal 1000 can further include a power supply (e.g., a battery) for powering the various components, and the power supply can be logically coupled to processor 1010 via a power management system, such that functions of managing charging, discharging, and power consumption are performed via the power management system. The terminal structure shown in fig. 10 does not constitute a limitation of the terminal, and the terminal may include more or less components than those shown, or combine some components, or have a different arrangement of components, and thus will not be described again.
Wherein, the processor 1010 is configured to:
acquiring a screen capture instruction;
intercepting and determining a first image of a target area in a current display area of the terminal based on the screen capturing instruction and pre-acquired screen capturing indication information;
and carrying out screen capture on the target area to obtain a target image.
In the embodiment of the application, a target area in a display area of the terminal is determined based on the screen capturing instruction and the screen capturing indication information acquired in advance, the screen capturing is performed on the target area to obtain a target image, a current display page of the terminal can be captured according to the screen capturing indication information, the target image conforming to the screen capturing indication information is obtained, and screen capturing experience is improved.
Optionally, the screen capture indication information includes indication information indicating a mask target object;
the determining a target area in a display area of the terminal based on the screen capturing instruction and the pre-acquired screen capturing instruction information comprises:
and shielding a region corresponding to the target object in the display region to obtain the target region under the condition that the display region comprises the target object based on the screen capturing instruction and the screen capturing indication information acquired in advance.
Optionally, the display area includes a first area and a second area, and the first area is a pop-up window display area of the terminal;
the determining a target area in a display area of the terminal based on the screen capturing instruction and the pre-acquired screen capturing instruction information comprises:
acquiring content information of the first area based on the screen capturing instruction and pre-acquired screen capturing indication information;
selecting the second area or the display area as the target area based on a preset rule and content information of the first area.
Optionally, the processor 1010 is further configured to:
zooming background page content of the display area to the target area, the target area being smaller than the display area;
the display area is used for displaying a popup message outside the target area, and the screen capture indication information comprises indication information for shielding the popup message.
Optionally, the capturing the screen of the target area to obtain a target image includes:
the target area is subjected to screen capture to obtain a first image;
segmenting the first image into a plurality of second regions;
determining at least one second region from the plurality of second regions based on a central region in the first image, the at least one second region including a second region in which the central region is located;
and obtaining the target image based on the at least one second area.
Optionally, said determining at least one second region from the plurality of second regions based on the central region of the first image comprises:
determining a target second region of the plurality of second regions based on the central region, the central region being located within the target second region;
and determining the at least one second area based on the target second area, wherein the at least one second area comprises the target second area, the similarity between the gray-scale value information of each of the at least one second area and the gray-scale value information of the target second area is greater than or equal to a preset value, and in the case that the at least one second area is at least two second areas, the at least two second areas are adjacent in sequence in the plurality of second areas.
Optionally, the processor 1010 is further configured to:
displaying the target image;
receiving a region selection instruction input by a user on the target image;
and generating a second image based on the target image and the region selection instruction.
It should be understood that, in the embodiment of the present application, the input Unit 1004 may include a Graphics Processing Unit (GPU) 10041 and a microphone 10042, and the Graphics Processing Unit 10041 processes image data of still pictures or video obtained by an image capturing device (such as a camera) in a video capturing mode or an image capturing mode. The display unit 1006 may include a display panel 10061, and the display panel 10061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like. The user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072. The touch panel 10071 is also referred to as a touch screen. The touch panel 10071 may include two parts, a touch detection device and a touch controller. Other input devices 10072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
The embodiment of the present application further provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or the instruction is executed by a processor, the program or the instruction implements each process of the foregoing screenshot method embodiment, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here.
The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read only memory ROM, a random access memory RAM, a magnetic or optical disk, and the like.
The embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement each process of the foregoing screenshot method embodiment, and can achieve the same technical effect, and the details are not repeated here to avoid repetition.
It should be understood that the chips mentioned in the embodiments of the present application may also be referred to as a system-on-chip, or a system-on-chip.
Embodiments of the present application provide a computer program product, where the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the processes of the foregoing screen capturing method embodiments, and can achieve the same technical effects, and in order to avoid repetition, details are not repeated here.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of another like element in a process, method, article, or apparatus that comprises the element. Further, it should be noted that the scope of the methods and apparatus of the embodiments of the present application is not limited to performing the functions in the order illustrated or discussed, but may include performing the functions in a substantially simultaneous manner or in a reverse order based on the functions involved, e.g., the methods described may be performed in an order different than that described, and various steps may be added, omitted, or combined. In addition, features described with reference to certain examples may be combined in other examples.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solutions of the present application may be embodied in the form of a computer software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling an electronic device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.
Claims (16)
1. A screen capture method, comprising:
acquiring a screen capture instruction;
determining a target area in a display area of the terminal based on the screen capturing instruction and pre-acquired screen capturing indication information;
and carrying out screen capture on the target area to obtain a target image.
2. The method of claim 1, wherein the screen capture indication information includes indication information indicating a mask target object;
the determining a target area in a display area of the terminal based on the screen capturing instruction and the pre-acquired screen capturing instruction information comprises:
and shielding a region corresponding to the target object in the display region to obtain the target region under the condition that the display region comprises the target object based on the screen capturing instruction and the screen capturing indication information acquired in advance.
3. The method of claim 1, wherein the display area comprises a first area and a second area, the first area being a pop-up display area of the terminal;
the determining a target area in a display area of the terminal based on the screen capturing instruction and the pre-acquired screen capturing instruction information comprises:
acquiring content information of the first area based on the screen capturing instruction and pre-acquired screen capturing indication information;
selecting the second area or the display area as the target area based on a preset rule and content information of the first area.
4. The method of claim 1, wherein after determining a target area in a display area of a terminal based on the screen capture instruction and pre-acquired screen capture indication information, the method further comprises:
zooming background page content of the display area to the target area, wherein the target area is smaller than the display area;
the display area is used for displaying a popup message outside the target area, and the screen capture indication information comprises indication information for shielding the popup message.
5. The method of claim 1, wherein said capturing the target area to obtain the target image comprises:
the target area is subjected to screen capture to obtain a first image;
segmenting the first image into a plurality of second regions;
determining at least one second region from the plurality of second regions based on a central region of the first image, the at least one second region including a second region in which the central region is located;
and obtaining the target image based on the at least one second area.
6. The method of claim 5, wherein said determining at least one second region from the plurality of second regions based on the center region of the first image comprises:
determining a target second region of the plurality of second regions based on the central region, the central region being located within the target second region;
and determining the at least one second area based on the target second area, wherein the at least one second area comprises the target second area, the similarity between the gray-scale value information of each of the at least one second area and the gray-scale value information of the target second area is greater than or equal to a preset value, and in the case that the at least one second area is at least two second areas, the at least two second areas are adjacent in sequence in the plurality of second areas.
7. The method of any one of claims 1 to 6, wherein after the target area is subjected to screen capture to obtain a target image, the method further comprises:
displaying the target image;
receiving an area selection instruction input by a user for the target image;
and generating a second image based on the target image and the region selection instruction.
8. A screen capture device, comprising:
the acquisition module is used for acquiring a screen capture instruction;
the determining module is used for determining a target area in a display area of the terminal based on the screen capturing instruction and the screen capturing instruction information acquired in advance;
and the screen capturing module is used for capturing the screen of the target area to obtain a target image.
9. The screen capture apparatus of claim 8, wherein the screen capture indication information includes indication information indicating a mask target object;
the determining module includes:
and the shielding unit is used for shielding the area corresponding to the target object in the display area to obtain the target area under the condition that the display area comprises the target object based on the screen capturing instruction and the screen capturing instruction information acquired in advance.
10. The screen capture device of claim 8, wherein the display area comprises a first area and a second area, the first area being a pop-up display area of the terminal;
the determining module includes:
a first obtaining unit, configured to obtain content information of the first area based on the screen capture instruction and pre-obtained screen capture instruction information;
a selection unit configured to select the second area or the display area as the target area based on a preset rule and content information of the first area.
11. The screen capture device of claim 8, wherein the screen capture device further comprises:
the zooming unit is used for zooming the background page content of the display area to the target area, and the target area is smaller than the display area;
the display area is used for displaying a popup message outside the target area, and the screen capture indication information comprises indication information indicating whether to shield the popup message.
12. The screen capture device of claim 8, wherein the screen capture module comprises:
the second acquisition unit is used for carrying out screen capture on the target area to obtain a first image;
a dividing unit configured to divide the first image into a plurality of second regions;
a second determining unit, configured to determine at least one second region from the plurality of second regions based on a central region of the first image, where the at least one second region includes a second region where the central region is located;
and the third acquisition unit is used for obtaining the target image based on the at least one second area.
13. The screen capture apparatus of claim 12, wherein the second determination unit includes:
a first determining subunit configured to determine a target second area of the plurality of second areas based on the central area, the central area being located within the target second area;
a second determining subunit, configured to determine the at least one second region based on the target second region, where the at least one second region includes the target second region, a similarity between the grayscale value information of each of the at least one second region and the grayscale value information of the target second region is greater than or equal to a preset value, and when the at least one second region is at least two second regions, the at least two second regions are sequentially adjacent to each other in the plurality of second regions.
14. The screen capture device of any one of claims 8 to 13, wherein the screen capture device further comprises:
the display module is used for displaying the target image;
the receiving module is used for receiving a region selection instruction input by a user based on the target image;
and the generating module is used for generating a second image based on the target image and the region selection instruction.
15. A terminal, characterized in that it comprises a processor and a memory, said memory storing a program or instructions executable on said processor, said program or instructions, when executed by said processor, implementing the steps of the screen capturing method according to any one of claims 1-7.
16. A readable storage medium, characterized in that it stores thereon a program or instructions which, when executed by a processor, implement the steps of the screen capture method of any one of claims 1-7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210931548.2A CN115291777A (en) | 2022-08-04 | 2022-08-04 | Screen capturing method and device, terminal and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210931548.2A CN115291777A (en) | 2022-08-04 | 2022-08-04 | Screen capturing method and device, terminal and readable storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115291777A true CN115291777A (en) | 2022-11-04 |
Family
ID=83825357
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210931548.2A Pending CN115291777A (en) | 2022-08-04 | 2022-08-04 | Screen capturing method and device, terminal and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115291777A (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105892839A (en) * | 2015-01-26 | 2016-08-24 | 腾讯科技(深圳)有限公司 | Screenshot processing method and device based on instant communication tool |
CN106502533A (en) * | 2016-10-21 | 2017-03-15 | 上海与德信息技术有限公司 | A kind of screenshotss method and device |
CN106775333A (en) * | 2017-02-16 | 2017-05-31 | 深圳市茁壮网络股份有限公司 | A kind of screenshotss method and device |
CN106970754A (en) * | 2017-03-28 | 2017-07-21 | 北京小米移动软件有限公司 | The method and device of screenshotss processing |
CN107357505A (en) * | 2017-07-26 | 2017-11-17 | 北京小米移动软件有限公司 | The method, apparatus and computer-readable recording medium of screenshot capture |
CN111143015A (en) * | 2019-12-31 | 2020-05-12 | 维沃移动通信有限公司 | Screen capturing method and electronic equipment |
CN112363787A (en) * | 2020-10-30 | 2021-02-12 | 维沃软件技术有限公司 | Image processing method and device and electronic equipment |
WO2021031717A1 (en) * | 2019-08-20 | 2021-02-25 | 维沃移动通信有限公司 | Screen capturing method and terminal device |
CN113791719A (en) * | 2020-05-26 | 2021-12-14 | 中兴通讯股份有限公司 | Method, device and equipment for processing screen shot box and computer readable medium |
CN114787863A (en) * | 2019-10-17 | 2022-07-22 | 三星电子株式会社 | Electronic device and method for capturing operation screen of electronic device |
-
2022
- 2022-08-04 CN CN202210931548.2A patent/CN115291777A/en active Pending
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105892839A (en) * | 2015-01-26 | 2016-08-24 | 腾讯科技(深圳)有限公司 | Screenshot processing method and device based on instant communication tool |
CN106502533A (en) * | 2016-10-21 | 2017-03-15 | 上海与德信息技术有限公司 | A kind of screenshotss method and device |
CN106775333A (en) * | 2017-02-16 | 2017-05-31 | 深圳市茁壮网络股份有限公司 | A kind of screenshotss method and device |
CN106970754A (en) * | 2017-03-28 | 2017-07-21 | 北京小米移动软件有限公司 | The method and device of screenshotss processing |
CN107357505A (en) * | 2017-07-26 | 2017-11-17 | 北京小米移动软件有限公司 | The method, apparatus and computer-readable recording medium of screenshot capture |
WO2021031717A1 (en) * | 2019-08-20 | 2021-02-25 | 维沃移动通信有限公司 | Screen capturing method and terminal device |
CN114787863A (en) * | 2019-10-17 | 2022-07-22 | 三星电子株式会社 | Electronic device and method for capturing operation screen of electronic device |
CN111143015A (en) * | 2019-12-31 | 2020-05-12 | 维沃移动通信有限公司 | Screen capturing method and electronic equipment |
CN113791719A (en) * | 2020-05-26 | 2021-12-14 | 中兴通讯股份有限公司 | Method, device and equipment for processing screen shot box and computer readable medium |
CN112363787A (en) * | 2020-10-30 | 2021-02-12 | 维沃软件技术有限公司 | Image processing method and device and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111612873B (en) | GIF picture generation method and device and electronic equipment | |
EP3125135A1 (en) | Picture processing method and device | |
CN111835982B (en) | Image acquisition method, image acquisition device, electronic device, and storage medium | |
CN111241340A (en) | Video tag determination method, device, terminal and storage medium | |
CN110889379A (en) | Expression package generation method and device and terminal equipment | |
CN112306347B (en) | Image editing method, image editing device and electronic equipment | |
CN112269522A (en) | Image processing method, image processing device, electronic equipment and readable storage medium | |
CN108683845A (en) | Image processing method, device, storage medium and mobile terminal | |
CN113794831B (en) | Video shooting method, device, electronic equipment and medium | |
CN112887615B (en) | Shooting method and device | |
CN113225451A (en) | Image processing method and device and electronic equipment | |
CN112330728A (en) | Image processing method, image processing device, electronic equipment and readable storage medium | |
CN115291777A (en) | Screen capturing method and device, terminal and readable storage medium | |
CN113271379B (en) | Image processing method and device and electronic equipment | |
CN113794943A (en) | Video cover setting method and device, electronic equipment and storage medium | |
CN114518859A (en) | Display control method, display control device, electronic equipment and storage medium | |
CN113473012A (en) | Virtualization processing method and device and electronic equipment | |
CN112150486A (en) | Image processing method and device | |
CN112887611A (en) | Image processing method, device, equipment and storage medium | |
CN114118029A (en) | Image processing method, device, equipment and storage medium | |
CN112529766A (en) | Image processing method and device and electronic equipment | |
CN112732961A (en) | Image classification method and device | |
CN113837195B (en) | Image processing method, device, equipment and storage medium | |
CN114049638A (en) | Image processing method, image processing device, electronic equipment and storage medium | |
CN115423823A (en) | Image processing method and device |
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 |