Image processing method and device

By obtaining the side length and rotation angle of the material display frame during image processing, the position and trajectory of the display frame outside the display screen are determined, which solves the problem of material being lost outside the screen and achieves real-time positioning and better material flying-in effects.

CN113888674BActive Publication Date: 2025-01-21BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111154176.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-01-21
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

During image processing, when the user drags the material out of the screen too far, it may cause the material to be unable to locate, resulting in the loss of the material.

Method used

By obtaining the side length and rotation angle of the material display frame, the position trajectory of the display frame outside the display screen is determined, so that the intersection point between the material and the display screen is always maintained, thereby locating the position of the material in real time.

Benefits of technology

It avoids the loss of materials, realizes the real-time positioning of materials during image processing, and can move the materials outside the display screen to a great extent when creating the effect of materials flying in from outside the display screen.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113888674B_ABST
    Figure CN113888674B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an image processing method and device, the image processing method comprising: obtaining the side length and rotation angle of a display frame of a material selected by a user, wherein the rotation angle is the angle at which the display frame rotates relative to a display screen; determining a position trajectory of the display frame outside the display screen according to the side length and the rotation angle, wherein the position trajectory is a trajectory formed by the position of a center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen; determining a display position of the material according to the position trajectory, wherein the display position is outside the display screen; and displaying the material at the display position.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing, and more specifically, to an image processing method and device. Background Art

[0002] In the process of image processing, keyframe technology is often used to create some visual effects, such as creating the effect of a material flying from outside the video into the video. However, in the process of creating the effect of a material flying from outside the video into the video, if the user drags the material too far out of the screen, it may be impossible to locate the position of the material outside the screen, resulting in loss of the material. Summary of the invention

[0003] The present disclosure provides an image processing method and apparatus to at least solve the above-mentioned problems in the related art, but may not solve any of the above-mentioned problems.

[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, comprising: obtaining a side length and a rotation angle of a display frame of a material selected by a user, wherein the rotation angle is an angle at which the display frame is rotated relative to a display screen; determining a position trajectory of the display frame outside the display screen according to the side length and the rotation angle, wherein the position trajectory is a trajectory formed by the position of a center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen; determining a display position of the material according to the position trajectory, wherein the display position is outside the display screen; and displaying the material at the display position.

[0005] Optionally, determining the position trajectory of the display frame outside the display screen based on the side length and the rotation angle includes: calculating a first distance and a second distance between the position trajectory and the display screen based on a first side length, a second side length and the rotation angle of the display frame, wherein the first side length is the side length of the display frame in the horizontal direction when the rotation angle is zero, and the second side length is the side length of the display frame that is perpendicular to the first side length, the first distance is the distance between the position trajectory and the display screen in the horizontal direction, and the second distance is the distance between the position trajectory and the display screen in the vertical direction; determining a first position trajectory based on the first distance and the second distance and the position of the display screen; and determining the position trajectory by adjusting a predetermined segment of the first position trajectory.

[0006] Optionally, the predetermined fragment includes a first fragment and a second fragment on an edge starting from each vertex of the first position trajectory, wherein the first fragment is a fragment on an edge in the first position trajectory parallel to an edge of the display screen in a vertical direction, and the second fragment is a fragment on an edge in the first position trajectory parallel to an edge of the display screen in a horizontal direction.

[0007] Optionally, determining the position trajectory by adjusting a predetermined segment of the first position trajectory includes: determining the position trajectory by adjusting the predetermined segment to a third segment, wherein when the center point of the display frame is located on the third segment, the display frame has a unique intersection with a first vertex of the display screen, wherein the first vertex is a vertex of the display screen that is closest to the predetermined segment.

[0008] Optionally, determining the position trajectory by adjusting the predetermined segment to a third segment includes: when a position point of the first position trajectory is on the predetermined segment, determining a pre-adjusted position of the display screen according to a side length of the display screen and a rotation angle of the display screen relative to the display frame, wherein the pre-adjusted position is a position where a center point of the display screen is located when the display screen has a unique intersection with the display frame; obtaining a pre-adjusted distance between the pre-adjusted position of the display screen and the center point of the display screen, wherein the pre-adjusted distance is the shortest distance between the center point of the display screen and the pre-adjusted position trajectory; and based on the pre-adjusted distance, adjusting the predetermined segment to a third segment to determine the position trajectory.

[0009] Optionally, adjusting the predetermined segment to a third segment based on the pre-adjustment distance includes: moving each position point on the predetermined segment toward the display screen by the pre-adjustment distance in the direction of a line connecting the pre-adjustment position and the center point position of the display screen to obtain the third segment.

[0010] Optionally, determining the display position of the material according to the position track includes: determining the center point position of the display frame of the material to be on the position track.

[0011] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, comprising: a display frame information acquisition unit, configured to acquire a side length and a rotation angle of a display frame of a material selected by a user, wherein the rotation angle is an angle at which the display frame is rotated relative to a display screen; a position trajectory acquisition unit, configured to determine a position trajectory of the display frame outside the display screen according to the side length and the rotation angle, wherein the position trajectory is a trajectory formed by the position of a center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen; a display position determination unit, configured to determine a display position of the material according to the position trajectory, wherein the display position is outside the display screen; and a material display unit, configured to display the material at the display position.

[0012] Optionally, the position trajectory acquisition unit may be configured to: calculate a first distance and a second distance between the position trajectory and the display screen according to a first side length, a second side length and the rotation angle of the display frame, wherein the first side length is the side length of the display frame in the horizontal direction when the rotation angle is zero, the second side length is the side length of the display frame perpendicular to the first side length, the first distance is the distance between the position trajectory and the display screen in the horizontal direction, and the second distance is the distance between the position trajectory and the display screen in the vertical direction; determine a first position trajectory based on the first distance and the second distance and the position of the display screen; determine the position trajectory by adjusting a predetermined segment of the first position trajectory.

[0013] Optionally, the predetermined fragment includes a first fragment and a second fragment on an edge starting from each vertex of the first position trajectory, wherein the first fragment is a fragment on an edge in the first position trajectory parallel to an edge of the display screen in a vertical direction, and the second fragment is a fragment on an edge in the first position trajectory parallel to an edge of the display screen in a horizontal direction.

[0014] Optionally, the position trajectory acquisition unit may be configured to determine the position trajectory by adjusting the predetermined fragment to a third fragment, wherein when the center point of the display frame is located on the third fragment, the display frame has a unique intersection with the first vertex of the display screen, wherein the first vertex is the vertex of the display screen that is closest to the predetermined fragment.

[0015] Optionally, the position trajectory acquisition unit may be configured to: when the position point of the first position trajectory is on the predetermined segment, determine the pre-adjusted position of the display screen according to the side length of the display screen and the rotation angle of the display screen relative to the display frame, wherein the pre-adjusted position is the position of the center point of the display screen when the display screen has a unique intersection with the display frame; acquire a pre-adjusted distance between the pre-adjusted position of the display screen and the center point of the display screen, wherein the pre-adjusted distance is the shortest distance between the center point of the display screen and the pre-adjusted position trajectory; and based on the pre-adjusted distance, adjust the predetermined segment to a third segment to determine the position trajectory.

[0016] Optionally, the position trajectory acquisition unit may be configured to: move each position point on the predetermined segment toward the display screen by the pre-adjusted distance in the direction of a line connecting the pre-adjusted position and the center point position of the display screen, to obtain a third segment.

[0017] Optionally, the display position determining unit may be configured to: determine the position of the center point of the display frame of the material to be on the position track.

[0018] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, prompt the at least one processor to execute the image processing method according to the present disclosure.

[0019] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to execute the image processing method according to the present disclosure.

[0020] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising computer instructions, which implement the image processing method according to the present disclosure when executed by at least one processor.

[0021] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0022] According to the image processing method and device disclosed in the present invention, the trajectory of the display position of the material is controlled by the side length and rotation angle of the material display frame, so that there is always an intersection between the material and the display screen, thereby locating the position of the material in real time during the image processing process to avoid losing the material.

[0023] In addition, the center point of the material display frame can be restricted to the trajectory of the display position. Therefore, when creating an effect in which the material flies from outside the display screen into the display screen, the material can be moved outside the display screen to a great extent, thereby achieving a better effect of the material flying into the screen.

[0024] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0026] Figure 1 is a flowchart illustrating an image processing method according to an exemplary embodiment of the present disclosure.

[0027] Figure 2 is a schematic diagram illustrating a first position trajectory according to an exemplary embodiment of the present disclosure.

[0028] Figure 3 to Figure 5 is a diagram showing an exemplary embodiment according to the present disclosure Figure 2 A schematic diagram showing the first position trajectory adjustment.

[0029] Figure 6 (a) and Figure 6 (b) is a diagram showing the effect of the image processing method according to an exemplary embodiment of the present disclosure.

[0030] Figure 7 is a block diagram illustrating an image processing apparatus according to an exemplary embodiment of the present disclosure.

[0031] Figure 8 is a block diagram illustrating an electronic device 800 according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0032] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the attached claims.

[0034] It should be noted that the phrase "at least one of the items" in the present disclosure includes three types of parallel situations: "any one of the items", "a combination of any number of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. Another example is "executing at least one of step 1 and step 2" which means the following three parallel situations: (1) executing step 1; (2) executing step 2; (3) executing step 1 and step 2.

[0035] In the process of image processing, the image materials on the display screen are often moved and transformed at will. A common situation is that the material is moved outside the screen during the movement process, resulting in material loss. One solution is to prevent material loss during the movement by forcibly restricting part of the material to the display screen. However, in some application scenarios, the material needs to be completely moved outside the display screen. For example, when creating the effect of material flying in from outside the video screen, this method will cause part of the material to always be on the display screen, and the effect of material flying in from outside the screen cannot be fully achieved.

[0036] In order to solve the problem that materials are easily lost during image processing, and at the same time solve the problem that materials cannot be completely moved out of the display screen in some application scenarios, the present disclosure proposes an image processing method and device. Specifically, according to the image processing method and device of the present disclosure, the trajectory of the display position of the material is controlled by the side length and rotation angle of the material display frame, so that there is always an intersection between the material and the display screen, thereby locating the position of the material in real time during the image processing process to avoid losing the material.

[0037] In addition, the center point of the material display frame can be restricted to the trajectory of the display position. Therefore, when creating an effect that makes the material fly from outside the display screen to inside the display screen, the material can be moved to the outside of the display screen to a great extent, thereby achieving a better effect of the material flying into the screen. Figures 1 to 6An image processing method and apparatus according to exemplary embodiments of the present disclosure are described in detail.

[0038] Figure 1 is a flow chart showing an image processing method according to an exemplary embodiment of the present disclosure. Here, image processing may be processing such as moving, scaling, and effect display of images added to videos and pictures, or may be limiting the movement position of any selected object in the game screen, etc., and the present disclosure does not limit this.

[0039] Reference Figure 1 In step 101, the side length and rotation angle of the display frame of the material selected by the user are obtained, wherein the rotation angle is the angle at which the display frame rotates relative to the display screen.

[0040] According to an exemplary embodiment of the present disclosure, the material selected by the user may be a material selected from a material library provided by the system, such as different types of emoji stickers, portrait stickers, and animal stickers, etc.; or a photo selected from a local gallery or a historically saved picture, etc., and the present disclosure does not limit this. After obtaining the material selected by the user, a display frame may be assigned to the material. In some embodiments, the display frame may be a rectangular frame. Specifically, material images of any shape exist in a rectangular shape at the pixel level, even if the material images of non-rectangular shapes in the eyes of some people are actually rectangles with transparent pixels on the edges. Therefore, in order to facilitate the calculation of the position of the material on the display screen, a rectangular frame may be assigned to the material first (for example, drawn in real time), the shape of the rectangular frame is similar to the rectangular material at the pixel level, and the size may be several pixels larger than the material to avoid blocking the material. Afterwards, the side length of the rectangular frame may be calculated by the vertex coordinates of the rectangular frame, and the angle of rotation of the rectangular frame relative to the display screen may be given according to the rotation operation performed by the user on the material. Here, the rectangular frame may rotate counterclockwise or clockwise relative to the display screen, and the present disclosure does not limit this. In addition, it should be noted that, for consistency in the description of the exemplary embodiments of the present disclosure, the present disclosure uses the angle at which the display frame rotates counterclockwise relative to the display screen as the rotation angle of the display frame.

[0041] In step 102, the position trajectory of the display frame outside the display screen is determined based on the side length and the rotation angle, wherein the position trajectory is a trajectory formed by the position of the center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen.

[0042] According to an exemplary embodiment of the present disclosure, the first distance and the second distance between the position track and the display screen can be calculated based on the first side length, the second side length and the rotation angle of the display frame relative to the display screen, and the first position track is determined based on the first distance, the second distance and the position of the display screen. Here, the first side length is the side length of the display frame in the horizontal direction when the rotation angle of the display frame relative to the display screen is zero, the second side length is the side length of the display frame perpendicular to the first side length, the first distance is the distance between the position track and the display screen in the horizontal direction, and the second distance is the distance between the position track and the display screen in the vertical direction. For example, but not limited to, the first distance and the second distance can be respectively expressed as:

[0043] MaxX=(a*cosθ+b*sinθ) / 2

[0044] MaxY=(a*sinθ+b*cosθ) / 2

[0045] Among them, MaxX represents the first distance; MaxY represents the second distance; a represents the first side length, b represents the second side length, and θ represents the rotation angle.

[0046] After calculating the first distance and the second distance, a first position track can be obtained, with the side length of the display screen in the horizontal direction (i.e., width) plus twice the first distance as the width, and the side length of the display screen in the vertical direction (i.e., height) plus twice the second distance as the height. In some embodiments, the first position track can be a rectangle similar to the display screen. In this step, the first position track cannot completely prevent the material from losing its position when it is displayed outside the display screen, so it is also necessary to adjust the predetermined segment of the first position track to determine the position track.

[0047] According to an exemplary embodiment of the present disclosure, the predetermined fragment includes a first fragment and a second fragment on the edge starting from each vertex of the first position trajectory, wherein the first fragment is a fragment on the edge of the first position trajectory that is parallel to the edge of the display screen in the vertical direction (i.e., height), and the second fragment is a fragment on the edge of the first position trajectory that is parallel to the edge of the display screen in the horizontal direction (i.e., width). Specifically, when the first position trajectory is a rectangle similar to the display screen, the area near the four corners of the first position trajectory may lose the position of the material, so the position points on the predetermined fragments on the edges starting from the four corners of the first position trajectory can be adjusted. For example, but not limited to, the first fragment and the second fragment at the first end of the first diagonal line of the first position trajectory can be respectively represented as:

[0048] h1=asinθ

[0049] h2=acosθ

[0050] The first segment and the second segment at the second end of the first diagonal line of the first position trajectory may be represented as:

[0051] h1=acosθ

[0052] h2=asinθ

[0053] The first segment and the second segment at the first end on the second diagonal line of the first position trajectory can be represented as:

[0054] h1=bcosθ

[0055] h2=bsinθ

[0056] The first segment and the second segment at the second end on the second diagonal line of the first position trajectory can be respectively expressed as:

[0057] h1=bsinθ

[0058] h2=bcosθ

[0059] Among them, h1 represents the first segment; h2 represents the second segment; a represents the first side length; b represents the second side length, and θ represents the rotation angle of the display frame relative to the display screen.

[0060] According to an exemplary embodiment of the present disclosure, the predetermined segment can be adjusted to a third segment to determine the position trajectory. Here, when the position of the center point of the display frame is on the third segment, the display frame has a unique intersection with the first vertex of the display screen, and the first vertex is the vertex of the display screen that is closest to the predetermined segment. According to an exemplary embodiment of the present disclosure, when the position point of the first position trajectory is on the predetermined segment, first, according to the side length of the display screen and the rotation angle of the display screen relative to the display frame, the pre-adjusted position of the display screen is determined, where the pre-adjusted position is the position of the center point of the display screen when the display screen has a unique intersection with the display frame; then, the pre-adjusted distance between the pre-adjusted position of the display screen and the center point of the display screen is obtained, where the pre-adjusted distance is the closest distance between the center point of the display screen and the pre-adjusted position trajectory. Based on the pre-adjusted distance, the predetermined segment can be adjusted to the third segment, and the portion of the first position trajectory other than the predetermined segment and the third segment together constitute the position trajectory.

[0061] According to an exemplary embodiment of the present disclosure, each position point on the predetermined segment may be moved along the line connecting the pre-adjusted position and the center point of the display screen by the pre-adjusted distance to obtain a third segment, thereby determining a position trajectory.

[0062] In step 103, the display position of the material is determined according to the position trajectory, wherein the display position is outside the display screen.

[0063] According to an exemplary embodiment of the present disclosure, the center point position of the display frame of the material can be determined to be on a position track. Specifically, the position track defines the farthest display position of the material outside the display screen. When the center point of the material exceeds the position track, the display frame of the material will be completely separated from the display screen, resulting in the loss of the position of the material. Therefore, in order to enable the material to be displayed at a position as far as possible outside the display screen without losing the position of the material, the center point position of the display frame of the material can be determined on the display track. In some embodiments, the center point position of the display frame of the material can also be determined within a predetermined range between the position track and the edge of the display screen. For example, the position track can be moved a few pixels in the direction of the display screen, and the center point position of the display frame of the material is limited between the position track and the track after moving a few pixels, so that the position of the display frame can be more displayed on the interface interacting with the user while keeping the material displayed outside the display screen, so as to facilitate user operation.

[0064] In step 104, the material is displayed at the display position. After steps 101 to 103, a suitable display position of the material outside the display screen can be obtained. When the material is displayed at the display position, the entire material area can be displayed outside the display screen while retaining a part of the display frame in the display screen, so that the position of the material is not lost, and the effect of the material completely flying in from outside the display screen can be achieved.

[0065] In order to clearly describe the solution of the present disclosure, the following Figure 2 to Figure 5 An image processing method according to an exemplary embodiment of the present disclosure will be described in detail.

[0066] Figure 2 is a schematic diagram illustrating a first position trajectory according to an exemplary embodiment of the present disclosure.

[0067] refer to Figure 2 , 2100 is the display frame of the material selected by the user, 2300 is the display screen, 2200 is the first position track, θ is the angle of the display frame 2100 rotated counterclockwise relative to the display screen 2300, 2110 is the first side length of the display frame 2100, 2120 is the second side length of the display frame 2100, 2410 is the first distance between the first position track 2200 and the display screen 2300, and 2420 is the second distance between the first position track 2200 and the display screen 2300.

[0068] When the display frame 2100 moves out of the display screen 2300, in order to avoid material loss, the display frame 2100 should have at least one intersection with the display screen 2300. When there is a unique intersection between the display frame 2100 and the display screen 2300, it is the farthest distance that the material can move outside the display screen. The first distance 2410 between the center point of the display frame 2100 and the display screen in the horizontal direction and the second distance 2420 between the center point of the display frame 2100 and the display screen in the vertical direction when the display frame 2100 has a unique intersection outside the display screen 2300 can be calculated according to the calculation formula of the first distance and the second distance in step 102. The trajectory formed by the calculated center point position is the first position trajectory 2200.

[0069] Figure 3 to Figure 5 is a diagram showing an exemplary embodiment according to the present disclosure Figure 2 A schematic diagram showing the first position trajectory adjustment.

[0070] Figure 2 Some segments on the first position track shown in FIG. 1 cannot make the display frame and the display screen have intersection points, so the position points of these segments need to be adjusted.

[0071] exist Figure 3 , 3100 is a first diagonal line of the first position track 2200, 3110 is a first end of the first diagonal line 3100, 3120 is a second end of the first diagonal line 3100, 3200 is a second diagonal line of the first position track 2200, 3210 is a first end of the second diagonal line 3200, 3220 is a second end of the second diagonal line 3200, segments 3311, 3321, 3331 and 3341 are first segments on the first position track that cannot make the display frame 2100 intersect with the display screen 2300, and segments 3312 are first segments on the first position track that cannot make the display frame 2100 intersect with the display screen 2300. 312, 3322, 3332 and 3342 are second segments on the first position track that cannot make the display frame 2100 intersect the display screen 2300, wherein segments 3311 and 3312 correspond to the first end 3110 of the first diagonal line 3100, segments 3321 and 3322 correspond to the first end 3210 of the second diagonal line 3200, segments 3331 and 3332 correspond to the second end 3120 of the first diagonal line 3100, and segments 3341 and 3342 correspond to the second end 3220 of the second diagonal line 3200. The length of each segment can be calculated according to the calculation formula of the first segment and the second segment in step 102.

[0072] When the center point of the display frame 2100 is Figure 3 When the first and second fragments are shown, Figure 4As shown, the display frame 2100 is used as a reference, and the position trajectory 4000 of the center point of the display screen 2300 relative to the display frame 2100 is calculated according to the implementation process of steps 101 to 102 when the display screen 2300 and the display frame 2100 have a unique intersection, so that the condition for realizing the unique intersection of the display screen 2300 and the display frame 2100 can be obtained, and the pre-adjustment distance 4100 of the center point of the display screen 2300 can be obtained. Here, the pre-adjustment distance 4100 is the shortest distance between the center point of the display screen 2300 and the position trajectory 4000. In the actual operation process, since the position of the display screen cannot be adjusted, it can be Figure 3 The position points on segments 3311, 3322, 3331, 3332, 3321, 3322, 3341 and 3342 are moved toward the display screen 2300 along the direction of the line connecting the pre-adjusted position and the center point of the display screen 2300 by a pre-adjusted distance 4100.

[0073] go through Figure 4 After the adjustment process shown, the following can be obtained: Figure 5 The position trajectory 5000 shown by the dotted line, Figure 5 , 5110, 5120, 5130 and 5140 are the third segment. And, in Figure 5 It also shows Figure 3 The position points on the middle segments 3311, 3322, 3331, 3332, 3321, 3322, 3341 and 3342 move toward the display screen 2300. When the center point of the display frame 2100 is restricted to the position track 5000, the display frame 2100 can always have an intersection with the display screen 2300 when it is outside the display screen 2300, thereby avoiding the loss of material. In addition, since the material is completely outside the display screen 2300 at this time, a better display effect can be obtained when creating the effect of the material flying in from outside the display screen 2300.

[0074] Figure 6 (a) and Figure 6 (b) is a diagram showing the effect of the image processing method according to an exemplary embodiment of the present disclosure.

[0075] refer to Figure 6 (a), a user adds a sticker to the mobile phone video interface and wants to create an effect that the sticker flies in from outside the display screen. According to the image processing method output by the present disclosure, the following can be done: Figure 6 As shown in (b), the sticker is completely moved out of the display interface, and a very small part of the rectangular frame of the sticker is retained to locate the sticker outside the display interface.

[0076] Figure 7is a block diagram illustrating an image processing apparatus according to an exemplary embodiment of the present disclosure.

[0077] Reference Figure 7 , the image processing apparatus 700 according to an exemplary embodiment of the present disclosure may include a display frame information acquiring unit 701 , a position track acquiring unit 702 , a display position determining unit 703 , and a material display unit 704 .

[0078] The display frame information acquisition unit 701 may acquire the side length and rotation angle of the display frame of the material selected by the user, wherein the rotation angle is the angle at which the display frame rotates relative to the display screen.

[0079] The position trajectory acquisition unit 702 can determine the position trajectory of the display frame outside the display screen according to the side length and rotation angle of the display frame, wherein the position trajectory is a trajectory formed by the position of the center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen.

[0080] According to an exemplary embodiment of the present disclosure, the position trajectory acquisition unit 702 may calculate the first distance and the second distance between the position trajectory and the display screen according to the first side length, the second side length and the rotation angle of the display frame relative to the display screen, and determine the first position trajectory based on the first distance and the second distance and the position of the display screen, and then determine the position trajectory by adjusting a predetermined segment of the first position trajectory. Here, the first side length is the side length of the display frame in the horizontal direction when the rotation angle of the display frame relative to the display screen is zero, the second side length is the side length of the display frame perpendicular to the first side length, the first distance is the distance between the position trajectory and the display screen in the horizontal direction, and the second distance is the distance between the position trajectory and the display screen in the vertical direction. For example, but not limited to, the first distance and the second distance may be respectively expressed as:

[0081] MaxX=(a*cosθ+b*sinθ) / 2

[0082] MaxY=(a*sinθ+b*cosθ) / 2

[0083] Among them, MaxX represents the first distance; MaxY represents the second distance; a represents the first side length, b represents the second side length, and θ represents the rotation angle.

[0084] According to an exemplary embodiment of the present disclosure, the predetermined segment includes a first segment and a second segment on the edge starting from each vertex of the first position trajectory. Here, the first segment is a segment on the edge of the first position trajectory parallel to the edge of the display screen in the vertical direction, and the second segment is a segment on the edge of the first position trajectory parallel to the edge of the display screen in the horizontal direction. For example, but not limited to, the first segment and the second segment on the first end of the first diagonal line of the first position trajectory can be respectively expressed as:

[0085] h1=asinθ

[0086] h2=acosθ

[0087] The first segment and the second segment at the second end of the first diagonal line of the first position trajectory are respectively expressed as:

[0088] h1=acosθ

[0089] h2=asinθ

[0090] The first segment and the second segment at the first end on the second diagonal line of the first position trajectory are respectively expressed as:

[0091] h1=hcosθ

[0092] h2=bsinθ

[0093] The first segment and the second segment at the second end on the second diagonal line of the first position trajectory are respectively expressed as:

[0094] h1=bsinθ

[0095] h2=bcosθ

[0096] Wherein, h1 represents the first segment; h2 represents the second segment; a represents the first side length of the display frame; b represents the second side length of the display frame, and θ represents the rotation angle of the display frame relative to the display screen.

[0097] According to an exemplary embodiment of the present disclosure, the position track acquisition unit 702 may adjust the predetermined segment to the third segment to determine the position track. Here, when the center point of the display frame is located on the third segment, the display frame has a unique intersection with the first vertex of the display screen, and the first vertex is the vertex of the display screen that is closest to the predetermined segment.

[0098] According to an exemplary embodiment of the present disclosure, when the position point of the first position trajectory is on a predetermined segment, the position trajectory acquisition unit 702 may first determine the pre-adjusted position of the display screen according to the side length of the display screen and the rotation angle of the display screen relative to the display frame, where the pre-adjusted position is the position where the center point of the display screen is located when the display screen has a unique intersection with the display frame; then, the pre-adjusted distance between the pre-adjusted position of the display screen and the center point of the display screen is acquired, where the pre-adjusted distance is the shortest distance between the center point of the display screen and the pre-adjusted position trajectory. Based on the pre-adjusted distance, the predetermined segment may be adjusted to a third segment.

[0099] According to an exemplary embodiment of the present disclosure, the position trajectory acquisition unit 702 may move each position point on the predetermined segment toward the display screen along a line connecting the pre-adjusted position and the center point position of the display screen by the pre-adjusted distance to obtain a third segment. The portion of the first position trajectory other than the predetermined segment and the third segment together constitute the position trajectory.

[0100] The display position determining unit 703 may determine the display position of the material according to the position trajectory, wherein the display position is outside the display screen.

[0101] According to an exemplary embodiment of the present disclosure, the display position determination unit 703 may determine the center point position of the display frame of the material to be on the position track determined by the position track acquisition unit 702 .

[0102] The material display unit 704 may display the material at the display position determined by the display unit 703 .

[0103] Figure 8 is a block diagram of an electronic device 800 according to an exemplary embodiment of the present disclosure.

[0104] Reference Figure 7 The electronic device 800 includes at least one memory 801 and at least one processor 802, wherein the at least one memory 801 stores a set of computer executable instructions, and when the computer executable instruction set is executed by the at least one processor 802, an image processing method according to an exemplary embodiment of the present disclosure is executed.

[0105] As an example, the electronic device 800 may be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 800 is not necessarily a single electronic device, but may also be any device or circuit collection capable of executing the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 800 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device interconnected with a local or remote (e.g., via wireless transmission) interface.

[0106] In the electronic device 800, the processor 802 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller or a microprocessor. As an example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0107] The processor 802 may execute instructions or codes stored in the memory 801, wherein the memory 801 may also store data. Instructions and data may also be sent and received over a network via a network interface device, wherein the network interface device may employ any known transmission protocol.

[0108] The memory 801 may be integrated with the processor 802, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. In addition, the memory 801 may include a separate device, such as an external disk drive, a storage array, or any other storage device that can be used by a database system. The memory 801 and the processor 802 may be operatively coupled, or may communicate with each other, such as through an I / O port, a network connection, etc., so that the processor 802 can read files stored in the memory.

[0109] In addition, the electronic device 800 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 800 may be connected to each other via a bus and / or a network.

[0110] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to perform the image processing method according to the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and provide the computer programs and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system, so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0111] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by a processor of a computer device to implement the image processing method according to the exemplary embodiment of the present disclosure.

[0112] According to the image processing method and device disclosed in the present invention, the trajectory of the display position of the material is controlled by the side length and rotation angle of the material display frame, so that there is always an intersection between the material and the display screen, thereby locating the position of the material in real time during the image processing process to avoid losing the material.

[0113] In addition, the center point of the material display frame can be restricted to the trajectory of the display position. Therefore, when creating an effect in which the material flies from outside the display screen into the display screen, the material can be moved outside the display screen to a great extent, thereby achieving a better effect of the material flying into the screen.

[0114] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0115] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. An image processing method, characterized in that: include: Obtaining the side length and rotation angle of the display frame of the material selected by the user, wherein the rotation angle is the angle at which the display frame rotates relative to the display screen; Determine, according to the side length and the rotation angle, a position trajectory of the display frame outside the display screen, wherein the position trajectory is a trajectory formed by the position of the center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen; Determining a display position of the material according to the position trajectory, so that the material has an intersection between the display position and the display screen, wherein the display position is outside the display screen; The material is displayed at the display position.

2. The image processing method according to claim 1, characterized in that: The determining, according to the side length and the rotation angle, a position trajectory of the display frame outside the display screen includes: Calculate a first distance and a second distance between the position track and the display screen according to a first side length, a second side length and the rotation angle of the display frame, wherein the first side length is the side length of the display frame in the horizontal direction when the rotation angle is zero, the second side length is the side length of the display frame perpendicular to the first side length, the first distance is the distance between the position track and the display screen in the horizontal direction, and the second distance is the distance between the position track and the display screen in the vertical direction; Determine a first position trajectory based on the first distance, the second distance and the position of the display screen; The position trajectory is determined by adjusting a predetermined segment of the first position trajectory.

3. The image processing method according to claim 2, characterized in that: The predetermined fragments include a first fragment and a second fragment on the edge starting from each vertex of the first position trajectory, wherein the first fragment is a fragment on the edge of the first position trajectory parallel to the edge of the display screen in the vertical direction, and the second fragment is a fragment on the edge of the first position trajectory parallel to the edge of the display screen in the horizontal direction.

4. The image processing method according to claim 2, wherein: The determining the position trajectory by adjusting a predetermined segment of the first position trajectory includes: The position trajectory is determined by adjusting the predetermined fragment to a third fragment, wherein when the center point of the display frame is located on the third fragment, the display frame has a unique intersection with the first vertex of the display screen, wherein the first vertex is the vertex of the display screen that is closest to the predetermined fragment.

5. The image processing method according to claim 4, characterized in that: The determining the position trajectory by adjusting the predetermined segment to a third segment includes: When the position point of the first position trajectory is on the predetermined segment, determining the pre-adjusted position of the display screen according to the side length of the display screen and the rotation angle of the display screen relative to the display frame, wherein the pre-adjusted position is the position where the center point of the display screen is located when the display screen has a unique intersection with the display frame; Acquire a pre-adjustment distance between the pre-adjustment position of the display screen and the center point of the display screen, wherein the pre-adjustment distance is the shortest distance between the center point of the display screen and the pre-adjustment position; Based on the pre-adjusted distance, the predetermined segment is adjusted to a third segment to determine the position trajectory.

6. The image processing method according to claim 5, characterized in that: The step of adjusting the predetermined segment to a third segment based on the pre-adjusted distance includes: Each position point on the predetermined segment is moved toward the display screen by the predetermined distance in the direction of a line connecting the predetermined position and the center point of the display screen to obtain a third segment.

7. The image processing method according to claim 1, characterized in that: Determining the display position of the material according to the position trajectory includes: The center point position of the display frame of the material is determined to be on the position track.

8. An image processing device, characterized in that: include: A display frame information acquisition unit is configured to: acquire the side length and rotation angle of the display frame of the material selected by the user, wherein the rotation angle is the angle at which the display frame rotates relative to the display screen; a position trajectory acquisition unit, configured to: determine a position trajectory of the display frame outside the display screen according to the side length and the rotation angle, wherein the position trajectory is a trajectory formed by the position of the center point of the display frame when the display frame has a unique intersection with the display screen outside the display screen; a display position determining unit configured to: determine a display position of the material according to the position trajectory, so that the material has an intersection between the display position and the display screen, wherein the display position is outside the display screen; The material display unit is configured to display the material at the display position.

9. The image processing device according to claim 8, wherein: The position trajectory acquisition unit is configured as follows: Calculate a first distance and a second distance between the position track and the display screen according to a first side length, a second side length and the rotation angle of the display frame, wherein the first side length is the side length of the display frame in the horizontal direction when the rotation angle is zero, the second side length is the side length of the display frame perpendicular to the first side length, the first distance is the distance between the position track and the display screen in the horizontal direction, and the second distance is the distance between the position track and the display screen in the vertical direction; Determine a first position trajectory based on the first distance, the second distance and the position of the display screen; The position trajectory is determined by adjusting a predetermined segment of the first position trajectory.

10. The image processing device according to claim 9, wherein: The predetermined fragments include a first fragment and a second fragment on the edge starting from each vertex of the first position trajectory, wherein the first fragment is a fragment on the edge of the first position trajectory parallel to the edge of the display screen in the vertical direction, and the second fragment is a fragment on the edge of the first position trajectory parallel to the edge of the display screen in the horizontal direction.

11. The image processing device according to claim 9, wherein: The position trajectory acquisition unit is configured as follows: The position trajectory is determined by adjusting the predetermined fragment to a third fragment, wherein when the center point of the display frame is located on the third fragment, the display frame has a unique intersection with the first vertex of the display screen, wherein the first vertex is the vertex of the display screen that is closest to the predetermined fragment.

12. The image processing device according to claim 11, wherein: The position trajectory acquisition unit is configured as follows: When the position point of the first position trajectory is on the predetermined segment, determining the pre-adjusted position of the display screen according to the side length of the display screen and the rotation angle of the display screen relative to the display frame, wherein the pre-adjusted position is the position where the center point of the display screen is located when the display screen has a unique intersection with the display frame; Acquire a pre-adjustment distance between the pre-adjustment position of the display screen and the center point of the display screen, wherein the pre-adjustment distance is the shortest distance between the center point of the display screen and the pre-adjustment position; Based on the pre-adjusted distance, the predetermined segment is adjusted to a third segment to determine the position trajectory.

13. The image processing device according to claim 12, wherein: The position trajectory acquisition unit is configured as follows: Each position point on the predetermined segment is moved toward the display screen by the predetermined distance in the direction of a line connecting the predetermined position and the center point of the display screen to obtain a third segment.

14. The image processing device according to claim 8, wherein: The display position determination unit is configured to: The center point position of the display frame of the material is determined to be on the position track.

15. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer executable instructions, Wherein, when the computer executable instructions are executed by the at least one processor, the at least one processor is prompted to perform the image processing method according to any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by at least one processor, the at least one processor is prompted to perform the image processing method according to any one of claims 1 to 7.

17. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the image processing method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Display management method and system of mobile terminal

    CN102439861A

  • Method and device for displaying mobile terminal operation control in concentrated mode

    CN104731510A