WO2023172195A2 - 线条特效处理方法、装置、电子设备、存储介质及产品 - Google Patents

线条特效处理方法、装置、电子设备、存储介质及产品 Download PDF

Info

Publication number
WO2023172195A2
WO2023172195A2 PCT/SG2023/050130 SG2023050130W WO2023172195A2 WO 2023172195 A2 WO2023172195 A2 WO 2023172195A2 SG 2023050130 W SG2023050130 W SG 2023050130W WO 2023172195 A2 WO2023172195 A2 WO 2023172195A2
Authority
WO
WIPO (PCT)
Prior art keywords
line
image
line segment
contour
special effect
Prior art date
Application number
PCT/SG2023/050130
Other languages
English (en)
French (fr)
Other versions
WO2023172195A3 (zh
Inventor
武明飞
李云珠
Original Assignee
脸萌有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 脸萌有限公司 filed Critical 脸萌有限公司
Publication of WO2023172195A2 publication Critical patent/WO2023172195A2/zh
Publication of WO2023172195A3 publication Critical patent/WO2023172195A3/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves

Definitions

  • an embodiment of the present disclosure provides a method for processing line special effects, which includes: collecting a plurality of contour points formed by the object contour of a target object in an image to be processed; performing point expansion processing on a plurality of the contour points to obtain multiple contour points. vertices; generate at least one texture curve based on two adjacent vertices among the plurality of vertices; use at least one of the texture curves to generate a special effect line frame; map the special effect line frame to the image to be processed, Obtain the target image corresponding to the image to be processed.
  • a line special effects processing device including: a contour collection unit, configured to collect multiple contour points formed by the object contour of the target object in the image to be processed; and a vertex expansion unit, configured to Perform point expansion processing on each of the contour points to obtain multiple vertices; a curve generation unit for generating at least one texture curve based on two adjacent vertices among the plurality of vertices; a special effects generation unit for utilizing at least one The texture curve generates a special effect line frame; a line mapping unit is used to map the special effect line frame to the image to be processed and obtain a target image corresponding to the image to be processed.
  • embodiments of the present disclosure provide an electronic device, including: a processor and a memory; the memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the at least one processor executes the line special effect processing method described in the first aspect above.
  • embodiments of the present disclosure provide a computer-readable storage medium. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executable instructions, the above described in the first aspect is implemented. Line special effects processing methods.
  • embodiments of the present disclosure provide a computer program product, which includes a computer program. When the computer program is executed by a processor, the computer program implements the line special effect processing method described in the first aspect.
  • embodiments of the present disclosure further provide a computer program, which when executed by a processor implements the line special effect processing method described in the first aspect.
  • line special effect processing method after collecting multiple contour points formed by the object outline of the target object in the image to be processed, point expansion processing can be performed on the multiple contour points to obtain multiple vertices. Multiple vertices are the basis for building special effect lines. Texture curves corresponding to adjacent pairs of vertices can be generated through multiple vertices to obtain at least one curve. The at least one curve may be at least one curve surrounding an object outline of the target object. Based on at least one texture curve, a special effect line frame can be generated to achieve accurate generation of the special effect line frame of the object outline.
  • Figure 1 is a system architecture diagram of a line special effects processing method provided by an embodiment of the present disclosure
  • Figure 2 is a flow chart of a line special effects processing method provided by an embodiment of the present disclosure
  • Figure 3 is a flow chart of a line special effects processing method provided by an embodiment of the present disclosure.
  • An example diagram of contour point expansion
  • Figure 4 is another flow chart of a line special effects processing method provided by an embodiment of the present disclosure
  • Figure 5 is another flow chart of a line special effects processing method provided by an embodiment of the present disclosure.
  • Figure 6 is a schematic structural diagram of a line special effect processing device provided by an embodiment of the present disclosure
  • Figure 7 is a schematic structural diagram of the hardware of an electronic device provided by an embodiment of the present disclosure.
  • the effect line frame realizes the continuous and smooth display of special effects lines and improves the display accuracy and effect of special effects lines.
  • special effect lines are usually constructed based on human body feature points.
  • a strip model can be directly constructed from the detected human body feature points, and special effect lines can be obtained after smoothing the width and curve of the strip model.
  • the line effects obtained have many problems such as leaky transitions and uneven lines.
  • the inventor considers vertex expansion of the collected feature points to obtain more vertices. Through more vertices, the line expansion can be achieved. Through the expansion of the lines, a better match with the object contour can be obtained. special effects lines to improve the precision and accuracy of special effects lines.
  • point expansion processing can be performed on the multiple contour points to obtain multiple vertices. Multiple vertices are the basis for building special effect lines. Texture curves corresponding to two adjacent vertices can be generated through multiple vertices to obtain at least one curve.
  • the at least one curve may be at least one curve surrounding an object outline of the target object.
  • a special effect line frame can be generated to achieve accurate generation of the special effect line frame of the object outline.
  • FIG. 1 is a network architecture diagram of the line special effect processing method according to the present disclosure.
  • the application network architecture according to the embodiment of the present disclosure may include an electronic device and a client connected to the electronic device through a local area network or a wide area network. It is assumed that the electronic device may be a personal computer, an ordinary server, a super personal computer, or a cloud server. and other types of servers. This disclosure does not limit the specific types of electronic devices too much.
  • the client can be, for example, a terminal device such as a mobile phone, a tablet computer, a personal computer, a smart home appliance, a wearable device, etc. The specific type of the client is not too limited in this disclosure.
  • any user device can initiate a line special effect playback request to the cloud server 1.
  • Cloud server 1 can obtain the target video sent by the user device and collect the image to be processed from the target video. After setting the special effect line frame on the image to be processed through this technical solution, the corresponding target image is obtained and the target image is sent to the user. After device 2, the display can be rendered in user device 2.
  • the example shown in Figure 1 is that the electronic device 1 and the user device 2 are different devices. In practical applications, the electronic device 1 and the user device 2 can be the same device, for example, both can be mobile phones, and this technology can be configured in the mobile phones.
  • the solution is to directly set special effect lines for the played video.
  • Figure 2 is a flow chart of an embodiment of a special effect line processing method provided by an embodiment of the present disclosure. The method may include the following steps:
  • the image to be processed may be an image captured from a video.
  • the video can include live videos, short videos and other types of videos.
  • the target object can refer to objects such as people, scenery, objects or vehicles in the image to be processed, especially faces.
  • the object outline can refer to the edge line formed by the body range of the target object, especially the outline of the face, facial features, etc. in the image.
  • Multiple contour points can refer to key points formed when the object contour is formed. Multiple contour points can be connected to form an object contour.
  • collecting multiple contour points formed by the object outline of the target object in the image to be collected may include: based on the human body key boundary recognition algorithm, identifying the target object from the image to be collected. Multiple outline points formed by the outline of an object.
  • a bone positioning and tracking algorithm can also be used to identify multiple contour points formed by the object contour of the target object from the image to be collected.
  • 202 Perform point expansion processing on multiple contour points to obtain multiple vertices. Multiple vertices can be obtained by the contour point expansion process. A contour point can extend one or more vertices.
  • Texture curves can be obtained by pairing adjacent vertices.
  • a line segment can be obtained by connecting two adjacent vertices, and multiple line segments can be obtained by connecting two adjacent vertices among multiple vertices.
  • a texture curve can be obtained.
  • the texture curve can be set with curve color and light curve attributes, which has a certain texture.
  • the special effect line frame can be generated by at least one texture curve.
  • At least one texture curve can be seamed to obtain a continuous curve, and the continuous curve can be smoothed to obtain a smooth curve.
  • curved lineframes can be obtained. After setting special effects on the curve line frame, you can obtain the special effect line frame.
  • mapping the special effects line frame to the image to be processed and obtaining the target image corresponding to the image to be processed may include: mapping the special effects line frame to the object outline of the target object in the image to be processed, and matching the special effects line frame with the object outline. , obtain the target image corresponding to the image to be processed.
  • point expansion processing can be performed on the multiple contour points to obtain multiple vertices. Multiple vertices are the basis for building special effect lines.
  • Texture curves corresponding to two adjacent vertices can be generated through multiple vertices to obtain at least one curve.
  • the at least one curve may be at least one curve surrounding an object outline of the target object.
  • a special effect line frame can be generated to achieve accurate generation of the special effect line frame of the object outline. After obtaining the special effects line frame, you can map the special effects line frame to the image to be processed, obtain the target image corresponding to the image to be processed, achieve effective and accurate setting of the special effect lines of the image to be processed, and improve the setting accuracy of the line special effects.
  • performing point expansion processing on multiple contour points to obtain multiple vertices may include: connecting two contour points that meet adjacent conditions among the multiple contour points to obtain at least one contour segment; based on the line width , determine the extended line segments corresponding to the contour line segments, so as to obtain the extended line segments corresponding to at least one contour line segment.
  • the two end points of the expansion line segment are determined as two expansion points, so as to obtain multiple expansion points composed of the expansion points of at least one expansion line segment.
  • the plurality of line segments may include at least one contour line segment and at least one extended line segment corresponding to the contour line segment.
  • the line width can be obtained by setting, and the width of the outline segment is expanded through the line width, so that the width of the special effect line meets the requirements of the special effect line.
  • the multiple contour points that satisfy adjacent conditions can first be By connecting two points of the contour, the contour of the target object can be accurately connected to obtain at least one contour segment. Based on the line width, the extended line segments corresponding to the contour line segments can be determined, and the extended line segments corresponding to at least one contour line segment can be obtained.
  • determining the extended line segment corresponding to the contour line segment may include: detecting whether the two vertices corresponding to the contour line segment include tail points; if they include tail points, then detect the non-tail points of the two vertices.
  • the multiple contour points shown in Figure 3 can be identified as 301-305 respectively, wherein the contour point 301 and the contour point 305 can refer to the tail point of the contour.
  • Contour points 302-304 may be non-tail points of the contour.
  • When expanding non-tail points you can directly make vertical lines according to the line width to obtain the corresponding expansion points.
  • When extending the tail point you can directly connect the extended point and the contour point to obtain the corresponding extended line segment.
  • the other two endpoints 306 and 307 of the two obtained vertical lines are both expansion points.
  • the line segment obtained by connecting these two expansion points is 302 And the extended line segment of the 303 contour segment.
  • a tail point 301 and a non-tail point 302 draw the non-tail point as a vertical line perpendicular to the contour segment according to the width of the line, determine the other end point 308 of the vertical line as the expansion point, and connect the tail point 301 and the expansion point 308 Form corresponding extended line segments.
  • the expansion point 306 and the expansion point 308 are also two adjacent endpoints, and corresponding expansion line segments can also be obtained by connecting 306 and 308. It should be noted that the expansion points 306 to 308 are shown in Figure 3, and other expansion points are not shown. The expansion points shown in Figure 3 are only exemplary and should not constitute an expansion of the number of contour points. Specific restrictions on the method.
  • vertical lines can be made directly according to the line width, and the other ends of the vertical lines are obtained as expansion points.
  • the two expansion points are connected to obtain a Extend the line segment.
  • connect the tail point with the extension point of the tail point to obtain the corresponding extension line segment.
  • the vertical line length is the line width.
  • the translation of the contour point can be realized, and the line segment formed by connecting the obtained expansion point and the tail point is the expansion line segment of the contour line segment.
  • the tail point is not included, you can make a vertical line perpendicular to the contour line segment according to the line width for the two contour points of the contour line segment, and obtain the line segment formed by the other two endpoints corresponding to the two vertical lines as an extended line segment.
  • special line segment expansion of the tail point can be implemented when the line segment has a tail point, and the line segment connected between the tail point and the other end point of the vertical line corresponding to the non-tail point is used as Expand the line segment to achieve targeted line segment expansion of the tail point.
  • FIG. 4 shows a flow chart of yet another embodiment of a special effect line processing method provided by an embodiment of the present disclosure. The method may include: Next few steps:
  • the plurality of line segments may include at least one contour line segment and at least one expansion line segment.
  • Multiple line segments corresponding to multiple vertices can also be obtained by connecting two vertices that meet the connection conditions among multiple vertices to obtain line segments.
  • multiple line segments may also include line segments formed by connecting two adjacent expansion points. Multiple line segments can be obtained by connecting two adjacent vertices among multiple vertices.
  • the step of generating the texture curve can be initiated. Specifically, when the refresh flag bit is detected to be true, the line construction interface can refresh the vertex data and vertex index data of the input mseh. Specifically, the position and color of the vertex can be refreshed. , UV (image horizontal axis and vertical axis coordinate points) and other attributes to complete the generation of texture curves.
  • connection point of two line segments can be smoothed by determining the intersection point, and a smooth curve corresponding to the two line segments can be obtained.
  • the smooth curve can include two intersecting line segments, realizing a smooth connection of the line segments.
  • at least one texture curve with the end of attribute setting can be obtained.
  • At least one texture curve can be two line segments connected by a smooth curve.
  • the main lines of the special effect lines can be obtained, and at least one texture curve obtained can be used to generate the special effect line frame.
  • the curve of the line segment can be made smoother and the display effect is better.
  • the respective texture curves of each line segment group include: setting the color attribute and/or width attribute of the smooth curve of the line segment group, and obtaining the respective texture curve of at least one line segment group at the end of the attribute setting.
  • the texture curve can be a smooth curve with a color attribute and/or a width attribute set.
  • the settings of the color attribute and/or width attribute of the curve may refer to the description in the above embodiment, and will not be described again here.
  • by setting the color attribute and/or the width attribute of the smooth curve the color or width of the smooth curve can be accurately set, and the color and width of the obtained texture curve can better match the actual usage requirements, and can be completed.
  • using at least one texture curve to generate a special effect line frame may include: mapping at least one texture curve to the line frame model to obtain the curve line frame corresponding to the object outline; Set the rendering properties of the frame area to obtain the special effect line frame.
  • the line box model can be a preset line box control. At least one texture curve can be mapped into the line box model. At least one texture curve can be represented by information such as a vertex set and vertex index defined by Mesh. Rendering attributes can include the use of special effect functions, such as HDR (High-Dynamic Range) and BLOOM (full-screen floodlight effects) functions to achieve rendering attributes such as floodlight and obtain a line frame with special effects.
  • at least one texture curve can be mapped to the line box model to obtain the curve line box corresponding to the object outline. By setting rendering attributes on the line box area corresponding to the curve line box, the rendering of the curve line box can be completed.
  • mapping the special effect line frame to the image to be processed and obtaining the target image corresponding to the image to be processed may include: determining the image positions corresponding to multiple contour points in the image to be processed; determining multiple contours The corresponding wire frame positions of the points in the special effect line frame; position matching the wire frame positions corresponding to multiple contour points and the image position to obtain the position matching relationship of multiple contour points; position matching based on multiple contour points Relationship, map the special effects line frame to the image to be processed, and obtain the target image corresponding to the image to be processed when the special effects line frame mapping ends.
  • Multiple contour points can respectively correspond to image positions in the image to be processed.
  • the corresponding wireframe positions of multiple contour points in the special effect lineframe corresponds to the line frame position, and the position matching relationship corresponding to the contour point can be obtained to achieve position matching of the contour points.
  • the special effect line frame can be Map to the image to be processed, and obtain the target image corresponding to the image to be processed.
  • the image positions of the contour points and the wire frame positions can be corresponding one-to-one to combine the special effects.
  • the line frame is mapped to the corresponding image position according to the line frame positions corresponding to multiple contour points, and the target image at the end of the mapping is obtained.
  • accurate mapping of the special effect line frame to the image to be processed can be achieved, and an accurate target image can be obtained.
  • the method further includes: performing position correction processing on the special effects line frame in the target image to obtain the corrected target image.
  • correcting the position of the special effect line frame may include performing vertex position, vertex angle, vertex direction, vertex normal (normal) and/or vertex UV0- on multiple vertices corresponding to the special effect line frame in the image.
  • UV0-3 can refer to the coordinates of the image in the horizontal and vertical directions of the display. The value is between 0 and 3, that is, the U-th pixel/picture width in the horizontal direction and the V-th pixel/picture height in the vertical direction.
  • the position correction processing of the special effects line frame in the target image can be performed, and the position of the special effects line frame can be matched with a more accurate position of the image.
  • the target image is more accurate.
  • the image to be processed can be collected from the target video played by the user device.
  • 501 During the process of the user device playing the target video, receive the line special effects processing request sent by the user device for the target video.
  • the user device can play the target video.
  • the target video can be a live video.
  • Line special effects processing controls can be set in the video player or playback page.
  • the user watches the target video through the user's device.
  • the user device can detect the user's line setting request for the line effects processing control settings. Through the line setting request, the line special effects processing of the target video can be started.
  • the timestamp Based on the timestamp, collect the corresponding images to be processed from the target video according to the collection frequency.
  • the timestamp can be read from the target video timestamp or from the system timer.
  • 504 Collect multiple contour points formed by the object contour of the target object in the image to be processed.
  • Control the user device to display the rendered target image may include sending a rendering instruction of the target image to the user device. After receiving the rendering instruction, the user device can render the target image in response to the rendering instruction.
  • the user equipment and the electronic device in the present disclosure may be the same device or different devices.
  • the connection method and the construction method of the user equipment and the electronic device are not too limited.
  • the user device can be a mobile phone, and the electronic device can be a cloud server.
  • the technical solution of the present disclosure can also be directly configured in the user equipment.
  • the technical solution of the present disclosure can be directly configured in the computer, and the computer executes the target image. specific rendering. Some steps in this embodiment are the same as some steps in the previous embodiment. For the sake of simplicity of description, they will not be described again here.
  • the line special effect processing request sent by the user equipment for the target video can be received.
  • the timestamp of initiating the line special effects processing request can be obtained, and based on the timestamp, the corresponding to-be-processed image is collected from the target video according to the collection frequency.
  • the target image After the target image is obtained by setting special effects lines on the to-be-processed image, It can be detected that when the user device plays the video to be processed, the target image corresponding to the special effects line frame is rendered according to the rendering attributes corresponding to the special effects line frame to display the rendered target image.
  • Special effects processing request can set corresponding special effects lines for the image to be processed in the target video, achieve accurate setting of special effects lines, improve the setting effect and accuracy of special effects lines, and achieve the goal of rendering completion through interaction with the user device
  • the display of images improves the smoothness of special effects lines, avoids leaks and other phenomena, and improves the display accuracy of special effects lines.
  • the line special effects processing device 600 may include the following units: Contour acquisition unit 601: used to collect to-be-processed Multiple contour points formed by the object contour of the target object in the image. Vertex expansion unit 602: used to perform point expansion processing on multiple contour points to obtain multiple vertices. Curve generating unit 603: configured to generate at least one texture curve based on two adjacent vertices among the plurality of vertices. Special effect generation unit 604: used to generate a special effect line frame using at least one texture curve.
  • Line mapping unit 605 used to map the special effect line frame to the image to be processed, and obtain the target image corresponding to the image to be processed.
  • point expansion processing can be performed on the multiple contour points to obtain multiple vertices. Multiple vertices are the basis for building special effect lines. Texture curves corresponding to two adjacent vertices can be generated through multiple vertices to obtain at least one curve. The at least one curve may be at least one curve surrounding an object outline of the target object. Based on at least one texture curve, a special effect line frame can be generated to achieve accurate generation of the special effect line frame of the object outline.
  • the vertex expansion unit includes: a line segment generation module, used to connect two contour points that meet adjacent conditions among multiple contour points to obtain at least one contour segment; a line segment expansion module, used to generate a line segment based on the line width , determine the extended line segment corresponding to the contour line segment, to obtain the extended line segment corresponding to at least one contour line segment; the end point determination module is used to use the extended line segment corresponding to at least one contour line segment to determine the two end points of the extended line segment as two expansion points , to obtain multiple expansion points composed of the expansion points of at least one expansion line segment; a vertex determination module, used to obtain multiple vertices after deduplicating multiple contour points and multiple expansion points.
  • the line segment expansion module includes: a tail point detection subunit, used to detect whether the two vertices corresponding to the contour line segment include tail points; a first processing subunit, used to detect if the tail points are included.
  • the non-tail points of the two vertices are drawn as a vertical line perpendicular to the contour segment according to the width of the line, and the other end point of the vertical line is determined to be the expansion point corresponding to the contour segment; the line segment formed by connecting the expansion point and the tail point is determined to be the corresponding expansion point of the contour segment.
  • the second processing subunit is used to make vertical lines perpendicular to the contour line segment for the two contour points of the contour line segment according to the line width if the tail point is not included, and determine the other two corresponding to the two vertical lines.
  • the line segment formed by the endpoints is an extended line segment.
  • the curve generation unit includes: a line segment determination module, used to determine multiple line segments corresponding to multiple vertices; an intersection determination module, used to determine any two line segments among the multiple line segments that meet the line segment intersection conditions.
  • Intersection calculation to obtain the intersection points corresponding to at least one line segment group among multiple line segments
  • Curve smoothing module used to perform intersection smoothing on two line segments of the line segment group and their intersection points based on any line segment group, to obtain the smoothness corresponding to the line segment group curve
  • the attribute setting module is used to set the segment attributes of the smooth curve of the line segment group to obtain the respective texture curves of at least one line segment group at the end of the attribute setting.
  • the attribute setting module includes: an attribute setting submodule, used to set the color attribute and/or width attribute of the smooth curve of the line segment group, and obtain the respective texture curve of at least one line segment group at the end of the attribute setting.
  • the special effects generation unit includes: a line determination module, used to map at least one texture curve to the line frame model, and obtain a curve line frame corresponding to the object outline; a rendering setting module, used to set the curve line Set the rendering properties of the line box area corresponding to the frame to obtain the special effect line box.
  • the line mapping unit includes: a first position module, used to determine the image positions corresponding to multiple contour points in the image to be processed; a second position module, used to determine the positions of multiple contour points in the image to be processed; The corresponding wire frame positions in the special effect line frame; the position matching module is used to position match the wire frame positions corresponding to multiple contour points with the image position to obtain the position matching relationship of multiple contour points; the position mapping module is used Based on the position matching relationship based on multiple contour points, the special effect line frame is mapped to the image to be processed, and the target image corresponding to the image to be processed at the end of the mapping of the special effect line frame is obtained.
  • the line mapping unit further includes: a position correction module, configured to perform position correction processing on the special effect line frame in the target image to obtain a corrected target image.
  • the device further includes: a request receiving unit, configured to receive a line special effect processing request sent by the user device for the target video while the user device is playing the target video; a request response unit, configured to respond to Line special effects processing request, obtains the timestamp of initiating the line special effects processing request; Image acquisition unit, used to collect corresponding to-be-processed images from the target video according to the collection frequency based on the timestamp; Image rendering unit, used to detect when the user device plays to When the image is to be processed, the target image corresponding to the special effect line frame is rendered according to the rendering attributes corresponding to the special effect line frame; the image display unit is used to control the user device to display the rendered target image.
  • FIG. 7 a schematic structural diagram of an electronic device 700 suitable for implementing an embodiment of the present disclosure is shown.
  • the electronic device 700 may be a terminal device or a server.
  • terminal devices may include, but are not limited to, mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA), tablet computers (Portable Android Device, PAD), portable multimedia players (Portable MediaPlayer, PMP), vehicle-mounted terminals (eg, vehicle-mounted navigation terminals), and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like.
  • PDA Personal Digital Assistant
  • PAD tablet computers
  • PMP portable multimedia players
  • vehicle-mounted terminals eg, vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, and the like.
  • the electronic device shown in FIG. 7 is only an example and should not bring any limitations to the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 700 may include a processing device (for example, a central processing unit, a graphics processor, etc.) 701, which may process data according to a program stored in a read-only memory (Read Only Memory, ROM) 702 or from a storage device. 708
  • the program loaded into Random Access Memory (RAM) 703 executes various appropriate actions. operation and processing.
  • RAM 703 various programs and data required for the operation of the electronic device 700 are also stored.
  • the processing device 701, the ROM 702 and the RAM 703 are connected to each other via a bus 704.
  • the input/output (I/O) interface 705 is also connected to the bus 704.
  • the following devices can be connected to the I/O interface 705: including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, and an accelerometer.
  • an input device 706 such as a gyroscope
  • an output device 707 including a liquid crystal display (LCD), a speaker, a vibrator, etc.
  • a storage device 708 including a magnetic tape, a hard disk, etc.
  • a communication device 709 o Communication device 709 Electronic device 700 may be allowed to communicate wirelessly or wiredly with other devices to exchange data.
  • FIG. 7 illustrates an electronic device 700 having various means, it should be understood that implementation or availability of all illustrated means is not required.
  • embodiments of the present disclosure include a computer program product including a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart.
  • the computer program may be downloaded and installed from the network via communication device 709, or installed from storage device 708, or Disk, hard disk, random access memory (RAM), read-only memory (ROM), Erasable Programmable Read-Only Memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc Read-Only Memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program code is carried.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device .
  • Program codes contained on computer-readable media can be transmitted using any appropriate medium, including but not limited to: wires, optical cables, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device; it may also exist independently without being assembled into the electronic device.
  • the computer-readable medium carries one or more programs.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional programming languages, or a combination thereof. Procedural programming language - such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network - including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external computer (for example, using an Internet service provider) to connect via the Internet).
  • LAN Local Area Network
  • WAN Wide Area Network
  • Internet service provider for example, using an Internet service provider
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or operations. , or can be implemented using a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments of the present disclosure may be implemented in software or hardware. The name of the unit does not constitute a limitation on the unit itself under certain circumstances.
  • the first acquisition unit can also be described as "the unit that acquires at least two Internet Protocol addresses.”
  • the functions described above herein may be performed, at least in part, by one or more hardware logic components.
  • exemplary types of hardware logic components include: field programmable gate array (Field Programmable Gate Array, FPGA), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), application specific standard product (Application Specific Standard Product (ASSP), System on Chip (SOC), Complex Programmable Logic Device (CPLD), etc.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
  • the machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • Machine-readable media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any suitable combination of the above. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, laptop disks, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a method for processing line special effects is provided, which includes: collecting multiple contour points formed by the object contour of the target object in the image to be processed; and performing processing on the multiple contour points.
  • Point expansion processing to obtain multiple vertices; based on multiple vertices, generate texture curves corresponding to adjacent pairs of vertices to obtain at least one texture curve; use at least one texture curve to generate a special effect line frame; map the special effect line frame to the to-be-processed Image, obtain the target image corresponding to the image to be processed.
  • performing point expansion processing on multiple contour points to obtain multiple vertices includes: connecting two contour points that meet adjacent conditions among the multiple contour points to obtain at least one contour Line segment; Based on the line width, determine the extended line segment corresponding to the contour line segment to obtain at least one extended line segment corresponding to the contour line segment; Use the extended line segment corresponding to at least one contour line segment to determine the two endpoints of the extended line segment as two extended points, To obtain multiple expansion points composed of expansion points of at least one expansion line segment; Multiple vertices are obtained by deduplicating multiple contour points and multiple extension points.
  • determining the extended line segment corresponding to the contour line segment includes: detecting whether the two vertices corresponding to the contour line segment include a tail point; The tail point makes a vertical line perpendicular to the contour line segment according to the width of the line, and the other end of the vertical line is the expansion point corresponding to the contour line segment; determine that the line segment formed by connecting the expansion point and the tail point is the expansion line segment corresponding to the contour line segment; if the tail is not included point, then draw a vertical line perpendicular to the contour line segment for the two contour points of the contour line segment according to the line width, and obtain the line segment formed by the other two endpoints corresponding to the two vertical lines as an extended line segment.
  • texture curves corresponding to two vertices are generated, and multiple texture curves are obtained, including: determining multiple line segments corresponding to the multiple vertices; determining the line segments among the multiple line segments that satisfy Calculate the intersection point of any two line segments of the intersection condition to obtain the intersection point corresponding to at least one line segment group among the multiple line segments; Based on any line segment group, perform intersection smoothing processing on the two line segments of the line segment group and their intersection point to obtain the line segment group Corresponding smooth curves to obtain at least one smooth curve corresponding to each line segment group; Perform line segment attribute settings on the smooth curves corresponding to at least one line segment group to obtain at least one texture curve with the end of attribute setting.
  • performing line segment attribute settings on the smooth curves respectively corresponding to at least one line segment group to obtain at least one texture curve at the end of the attribute setting includes: determining the smooth curve corresponding to at least one line segment group, Obtain at least one smooth curve; set the color attribute and/or width attribute of at least one smooth curve in sequence, and obtain at least one texture curve with the end of attribute setting.
  • using at least one texture curve to generate a special effect line frame includes: mapping at least one texture curve to the line frame model to obtain a curve line frame corresponding to the object outline; Set the rendering properties of the line box area to obtain the special effect line box.
  • mapping the special effect line frame to the image to be processed and obtaining the target image corresponding to the image to be processed includes: determining the image positions corresponding to multiple contour points in the image to be processed; determining multiple contour points in the image to be processed. The corresponding wire frame positions of each contour point in the special effect line frame; Match the position of the wire frame corresponding to multiple contour points with the image position to obtain the position matching relationship of multiple contour points; Based on the positions of multiple contour points Matching relationship, map the special effects line frame to the image to be processed, and obtain the target image corresponding to the image to be processed at the end of the mapping of the special effects line frame.
  • the method further includes: performing position correction processing on the special effects line frame in the target image to obtain a corrected target image.
  • the method before collecting a plurality of contour points formed by the object outline of the target object in the image to be processed, the method further includes: while the user equipment plays the target video, receiving the information sent by the user equipment for the target video.
  • Line special effects processing please Request In response to the line special effects processing request, obtain the timestamp that initiated the line special effects processing request; Based on the timestamp, collect the corresponding to-be-processed images from the target video according to the collection frequency; Map the special effects line frame to the to-be-processed image to obtain the to-be-processed
  • the target image corresponding to the image also includes: detecting that when the user device plays the image to be processed, rendering the target image corresponding to the special effects line box according to the rendering attributes corresponding to the special effects line box; controlling the user device to display the rendered target image.
  • a line special effects processing device including: a contour collection unit configured to collect a plurality of contour points formed by the object contour of the target object in the image to be processed;
  • the vertex expansion unit is used to perform point expansion processing on multiple contour points to obtain multiple vertices;
  • the curve generation unit is used to generate texture curves corresponding to adjacent pairs of vertices based on multiple vertices to obtain at least one texture curve;
  • special effects The generation unit is used to generate a special effect line frame using at least one texture curve;
  • the line mapping unit is used to map the special effect line frame to the image to be processed and obtain a target image corresponding to the image to be processed.
  • an electronic device including: at least one processor and a memory; the memory stores computer execution instructions; at least one processor executes the computer execution instructions stored in the memory, so that At least one processor executes the line special effect processing methods of the first aspect and various possible designs of the first aspect.
  • a computer-readable storage medium is provided. Computer-executable instructions are stored in the computer-readable storage medium. When the processor executes the computer-executed instructions, the first step above is implemented. Aspects as well as line special effects processing methods for various possible designs in the first aspect.
  • a computer program product including a computer program.
  • the lines of the first aspect and various possible designs of the first aspect are implemented.
  • Special effects processing methods are implemented.
  • embodiments of the present disclosure provide a computer program that, when executed by a processor, implements the above first aspect and various possible designed line special effect processing methods of the first aspect.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Generation (AREA)

Abstract

摘要本公开实施例提供一种线条特效处理方法及装置、电子设备、存储介质、计算机程序产品及计算机程序,该方法可以包括:采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点;对多个所述轮廓点进行点扩展处理,获得多个顶点;基于多个所述顶点,生成相邻的两两顶点对应纹理曲线,获得至少一个纹理曲线;利用至少一个所述纹理曲线,生成特效线条框;将所述特效线条框映射至所述待处理图像,获得所述待处理图像对应的目标图像。解决了线条特效显示存在漏缝等问题,提高了线条特效的平滑显示准确性。

Description

线条 特效 处 理方 法、 装置、 电子设备 、 存储介 质 及产 品 相关申请的交叉引用 本公开要求于 2022年 3月 8日提交中国专利局、 申请号为 202210220029.5、 申请名称为 “线条特效处理方法、装置、 电子设备、存储介质及产品”的中国专利申请的优先权, 其全部 内容通过引用结合在本公开中。 技术领域 本公开实施例涉及计算机技术领域,尤其涉及一种线条特效处理方法及装置、电子设备、 存储介质、 计算机程序产品及计算机程序。 背景技术 随着直播领域、短视频领域的迅速发展, 视频特效的应用越来越广泛。其中, 基于人体特 征点来构造线条特效是一种较为常见的渲染技术。 较为常见的技术是通过人体特征点动态构 建合适的条带模型,并且对条带的宽度和曲线平滑设置之后获得特效线条。但是,通过这种方 式构造获得的线条特效转接处存在漏缝、线条不平滑等问题, 导致线条特效的准确度不高,显 示效果较差。 发明内容 本公开实施例提供一种线条特效处理方法及装置、 电子设备、存储介质、计算机程序产品 及计算机程序, 以克服由于线条特效转接处存在漏缝、线条不平滑等问题, 导致线条特效的准 确度不高, 显示效果较差的技术问题。 第一方面, 本公开实施例提供一种线条特效处理方法, 包括: 采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点; 对多个所述轮廓点进行点扩展处理, 获得多个顶点; 基于多个所述顶点中两两相邻的顶点, 生成至少一个纹理曲线; 利用至少一个所述纹理曲线, 生成特效线条框; 将所述特效线条框映射至所述待处理图像, 获得所述待处理图像对应的目标图像。 第二方面, 本公开实施例提供一种线条特效处理装置, 包括: 轮廓采集单元, 用于采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点; 顶点扩展单元, 用于对多个所述轮廓点进行点扩展处理, 获得多个顶点; 曲线生成单元, 用于基于多个所述顶点中两两相邻的顶点, 生成至少一个纹理曲线; 特效生成单元, 用于利用至少一个所述纹理曲线, 生成特效线条框; 线条映射单元,用于将所述特效线条框映射至所述待处理图像,获得所述待处理图像对应 的目标图像。 第三方面, 本公开实施例提供一种电子设备, 包括: 处理器以及存储器; 所述存储器存储计算机执行指令; 所述处理器执行所述存储器存储的计算机执行指令, 使得所述至少一个处理器执行如上 第一方面所述的线条特效处理方法。 第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储 有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面所述的线条特效 处理方法。 第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,所述计算机程序被 处理器执行时实现如上第一方面所述的线条特效处理方法。 第六方面,本公开实施例还提供一种计算机程序,所述计算机程序在被处理器执行时实现 如上第一方面所述的线条特效处理方法。 本实施例提供的线条特效处理方法, 采集待处理图像中目标对象的对象轮廓所形成的多 个轮廓点之后,可以对多个轮廓点进行点扩展处理,获得多个顶点。多个顶点即为特效线条的 构建基础。通过多个顶点可以生成相邻的两两顶点对应的纹理曲线, 以获得至少一个曲线。该 至少一个曲线可以为围绕目标对象的对象轮廓的至少一个曲线。基于至少一个纹理曲线,可以 生成特效线条框,实现对对象轮廓的特效线条框的准确生成。获得特效线条框之后,可以将特 效线条框映射至待处理图像,获得待处理图像对应的目标图像,实现对待处理图像的特效线条 的有效而准确的设置, 提高线条特效的设置准确度。 附图说明 为了更清楚地说明本公开实施例或现有技术中的技术方案, 下面将对实施例或现有技术 描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实 施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图 获得其他的附图。 图 1为本公开实施例提供的一种线条特效处理方法的一个系统架构图; 图 2为本公开实施例提供的一种线条特效处理方法的一个流程图; 图 3为本公开实施例提供的一种轮廓点扩展的示例图; 图 4为本公开实施例提供的一种线条特效处理方法的又一个流程图; 图 5为本公开实施例提供的一种线条特效处理方法的又一个流程图; 图 6为本公开实施例提供的一种线条特效处理装置的一个结构示意图; 图 7为本公开实施例提供的一种电子设备的硬件结构示意图。 具体实施方式 为使本公开实施例的目的、 技术方案和优点更加清楚, 下面将结合本公开实施例中的附 图, 对本公开实施例中的技术方案进行清楚、完整地描述, 显然, 所描述的实施例是本公开一 部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出 创造性劳动前提下所获得的所有其他实施例, 都属于本公开保护的范围。 本公开的技术方案可以应用于视频播放场景中,视频例如可以包括直播视频、短视频、影 音视频等类型的视频。可以通过对视频中的图像进行轮廓点检测以及轮廓点扩展,可以获得覆 盖面更宽的多个顶点,以利用更多的顶点进行纹理曲线的生成,利用纹理曲线获得更准确的特 效线条框, 实现特效线条的连续且平滑的显示, 提高特效线条的显示准确度以及效果。 相关技术中,通常采用基于人体特征点来构造特效线条。通常,可以对检测得到的人体特 征点直接构造条带模型,并且对条带模型进行宽度和曲线平滑之后可以获得特效线条。但是, 通过这种直接利用人体特征点构造条带模型的方式,获得的线条特效存在较多的转接漏缝,线 条不平滑等问题。 导致线条特效的准确度不高, 显示效果较差。 为了解决上述技术问题, 发明人考虑对采集到的特征点进行顶点扩展, 以获得更多的顶 点,通过较多的顶点可以实现对线条的扩展,通过线条的扩展,可以获得与对象轮廓更匹配的 特效线条, 提高特效线条的精确度和准确度。 本公开的实施例中,采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点之后,可 以对多个轮廓点进行点扩展处理,获得多个顶点。多个顶点即为特效线条的构建基础。通过多 个顶点可以生成相邻的两两顶点对应的纹理曲线,以获得至少一个曲线。该至少一个曲线可以 为围绕目标对象的对象轮廓的至少一个曲线。基于至少一个纹理曲线,可以生成特效线条框, 实现对对象轮廓的特效线条框的准确生成。获得特效线条框之后,可以将特效线条框映射至待 处理图像,获得待处理图像对应的目标图像,实现对待处理图像的特效线条的有效而准确的设 置, 提高线条特效的设置准确度。 下面将以具体实施例对本公开的技术方案以及本公开的技术方案如何解决上述技术问题 进行详细说明。下面几个具体实施例可以相互结合,对于相同或相似的概念或过程可能在某些 实施例中不再赘述。 下面将结合附图对本公开的实施例进行详细描述。 图 1 是根据本公开线条特效处理方法的一个网络架构图。 根据本公开实施例的应用网络 架构中可以包括一个电子设备以及一个与该电子设备通过局域网或者广域网进行网络连接的 客户端, 假设该电子设备可以为个人计算机、普通服务器、超级个人计算机、云服务器等类型 的服务器,本公开中对电子设备的具体类型并不作出过多限定。客户端例如可以为手机、平板 电脑、个人计算机、智能家电、可穿戴设备等终端设备, 本公开中对客户端的具体类型并不作 出过多限定。 如图 1所示, 以电子设备为云服务器 1 , 用户设备 2为手机 21、 平板电脑 22为 例, 任一个用户设备可以向云服务器 1发起线条特效的播放请求。 云服务器 1 中可以获取用 户设备发送的目标视频,并从目标视频中采集待处理图像,通过本技术方案对待处理图像进行 特效线条框的设置之后,获得对应的目标图像,将目标图像发送至用户设备 2之后,可以在用 户设备 2中渲染显示。 当然, 图 1所示的示例是电子设备 1与用户设备 2是不同的设备, 在实际应用中, 电子 设备 1与用户设备 2可以为同一设备, 例如均可以为手机, 手机中可以配置本技术方案以直 接对播放的视频进行特效线条的设置。 参考图 2, 图 2为本公开实施例提供的一种特效线条处理方法的一个实施例的流程图, 该 方法可以包括以下几个步骤:
201: 采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点。 可选地,待处理图像可以为从视频中采集的图像。该视频可以包括直播视频、短视频等类 型的视频。 目标对象可以指待处理图像中人物、景物、物品或者车辆等类型的对象, 特别是人 脸。对象轮廓可以指目标对象的形体范围所形成的边缘线,特别是图像中的人脸轮廓,五官轮 廓等。 多个轮廓点可以指对象轮廓形成时所形成的关键点。 多个轮廓点连接可以形成对象轮 廓。 本示例中,在目标对象指人脸或者五官时,采集待采集图像中目标对象的对象轮廓所形成 的多个轮廓点可以包括:基于人体关键边界识别算法,从待采集图像中识别目标对象的对象轮 廓所形成的多个轮廓点。还可以采用骨骼定位追踪算法,从待采集图像中识别目标对象的对象 轮廓所形成的多个轮廓点。
202: 对多个轮廓点进行点扩展处理, 获得多个顶点。 多个顶点可以由轮廓点扩展处理获得。 一个轮廓点可以扩展一个或多个顶点。
203: 基于多个顶点中两两相邻的顶点, 生成至少一个纹理曲线。 纹理曲线可以通过两两相邻的顶点获得。两两相邻的顶点连接可以获得一条线段,对多个 顶点中两两相邻的顶点相连接,可以获得多个线段。对两个线段进行线段连接以及线条平滑处 理后,可以获得一个纹理曲线,对多个线段中两个相邻的线段连接以及线条平滑处理可以获得 至少一个纹理曲线。 纹理曲线可以设置有曲线颜色以及光线的曲线属性的曲线, 其具有一定的纹理。
204: 利用至少一个纹理曲线, 生成特效线条框。 其中, 特效线条框可以由至少一个纹理曲线生成。 可以将至少一个纹理曲线进行接缝处 理,获得连续的曲线,将连续的曲线平滑处理,获得的平滑曲线。将平滑曲线映射至线框模型, 可以获得曲线线条框。 对曲线线条框进行特效设置之后, 可以获得特效线条框。
205: 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图像。 可选地,将特效线条框映射至待处理图像,获得待处理图像对应的目标图像可以包括:将 特效线条框映射至待处理图像中目标对象的对象轮廓,将特效线条框与对象轮廓相匹配,获得 待处理图像对应的目标图像。 本公开的实施例中,采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点之后,可 以对多个轮廓点进行点扩展处理,获得多个顶点。多个顶点即为特效线条的构建基础。通过多 个顶点可以生成相邻的两两顶点对应的纹理曲线,以获得至少一个曲线。该至少一个曲线可以 为围绕目标对象的对象轮廓的至少一个曲线。基于至少一个纹理曲线,可以生成特效线条框, 实现对对象轮廓的特效线条框的准确生成。获得特效线条框之后,可以将特效线条框映射至待 处理图像,获得待处理图像对应的目标图像,实现对待处理图像的特效线条的有效而准确的设 置, 提高线条特效的设置准确度。 作为一个实施例, 对多个轮廓点进行点扩展处理, 获得多个顶点, 可以包括: 对多个轮廓点中满足相邻条件的两个轮廓点进行连接, 获得至少一个轮廓线段; 基于线条宽度,确定轮廓线段对应的扩展线段,以获得至少一个轮廓线段分别对应的扩展 线段。 利用至少一个轮廓线段分别对应的扩展线段,确定扩展线段的两端端点为两个扩展点,以 获得至少一个扩展线段的扩展点构成的多个扩展点。 将多个轮廓点以及多个扩展点去重处理, 以获得多个顶点。 对多个轮廓点进行点扩展, 可以获得多个顶点。 多个顶点对应的点集合可以实现多个线 段。 多个线段可以包括至少一个轮廓线段和至少一个轮廓线段分别对应的扩展线段。 线条宽度可以通过设置获得,通过线条宽度对轮廓线段进行宽度扩展,使得特效线条的宽 度满足特效线条要求。 本公开实施例中,对多个轮廓点进行点扩展处理时,可以先将多个轮廓点中满足相邻条件 的两个点进行连接,通过连接轮廓点,可以对目标对象的轮廓进行准确连接,获得至少一个轮 廓线段。基于线条宽度,可以确定轮廓线段对应的扩展线段,获得至少一个轮廓线段分别对应 的扩展线段。利用至少一个轮廓线段分别对应的扩展线段,可以确定扩展线段的两端端点为两 个扩展点。以轮廓线段作为扩展基础,实现对特效线条的线段扩展。通过特效线条的线段扩展, 可以获得与特效线条更匹配的扩展点,实现对特效线条相关的点的准确扩展,提高扩展精度以 及准确度。 在一种可能的设计中, 基于线条宽度, 确定轮廓线段对应的扩展线段, 可以包括: 检测轮廓线段对应的两个顶点是否包括尾点; 若包括尾点,则对两个顶点的非尾点按照线条宽度做垂直于轮廓线段的垂线,并确定垂线 的另一端点为轮廓线段对应的扩展点; 确定扩展点与尾点连接形成的线段为轮廓线段对应的扩展线段; 若不包括尾点,则对轮廓线段的两个轮廓点分别按照线条宽度做垂线,确定两条垂线分别 对应的另外两个端点形成的线段为扩展线段。 尾点可以指轮廓的两个端点。为了便于理解, 如图 3所示, 在图 3所示的多个轮廓点, 可 以分别标识为 301-305,其中,轮廓点 301以及轮廓点 305可以指轮廓的尾点。轮廓点 302-304 可以为轮廓的非尾点。 对非尾点进行扩展时,可以直接按线条宽度做垂线,获得对应的扩展点。对尾点进行扩展 时, 可以将扩展点与轮廓点直接连接, 获得对应的扩展线段。 参考图 3 , 对两个非尾点 302及 303的线段做垂线, 获得的两个垂线的另外两个端点 306和 307均为扩展点, 这两个扩展点连 接获得的线段即为 302及 303的轮廓线段的扩展线段。 对具有一个尾点 301一个非尾点 302, 将非尾点按照线条宽度做垂直于轮廓线段的垂线, 确定垂线的另一端点 308为扩展点, 可以 将尾点 301与扩展点 308连接形成相应的扩展线段。 其中, 扩展点 306和扩展点 308也是相 邻的两个端点,连接 306和 308也可以获得相应的扩展线段。需要说明的是图 3中示出了 306 - 308的扩展点, 对于其他扩展点未示出, 图 3中示出的扩展点仅仅是示例性的, 并不应构成对 轮廓点的扩展数量以及方式的具体限制。 当然,在某些实施例中,对于顶点中的尾点和非尾点,均可以直接按照线条宽度做垂线, 获得垂线的另一端均为扩展点, 将两个扩展点连接, 获得一个扩展线段。 同时, 将尾点与该尾 点的扩展点连接, 获得对应的扩展线段。 本公开实施例中,检测轮廓线段对应的两个顶点是否包括尾点,若包括尾点,则可以对两 个顶点中的非尾点按照线条宽度做垂线,获得垂线另一端点为轮廓线段的扩展点。垂线长度为 线条宽度。以垂线方式,可以实现对轮廓点的平移,获得的扩展点与尾点连接可以形成的线段 即为轮廓线段的扩展线段。若不包括尾点,可以对轮廓线段的两个轮廓点分别按照线条宽度做 垂直于轮廓线段的垂线,获得两条垂线分别对应的另外两个端点形成的线段为扩展线段。通过 对轮廓线段的两个顶点进行尾点检测,可以在线段存在尾点时,实现对尾点的特殊线段扩展, 利用尾点与非尾点对应垂线的另一端点之间连接的线段作为扩展线段, 实现对尾点的针对性 线段扩展。若不包含尾点,则可以直接平移获得相应的扩展线段,实现对特效线条的宽度扩展。 通过尾点以及非尾点的检测, 可以实现对特效线条的准确扩展, 提高扩展效率以及精度。 为了获得更为平滑的特效线条, 可以对两个线段之间的交点进行平滑处理。 如图 4所示 为本公开实施例提供的一种特效线条处理方法的又一个实施例的流程图, 该方法可以包括以 下几个步骤:
401: 采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点。 本实施例中部分步骤与前述实施例中部分步骤相同,为了描述的简洁性考虑,在此不再赘 述。
402: 对多个轮廓点进行点扩展处理, 获得多个顶点。
403: 确定多个顶点对应的多个线段。 可选地,多个线段可以包括至少一个轮廓线段和至少一个扩展线段。多个顶点对应的多个 线段也可以根据多个顶点中满足连接条件的两个顶点连接获得线段获得。此外,多个线段还可 以包括相邻的两个扩展点之间连接形成的线段。 多个线段可以通过多个顶点中两两相邻的顶 点连接获得。
404: 对多个线段中满足线段相交条件的任意两个线段进行线段交点计算, 获得多个线段 中至少一个线段组分别对应的交点。
405: 基于任一个线段组, 对线段组的两个线段以及其交点进行交点平滑处理, 获得线段 组对应的平滑曲线。 对两个线段之间的交点处进行平滑处理, 可以使得两个线段以及其连接线形成了平滑的 曲线, 获得线段组的平滑曲线。 获得至少一线段组分别对应的平滑曲线。
406: 对线段组的平滑曲线进行线段属性设置, 以获得属性设置结束的至少一个线段组各 自的纹理曲线。 对线段组的平滑曲线进行线段属性设置,获得属性设置结束的纹理曲线,可以包括: 调用 线条位置设置函数,对平滑曲线的曲线位置进行设置。其中, 曲线位置可以使用曲线中的顶点 表示, 为了便于对曲线位置进行准确设置, 可以使用 Unity(游戏引擎) 中的 Mesh(网络)记 录曲线位置, mesh是网格的数据结构, 可以记录顶点和顶点索引等信息。 之后, 可以对平滑 曲线的曲线拐角进行设置,之后还可以对曲线位置、 曲线宽度以及曲线颜色分别进行设置,设 置结束时可以触发刷新机制,修改刷新标志位为真值。设置结束之后,可以发起对纹理曲线的 生成步骤, 具体可以检测刷新标志位为真值时, 线条构建接口可以刷新输入的 mseh的顶点数 据和顶点索引数据, 其中, 具体可以刷新顶点的位置、 颜色、 UV(图像横轴和纵轴坐标点) 等属性, 以完成纹理曲线的生成。
407: 利用至少一个纹理曲线, 生成特效线条框。
408: 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图像。 本公开实施例中,通过交点确定可以对两个线段连接点处进行平滑,获得两个线段对应的 平滑曲线,该平滑曲线中可以包括两个相交的线段,实现了对线段的平滑连接。在对至少一个 线段组分别对应的平滑曲线进行线段属性的设置, 可以获得属性设置结束的至少一个纹理曲 线。至少一个纹理曲线可以为以平滑曲线连接的两个线段,而对于线段之间的连接,所有线段 组分别获得对应的平滑曲线之后,可以完成对所有线段的初步连接。而之后,对各个线段组的 平滑曲线进行线段属性的设置之后,可以实现对特效线条的主要线条的获取,获得的至少一个 纹理曲线即可以用于生成特效线条框。通过为两个可连接的线段确定交点,进而通过平滑曲线 的方式连接两个线段, 可以使得线段的曲线更平滑, 展示效果更好。 作为一个实施例,对线段组的平滑曲线进行线段属性设置,以获得属性设置结束的至少一 个线段组各自的纹理曲线, 包括: 对线段组的平滑曲线的颜色属性和 /或宽度属性进行设置, 获得属性设置结束的至少一个 线段组各自的纹理曲线。 纹理曲线可以为设置了颜色属性和 /或宽度属性的平滑曲线。 曲线的颜色属性和 /或宽度属性的设置可以参考上述实施例中的描述, 在此不再赘述。 本公开实施例中, 通过对平滑曲线设置颜色属性和 /或宽度属性, 可以实现对平滑曲线的 颜色或宽度的准确设置,获得的纹理曲线的颜色与宽度与实际的使用需求更匹配,可以完成纹 理曲线的准确设置。 在一种可能的设计中, 利用至少一个纹理曲线, 生成特效线条框, 可以包括: 将至少一个纹理曲线映射至线条框模型中, 获得对象轮廓对应的曲线线条框; 为曲线线条框对应的线条框区域设置渲染属性, 获得特效线条框。 线条框模型可以为预先设置的线条框控件。 可以将至少一个纹理曲线映射至线条框模型 中。至少一个纹理曲线可以以 Mesh定义的顶点集合和顶点索引等信息表示。渲染属性可以包 括利用特效函数, 例如 HDR (High-Dynamic Range, 高动态范围)和 BLOOM(全屏泛光特 效) 函数配合来实现泛光等渲染属性, 获得具特效线条框。 本公开实施例中,可以将至少一个纹理曲线映射至线条框模型中,获得对象轮廓对应的曲 线线条框,通过对曲线线条框对应的线条框区域设置渲染属性,可以完成对曲线线条框的渲染 设置, 可以获得具有渲染特效的特效线条框, 完成渲染线条的有效获取。 在一种可能的设计中, 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图 像, 可以包括: 确定多个轮廓点在待处理图像中分别对应的图像位置; 确定多个轮廓点在特效线条框中分别对应的线框位置; 将多个轮廓点分别对应的线框位置与图像位置进行位置匹配, 可以获得多个轮廓点的位 置匹配关; 基于多个轮廓点的位置匹配关系,将特效线条框映射至待处理图像中,获得特效线条框映 射结束时待处理图像对应的目标图像。 多个轮廓点可以在待处理图像中分别对应有图像位置。 多个轮廓点在特效线条框中分别 对应的线框位置。任一个轮廓点在待处理图像中的图像位置与线框位置相对应,可以获得该轮 廓点对应的位置匹配关系,实现对轮廓点的位置匹配,通过轮廓点的位置匹配,可以将特效线 条框映射至待处理图像中, 获得待处理图像对应的目标图像。 本公开实施例中, 确定多个轮廓点分别在待处理图像中的图像位置以及在特效线条框中 的线框位置之后,可以将轮廓点的图像位置与线框位置一一对应,以将特效线条框按照多个轮 廓点分别对应的线框位置映射至对应的图像位置,获得映射结束时的目标图像。通过图像位置 与线框位置的映射可以实现特效线条框至待处理图像的准确映射, 获得准确的目标图像。 在一种可能的设计中,获得特效线条框映射结束时待处理图像对应的目标图像之后,还包 括: 对目标图像中特效线条框进行位置修正处理, 获得修正处理后的目标图像。 可选地, 对特效线条框的位置进行修正处理可以包括对图像中的特效线条框对应的多个 顶点分别进行顶点位置、 顶点角度、 顶点方向、 顶点法线 (normal) 和 /或顶点 UV0-3修正。 其中, UV0-3可以指图像在显示器水平和垂直方向上坐标, 值在 0 - 3之间, 即水平方向的第 U 个像素 /图片宽度, 垂直方向的第 V个像素 /图片高度。 本公开实施例中,将特效线条框映射至待处理图像之后,可以对目标图像中的特效线条框 进行位置修正处理,可以对特效线条框的位置进行与图像更准确的位置匹配,修正处理后的目 标图像更准确。 在实际应用中,待处理图像可以为用户设备播放的目标视频中采集。如图 5所示,为本公 开实施例提供的一种线条特效处理方法的又一个实施例的流程图, 该方法可以包括以下几个 步骤:
501: 在用户设备播放目标视频的过程中, 接收用户设备针对目标视频发送的线条特效处 理请求。 用户设备可以播放目标视频。目标视频可以为直播视频。可以在视频播放器或者播放页面 中设置线条特效处理控件。用户通过用户设备观看目标视频。用户设备可以检测用户针对线条 特效处理控件设置的线条设置请求。 通过线条设置请求, 可以启动对目标视频的线条特效处 理。
502: 响应于线条特效处理请求, 获取发起线条特效处理请求的时间戳。
503: 基于时间戳, 从目标视频中按照采集频率采集对应的待处理图像。 时间戳可以从目标视频时间戳中读取获得, 也可以从系统计时器读取获得。
504: 采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点。
505: 对多个轮廓点进行点扩展处理, 获得多个顶点。
506: 基于多个顶点中两两相邻的顶点, 生成至少一个纹理曲线。
507: 利用至少一个纹理曲线, 生成特效线条框。
508: 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图像。
509: 检测用户设备播放至待处理图像时, 按照特效线条框对应的渲染属性渲染特效线条 框对应的目标图像。
510: 控制用户设备展示渲染完成的目标图像。 控制用户设备渲染完成的目标图像可以包括将目标图像的渲染指令发送至用户设备。 用 户设备接收到渲染指令之后,可以响应于该渲染指令对目标图像进行渲染处理。本公开中的用 户设备与电子设备可以为同一设备也可以为不同的设备, 本公开实施例中对用户设备与电子 设备的连接方式以及组建方式并不做出过多限定。例如,用户设备可以为手机、 电子设备可以 为云服务器。而在用户设备处理性能较强,本公开的技术方案也可以直接配置于用户设备中, 例如,用户设备为计算机时,可以直接将本公开的技术方案配置于计算机中,并由计算机执行 目标图像的具体渲染。 本实施例中部分步骤与前述实施例中部分步骤相同,为了描述的简洁性考虑,在此不再赘 述。 本公开实施例中,在用户设备播放目标视频的过程中,可以接收用户设备针对目标视频发 送的线条特效处理请求。可以响应于该线条特效处理请求,获取发起线条特效处理请求的时间 戳, 以基于该时间戳,从目标视频中按照采集频率采集对应的待处理图像,对待处理图像设置 特效线条获得目标图像之后,可以检测用户设备播放至待处理视频时,按照特效线条框对应的 渲染属性渲染特效线条框对应的目标图像,以展示渲染完成的目标图像。通过检测用户的线条 特效处理请求,可以对目标视频中的待处理图像设置对应的特效线条,实现对特效线条的准确 设置,提高特效线条的设置效果以及准确性,通过与用户设备的交互,实现对渲染完成的目标 图像的显示, 提高特效线条的平滑性, 避免出现漏缝等现象, 提高特效线条的显示准确度。 如图 6所示,为本公开实施例提供的一种线条特效处理装置的一个实施例的结构示意图, 该线条特效处理装置 600可以包括以下几个单元: 轮廓采集单元 601: 用于采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点。 顶点扩展单元 602: 用于对多个轮廓点进行点扩展处理, 获得多个顶点。 曲线生成单元 603: 用于基于多个顶点中两两相邻的顶点, 生成至少一个纹理曲线。 特效生成单元 604: 用于利用至少一个纹理曲线, 生成特效线条框。 线条映射单元 605: 用于将特效线条框映射至待处理图像, 获得待处理图像对应的目标图 像。 本公开的实施例中,采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点之后,可 以对多个轮廓点进行点扩展处理,获得多个顶点。多个顶点即为特效线条的构建基础。通过多 个顶点可以生成相邻的两两顶点对应的纹理曲线,以获得至少一个曲线。该至少一个曲线可以 为围绕目标对象的对象轮廓的至少一个曲线。基于至少一个纹理曲线,可以生成特效线条框, 实现对对象轮廓的特效线条框的准确生成。获得特效线条框之后,可以将特效线条框映射至待 处理图像,获得待处理图像对应的目标图像,实现对待处理图像的特效线条的有效而准确的设 置, 提高线条特效的设置准确度。 作为一个实施例, 顶点扩展单元, 包括: 线段生成模块,用于对多个轮廓点中满足相邻条件的两个轮廓点进行连接,获得至少一个 轮廓线段; 线段扩展模块,用于基于线条宽度,确定轮廓线段对应的扩展线段, 以获得至少一个轮廓 线段分别对应的扩展线段; 端点确定模块,用于利用至少一个轮廓线段分别对应的扩展线段,确定扩展线段的两端端 点为两个扩展点, 以获得至少一个扩展线段的扩展点构成的多个扩展点; 顶点确定模块, 用于将多个轮廓点以及多个扩展点去重处理后获得多个顶点。 在一种可能的设计中, 线段扩展模块, 包括: 尾点检测子单元, 用于检测轮廓线段对应的两个顶点是否包括尾点; 第一处理子单元,用于若包括尾点,则对两个顶点的非尾点按照线条宽度做垂直于轮廓线 段的垂线,并确定垂线的另一端点为轮廓线段对应的扩展点;确定扩展点与尾点连接形成的线 段为轮廓线段对应的扩展线段; 第二处理子单元,用于若不包括尾点,则对轮廓线段的两个轮廓点分别按照线条宽度做垂 直于轮廓线段的垂线, 确定两条垂线分别对应的另外两个端点形成的线段为扩展线段。 作为又一个实施例, 曲线生成单元, 包括: 线段确定模块, 用于确定多个顶点对应的多个线段; 交点确定模块, 用于对多个线段中满足线段相交条件的任意两个线段进行线段交点计算, 获得多个线段中至少一个线段组分别对应的交点; 曲线平滑模块,用于基于任一个线段组,对线段组的两个线段以及其交点进行交点平滑处 理, 获得线段组对应的平滑曲线; 属性设置模块,用于对线段组的平滑曲线进行线段属性设置,以获得属性设置结束的至少 一个线段组各自的纹理曲线。 在某些实施例中, 属性设置模块, 包括: 属性设置子模块, 用于对线段组的平滑曲线的颜色属性和 /或宽度属性进行设置, 获得属 性设置结束的至少一个线段组各自的纹理曲线。 在一种可能的设计中, 特效生成单元, 包括: 线条确定模块,用于将至少一个纹理曲线映射至线条框模型中,获得对象轮廓对应的曲线 线条框; 渲染设置模块, 用于为曲线线条框对应的线条框区域设置渲染属性, 获得特效线条框。 在一种可能的设计中, 线条映射单元, 包括: 第一位置模块, 用于确定多个轮廓点在待处理图像中分别对应的图像位置; 第二位置模块, 用于确定多个轮廓点在特效线条框中分别对应的线框位置; 位置匹配模块,用于将多个轮廓点分别对应的线框位置与图像位置进行位置匹配,获得多 个轮廓点的位置匹配关系; 位置映射模块, 用于基于多个轮廓点的位置匹配关系, 将特效线条框映射至待处理图像 中, 获得特效线条框映射结束时待处理图像对应的目标图像。 在某些实施例中, 线条映射单元, 还包括: 位置修正模块,用于对目标图像中特效线条框进行位置修正处理,获得修正处理后的目标 图像。 在一种可能的设计中, 该装置还包括: 请求接收单元,用于在用户设备播放目标视频的过程中,接收用户设备针对目标视频发送 的线条特效处理请求; 请求响应单元, 用于响应于线条特效处理请求, 获取发起线条特效处理请求的时间戳; 图像获取单元, 用于基于时间戳, 从目标视频中按照采集频率采集对应的待处理图像; 图像渲染单元,用于检测用户设备播放至待处理图像时,按照特效线条框对应的渲染属性 渲染特效线条框对应的目标图像; 图像显示单元, 用于控制用户设备展示渲染完成的目标图像。 本实施例提供的装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类 似, 本实施例此处不再赘述。 为了实现上述实施例, 本公开实施例还提供了一种电子设备。 参考图 7, 其示出了适于用来实现本公开实施例的电子设备 700的结构示意图,该电子设 备 700可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电 脑、 数字广播接收器、 个人数字助理 (Personal Digital Assistant, PDA) 、 平板电脑 (Portable Android Device, PAD)、便携式多媒体播放器 (Portable MediaPlayer, PMP)、 车载终端 (例 如, 车载导航终端)等等的移动终端以及诸如数字 TV、 台式计算机等等的固定终端。 图 7示 出的电子设备仅仅是一个示例, 不应对本公开实施例的功能和使用范围带来任何限制。 如图 7所示, 电子设备 700可以包括处理装置 (例如, 中央处理器、图形处理器等 ) 701 , 其可以根据存储在只读存储器 (Read Only Memory, ROM) 702中的程序或者从存储装置 708 加载到随机访问存储器 (Random Access Memory, RAM) 703中的程序而执行各种适当的动 作和处理。 在 RAM 703 中, 还存储有电子设备 700操作所需的各种程序和数据。 处理装置 701、 ROM 702以及 RAM 703通过总线 704彼此相连。 输入 /输出 (Input/Output, I/O) 接口 705也连接至总线 704 o 通常, 以下装置可以连接至 I/O接口 705: 包括例如触摸屏、 触摸板、 键盘、 鼠标、 摄像 头、麦克风、加速度计、陀螺仪等的输入装置 706;包括例如液晶显示器 (Liquid Crystal Display, LCD) 、 扬声器、 振动器等的输出装置 707; 包括例如磁带、 硬盘等的存储装置 708; 以及通 信装置 709 o 通信装置 709可以允许电子设备 700与其他设备进行无线或有线通信以交换数 据。 虽然图 7示出了具有各种装置的电子设备 700, 但是应理解的是, 并不要求实施或具备所 有示出的装置。 可以替代地实施或具备更多或更少的装置。 特别地, 根据本公开的实施例, 上文参考流程图描述的过程可以被实现为计算机软件程 序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算 机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计 算机程序可以通过通信装置 709从网络上被下载和安装, 或者从存储装置 708被安装, 或者
Figure imgf000013_0001
磁盘、硬盘、随机访问存储器 (RAM)、只读存储器 (ROM)、可擦式可编程只读存储器 (Erasable Programmable Read-Only Memory , EPROM或闪存) 、 光纤、 便携式紧凑磁盘只读存储器 ( Compact Disc Read-Only Memory , CD-ROM)、 光存储器件、 磁存储器件、 或者上述的任意 合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程 序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信 号介质可以包括在基带中或者作为载波一部分传播的数据信号, 其中承载了计算机可读的程 序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任 意合适的组合。 计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介 质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用 或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包 括但不限于: 电线、 光缆、 射频 (Radio Frequency, RF)等等, 或者上述的任意合适的组合。 上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该 电子设备中。 上述计算机可读介质承载有一个或者多个程序, 当上述一个或者多个程序被该电子设备 执行时, 使得该电子设备执行上述实施例所示的方法。 可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代 码, 上述程序设计语言包括面向对象的程序设计语言一诸如 Java、 Smalltalk, C++, 还包括常 规的过程式程序设计语言一诸如 “C”语言或类似的程序设计语言。程序代码可以完全地在用 户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算 机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的 情形中, 远程计算机可以通过任意种类的网络 -包括局域网 (Local Area Network, LAN) 或广域网 (Wide Area Network, WAN) 一连接到用户计算机, 或者, 可以连接到外部计算机 (例如利用因特网服务提供商来通过因特网连接) 。 附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的 可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、 程序段、或代码的一部分, 该模块、程序段、或代码的一部分包含一个或多个用于实现规定的 逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以 以不同于附图中所标注的顺序发生。 例如, 两个接连地表示的方框实际上可以基本并行地执 行, 它们有时也可以按相反的顺序执行, 这依所涉及的功能而定。 也要注意的是, 框图和 /或 流程图中的每个方框、 以及框图和 /或流程图中的方框的组合, 可以用执行规定的功能或操作 的专用的基于硬件的系统来实现, 或者可以用专用硬件与计算机指令的组合来实现。 描述于本公开实施例中所涉及到的单元可以通过软件的方式实现, 也可以通过硬件的方 式来实现。其中, 单元的名称在某种情况下并不构成对该单元本身的限定, 例如, 第一获取单 元还可以被描述为 “获取至少两个网际协议地址的单元” 。 本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制 性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列 (Field Programmable Gate Array, FPGA) 、 专用集成电路 (Application Specific Integrated Circuit, ASIC) 、 专用标准产 品 (Application Specific Standard Product, ASSP) 、 片上系统 (System on Chip, SOC) 、 复杂 可编程逻辑设备 ( Complex Programmable Logic Device, CPLD )等等。 在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行 系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以 是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、 光学的、 电磁的、 红外的、 或半导体系统、 装置或设备, 或者上述内容的任何合适组合。机器 可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随 机存取存储器 (RAM)、 只读存储器 (ROM)、可擦除可编程只读存储器 (EPROM或快闪存 储器) 、 光纤、 便捷式紧凑盘只读存储器 (CD-ROM)、 光学储存设备、 磁储存设备、 或上述 内容的任何合适组合。 第一方面, 根据本公开的一个或多个实施例, 提供了一种线条特效处理方法, 包括: 采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点; 对多个轮廓点进行点扩展处理, 获得多个顶点; 基于多个顶点, 生成相邻的两两顶点对应纹理曲线, 获得至少一个纹理曲线; 利用至少一个纹理曲线, 生成特效线条框; 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图像。 根据本公开的一个或多个实施例,对多个轮廓点进行点扩展处理,获得多个顶点,包括: 对多个轮廓点中满足相邻条件的两个轮廓点进行连接, 获得至少一个轮廓线段; 基于线条宽度,确定轮廓线段对应的扩展线段,以获得至少一个轮廓线段分别对应的扩展 线段; 利用至少一个轮廓线段分别对应的扩展线段,确定扩展线段的两端端点为两个扩展点,以 获得至少一个扩展线段的扩展点构成的多个扩展点; 将多个轮廓点以及多个扩展点去重处理后获得多个顶点。 根据本公开的一个或多个实施例,基于线条宽度,确定轮廓线段对应的扩展线段,包括: 检测轮廓线段对应的两个顶点是否包括尾点; 若包括尾点,则对两个顶点的非尾点按照线条宽度做垂直于轮廓线段的垂线,并获得垂线 另一端为轮廓线段对应的扩展点; 确定扩展点与尾点连接形成的线段为轮廓线段对应的扩展线段; 若不包括尾点, 则对轮廓线段的两个轮廓点分别按照线条宽度做垂直于轮廓线段的垂线, 获得两条垂线分别对应的另外两个端点形成的线段为扩展线段。 根据本公开的一个或多个实施例,基于多个顶点,生成两两顶点对应的纹理曲线,获得多 个纹理曲线, 包括: 确定多个顶点对应的多个线段; 对多个线段中满足线段相交条件的任意两个线段进行线段交点计算, 获得多个线段中至 少一个线段组分别对应的交点; 基于任一个线段组,对线段组的两个线段以及其交点进行交点平滑处理,获得线段组对应 的平滑曲线, 以获得至少一线段组分别对应的平滑曲线; 对至少一个线段组分别对应的平滑曲线进行线段属性设置, 以获得属性设置结束的至少 一个纹理曲线。 根据本公开的一个或多个实施例, 对至少一个线段组分别对应的平滑曲线进行线段属性 设置, 以获得属性设置结束的至少一个纹理曲线, 包括: 确定至少一个线段组分别对应的平滑曲线, 获得至少一个平滑曲线; 依次对至少一个平滑曲线的颜色属性和 /或宽度属性进行设置, 获得属性设置结束的至少 一个纹理曲线。 根据本公开的一个或多个实施例, 利用至少一个纹理曲线, 生成特效线条框, 包括: 将至少一个纹理曲线映射至线条框模型中, 获得对象轮廓对应的曲线线条框; 为曲线线条框对应的线条框区域设置渲染属性, 获得特效线条框。 根据本公开的一个或多个实施例,将特效线条框映射至待处理图像,获得待处理图像对应 的目标图像, 包括: 确定多个轮廓点在待处理图像中分别对应的图像位置; 确定多个轮廓点在特效线条框中分别对应的线框位置; 将多个轮廓点分别对应的线框位置与图像位置进行位置匹配, 获得多个轮廓点的位置匹 配关系; 基于多个轮廓点的位置匹配关系,将特效线条框映射至待处理图像中,获得特效线条框映 射结束时待处理图像对应的目标图像。 根据本公开的一个或多个实施例, 获得特效线条框映射结束时待处理图像对应的目标图 像之后, 还包括: 对目标图像中特效线条框进行位置修正处理, 获得修正处理后的目标图像。 根据本公开的一个或多个实施例, 采集待处理图像中目标对象的对象轮廓所形成的多个 轮廓点之前, 还包括: 在用户设备播放目标视频的过程中, 接收用户设备针对目标视频发送的线条特效处理请 求; 响应于线条特效处理请求, 获取发起线条特效处理请求的时间戳; 基于时间戳, 从目标视频中按照采集频率采集对应的待处理图像; 将特效线条框映射至待处理图像, 获得待处理图像对应的目标图像, 之后还包括: 检测用户设备播放至待处理图像时, 按照特效线条框对应的渲染属性渲染特效线条框对 应的目标图像; 控制用户设备展示渲染完成的目标图像。 第二方面, 根据本公开的一个或多个实施例, 提供了一种线条特效处理装置, 包括: 轮廓采集单元, 用于采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点; 顶点扩展单元, 用于对多个轮廓点进行点扩展处理, 获得多个顶点; 曲线生成单元,用于基于多个顶点,生成相邻的两两顶点对应纹理曲线,获得至少一个纹 理曲线; 特效生成单元, 用于利用至少一个纹理曲线, 生成特效线条框; 线条映射单元,用于将特效线条框映射至待处理图像,获得待处理图像对应的目标图像。 第三方面, 根据本公开的一个或多个实施例, 提供了一种电子设备, 包括: 至少一个处理 器和存储器; 存储器存储计算机执行指令; 至少一个处理器执行存储器存储的计算机执行指令, 使得至少一个处理器执行如上第一 方面以及第一方面各种可能的设计的线条特效处理方法。 第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,计算机可 读存储介质中存储有计算机执行指令,当处理器执行计算机执行指令时,实现如上第一方面以 及第一方面各种可能的设计的线条特效处理方法。 第五方面,根据本公开的一个或多个实施例,提供了一种计算机程序产品,包括计算机程 序, 计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计的线条特效 处理方法。 第六方面,本公开实施例提供一种计算机程序,所述计算机程序在被处理器执行时实现如 上第一方面以及第一方面各种可能的设计的线条特效处理方法。 以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。 本领域技术人员应当 理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案, 同时 也应涵盖在不脱离上述公开构思的情况下, 由上述技术特征或其等同特征进行任意组合而形 成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进 行互相替换而形成的技术方案。 此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特 定次序或以顺序次序执行来执行。在一定环境下, 多任务和并行处理可能是有利的。同样地, 虽然在上面论述中包含了若干具体实现细节, 但是这些不应当被解释为对本公开的范围的限 制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地, 在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在 多个实施例中。 尽管巳经采用特定于结构特征和 /或方法逻辑动作的语言描述了本主题, 但是应当理解所 附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特 定特征和动作仅仅是实现权利要求书的示例形式。

Claims

权 利 要 求 书
1、 一种线条特效处理方法, 包括: 采集待处理 图像中目标对象的对象轮廓所形成的多个轮廓点; 对多个所述轮廓 点进行点扩展处理, 获得多个顶点; 基于 多个所述顶点中两两相邻的顶点, 生成至少一个纹理曲线; 利用至少一个所述 纹理曲线, 生成特效线条框; 将所述特效线 条框映射至所述待处理图像, 获得所述待处理图像对应的目标图像。
2、 根据权利要求 1所述的方法, 其中, 所述对多个所述轮廓点进行点扩展处理, 获 得多个顶点, 包括: 对多个所述轮廓 点中满足相邻条件的两个轮廓点进行连接, 获得至少一个轮廓线段; 基于线条 宽度,确定所述轮廓线段对应的扩展线段, 以获得至少一个所述轮廓线段分 别对应的扩展线段; 利用 至少一个所述轮廓线段分别对应的扩展线段, 确定扩展线段的两端端点为两个 扩展点, 以获得至少一个所述扩展线段的扩展点构成的多个扩展点; 将多个所述轮廓 点以及多个所述扩展点去重处理, 以获得多个所述顶点。
3、 根据权利要求 2所述的方法, 其中, 所述基于线条宽度, 确定所述轮廓线段对应 的扩展线段, 包括: 检测所述轮廓线段 对应的两个顶点是否包括尾点; 若包括 尾点, 则对所述两个顶点的非尾点按照所述线条宽度做垂直于所述轮廓线段 的垂线,并确定所述垂线的另一端点为所述轮廓线段对应的扩展点;确定所述扩展点与所 述尾点连接形成的线段为所述轮廓线段对应的扩展线段; 若不包 括尾点, 则对所述轮廓线段的两个轮廓点分别按照所述线条宽度做垂直于所 述轮廓线段的垂线, 确定两条垂线分别对应的另外两个端点形成的线段为所述扩展线段。
4、 根据权利要求 1-3任一项所述的方法, 其中, 所述基于多个所述顶点中两两相邻 的顶点, 生成至少一个纹理曲线, 包括: 确定多个所述顶 点对应的多个线段; 对 多个所述线段中满足线段相交条件的任意两个线段进行线段交点计算 , 获得多个 所述线段中至少一个线段组分别对应的交点; 基于任一个线段 组,对所述线段组的两个线段以及其交点进行交点平滑处理,获得所 述线段组对应的平滑曲线; 对所述 线段组的平滑曲线进行线段属性设置, 以获得属性设置结束的至少一个所述 线段组各自的所述纹理曲线。
5、 根据权利要求 4所述的方法, 其中, 所述对所述线段组的平滑曲线进行线段属性 设置, 以获得属性设置结束的至少一个所述线段组各自的所述纹理曲线包括: 对所述线段 组的平滑曲线的颜色属性和 /或宽度属性进行设置, 获得属性设置结束的 至少一个所述线段组各自的纹理曲线。
6、 根据权利要求 1-5任一项所述的方法, 其中, 所述利用至少一个所述纹理曲线, 生成特效线条框, 包括: 将至少 一个所述纹理曲线映射至线条框模型中, 获得所述对象轮廓对应的曲线线条 框; 为所述 曲线线条框对应的线条框区域设置渲染属性, 获得所述特效线条框。
7、 根据权利要求 1-6任一项所述的方法, 其中, 所述将所述特效线条框映射至所述 待处理图像, 获得所述待处理图像对应的目标图像, 包括: 确定多个所述轮廓 点在所述待处理图像中分别对应的图像位置; 确定多个所述轮廓 点在所述特效线条框中分别对应的线框位置; 将 多个所述轮廓点分别对应的线框位置与图像位置进行位置匹配, 获得多个所述轮 廓点的位置匹配关系; 基于 多个所述轮廓点的位置匹配关系, 将所述特效线条框映射至所述待处理图像中, 获得所述特效线条框映射结束时所述待处理图像对应的 目标图像。
8、 根据权利要求 7所述的方法, 其中, 所述获得所述特效线条框映射结束时所述待 处理图像对应的目标图像之后, 还包括: 对所述 目标图像中所述特效线条框进行位置修正处理, 获得修正处理后的目标图像。
9、 根据权利要求 1-8任一项所述的方法, 其中, 所述采集待处理图像中目标对象的 对象轮廓所形成的多个轮廓点之前, 还包括: 在用户 设备播放目标视频的过程中, 接收所述用户设备针对所述目标视频发送的线 条特效处理请求; 响应于所述线条特 效处理请求, 获取发起所述线条特效处理请求的所述时间戳; 基于所述 时间戳, 从所述目标视频中按照采集频率采集对应的待处理图像; 所述将 所述特效线条框映射至所述待处理图像, 获得所述待处理图像对应的目标图 像之后, 还包括: 检测所 述用户设备播放至所述待处理图像时, 按照所述特效线条框对应的渲染属性 渲染所述特效线条框对应的所述目标图像; 控制所述用户 设备展示渲染完成的所述目标图像。
10、 一种线条特效处理装置, 包括: 轮廓采集单元 , 用于采集待处理图像中目标对象的对象轮廓所形成的多个轮廓点; 顶点扩展单元 , 用于对多个所述轮廓点进行点扩展处理, 获得多个顶点; 曲线生成单元,用于基于多个所述顶点中两两相邻的顶点,生成至少一个纹理曲线; 特效生成单元 , 用于利用至少一个所述纹理曲线, 生成特效线条框; 线条 映射单元,用于将所述特效线条框映射至所述待处理图像,获得所述待处理图像 对应的目标图像。
11、 一种电子设备, 其中, 包括: 处理器、 存储器; 所述存储器存储计 算机执行指令; 所述 处理器执行所述存储器存储的计算机执行指令, 使得所述处理器配置有如权利 要求 1-9任一项所述的线条特效处理方法。
12、一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令, 当处理器执行所述计算机执行指令时,实现如权利要求 1-9任一项所述的线条特效处理方 法。
13、 一种计算机程序产品, 包括计算机程序, 所述计算机程序被处理器执行, 以配置 有如权利要求 1・9任一项所述的线条特效处理方法。
14、一种计算机程序,所述计算机程序在被处理器执行时实现根据权利要求 1・9任一 项所述的线条特效处理方法。
18
PCT/SG2023/050130 2022-03-08 2023-03-03 线条特效处理方法、装置、电子设备、存储介质及产品 WO2023172195A2 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210220029.5A CN114596383A (zh) 2022-03-08 2022-03-08 线条特效处理方法、装置、电子设备、存储介质及产品
CN202210220029.5 2022-03-08

Publications (2)

Publication Number Publication Date
WO2023172195A2 true WO2023172195A2 (zh) 2023-09-14
WO2023172195A3 WO2023172195A3 (zh) 2023-11-16

Family

ID=81814780

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/SG2023/050130 WO2023172195A2 (zh) 2022-03-08 2023-03-03 线条特效处理方法、装置、电子设备、存储介质及产品

Country Status (2)

Country Link
CN (1) CN114596383A (zh)
WO (1) WO2023172195A2 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117315288A (zh) * 2023-11-28 2023-12-29 图兮数字科技(北京)有限公司 目标对象的轮廓确定方法、装置、电子设备及存储介质

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115358958A (zh) * 2022-08-26 2022-11-18 北京字跳网络技术有限公司 特效图生成方法、装置、设备及存储介质

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110070555A (zh) * 2018-10-19 2019-07-30 北京微播视界科技有限公司 图像处理方法、装置、硬件装置
CN110223218B (zh) * 2019-05-16 2024-01-12 北京达佳互联信息技术有限公司 人脸图像处理方法、装置、电子设备及存储介质
CN110782504A (zh) * 2019-09-16 2020-02-11 腾讯科技(深圳)有限公司 曲线确定方法、装置、计算机可读存储介质及设备
CN114125320B (zh) * 2021-08-31 2023-05-09 北京达佳互联信息技术有限公司 一种图像特效的生成方法及装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117315288A (zh) * 2023-11-28 2023-12-29 图兮数字科技(北京)有限公司 目标对象的轮廓确定方法、装置、电子设备及存储介质
CN117315288B (zh) * 2023-11-28 2024-02-13 图兮数字科技(北京)有限公司 目标对象的轮廓确定方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
WO2023172195A3 (zh) 2023-11-16
CN114596383A (zh) 2022-06-07

Similar Documents

Publication Publication Date Title
WO2023172195A2 (zh) 线条特效处理方法、装置、电子设备、存储介质及产品
US11776209B2 (en) Image processing method and apparatus, electronic device, and storage medium
WO2020248900A1 (zh) 全景视频的处理方法、装置及存储介质
JP7199527B2 (ja) 画像処理方法、装置、ハードウェア装置
WO2017088491A1 (zh) 一种视频的播放方法和装置
WO2021139382A1 (zh) 人脸图像的处理方法、装置、可读介质和电子设备
WO2022007565A1 (zh) 增强现实的图像处理方法、装置、电子设备及存储介质
WO2020140976A1 (zh) 图像获取方法、装置、点读设备、电子设备及存储介质
WO2021098361A1 (zh) 地形图编辑方法、装置、电子设备及计算机可读介质
WO2022132033A1 (zh) 基于增强现实的显示方法、装置、设备及存储介质
CN111292420A (zh) 用于构建地图的方法和装置
US20240168615A1 (en) Image display method and apparatus, device, and medium
WO2022028254A1 (zh) 定位模型优化方法、定位方法和定位设备
WO2023207522A1 (zh) 视频合成方法、装置、设备、介质及产品
WO2024051536A1 (zh) 直播特效渲染方法、装置、设备、可读存储介质及产品
WO2023143217A1 (zh) 特效道具的展示方法、装置、设备及存储介质
WO2024046284A1 (zh) 绘制动画生成方法、装置、设备、可读存储介质及产品
WO2022247630A1 (zh) 图像处理方法、装置、电子设备及存储介质
WO2020215789A1 (zh) 虚拟画笔实现方法、装置和计算机可读存储介质
US11494961B2 (en) Sticker generating method and apparatus, and medium and electronic device
WO2022141781A1 (zh) 一种播放全景视频的方法、系统、存储介质及播放设备
US20230267664A1 (en) Animation processing method and apparatus, electronic device and storage medium
WO2023109564A1 (zh) 视频图像处理方法、装置、电子设备及存储介质
CN110070617B (zh) 数据同步方法、装置、硬件装置
WO2023165390A1 (zh) 变焦特效的生成方法、装置、设备及存储介质