Screenshot method, device, electronic device and storage medium
By receiving user input and detecting target objects in video processing, precise screenshots of target objects in the image are achieved, which solves the problems of single screenshot methods and poor flexibility in the existing technology, and improves the flexibility and precision of screenshots.
Patent Information
- Application Number
- CN202111569825.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-21
AI Technical Summary
The existing video screenshot method is single and has poor flexibility, making it difficult for users to quickly obtain screenshots of interesting parts.
By receiving user input when displaying an image, determining the screenshot area and performing edge detection of the target object, a precise screenshot of the target object in the image is achieved. The user can determine the screenshot area through the input position and input duration.
The flexibility and precision of screenshots are improved. Users can quickly locate and obtain partial screenshot results. The operation is simple and meets diverse needs.
Smart Images

Figure CN114253451B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing, and in particular to a screenshot method, device, electronic equipment and storage medium. Background Art
[0002] The existing technology has a relatively simple method for video screenshots. For example, a user can trigger a screenshot of the current frame of the video by clicking a screenshot function key. The screenshot content obtained in this way is the content of the current frame. If the user does not need the entire current frame, but only needs an interested part of the current frame, the user needs to manually edit the current frame, for example, cropping, etc., to obtain the interested content, and the whole operation is relatively cumbersome.
[0003] In other words, the current screenshot method is single and has poor flexibility. Summary of the invention
[0004] The embodiments of the present invention provide a screenshot method, device, electronic device and storage medium to solve the problem that the screenshot method in the prior art is single and has poor flexibility.
[0005] The embodiment of the present invention is implemented as follows:
[0006] In a first aspect, an embodiment of the present invention provides a screenshot method, comprising:
[0007] In the case of displaying the image, receiving a first input;
[0008] In response to the first input, a screenshot is taken of a target object in the image to obtain a screenshot result, wherein the target object is determined according to an input position of the first input.
[0009] In a second aspect, an embodiment of the present invention provides a screenshot device, comprising:
[0010] A receiving module, configured to receive a first input while displaying an image;
[0011] A screenshot module is used to take a screenshot of a target object in the image in response to the first input to obtain a screenshot result, wherein the target object is determined according to an input position of the first input.
[0012] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the screenshot method as described in the first aspect.
[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the screenshot method described in the first aspect are implemented.
[0014] In an embodiment of the present invention, when an image is displayed, a first input is received; in response to the first input, a target object in the image is captured to obtain a screenshot result, and the target object is determined according to the input position of the first input. In the above screenshot method, the user can quickly locate the screenshot area through the first input and obtain a detailed local screenshot result. The whole process is simple to operate, which can improve the flexibility of the screenshot method. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a flowchart of a screenshot method provided by an embodiment of the present invention;
[0016] Figure 2a is a schematic diagram of the display effect when a first input is performed on an image provided by an embodiment of the present invention;
[0017] Figure 2b is a schematic diagram of the ripple effect principle provided by an embodiment of the present invention;
[0018] Figure 2c is a schematic diagram of sub-regions obtained by detecting a detection region provided by an embodiment of the present invention;
[0019] Figure 2d is a schematic diagram of a screenshot result provided by an embodiment of the present invention;
[0020] Figure 2e is a schematic diagram of highlighting a target object provided by an embodiment of the present invention;
[0021] Figure 2f is another schematic diagram of screenshot results provided by an embodiment of the present invention;
[0022] Figure 2g is a schematic diagram of water ripples provided by an embodiment of the present invention;
[0023] Figure 3 is a structural diagram of a screenshot device provided by an embodiment of the present invention;
[0024] Figure 4 is a structural diagram of an electronic device provided by an embodiment of the present invention;
[0025] Figure 5 is another structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] See also Figure 1 , Figure 1 is a flowchart of a screenshot method provided by an embodiment of the present invention, such as Figure 1 As shown, this embodiment provides a screenshot method, comprising the following steps:
[0028] Step 101: Receive a first input while displaying an image.
[0029] The image may be a video or a picture. For example, in the case of displaying a picture, the first input is the input of the picture; in the case of video playback, the first input is the input of the currently played video frame. The first input may be a press input, and the first input includes an input position and an input duration (the input duration may also be understood as a press duration). The first input may also be a press input to an input device of an electronic device, for example, a press input to a mouse (such as a left or right mouse button). Before the press input, the mouse may be placed at a certain position in the image, and this position is the input position.
[0030] Step 102: In response to the first input, take a screenshot of the target object in the image to obtain a screenshot result, wherein the target object is determined according to an input position of the first input.
[0031] The target object can be a person or an object, etc. Taking a screenshot of the target object can be understood as cutting out the target object from the image, and the obtained screenshot is a screenshot of the area occupied by the target object. For example, if the target object is a face, the screenshot is taken according to the outline of the face in the image, and the obtained screenshot result only includes the face area. Furthermore, the user can save the screenshot result, or edit it, etc.
[0032] The target object can be determined based on the input position of the first input, which can be understood as: the target object is the object selected by the first input. For example, if the image includes a face, and the first input is an input of clicking on the face, then the face is the target object; the target object can be determined based on the input position of the first input, which can also be understood as: a detection area is determined based on the input position, and the target object is the object in the detection area.
[0033] In this embodiment, when an image is displayed, a first input is received; in response to the first input, a target object in the image is screenshotted to obtain a screenshot result, and the target object is determined according to the input position of the first input. In the above screenshot method, the user can quickly locate the screenshot area through the first input and obtain a detailed local screenshot result. The whole process is simple to operate, which can improve the flexibility of the screenshot method.
[0034] In one embodiment of the present application, in response to the first input, taking a screenshot of the target object in the image to obtain a screenshot result includes:
[0035] In response to the first input, determining a detection area;
[0036] Detecting the detection area to obtain the target object;
[0037] A screenshot is taken of the target object to obtain a screenshot result.
[0038] Specifically, the detection area can be determined according to the input position of the first input. For example, the detection area is a circular area with the input position as the center and a preset radius; or, a rectangular area with the input position as the center and a preset length; or, a rectangular area with the input position as the lower left corner, upper left corner, upper right corner or lower right corner, and a preset length, etc., which is not limited here.
[0039] The detection area may also be determined according to the input position of the first input and the input duration of the first input. For example, the detection area is a circular area with the input position as the center and the length determined according to the input duration as the radius; or the detection area is a rectangular area with the input position as the lower left corner, upper left corner, upper right corner or lower right corner and the length determined according to the input duration as the side length, etc., wherein the length determined according to the input duration may be: length = input duration × preset speed, wherein the preset speed may be a default value or may be set by the user. The unit of the preset speed may be "pixels / second" or "inches / second", etc., which are not limited here.
[0040] When determining the length according to the input duration, a normalized time variable u_Time can be obtained, where the value range of u_Time is a decimal of [0, 1], representing the percentage of the short side of the screen, and the variable increases as the input duration increases. The length determined according to the input duration can be: determining the value of u_Time according to the input duration, and then determining the length according to the value of u_Time.
[0041] It should be noted that the length determined according to the input duration has a range interval [L, H]. If the length is equal to the maximum value H, the length will not increase even if the input duration increases. For example, the short side of the display screen can be used as H, and L can be 0, or a value greater than 0 and less than H set by the user.
[0042] After acquiring the detection area, target detection can be performed on the detection area to determine whether there is an object in the detection area, such as a person or an object. After the object is detected, the target object is further determined. The target object may include one or more objects among the detected objects.
[0043] After obtaining the target object, edge detection is performed on the target object to obtain the area where the target object is located, and a screenshot is taken of the area to obtain a screenshot result. The screenshot result includes an image obtained by extracting the target object from the image, and the screenshot result does not include other objects except the target object.
[0044] In this embodiment, through the first input, the detection area is determined, and the detection area is detected to obtain the target object, and then a screenshot of the target object is taken to obtain a screenshot result that only includes the target object, which is convenient for the user to further edit the screenshot result and meet the diverse needs of users.
[0045] In one embodiment of the present application, determining the detection area in response to the first input includes:
[0046] In response to the first input, determining a target area according to the input position and an input duration of the first input;
[0047] The detection area is determined according to the target area.
[0048] Specifically, the target area is determined according to the input position of the first input and the input duration of the first input. For example, the target area is a circular area with the input position as the center and the length determined according to the input duration as the radius; wherein the length determined according to the input duration can be: length = input duration × preset speed, wherein the preset speed can be a default value or can be set by the user. The unit of the preset speed can be "pixels / second" or "inches / second", etc., which are not limited here.
[0049] When determining the length according to the input duration, a normalized time variable u_Time can be obtained, where the value range of u_Time is a decimal of [0, 1], representing the percentage of the short side of the screen, and the variable increases as the input duration increases. The length determined according to the input duration can be: determining the value of u_Time according to the input duration, and then determining the length according to the value of u_Time.
[0050] It should be noted that the length determined according to the input duration has a range interval [L, H]. If the length is equal to the maximum value H, the length will not increase even if the input duration increases. For example, the short side of the display screen can be used as H, and a can be 0, or a value greater than 0 and less than H set by the user.
[0051] After acquiring the target area, the detection area is determined according to the target area. For example, when the target area is circular, the minimum circumscribed rectangle of the target area can be determined as the detection area, or the maximum inscribed rectangle of the target area can be determined as the detection area, and so on.
[0052] In the above, the target area is determined according to the input position and the input duration of the first input; and the detection area is further determined according to the target area, that is, the detection area is determined by the first input, and the user can quickly and accurately locate the screenshot area through the first input to obtain a local screenshot result, thereby improving the flexibility of the screenshot.
[0053] Further, after determining the target area according to the input position and the input duration of the first input in response to the first input, and before determining the detection area according to the target area, the method further includes:
[0054] Displaying a ripple effect in a target area of the image, the target area comprising at least two concentric circles with the input position as the center, the radius of the largest circle of the at least two concentric circles being determined according to the input duration, and the ripple effect comprising a region of the image located between two adjacent concentric circles of the at least two concentric circles presenting a zoom-in and / or zoom-out effect;
[0055] Accordingly, determining the detection area according to the target area includes:
[0056] The minimum circumscribed rectangle of the largest circle among the at least two concentric circles is determined as the detection area.
[0057] In the above, after determining the target area, a ripple effect can be displayed in the target area. The target area includes at least two concentric circles with the input position as the center, and the radius of the largest circle of the at least two concentric circles is determined according to the input duration, that is, the length determined according to the input duration is the radius of the largest circle. The determination of the length according to the input duration can refer to the above-mentioned related records, which will not be repeated here.
[0058] like Figure 2a As shown, Figure 2aAn image 1 is displayed in the image 1, and a plurality of concentric circles are displayed in the image 1, and the centers of these concentric circles are located at the input position m (i.e., the pressing position of the first input), and the radius of the largest circle 13 is equal to the length determined according to the input duration (for the convenience of description, the length determined according to the input duration is referred to as the target length hereinafter). During the first input pressing, the ripple effect is presented as follows: with the pressing position m as the center, a small circle is generated from the center of the circle at every preset time, and the radius of the small circle gradually increases with time until the radius of the small circle increases to the target length, and the area of the image located between two adjacent concentric circles of the at least two concentric circles presents at least one of a magnification effect and a reduction effect. For example, the area of the image between two adjacent concentric circles all presents a magnification effect, or all presents a reduction effect, or the area of the image between each two adjacent concentric circles alternately presents one of a magnification effect or a reduction effect, or the area of the image between two adjacent concentric circles, half presents a magnification effect, and the other half presents a reduction effect, such as Figure 2b As shown, the portion of the image located in area a presents a zoomed-out effect, and the portion of the image located in area b presents a zoomed-in effect.
[0059] The ripple effect is a circle with a gradually increasing radius spreading outward in the shape of a water ripple with the pressed position as the center. The dynamic effect of the water ripple gradually spreading outward as the pressing time increases can increase the fun of user screenshots and improve user experience. At the same time, it also allows users to intuitively know the size of the target area based on the radius of the largest circle, so as to decide whether to continue pressing.
[0060] In one embodiment of the present application, detecting the detection area to obtain the target object includes:
[0061] Detecting the detection area to obtain at least one sub-area, each sub-area including a detected detection object;
[0062] Acquire a target sub-region that meets a preset condition in the at least one sub-region;
[0063] The detection object included in the target sub-region is determined as the target object.
[0064] Specifically, a person or object in the detection area is detected to obtain at least one sub-area, each of which includes a detection object. Figure 2c As shown in FIG. 1 , the figure includes multiple sub-regions, each of which can be regarded as a region where a detected object is located, and the sub-region can be the minimum bounding rectangle of a detected object. Figure 2cIn the sub-region 11, the detection object included in the sub-region 11 is the eyes, and the detection object included in the sub-region 22 is the face. Although the sub-region 22 also includes the eyes, the eyes are not the detection object included in the sub-region 22, and the face is the detection object included in the sub-region 22.
[0065] After acquiring at least one sub-region, the at least one sub-region is screened, a sub-region that meets a preset condition is determined as a target sub-region, and a detection object included in the target sub-region is determined as a target object, for example Figure 2c The face of a person included in the sub-region 22 is the target object.
[0066] In the above, the preset condition includes at least one of the following:
[0067] The target sub-region has an area greater than a preset area;
[0068] The target sub-region includes the input position;
[0069] The target sub-region does not include the input position, and a minimum distance between a boundary of the target sub-region and the input position is less than a preset distance.
[0070] Specifically, when screening the sub-regions in the at least one sub-region, the target sub-region that meets the preset conditions can be screened out, for example, the area of the target sub-region is larger than the preset area. If the size of the sub-region is too small, it is regarded as invalid recognition and needs to be ignored; the target sub-region includes the input position, that is, the input position is located in the target sub-region; the target sub-region does not include the input position, and the closest distance between the boundary of the target sub-region and the input position is less than the preset distance, that is, the person or object adjacent to the input position is regarded as valid recognition and the corresponding sub-region is retained.
[0071] In one embodiment of the present application, taking a screenshot of the target object in the image to obtain a screenshot result includes:
[0072] highlighting a target object in the image, wherein the target object includes at least one object;
[0073] receiving a second input for a first object among the target objects;
[0074] In response to the second input, a screenshot is taken of the first object to obtain a screenshot result.
[0075] Specifically, the target object may include at least one object, and each object may be highlighted. For example, edge detection may be performed on the target object in the image to obtain an edge detection result; based on the edge detection result, the edge of the target object may be highlighted. For example, the edge of the target object may be drawn with a white or red line to highlight the target object, which plays a striking role and is convenient for users to view. Figure 2e As shown, the edge of the face is highlighted by bold black lines. Further, based on the second input of the user, the first object is selected to take a screenshot of the first object to obtain a screenshot result.
[0076] Further, in response to the second input, taking a screenshot of the first object to obtain a screenshot result includes:
[0077] In response to the second input, obtaining a screenshot of the first object;
[0078] receiving a third input of a screenshot of the first object, wherein the third input is used to process the screenshot of the first object, wherein the processing includes at least one of image saving, image editing, and image synthesis;
[0079] In response to the third input, a screenshot result is obtained.
[0080] Specifically, after the first object is selected based on the user's second input, an operation bar is displayed. The operation bar may include operations such as picture saving, picture editing, picture synthesis, picture sharing, etc. The user can share the first object through the "Share" button in the operation bar, for example, send it to a friend, or upload it to a cloud space or a social platform, etc. The user can also save the first object through the "Save" button in the operation bar. The screenshot result can be saved in a local folder of the electronic device. The background of the final saved picture is transparent or blank, and the foreground of the picture is the first object, such as Figure 2d In the screenshot result shown, only the first object is captured, and the other areas are transparent or blank.
[0081] That is, the user can process the screenshot of the first object through the third input, for example, at least one of image saving, image editing and image synthesis, and use the processing result as the screenshot result, for example, Figure 2f The screenshot result shown is a picture synthesis result obtained based on the third input, and the synthesis result includes the first object and a plurality of stars. Further, the screenshot result can be saved, shared with friends, or uploaded to a cloud space or a social platform, which is not limited here.
[0082] The following describes the screenshot method provided by this application using video playback as an example.
[0083] The process of the screenshot method is as follows:
[0084] (1) On the video playback page, the user triggers a partial screenshot operation by long pressing the video. At this time, the detection area becomes larger with the finger pressing area as the center, and the user can see the corresponding water ripple effect (also called ripple effect), such as Figure 2a As shown in the figure, with the finger pressing area as the center, the detection area spreads outward in the form of water ripples. The water ripple effect is actually a series of alternating effects with the amplitude gradually decreasing outwards. The video image displayed in the area affected by the water ripples has a zooming in and out effect.
[0085] like Figure 2b As shown, two adjacent concentric circles are used as an example to illustrate the zoom-in and zoom-out effects. With the click position as the center point, the deformed area is the area between the inner circle 33 and the outer circle 44, and the circle 55 constructed with the normalized time variable u_Time (a decimal in the value interval [0,1], indicating the percentage of the short side of the display screen, which increases with the increase in the user's pressing time) as the radius is the boundary. The inner side a (the area between the inner circle 33 and the circle 55) is set as the area to achieve the zoom-out effect, and the outer side b (the area between the outer circle 44 and the circle 55) is set as the area to achieve the zoom-in effect, and the setting can also be reversed.
[0086] The distance between inner circle 33 and circle 55 is equal to the distance between circle 44 and circle 55, both are u_Boundary (such as Figure 2b The width of the deformed area is a fixed value of 2*u_Boundary. As u_Time increases, this deformed area gradually moves outward, forming a dynamic water ripple effect.
[0087] Figure 2g The figure shows a simulated water ripple effect, wherein the reduction effect models the concave surface 10 of the water ripple, and the magnification effect simulates the convex surface 20 of the water ripple.
[0088] In order to better display the water ripple effect, the deformed area can be smoothed, so that the transition between the zoom-in and zoom-out effects is smooth and the display effect is improved. The specific method is as follows:
[0089] The sampling point is the different detection position during the image recognition process. For each detection, such as Figure 2b As shown, let the distance from the sampling point to the center point m (i.e., the input position m) be d, and calculate the value of d-u_t=diff to determine whether the sampling point is located in the reduced area a (diff<0) or the enlarged area b (diff>0). u_t is the distance value determined according to u_Time. Finally, a smoothing function needs to be constructed:
[0090] y=20x*(x-0.1)*(x+0.1), where x is diff.
[0091] With diff as input, the function outputs a positive value when diff < 0, and a negative value when diff > 0. When the user releases his finger, the rectangular detection area is determined with the radius of the waveform effect u_t as the side length, or the radius of the circle 44 as the side length.
[0092] (2) Determine at least one person or object in the detection area through edge detection algorithm and target detection algorithm. Image edge detection and target detection are centered on the user touch point and identify multiple people or objects (anchors) in the detection area.
[0093] like Figure 2c As shown in the figure, the process is a set of rectangles generated by the relevant algorithm, with the touch point as the center. The person or object whose generated rectangle is at or near the touch point is considered as a valid recognition (positive archor), marked in blue (marked as a solid line frame 22 in the figure); the person or object whose recognition area is far away from the touch point and whose rectangular area is too small is considered as an invalid recognition (negative archor), marked in red (marked as a dotted line frame 11 in the figure); finally, the blue valid recognition result is displayed to the user in the form of an edge area, and the red invalid recognition result is discarded. The blue and red marks in this process are only for explaining the process of determining the target object, which belongs to the internal execution process and is not displayed to the user.
[0094] (3) Displaying the edge area of the identified object to the user so that the user can select it (e.g. Figure 2e As shown, the object is distinguished from other areas by bold black lines);
[0095] (4) The user selects one of the identified people or objects, and based on the attributes of the object, the user can edit the image, replace or synthesize the real person or picture;
[0096] (5) Taking the example of a user selecting to save a character, a screenshot of the character's head portrait selected by the user is taken and saved in a local folder of the electronic device in the format of an image file. The background of the final saved image is transparent, and the content is only the selected character's head portrait part, such as Figure 2d shown.
[0097] The beneficial effects of this application include: this proposal can quickly locate and obtain more detailed partial screenshots of the image through a simple press trigger by the user; the partial screenshot materials provide users with more diversified usage scenarios and enhance the user experience.
[0098] See also Figure 3 , Figure 3is a structural diagram of a screenshot device provided by an embodiment of the present invention, such as Figure 3 As shown, the screenshot device 300 includes:
[0099] The receiving module 301 is used to receive a first input when displaying an image;
[0100] The screenshot module 302 is used to take a screenshot of the target object in the image in response to the first input to obtain a screenshot result, wherein the target object is determined according to an input position of the first input.
[0101] Furthermore, the screenshot module 302 includes:
[0102] a determination submodule, configured to determine a detection area in response to the first input;
[0103] An acquisition submodule, used to detect the detection area and obtain the target object;
[0104] The first screenshot submodule is used to take a screenshot of the target object to obtain a screenshot result.
[0105] Further, submodules are determined, including:
[0106] a first determining unit, configured to determine, in response to the first input, a target area according to the input position and an input duration of the first input;
[0107] The second determining unit is used to determine the detection area according to the target area.
[0108] Furthermore, the screenshot device 300 further includes:
[0109] A display module, configured to display a ripple effect in a target area of the image, the target area comprising at least two concentric circles with the input position as a center, the radius of the largest circle of the at least two concentric circles being determined according to the input duration, and the ripple effect comprising a region of the image located between two adjacent concentric circles of the at least two concentric circles presenting a zoom-in and / or zoom-out effect;
[0110] Correspondingly, the second determining unit is used to determine the minimum circumscribed rectangle of the largest circle among the at least two concentric circles as the detection area.
[0111] Furthermore, the acquisition submodule includes:
[0112] A first acquisition unit, configured to detect the detection area to obtain at least one sub-area, each sub-area including a detected detection object;
[0113] A second acquisition unit, configured to acquire a target sub-region that meets a preset condition in the at least one sub-region;
[0114] A third determining unit is configured to determine the detection object included in the target sub-region as the target object.
[0115] Furthermore, the preset condition includes at least one of the following:
[0116] The target sub-region has an area greater than a preset area;
[0117] The target sub-region includes the input position;
[0118] The target sub-region does not include the input position, and a minimum distance between a boundary of the target sub-region and the input position is less than a preset distance.
[0119] Furthermore, the screenshot module 302 includes:
[0120] A display submodule, configured to highlight a target object in the image, wherein the target object includes at least one object;
[0121] A receiving submodule, configured to receive a second input of a first object among the target objects;
[0122] The second screenshot submodule is used to take a screenshot of the first object in response to the second input to obtain a screenshot result.
[0123] Furthermore, the display submodule is used to perform edge detection on the target object in the image to obtain an edge detection result; and highlight the edge of the target object according to the edge detection result.
[0124] Furthermore, the second screenshot submodule includes:
[0125] A first acquisition unit, configured to obtain a screenshot of the first object in response to the second input;
[0126] a receiving unit, configured to receive a third input of a screenshot of the first object, wherein the third input is used to process the screenshot of the first object, wherein the processing includes at least one of image saving, image editing, and image synthesis;
[0127] The second acquisition unit is used to obtain a screenshot result in response to the third input.
[0128] The screenshot device 300 can realize Figure 1 The various processes implemented by the illustrated method embodiment achieve the same beneficial effects, and to avoid repetition, they will not be described again here.
[0129] Figure 4 A schematic diagram of the hardware structure of an electronic device provided to implement an embodiment of the present invention is shown in FIG. Figure 4 As shown, the electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, a processor 910, and a power supply 911. Those skilled in the art can understand that Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, and a pedometer.
[0130] A user input unit 907, used to receive a first input when displaying an image;
[0131] The processor 910 is used to take a screenshot of the target object in the image in response to the first input to obtain a screenshot result, wherein the target object is determined according to an input position of the first input.
[0132] Further, the processor 910 is used to determine a detection area in response to the first input;
[0133] Detecting the detection area to obtain the target object;
[0134] A screenshot is taken of the target object to obtain a screenshot result.
[0135] Further, the processor 910 is configured to determine, in response to the first input, a target area according to the input position and an input duration of the first input;
[0136] The detection area is determined according to the target area.
[0137] Further, the display unit 906 is used to display a ripple effect in a target area of the image, the target area includes at least two concentric circles with the input position as the center, the radius of the largest circle of the at least two concentric circles is determined according to the input duration, and the ripple effect includes a region of the image located between two adjacent concentric circles of the at least two concentric circles presenting a zoom-in and / or zoom-out effect;
[0138] The processor 910 is configured to determine the minimum circumscribed rectangle of the largest circle of the at least two concentric circles as the detection area.
[0139] Further, the processor 910 is used to detect the detection area to obtain at least one sub-area, each sub-area including a detected detection object;
[0140] Acquire a target sub-region that meets a preset condition in the at least one sub-region;
[0141] The detection object included in the target sub-region is determined as the target object.
[0142] Furthermore, the preset condition includes at least one of the following:
[0143] The target sub-region has an area greater than a preset area;
[0144] The target sub-region includes the input position;
[0145] The target sub-region does not include the input position, and a minimum distance between a boundary of the target sub-region and the input position is less than a preset distance.
[0146] Further, the display unit 906 is used to highlight the target object in the image, and the target object includes at least one object;
[0147] A user input unit 907, used to receive a second input to a first object among the target objects;
[0148] The processor 910 is configured to take a screenshot of the first object in response to the second input to obtain a screenshot result.
[0149] Further, the processor 910 is used to perform edge detection on the target object in the image to obtain an edge detection result;
[0150] The display unit 906 is used to highlight the edge of the target object according to the edge detection result.
[0151] Further, the processor 910 is configured to obtain a screenshot of the first object in response to the second input;
[0152] A user input unit 907, configured to receive a third input of a screenshot of the first object, wherein the third input is used to process the screenshot of the first object, wherein the processing includes at least one of image saving, image editing, and image synthesis;
[0153] The processor 910 is configured to obtain a screenshot result in response to the third input.
[0154] The electronic device 900 can implement each process implemented by the electronic device in the aforementioned embodiment and achieve the same technical effect, which will not be described again here to avoid repetition.
[0155] It should be understood that in the embodiment of the present invention, the radio frequency unit 901 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 910 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 901 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 901 can also communicate with the network and other devices through a wireless communication system.
[0156] The electronic device provides users with wireless broadband Internet access through the network module 902, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0157] The audio output unit 903 can convert the audio data received by the RF unit 901 or the network module 902 or stored in the memory 909 into an audio signal and output it as sound. Moreover, the audio output unit 903 can also provide audio output related to a specific function performed by the electronic device 900 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 903 includes a speaker, a buzzer, a receiver, etc.
[0158] The input unit 904 is used to receive audio or video signals. The input unit 904 may include a graphics processor (GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 906. The image frame processed by the graphics processor 9041 can be stored in the memory 909 (or other storage medium) or sent via the radio frequency unit 901 or the network module 902. The microphone 9042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 901 in the case of a telephone call mode.
[0159] The electronic device 900 also includes at least one sensor 909, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 9061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 9061 and / or the backlight when the electronic device 900 is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 909 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0160] The display unit 906 is used to display information input by the user or information provided to the user. The display unit 906 may include a display panel 9061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0161] The user input unit 907 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 9071 or near the touch panel 9071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 9071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 910, receives the command sent by the processor 910 and executes it. In addition, the touch panel 9071 can be implemented using various types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 9071, the user input unit 907 may also include other input devices 9072. Specifically, other input devices 9072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be described in detail here.
[0162] Furthermore, the touch panel 9071 may be overlaid on the display panel 9061. When the touch panel 9071 detects a touch operation on or near it, it transmits the information to the processor 910 to determine the type of the touch event. Then, the processor 910 provides a corresponding visual output on the display panel 9061 according to the type of the touch event. Figure 4 In the figure, the touch panel 9071 and the display panel 9061 are used as two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 9071 and the display panel 9061 can be integrated to realize the input and output functions of the electronic device, which is not limited here.
[0163] The interface unit 908 is an interface for connecting an external device to the electronic device 900. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 908 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 900 or may be used to transmit data between the electronic device 900 and an external device.
[0164] The memory 909 can be used to store software programs and various data. The memory 909 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 909 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0165] The processor 910 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 909, and calling data stored in the memory 909, so as to monitor the electronic device as a whole. The processor 910 may include one or more processing units; preferably, the processor 910 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 910.
[0166] The electronic device 900 may also include a power supply 911 (such as a battery) for supplying power to each component. Preferably, the power supply 911 may be logically connected to the processor 910 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0167] In addition, the electronic device 900 includes some functional modules not shown, which will not be described in detail here.
[0168] like Figure 5 As shown, an embodiment of the present invention further provides an electronic device, including a processor 1010, a memory 1009, and a computer program stored in the memory 1009 and executable on the processor 1010, wherein the computer program is executed by the processor 1010 to implement the above Figure 1 The various processes of the illustrated embodiments can achieve the same technical effect, and will not be described again here to avoid repetition.
[0169] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, which implements the above-mentioned Figure 1 The various processes of the screenshot method embodiment shown in the figure can achieve the same technical effect, and will not be repeated here to avoid repetition. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0170] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0171] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0172] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A screenshot method, characterized in that: include: In the case of displaying the image, receiving a first input; In response to the first input, taking a screenshot of a target object in the image to obtain a screenshot result, wherein the target object is determined according to an input position of the first input; In response to the first input, taking a screenshot of the target object in the image to obtain a screenshot result includes: In response to the first input, determining a target area according to the input position and an input duration of the first input; Determine a detection area according to the target area; Detecting the detection area to obtain the target object; Taking a screenshot of the target object to obtain a screenshot result; The screenshot result is a result obtained by performing edge detection on the target object, obtaining the area where the target object is located, and taking a screenshot of the area where the target object is located; The detecting the detection area to obtain the target object includes: Detecting the detection area to obtain at least one sub-area, each sub-area including a detected detection object; Acquire a target sub-region that meets a preset condition in the at least one sub-region; Determining the detection object included in the target sub-region as the target object; The preset condition includes at least one of the following: The target sub-region includes the input position; The target sub-region does not include the input position, and a minimum distance between a boundary of the target sub-region and the input position is less than a preset distance.
2. The method according to claim 1, characterized in that After determining the target area according to the input position and the input duration of the first input in response to the first input, and before determining the detection area according to the target area, the method further includes: Displaying a ripple effect in a target area of the image, the target area comprising at least two concentric circles with the input position as the center, the radius of the largest circle of the at least two concentric circles being determined according to the input duration, and the ripple effect comprising a region of the image located between two adjacent concentric circles of the at least two concentric circles presenting a zoom-in and / or zoom-out effect; The step of determining the detection area according to the target area includes: The minimum circumscribed rectangle of the largest circle among the at least two concentric circles is determined as the detection area.
3. The method according to claim 1, characterized in that The preset conditions also include: The target sub-region has an area greater than a preset area.
4. The method according to claim 1, characterized in that: Taking a screenshot of the target object in the image to obtain a screenshot result includes: highlighting a target object in the image, wherein the target object includes at least one object; receiving a second input for a first object among the target objects; In response to the second input, a screenshot is taken of the first object to obtain a screenshot result.
5. The method according to claim 4, characterized in that The highlighting of the target object in the image includes: Performing edge detection on the target object in the image to obtain an edge detection result; According to the edge detection result, the edge of the target object is highlighted.
6. The method according to claim 4, characterized in that The step of taking a screenshot of the first object in response to the second input to obtain a screenshot result includes: In response to the second input, obtaining a screenshot of the first object; receiving a third input of a screenshot of the first object, wherein the third input is used to process the screenshot of the first object, wherein the processing includes at least one of image saving, image editing, and image synthesis; In response to the third input, a screenshot result is obtained.
7. A screenshot device, characterized in that: include: A receiving module, configured to receive a first input while displaying an image; A screenshot module, configured to take a screenshot of a target object in the image in response to the first input to obtain a screenshot result, wherein the target object is determined according to an input position of the first input; The screenshot module includes: A determination submodule, the determination submodule comprising: a first determination unit, configured to determine a target area according to the input position and the input duration of the first input in response to the first input; a second determination unit, configured to determine a detection area according to the target area; An acquisition submodule, used to detect the detection area and obtain the target object; A first screenshot submodule is used to take a screenshot of the target object and obtain a screenshot result; The screenshot result is a result obtained by performing edge detection on the target object, obtaining the area where the target object is located, and taking a screenshot of the area where the target object is located; The acquisition submodule includes: A first acquisition unit, configured to detect the detection area to obtain at least one sub-area, each sub-area including a detected detection object; A second acquisition unit, configured to acquire a target sub-region that meets a preset condition in the at least one sub-region; A third determining unit, configured to determine the detection object included in the target sub-region as the target object; The preset condition includes at least one of the following: The target sub-region includes the input position; The target sub-region does not include the input position, and a minimum distance between a boundary of the target sub-region and the input position is less than a preset distance.
8. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the screenshot method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the screenshot method according to any one of claims 1 to 6 are implemented.
