Sticker processing method and device
The method and apparatus use target reference lines to accurately position stickers by detecting position changes and determining adhesion states, addressing the imprecision in existing sticker placement technologies.
Patent Information
- Application Number
- JP2022556501
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Priority Date
- 2020-03-19
- Filing Date
- 2021-02-25
- Publication Date
- 2025-01-20
- Estimated Expiration
- 2041-02-25
AI Technical Summary
Existing image processing technologies fail to accurately determine the location of stickers in images, leading to imprecise placement.
A method and apparatus that utilize a target reference line to identify additional positions for stickers, detect position changes, and determine a final adhesion state to accurately place stickers based on these lines.
Enables precise positioning of stickers by determining the final adhesion state between preset and target reference lines, ensuring accurate placement.
Smart Images

Figure 0007617939000001 
Figure 0007617939000002 
Figure 0007617939000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to the field of image special effect processing technology, and in particular to a sticker processing method, apparatus, and computer-readable storage medium. [Background technology]
[0002] With the development of smart terminal technology, the functions of smart terminals are becoming more and more diverse. For example, users can use the camera in the terminal to take images (e.g., photos or videos), which has already become a new mode of entertainment for people. However, simply taking images can no longer meet the needs of users. Therefore, attention is being paid to what kind of special effects processing can be applied to the taken images in order to obtain more interesting images.
[0003] In the prior art, there is a special effect of adding a sticker to an image, in which a user preselects a position on an image to add a sticker, and then directly drags the sticker to the adding position, but the adding position is a rough position selected by the user by eye, so the position of the sticker cannot be determined precisely. Summary of the Invention [Problem to be solved by the invention]
[0004] This section of the present disclosure is provided to introduce concepts in a concise form, and these concepts are described in detail in the following specific embodiments section. This section of the present disclosure is not intended to identify key features or required features of the claimed technical solution, nor is it intended to be used to limit the scope of the claimed technical solution.
[0005] The technical problem solved by the present disclosure is to provide a sticker processing method for at least partially solving the problem in the existing technology that the sticker position cannot be accurately determined, and further provides a sticker processing device, a sticker processing hardware device, a computer readable storage medium and a sticker processing terminal. [Means for solving the problem]
[0006] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0007] A sticker processing method, comprising: obtaining an image and a sticker; determining a target reference line for identifying an additional location in the image of the sticker; detecting a change in position of the sticker in the image in response to a user moving the sticker; determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change; If the final adhesion state is adhesion, moving the sticker to the add position.
[0008] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0009] A sticker processing device, an acquisition module for acquiring images and stickers; a baseline determination module for determining a target baseline for identifying an additional location in the image of the sticker; a position detection module for detecting a change in position of the sticker in the image in response to a user moving the sticker; a state determination module for determining a final adhesion state between the preset reference line and the target reference line on the sticker in response to the position change; and a sticker moving module for moving the sticker to the additional position if the final adhesion state is adhesion.
[0010] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0011] An electronic device, a memory for storing non-transitory computer readable instructions; and a processor for executing the non-transitory computer readable instructions, which, when executed by the processor, perform the sticker processing method of any one of the preceding claims.
[0012] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0013] A computer readable storage medium for storing non-transitory computer readable instructions, which when executed by a computer, cause the computer to perform the sticker processing method of any one of the preceding claims.
[0014] In order to achieve the above object, according to another embodiment of the present disclosure, the following technical solution is further provided.
[0015] A sticker processing terminal comprising any one of the sticker processing devices described above.
[0016] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0017] A computer program product comprising a computer program carried on a computer readable medium, the computer program being adapted, when executed by a processor, to cause the processor to carry out the sticker processing method according to any one of the preceding claims.
[0018] In order to achieve the above object, according to an embodiment of the present disclosure, the following technical solution is provided.
[0019] A computer program, when executed in an electronic device, causes the electronic device to execute the sticker processing method according to any one of the above. The embodiment of the present disclosure can accurately determine the position of the sticker by determining the coordinates of a target reference line, determining a final adhesion state between the preset reference line of the sticker and the target reference line according to a position change of the sticker in the image, and moving the sticker to the additional position if the final adhesion state is adhesion. The above description is only an outline of the technical solution of the present disclosure, which can be implemented according to the contents of the specification in order to more clearly understand the technical solution of the present disclosure. In order to make the above-mentioned other objectives, features and advantages of the present disclosure more clear and easily understandable, preferred embodiments are described in detail below with reference to the drawings. [Brief description of the drawings]
[0020] The above and other features, advantages and aspects of each embodiment of the present disclosure will become more apparent by reference to the following specific embodiments in conjunction with the drawings, in which the same or similar reference numerals represent the same or similar elements throughout the drawings. It should be understood that the drawings are schematic and that objects and elements are not necessarily drawn to scale. [Figure 1] 1 is a schematic flow chart of a sticker processing method according to an embodiment of the present disclosure. [Diagram 2] FIG. 1 is a schematic diagram of a sticker processing device according to one embodiment of the present disclosure. [Diagram 3] FIG. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0021] Hereinafter, the embodiments of the present disclosure will be described in more detail with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be realized in various forms and should not be construed as being limited to the embodiments described herein, but rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only used for illustrative purposes and are not intended to limit the scope of protection of the present disclosure.
[0022] It should be understood that the steps described in the method embodiments of the present disclosure may be performed in a different order or in parallel, and method embodiments may include additional steps or omit performing steps as shown, and the scope of the present disclosure is not limited in this respect.
[0023] As used herein, the term "including" and variations thereof are open-ended, i.e., "including but not limited to." The term "based on" means "based at least in part on." The term "in one embodiment" refers to "at least one embodiment," the term "another embodiment" refers to "at least one other embodiment," and the term "some embodiments" refers to "at least some embodiments." Definitions relating to other terms are set forth in the description below. Example 1
[0024] The embodiment of the present disclosure provides a sticker processing method to solve the technical problem in the existing technology that the position of the sticker cannot be accurately determined. As shown in Fig. 1, the sticker processing method mainly includes steps S11 to S15.
[0025] In step S11, an image and a sticker are obtained.
[0026] Specifically, the image may be an image to which a sticker special effect is to be added, specifically a video image input in real time, such as a live video in a short video application, or a video image pre-stored in the terminal. The image may also be a still image, i.e., a photograph. Here, the terminal may be a mobile terminal, such as a smartphone, a tablet, or a fixed terminal, such as a desktop computer.
[0027] The image may further be a template image that corresponds to the image to which the sticker special effect is to be added; for example, if the image to which the sticker special effect is to be added is a face image, the corresponding template image may be a standard face template.
[0028] Here, the stickers may be obtained from a local database or from the Internet.
[0029] In step S12, a target reference line is determined for identifying additional locations in the image of the sticker.
[0030] Specifically, the target reference line can be customized by the user as needed. That is, the user can determine the target reference line according to the adding position of the sticker in the image. For example, if the user wants to add a sticker to a certain position of the image, the target reference line can be set at that position. In order to facilitate the user to more accurately position the adding position of the sticker, the reference line coordinates can also be determined based on the feature points of the image. For example, if the user wants to add a special effect to the eye area, the target reference line can be determined based on the feature points of the eye area, and thus the sticker can be more accurately positioned at the eye area.
[0031] In step S13, in response to a user's operation of moving the sticker, a change in the position of the sticker in the image is detected.
[0032] Here, the movement operation on the sticker may be a drag operation on the sticker, a zoom operation on the sticker, a drag transformation operation on the sticker, etc. Here, the drag operation on the sticker may specifically be an operation of dragging the sticker to move it horizontally, up and down, or diagonally. Here, the zoom operation on the sticker includes a proportional zoom operation, a non-proportional zoom operation, a center zoom operation, etc. Here, the drag transformation operation on the sticker is an operation of changing the shape of the sticker.
[0033] In step S14, a final adhesion state between the preset reference line on the sticker and the target reference line is determined according to the position change.
[0034] Here, the position change may be a position change caused by moving the sticker, or a position change caused by shrinking or enlarging the sticker. Specifically, the position change may be controlled by a user. For example, the user changes the position of the sticker by using a mouse to move the sticker, shrink the sticker, or enlarge the sticker.
[0035] Here, the preset reference line is a reference line on the sticker, and when judging the adsorption state, the preset reference line corresponds to the target reference line, i.e., if the preset reference line is a horizontal reference line, the corresponding target reference line is also a horizontal reference line, or if the preset reference line is a vertical reference line, the corresponding target reference line is also a vertical reference line. For example, if the preset reference line is a first horizontal reference line, the corresponding target reference line is a second horizontal reference line, or if the preset reference line is a first vertical reference line, the corresponding target reference line is a second vertical reference line.
[0036] Here, the target reference lines may be multiple, for example, one horizontal reference line and one vertical reference line, multiple horizontal reference lines, or multiple vertical reference lines. When judging the suction state, the target reference line corresponding to the preset reference line on the sticker is selected for judgment.
[0037] Specifically, at least one of the upper boundary line of the sticker, the lower boundary line of the sticker, the horizontal center line of the sticker, the left boundary line of the sticker, the right boundary line of the sticker, and the vertical center line of the sticker can be the preset reference line. When the preset reference line is at least one of the upper boundary line of the sticker, the lower boundary line of the sticker, and the horizontal center line of the sticker, the corresponding target reference line is a horizontal reference line when determining the adhesion state, and when the preset reference line is at least one of the left boundary line of the sticker, the right boundary line of the sticker, and the vertical center line of the sticker, the corresponding target reference line is a vertical reference line when determining the adhesion state.
[0038] Here, the final attraction state includes a state in which the preset reference line is attracted to the target reference line and a state in which the preset reference line is not attracted to the target reference line.
[0039] In step S15, if the final sticking state is sticking, the sticker is moved to the adding position.
[0040] Specifically, if the final adhesion state is adhesion, automatically move the sticker to the adding position to obtain a corresponding sticker special effect image; if the adhesion state is non-adhesive, determine that the sticker has not reached the adding position, and continue to change the position of the sticker until the sticker is adhered to the target reference line to obtain a corresponding sticker special effect image, or stop the movement operation on the sticker, and add the sticker to the current movement position.
[0041] In this embodiment, the coordinates of a target reference line are determined, and the final adhesion state between the preset reference line of the sticker and the target reference line is determined according to the position change of the sticker in the image, and if the final adhesion state is adhesion, the sticker is moved to the additional position, thereby accurately determining the position of the sticker.
[0042] In one alternative embodiment, step S14 specifically includes a first sub-step and a second sub-step.
[0043] In a first substep, an initial adhesion state between the preset reference line on the sticker and the target reference line before a position change is determined.
[0044] Here, the initial adhesion state includes a state in which the preset reference line is attached to the target reference line and a state in which the preset reference line is not attached to the target reference line.
[0045] In a second sub-step, a distance between the preset reference line and the target reference line after a position change is determined.
[0046] Specifically, the position change of the sticker is detected in real time, and the current position is determined according to the preset reference line of the sticker. Here, the preset reference line can be customized by the user according to the sticker adding position. Specifically, the preset reference line may be the top, bottom, left, right boundary and / or center line of the sticker. For example, if the sticker is rectangular, the four boundaries and two center lines of the sticker can be the preset reference lines. In this embodiment, the preset reference line may be one or more. For example, if the preset reference line is the upper boundary of the sticker, the current position can be determined according to the upper boundary of the sticker. The distance between the current position and the target reference line is the distance.
[0047] In a third substep, a final adhesion state between the preset reference line and the target reference line after a position change is determined according to the initial adhesion state and the distance.
[0048] In one alternative embodiment, if the initial adhesion state is non-adherence and the distance is less than or equal to a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0049] Here, the preset stiction threshold is the minimum distance at which stiction occurs, and for example, the minimum distance can be expressed as the smallest number of pixels within the interval.
[0050] Here, the distance between the preset reference line and the target reference line is specifically the shortest distance between the preset reference line and the target reference line. For example, when the sticker moves horizontally, the corresponding preset reference line is the boundary corresponding to the horizontal direction of the sticker, and at this time, if the corresponding target reference line is a horizontal reference line, the distance between the preset reference line and the target reference line is the shortest distance between two horizontal lines.
[0051] When the sticker moves vertically, the corresponding preset reference line is the boundary corresponding to the vertical direction of the sticker, and in this case, if the corresponding target reference line is a vertical reference line, the distance between the preset reference line and the target reference line is the shortest distance between two vertical lines.
[0052] When the sticker moves diagonally, the corresponding preset reference line is the boundary corresponding to the sticker, and in this case, when calculating the distance, it is necessary to calculate it by decomposing it into the horizontal direction and the vertical direction respectively. For example, when the target reference line is a horizontal reference line, the horizontal component of the preset reference line is used to calculate the shortest distance to the horizontal reference line, and when the target reference line is a vertical reference line, the vertical component of the preset reference line is used to calculate the shortest distance to the vertical reference line.
[0053] If the distance between the preset reference line and the target reference line is equal to or less than a preset adhesion threshold, the preset reference line is attached to the target reference line, thereby determining that the final adhesion state is adhesion. If there are multiple reference lines that satisfy adhesion in the same direction, the most recent reference line is selected for adhesion. If the adhesion conditions are simultaneously satisfied in different directions, they can be attached according to a preset adhesion strategy. For example, the adhesion strategy may be horizontal direction preferential adhesion or vertical direction preferential adhesion.
[0054] In one alternative embodiment, if the initial adhesion state is non-adherence and the distance is greater than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0055] In one alternative embodiment, if the initial adhesion state is adhesion and the distance is less than or equal to a preset adhesion release threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0056] Here, the preset suction release threshold is the minimum distance at which suction is released, and specifically, can be expressed as the smallest number of pixels within the interval.
[0057] Specifically, if the sticker is in an adsorbed state before the position change, the user may further fine-tune the added position of the sticker as necessary, at which time the position of the sticker may be further changed, and if the distance between the preset reference line and the target reference line after the position change is less than or equal to the preset release threshold, the adsorbed state is still maintained as an adsorbed state, i.e., a final adsorbed state.
[0058] In one alternative embodiment, if the initial adhesion state is adhesion and the distance is greater than a preset unadhesion threshold, the preset reference line is triggered to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0059] Specifically, if the sticker is in an adhered state before the position change, the user may further fine-tune the adding position of the sticker as needed, at which time the position of the sticker may be further changed; if the distance between the preset reference line and the target reference line after the position change is greater than the preset suction release threshold, the suction is released and the sticker is triggered to move away from the target reference line, and the suction state changes from adhered to non-adhered, i.e., the final suction state.
[0060] Here, in order to avoid overlapping of suction, the preset suction threshold should be equal to or less than the preset suction release threshold.
[0061] In one alternative embodiment, step S14 specifically includes a first sub-step and a second sub-step.
[0062] In a first sub-step, position coordinates of a preset reference point on the preset reference line are determined in response to the position change.
[0063] For example, if the preset reference line is the boundary of a sticker, the two end points and the midpoint of the boundary can be the preset reference points.
[0064] In a second substep, if the position coordinates are within a preset coordinate set consisting of coordinates of each position point on the target reference line, the final adhesion state is determined to be a state in which the preset reference line is adhered to the target reference line.
[0065] After the sticker is attached, the user may delete the target reference line, and in order to avoid misjudging the sticker attachment status, this embodiment pre-stores a coordinate set consisting of the coordinates of all the reference lines, and then further judges the attachment status of the sticker according to the coordinates of the preset reference point at the current position.
[0066] In an alternative embodiment, the method further includes steps S15 and S16.
[0067] In step S15, hidden reference lines are automatically generated according to the image.
[0068] Specifically, there may be one or more hidden reference lines, and the specific locations may correspond to at least one of the four boundaries, two center lines, or two center lines of the image.
[0069] In step S16, during the position change process, if the sticker satisfies an adhesion condition, it is automatically attached to the hidden reference line.
[0070] Here, the adsorption condition may be that the distance between the sticker's preset reference line and the hidden reference line is less than or equal to a preset adsorption threshold, or that the coordinates of the preset reference point on the preset reference line are included in the coordinate set of the hidden reference line.
[0071] It should be understood by those skilled in the art that further obvious modifications (eg, overlay of the listed modes) or equivalent replacements can be made based on the above embodiments.
[0072] The above describes each step of the embodiment of the sticker processing method according to the above order, but it is clear to those skilled in the art that the steps of the embodiments of the present disclosure do not necessarily need to be performed according to the above order, and may be performed in other orders such as reverse order, parallel order, cross order, etc., and those skilled in the art may also add other steps based on the above steps. These obvious modifications or equivalent replacement methods should also be included in the scope of protection of the present disclosure, and detailed descriptions will be omitted here.
[0073] The following is an embodiment of the apparatus of the present disclosure, which is used to perform steps realized in the embodiment of the method of the present disclosure. For convenience of explanation, only parts related to the embodiment of the present disclosure are shown, and specific technical details are not provided, so please refer to the embodiment of the method of the present disclosure. Example 2
[0074] In order to solve the technical problem in the existing technology that the position of the sticker cannot be accurately determined, the embodiment of the present disclosure provides a sticker processing device. The device can perform the steps in the embodiment of the sticker processing method described in the above embodiment 1. As shown in FIG. 2, the device mainly includes: an acquisition module 21, a baseline determination module 22, a position detection module 23, a state determination module 24 and a sticker movement module 25.
[0075] The acquisition module 21 is used to acquire images and stickers.
[0076] A reference line determination module 22 is used to determine target reference lines for identifying additional locations in the image of the sticker.
[0077] The position detection module 23 is used to detect a change in position of the image of the sticker in response to a user moving the sticker.
[0078] A state determination module 24 is used to determine a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change.
[0079] A sticker moving module 25 is used to move the sticker to the add position if the final adhesion state is adhesion.
[0080] Further, the state determination module 24 specifically determines an initial adhesion state between the preset reference line and the target reference line on the sticker before the position change, and determines a distance between the preset reference line and the target reference line after the position change; The initial adhesion state and the distance are used to determine a final adhesion state between the preset reference line and the target reference line after a position change.
[0081] Furthermore, if the initial adhesion state is non-adhesion and the distance is equal to or less than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0082] Furthermore, if the initial adhesion state is adhesion and the distance is equal to or less than a preset adhesion release threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0083] Furthermore, if the initial adhesion state is adhesion and the distance is greater than a preset adhesion release threshold, the preset reference line is triggered to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0084] Furthermore, if the initial adhesion state is non-adherence and the distance is greater than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0085] Furthermore, the state determination module 24 specifically determines the position coordinates of a preset reference point on the preset reference line according to the position change, and if the position coordinates are within a preset coordinate set consisting of the coordinates of each position point on the target reference line, the final adhesion state is used as a state in which the preset reference line is adhered to the target reference line.
[0086] Moreover, the target-baseline determination module 22 is further used to automatically generate hidden baselines according to the image.
[0087] The state determination module 24 is further used for automatically adhering the preset reference line to the hidden reference line when the sticker meets an adhering condition during the position change process.
[0088] The sticker moving module 25 is further used for adding the sticker to the current moving position according to the preset reference line, and when the preset reference line is a first horizontal reference line, the corresponding target reference line is a second horizontal reference line, or when the preset reference line is a first vertical reference line, the corresponding target reference line is a second vertical reference line.
[0089] Furthermore, the first horizontal reference line is one of an upper boundary line of the sticker, a lower boundary line of the sticker, and a horizontal center line of the sticker.
[0090] Furthermore, the first vertical reference line is one of a left boundary line of the sticker, a right boundary line of the sticker, and a vertical center line of the sticker.
[0091] For a detailed description of the operation principle of the embodiment of the sticker processing device, the technical effects achieved, etc., please refer to the description of the embodiment of the sticker processing method described above, and a detailed description will be omitted here. Example 3
[0092] Hereinafter, reference is made to FIG. 3, which shows a schematic structural diagram of an electronic device suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablets), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG. 3 is merely an example and should not impose any limitations on the functions and scope of use of the embodiment of the present disclosure.
[0093] 3, the electronic device may include a processing unit (e.g., a central processor, a graphics processor, etc.) 301, which can perform various appropriate operations and processes according to programs stored in a read-only memory (ROM) 302 or programs loaded from a device 308 into a random access memory (RAM) 303. The RAM 303 further stores various programs and data necessary for the operation of the electronic device. The processing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0094] Typically, input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 307 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc., storage devices 308 including, for example, a magnetic tape, hard disk, etc., and communication devices 309 can be connected to the I / O interface 305. The communication devices 309 can enable the electronic device to communicate and exchange data with other devices wirelessly or via wires. Although the electronic device is shown in FIG. 3 with various devices, it should be understood that it is not necessary to implement or include all the devices shown. Alternatively, more or fewer devices may be implemented or included.
[0095] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowcharts may be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product including a computer program carried on a non-transitory computer-readable medium, the computer program including a program code for executing the method shown in the flowchart. In such an embodiment, the computer program may be downloaded from a network by the communication device 309 and installed, or may be installed from the storage device 308, or may be installed from the ROM 302. When the computer program is executed by the processing device 301, the above-mentioned functions limited to the method of the embodiment of the present disclosure are performed. Some embodiments of the present disclosure further include a computer program, which, when executed on an electronic device, performs the above-mentioned functions limited to the method of the embodiment of the present disclosure.
[0096] It should be noted that the above computer-readable medium of the present disclosure may be a computer-readable signal medium, a computer-readable storage medium, or any overlay of the above. The computer-readable storage medium may be, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any overlay of the above. More specific examples of the computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable overlay of the above. In the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program, which can be used by or in combination with an instruction execution system, apparatus, or device. In the present disclosure, the computer-readable signal medium includes a data signal propagated in baseband or as part of a carrier wave, the data signal carrying computer-readable program code. Such a propagated data signal may take several forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable overlay of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code contained in a computer-readable medium may be transmitted by any suitable medium, including, but not limited to, electrical wire, optical cable, RF (radio frequency), or the like, or any suitable overlay of the above.
[0097] In some embodiments, clients and servers may communicate using any now known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and may interact with any form or medium of digital data communication (e.g., a communications network). Examples of communications networks include local area networks ("LANs"), wide area networks ("WANs"), networks between networks (e.g., the Internet), end-to-end networks (e.g., ad hoc end-to-end networks), and any now known or later developed networks.
[0098] The computer-readable medium may be included in the electronic device, or may exist independently of the electronic device.
[0099] The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the following steps: acquiring an image and a sticker; determining a target reference line for identifying an additional position of the sticker in the image; detecting a position change in the image of the sticker in response to a user's movement of the sticker; determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change; and, if the final adhesion state is adhesion, moving the sticker to the additional position.
[0100] Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages or overlays thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and the like, as well as general procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a single software packet, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0101] The flowcharts and block diagrams in the drawings illustrate the system architecture, functions and operations that can be realized according to the system, method and computer program product of various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, program segment or part of code, which includes one or more executable instructions for implementing a preset logical function. It should be noted that in some alternative implementations, the functions noted in the blocks can occur in a different order than the order noted in the drawings. For example, two consecutively shown blocks may actually be executed essentially in parallel, and they may be executed in reverse order depending on the functions involved. It should be noted that each block in the block diagram or flowchart, and the overlay of the blocks in the block diagram or flowchart can be implemented in a dedicated hardware-based system for performing a preset function or operation, or in an overlay of dedicated hardware and computer instructions.
[0102] The units according to the embodiments of the present disclosure may be implemented in a software manner or a hardware manner, and the names of the units may not necessarily be limited to the units themselves, for example, the acquisition unit may be further described as a "unit for acquiring images and stickers."
[0103] The functions described herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary hardware logic components that may be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), etc.
[0104] In the context of this disclosure, a machine-readable medium may be a tangible medium that can provide for use with an instruction execution system, device, or device, or that can contain or store a program for use in conjunction with an instruction execution system, device, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable overlay of the above. More specific examples of machine-readable storage media include one or more wire-based electrical connections, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable overlay of the above.
[0105] According to one or more embodiments of the present disclosure, there is provided a sticker processing method, comprising: obtaining an image and a sticker; determining a target reference line for identifying an additional location in the image of the sticker; detecting a change in position of the sticker in the image in response to a user moving the sticker; determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change; If the final adhesion state is adhesion, moving the sticker to the add position.
[0106] Furthermore, the step of determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change includes: determining an initial adhesion state between the preset reference line and the target reference line on the sticker before a position change; determining a distance between the preset reference line and the target reference line after a position change; and determining a final adhesion state between the preset reference line and the target reference line after a position change according to the initial adhesion state and the distance.
[0107] Furthermore, if the initial adhesion state is non-adhesion and the distance is equal to or less than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0108] Furthermore, if the initial adhesion state is adhesion and the distance is equal to or less than a preset adhesion release threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0109] Furthermore, if the initial adhesion state is adhesion and the distance is greater than a preset adhesion release threshold, the preset reference line is triggered to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0110] Furthermore, if the initial adhesion state is non-adherence and the distance is greater than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0111] Furthermore, the step of determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change includes: determining position coordinates of a preset reference point on the preset reference line in response to the position change; The method includes a step of determining that the final adhesion state is a state in which the preset reference line is adhered to the target reference line if the position coordinate is within a preset coordinate set consisting of coordinates of each position point on the target reference line.
[0112] Additionally, the method may further comprise: automatically generating hidden reference lines in response to the image; In the position change process, when the sticker satisfies an adsorption condition, the preset reference line is automatically adsorbed to the hidden reference line; adding the sticker to a current movement position according to the preset reference line.
[0113] Furthermore, when the preset reference line is a first horizontal reference line, the corresponding target reference line is a second horizontal reference line, or when the preset reference line is a first vertical reference line, the corresponding target reference line is a second vertical reference line.
[0114] Furthermore, the first horizontal reference line is one of an upper boundary line of the sticker, a lower boundary line of the sticker, and a horizontal center line of the sticker.
[0115] Furthermore, the first vertical reference line is one of a left boundary line of the sticker, a right boundary line of the sticker, and a vertical center line of the sticker.
[0116] According to one or more embodiments of the present disclosure, there is provided a sticker processing device, comprising: an acquisition module for acquiring images and stickers; a baseline determination module for determining a target baseline for identifying an additional location in the image of the sticker; a position detection module for detecting a change in position of the sticker in the image in response to a user moving the sticker; a state determination module for determining a final adhesion state between the preset reference line and the target reference line on the sticker in response to the position change; and a sticker moving module for moving the sticker to the additional position if the final adhesion state is adhesion.
[0117] Furthermore, the state determination module is specifically used to determine an initial adsorption state between a preset reference line and the target reference line on the sticker before a position change, to determine a distance between the preset reference line and the target reference line after a position change, and to determine a final adsorption state between the preset reference line and the target reference line after a position change according to the initial adsorption state and the distance.
[0118] Furthermore, if the initial adhesion state is non-adhesion and the distance is equal to or less than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0119] Furthermore, if the initial adhesion state is adhesion and the distance is equal to or less than a preset adhesion release threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line.
[0120] Furthermore, if the initial adhesion state is adhesion and the distance is greater than a preset adhesion release threshold, the preset reference line is triggered to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0121] Furthermore, if the initial adhesion state is non-adherence and the distance is greater than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is not adhered to the target reference line.
[0122] Furthermore, the state determination module specifically determines the position coordinates of a preset reference point on the preset reference line in response to the position change, and if the position coordinates are within a preset coordinate set consisting of the coordinates of each position point on the target reference line, the final adsorption state is used to determine that the preset reference line is adsorbed to the target reference line.
[0123] Moreover, the target-baseline determining module is further adapted to automatically generate hidden baselines according to the image.
[0124] The state determination module is further used for automatically adhering the preset reference line to the hidden reference line when the sticker satisfies an adhering condition during the position change process.
[0125] The sticker moving module is further used for adding the sticker to a current moving position according to the preset reference line.
[0126] Furthermore, when the preset reference line is a first horizontal reference line, the corresponding target reference line is a second horizontal reference line, or when the preset reference line is a first vertical reference line, the corresponding target reference line is a second vertical reference line.
[0127] Furthermore, the first horizontal reference line is one of an upper boundary line of the sticker, a lower boundary line of the sticker, and a horizontal center line of the sticker.
[0128] Furthermore, the first vertical reference line is one of a left boundary line of the sticker, a right boundary line of the sticker, and a vertical center line of the sticker.
[0129] According to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: a memory for storing non-transitory computer readable instructions; and a processor for executing the computer readable instructions, which, when executed by the processor, perform the sticker processing method described above.
[0130] According to one or more embodiments of the present disclosure, a computer-readable storage medium is provided for storing non-transitory computer-readable instructions that, when executed by a computer, cause the computer to perform the above-described sticker processing method.
[0131] The above description is merely an explanation of the preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art will understand that the scope of the present disclosure is not limited to the technical solution by the specific overlay of the above technical features, but should include other technical solutions formed by arbitrarily overlaying the above technical features or their equivalent features, as long as they are included within the scope of the concept of the above disclosure. For example, a technical solution formed by mutually replacing the above features with technical features having similar functions disclosed in the present disclosure (but not limited to these).
[0132] Also, although operations have been described in a particular sequence, this should not be understood as performing these operations in the particular sequence or order shown. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although the above discussion includes some specific implementation details, these should not be construed as limitations on the scope of the disclosure. Some features described in the context of separate embodiments may also be implemented in a single embodiment in an overlay fashion. Rather, various features described in the context of a single embodiment may be implemented in multiple embodiments alone or in any suitable sub-overlay fashion.
[0133] Although the present subject matter has been described using language specific to structural features or methodological operations, it is to be understood that the claimed subject matter need not be limited to the specific features or operations described above. Rather, the specific features and operations described above are merely example forms of implementing the claims.
[0134] This application claims priority to a Chinese patent application filed on March 19, 2020, bearing application number 202010198167.9 and entitled "STICKER PROCESSING METHOD AND APPARATUS," the entire contents of which are incorporated herein by reference.
Claims
1. obtaining an image and a sticker; determining a target reference line for identifying an additional location in the image of the sticker; detecting a change in position of the sticker in the image in response to a user moving the sticker; determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change; if the final adhesion state is adhesion, moving the sticker to the add position; The step of determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change includes: determining an initial adhesion state between the preset reference line and the target reference line on the sticker before a position change; determining a distance between the preset reference line and the target reference line after a position change; determining a final adhesion state between the preset reference line and the target reference line after a position change according to the initial adhesion state and the distance; if the initial adhesion state is adhesion and the distance is greater than a preset unadhesion threshold, triggering the preset reference line to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line; A sticker processing method comprising:
2. when the initial adhesion state is non-adhesion and the distance is equal to or less than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line; 2. The method of claim 1 .
3. if the initial adhesion state is adhesion and the distance is equal to or less than a preset adhesion release threshold, the final adhesion state is a state in which the preset reference line is adhered to the target reference line; 3. The method according to claim 1 or 2.
4. if the initial adhesion state is non-adhesion and the distance is greater than a preset adhesion threshold, the final adhesion state is a state in which the preset reference line is not adhered to the target reference line; The method according to any one of claims 1 to 3.
5. The step of determining a final adhesion state between the preset reference line on the sticker and the target reference line in response to the position change includes: determining position coordinates of a preset reference point on the preset reference line in response to the position change; determining that the final adhesion state is a state in which the preset reference line is adhered to the target reference line if the position coordinate is within a preset coordinate set that includes coordinates of each position point on the target reference line.
2. The method of claim 1 .
6. automatically generating hidden reference lines in response to the image; In the position change process, when the sticker satisfies an adsorption condition, the preset reference line is automatically adsorbed to the hidden reference line; adding the sticker to a current moving position according to the preset reference line; The location of the hidden reference line corresponds to at least one of four boundaries, two centerlines, and two centerlines of the image. The method according to any one of claims 1 to 5.
7. When the preset reference line is a first horizontal reference line and the corresponding target reference line is a second horizontal reference line, or when the preset reference line is a first vertical reference line, the corresponding target reference line is a second vertical reference line; The method according to any one of claims 1 to 6.
8. The first horizontal reference line is any one of an upper boundary line of the sticker, a lower boundary line of the sticker, and a horizontal center line of the sticker.
8. The method of claim 7.
9. The first vertical reference line is any one of a left boundary line of the sticker, a right boundary line of the sticker, and a vertical center line of the sticker.
9. The method according to claim 7 or 8.
10. an acquisition module for acquiring images and stickers; a baseline determination module for determining a target baseline for identifying an additional location in the image of the sticker; a position detection module for detecting a change in position of the sticker in the image in response to a user moving the sticker; a state determination module for determining a final adhesion state between the preset reference line and the target reference line on the sticker in response to the position change; a sticker moving module for moving the sticker to the additional position if the final adhesion state is adhesion; The state determination module further comprises: determining an initial adhesion state between a preset reference line and the target reference line on the sticker before a position change, determining a distance between the preset reference line and the target reference line after a position change, and determining a final adhesion state between the preset reference line and the target reference line after a position change according to the initial adhesion state and the distance; if the initial adhesion state is adhesion and the distance is greater than a preset unadhesion threshold, triggering the preset reference line to move away from the target reference line, and the final adhesion state is a state in which the preset reference line is not adhered to the target reference line; A sticker processing device.
11. a memory for storing non-transitory computer readable instructions; and a processor for executing the non-transitory computer readable instructions, the sticker processing method according to any one of claims 1 to 9 being realized when the processor executes the non-transitory computer readable instructions. electronic equipment.
12. A computer readable storage medium for storing non-transitory computer readable instructions, which when executed by a computer, cause the computer to perform the sticker processing method of any one of claims 1 to 9. A computer-readable storage medium.
13. When executed on an electronic device, the electronic device is caused to carry out the sticker processing method according to any one of claims 1 to 9. Computer program.
Citation Information
Patent Citations
Method, device and apparatus for quickly placing UI control on virtual canvas
CN110389810A
Image layout device
JP2003099794A
Method and apparatus for setting display bezel compensation for a single large-screen display formed by multiple displays.
JP2013516651A
Method and apparatus for creating user-created sticker and system for sharing user-created sticker
US20180182149A1