CN117726644A - Contour line drawing method, contour line drawing device, computer equipment and storage medium - Google Patents

Contour line drawing method, contour line drawing device, computer equipment and storage medium Download PDF

Info

Publication number
CN117726644A
CN117726644A CN202310715409.0A CN202310715409A CN117726644A CN 117726644 A CN117726644 A CN 117726644A CN 202310715409 A CN202310715409 A CN 202310715409A CN 117726644 A CN117726644 A CN 117726644A
Authority
CN
China
Prior art keywords
contour
image
processed
target object
contour line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310715409.0A
Other languages
Chinese (zh)
Inventor
袁知洪
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaohongshu Technology Co ltd
Original Assignee
Xiaohongshu Technology Co ltd
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 Xiaohongshu Technology Co ltd filed Critical Xiaohongshu Technology Co ltd
Priority to CN202310715409.0A priority Critical patent/CN117726644A/en
Publication of CN117726644A publication Critical patent/CN117726644A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The embodiment of the application discloses a contour line drawing method, a contour line drawing device, computer equipment and a storage medium; performing contour detection processing on a target object in an image to be processed to obtain object contour information of the target object; constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information; and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line. According to the method and the device for drawing the contour line, through contour detection processing, object contour information of a target object can be accurately extracted, then, a contour grid is constructed according to the contour information, then, contour line materials are rendered in the contour grid, and therefore, the contour line can be automatically drawn for the target object in an image to be processed, user participation is not needed in the drawing process of the contour line, the drawing difficulty of the contour line is reduced, and the drawing effect of the contour line is better due to the fact that the object contour information is accurately obtained.

Description

Contour line drawing method, contour line drawing device, computer equipment and storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, a computer device, and a storage medium for drawing an outline, where the storage medium is a computer readable storage medium.
Background
With the rapid development of internet technology and technology photography technology, people tend to replace text to share life, content or knowledge in an image and video mode, and also tend to mark images to increase the interestingness of the images, or highlight main content in the images, for example, a user can manually draw a contour curve for a target object or circle the target object by a square frame, and the modes all require manual processing of the user, so that the contour drawing difficulty is high and the drawing effect is poor.
Disclosure of Invention
The embodiment of the application provides a contour line drawing method, a contour line drawing device, computer equipment and a storage medium, and the contour line drawing method provided by the embodiment of the application comprises the following steps:
acquiring an image to be processed;
performing contour detection processing on a target object in the image to be processed to obtain object contour information of the target object;
constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information;
and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
Correspondingly, the embodiment of the application also provides a contour drawing device, which comprises:
an acquisition unit configured to acquire an image to be processed;
the detection unit is used for carrying out contour detection processing on the target object in the image to be processed to obtain object contour information of the target object;
a construction unit for constructing a contour grid describing a contour shape of the target object in the image to be processed according to the object contour information;
and the rendering unit is used for rendering the contour line materials in the contour grid to obtain a processed image of the target object drawn with the contour line.
In an embodiment, the object contour information comprises a plurality of contour points, and the construction unit comprises:
an expansion subunit, configured to expand each contour point in the object contour information to obtain an expanded contour point corresponding to each contour point;
and the first grid construction subunit is used for constructing a contour grid in the image to be processed according to the contour points in the object contour information and the extended contour points.
In one embodiment, the expansion subunit includes:
the proportion determining module is used for determining the image proportion of the image area containing the target object in the image to be processed;
the expansion information is determined, and is used for determining the expansion direction and the expansion distance of the contour points in the object contour information according to the image proportion;
and the contour point expansion is used for expanding each contour point in the object contour information according to the expansion direction and the expansion distance to obtain an expansion contour point corresponding to each contour point.
In an embodiment, the building unit comprises:
a size determining subunit, configured to determine a material size of the contour line material;
the segmentation subunit is used for carrying out segmentation processing on the object contour information according to the material size to obtain sub-object contour information corresponding to at least two segments of contours of the target object;
and the second grid construction subunit is used for constructing a corresponding contour network on the image to be processed according to the contour information of the sub-object corresponding to each section of contour.
In an embodiment, the detection unit includes:
the object detection subunit is used for carrying out object detection on the image to be processed and determining an image area where a target object in the image to be processed is located;
and the characteristic extraction subunit is used for extracting edge characteristics of the image area to obtain object contour information of the target object.
In an embodiment, the contour drawing device further includes:
the material acquisition unit is used for acquiring a target material unit;
and the material generating unit is used for generating the contour line material according to the target material unit.
In an embodiment, the rendering unit comprises:
a pixel value obtaining subunit, configured to obtain a pixel value corresponding to a pixel in the image to be processed;
a color determining subunit, configured to determine a rendering color of the contour line material according to a distribution feature of the pixel values;
and the image rendering subunit is used for rendering the contour line materials of the rendering colors in the contour grid to obtain the processed image containing the image content of the image to be processed and the contour line materials.
Correspondingly, the embodiment of the application also provides computer equipment, which comprises a memory and a processor; the memory stores a computer program, and the processor is configured to run the computer program in the memory, so as to execute any one of the contour drawing methods provided in the embodiments of the present application.
Accordingly, embodiments of the present application also provide a computer readable storage medium for storing a computer program loaded by a processor to perform any of the contour drawing methods provided by the embodiments of the present application.
The embodiment of the application obtains the image to be processed; performing contour detection processing on a target object in an image to be processed to obtain object contour information of the target object; constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information; and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
According to the method and the device for drawing the contour line, through contour detection processing, object contour information of a target object can be accurately extracted, then, a contour grid is constructed according to the contour information, then, contour line materials are rendered in the contour grid, and therefore, the contour line can be automatically drawn for the target object in an image to be processed, user participation is not needed in the drawing process of the contour line, the drawing difficulty of the contour line is reduced, and the drawing effect of the contour line is better due to the fact that the object contour information is accurately obtained.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a contour drawing method provided in an embodiment of the present application;
FIG. 2 is a schematic image to be processed provided in an embodiment of the present application;
FIG. 3 is a schematic diagram of a profile grid provided by an embodiment of the present application;
fig. 4 is a schematic diagram of a contour line material provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a profile grid provided by an embodiment of the present application;
FIG. 6 is a schematic processed image provided by an embodiment of the present application;
fig. 7 is a schematic diagram of a contour drawing apparatus provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The embodiment of the application provides a contour line drawing method, a contour line drawing device, computer equipment and a computer readable storage medium. The contour drawing device may be integrated in a computer device, which may be a server or a terminal.
The terminal may include a mobile phone, a wearable intelligent device, a tablet computer, a notebook computer, a personal computer (PC, personal Computer), a car-mounted computer, and the like.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described from the viewpoint of a contour drawing apparatus, which may be integrated in a computer device, which may be a server or a terminal or the like.
The specific flow of the contour line drawing method provided in the embodiment of the present application, as shown in fig. 1, may be as follows:
101. and acquiring an image to be processed.
Wherein the image to be processed includes an image in which a contour line needs to be drawn for an object specified in the image.
The user can upload the image needing to draw the contour line through the client, and the terminal can respond to the uploading operation of the user to acquire the image uploaded by the user, so as to obtain the image to be processed.
102. And carrying out contour detection processing on the target object in the image to be processed to obtain object contour information of the target object.
Wherein the target object may comprise a person, an animal, an insect, an article, or the like.
The object contour information includes information indicating contour characteristics of the object, for example, contour curves, contour points, and the like.
For example, the image to be processed may be input into a neural network model, contour detection processing is performed on the target object in the image to be processed by the neural network model, and object contour information of the target object is output.
Optionally, the contour detection processing may include a processing procedure of detecting a position of the target object and extracting a contour feature of the target object, that is, in an embodiment, the step of performing contour detection on the target object in the image to be processed to obtain object contour information of the target object may specifically include:
object detection is carried out on the image to be processed, and an image area where a target object in the image to be processed is located is determined;
and extracting edge characteristics of the image area to obtain object contour information of the target object.
Among them, object detection may include a manner in which a specified object can be detected from an image, such as target detection, pedestrian detection, human body posture estimation, and general human body detection based on a Convolutional Neural Network (CNN), and the like.
Edge feature extraction may include edge detection (e.g., canny operator and Sobel operator, etc.), shape detection, etc. in a manner that enables edge features of a target object to be extracted.
Optionally, after determining the area where the target object is located, mask processing may be performed on the image to be processed to reduce image noise, and the step of improving accuracy of edge feature extraction "performing edge feature extraction on the image area to obtain object profile information of the target object" may specifically include:
performing first mask processing on an image area where a target object in the image to be processed is located, and performing second mask processing on other image areas except the image area in the image to be processed to obtain a masked image;
and extracting edge characteristics of the image after masking to obtain object contour information of the target object.
For example, as shown in fig. 2, the image to be processed is a person in fig. 2, masking is performed on the image to be processed to obtain a masked image as shown in fig. 3, and as can be seen from fig. 3, the image area where the person is located and other areas are set with different colors to distinguish the two image areas, so that noise interference is reduced, and the contour information of the target object can be accurately mentioned.
103. And constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information.
Wherein the contour mesh is a mesh representing the contour shape of the target object, the mesh (mesh) may also be referred to as a mesh model. In computer graphics, mesh refers to a two-dimensional surface consisting of vertices, edges, and faces. It is commonly used to represent the shape of a three-dimensional object surface.
mesh is widely used in computer animation and game development, such as 3D modeling software, game engines, renderers, and the like. mesh allows editing, deforming, texture rendering, etc. of the three-dimensional model to achieve high quality three-dimensional scene presentation.
In computer graphics, mesh (grid) refers to a two-dimensional surface consisting of vertices, edges, and faces, commonly used to represent the shape of a three-dimensional object surface. Specifically, mesh creates a shape on a plane by connecting a series of points and lines, the points being called vertices, a line segment connecting the two vertices being called edges, and a plane area connected by the edges being called a face. A mesh may contain millions of vertices and millions of faces, thereby presenting a highly accurate three-dimensional model. mesh has wide application, such as 3D modeling software, game engines, renderers, etc., allowing editing, morphing, texture rendering, etc., of three-dimensional models to achieve high quality three-dimensional scene presentation.
In the embodiment of the application, the contour grid is a grid constructed based on contour point connection of the target object, and the effect of drawing the contour line for the target object can be obtained by rendering the contour grid.
For example, the object contour information may include contour points of the target object, the contour points are connected to form faces, and a contour grid describing a contour shape of the target object may be obtained from the formed faces. A schematic diagram of the contour grid may be as shown in fig. 4.
If the contour information of the object is a contour line, the contour line can be sampled to obtain contour points, and then a contour grid is generated according to the contour points.
Alternatively, in order to draw a smooth contour curve, curve fitting may be performed on the contour points to obtain smooth contour points.
The types of contour line materials filled into the finger contour grids are different, for example, a dotted contour can be drawn for a target object, a contour small flower contour, a panda contour and the like can be drawn for the target object, and then a contour grid with larger width is needed, so in order to improve the usability of the constructed contour grid, contour points can be expanded to increase the area of a contour network, that is, in an embodiment, the object contour information comprises a plurality of contour points, and the step of constructing a contour grid describing the contour shape of the target object in a to-be-processed image according to the object contour information can specifically include:
expanding each contour point in the object contour information to obtain an expanded contour point corresponding to each contour point;
and constructing a contour grid in the image to be processed according to the contour points in the contour information of the object and the extended contour points.
For example, the profile point may be moved to the left and right by a certain distance to obtain two extended profile points, specifically, the coordinates (u, v) of the profile point may be determined, and assuming that the moving distance is d, the coordinates of the obtained extended profile points are (u-4, v) and (u+4, v), respectively.
Alternatively, the contour point may be moved inward and outward by a certain distance to obtain two extended contour points, where the inward direction may be a direction from the contour point to the center point of the target object, and the outward direction may be a direction from the center point of the target object to the contour point.
Alternatively, the expansion may be performed in only one direction, or may be performed in multiple directions, for example, expansion may be performed only to the left, expansion may be performed only to the inside, the expansion direction and expansion distance may be preset, or the expansion direction and expansion distance may be automatically selected according to the feature of the image to be processed, that is, in an embodiment, the step of expanding each contour point in the object contour information to obtain an expanded contour point corresponding to each contour point may specifically include:
determining the image proportion of an image area containing a target object in an image to be processed;
determining the expansion direction and the expansion distance of the contour points in the contour information of the object according to the image proportion;
and expanding each contour point in the object contour information according to the expansion direction and the expansion distance to obtain an expansion contour point corresponding to each contour point.
The expansion distance is the distance between the expansion contour point and the contour point, and the expansion direction refers to the direction between the expansion contour point and the contour point.
For example, the area of the image to be processed can be calculated, the surface of the image area containing the target object can be calculated, and the image proportion of the image area containing the target object can be obtained according to the ratio of the surface of the image area containing the target object to the area of the processed image; alternatively, the image proportion of the image region containing the target object may also be determined from the pixel data.
The smaller the image proportion is, the smaller the image area occupied by the target object in the image to be processed is, when the target object is smaller, the contour line can be selected to be expanded outwards and the expansion distance is smaller in order to avoid that the drawn contour line shields the target object or the existence sense of the contour line is too strong for the target object.
For example, a scale threshold may be set, when the image scale is less than the scale threshold, the expansion direction is outward, the expansion distance is a, and when the image scale is greater than or equal to the scale threshold, the expansion direction may include inward and outward, and expansion is b, where b > a.
Optionally, a mapping relationship between the extended distance and the image scale may also be set to determine the extended distance according to the image scale, for example, d=kp, where D is the extended distance, P is the image scale, and k is a coefficient.
In different images, the objects to be drawn with contour lines have different sizes, the contour line lengths are different, if the lengths of the contour line materials are smaller than the contour line lengths, the contour line materials need to be stretched, so that the contour grid can be completely filled with the contour line materials, and then the contour line materials are stretched, which can lead to deformation of the contour line materials and poor contour line drawing effect, in an embodiment, the contour of the target object can be subjected to segmentation processing, namely, the step of constructing the contour grid describing the contour shape of the target object in the image to be processed according to the contour information of the object, specifically, the method comprises the following steps:
determining the material size of the contour line material;
carrying out segmentation processing on the object contour information according to the material size to obtain sub-object contour information corresponding to at least two sections of contours of the target object;
and constructing a corresponding contour network on the image to be processed according to the contour information of the sub-object corresponding to each section of contour.
The contour line material is a material used in rendering a finger contour grid to achieve the effect of drawing a contour line on a target object, and the contour line material may be in the form of an image or the like, for example, the contour line material may be as shown in fig. 5.
For example, the length of the contour line material is determined, and the object contour information is segmented according to the length of the contour line material so as to divide the object contour information into at least two parts of sub-object contour information, wherein each part of sub-object contour information can comprise a contour point corresponding to a section of contour, and the length of each section of contour is smaller than or equal to the length of the contour line material.
According to the sub-object contour information of each section of contour, a contour grid corresponding to each section of contour can be constructed.
104. And rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
After the contour grid is built, the contour line material can be rendered into the contour grid to obtain a processed image, contour lines corresponding to the contour line material are drawn on the target object in the processed image, and fig. 6 is the processed image obtained by drawing the contour lines on the target object in fig. 2.
The color of the drawn contour line may be preset or determined according to the color selected by the user, and in addition, the color of the contour line may be determined according to the color distribution feature characteristics in the image to be processed, that is, in an embodiment, the step of rendering the contour line material in the contour grid to obtain a processed image including the image content of the image to be processed and the contour line material may specifically include:
acquiring a pixel value corresponding to a pixel in an image to be processed;
determining the rendering color of the contour line material according to the distribution characteristics of the pixel values;
rendering the contour line material of the rendering color in the contour grid to obtain a processed image containing the image content of the image to be processed and the contour line material.
For example, the pixel values of the pixels in the image to be processed can be obtained, the pixel values are counted, the pixel value distribution characteristics of the image to be processed are determined, the color with high contrast with the image to be processed can be selected as the color of the rendering contour line material according to the distribution characteristics of the pixel values, and the color which is relatively similar to the color of the image to be processed can be selected as the color of the rendering contour line material, so that the colors in the processed image are relatively coordinated.
Optionally, the rendering color may also be determined according to the distribution characteristics of the image region in which the included target object is located.
Then, the contour line material matched with the rendering color is rendered in the contour grid according to the rendering color.
The contour line material may be preset, for example, a plurality of contour line materials may be preset for a user to select, and the user may select a contour line for drawing the target object.
The contour line material may also be generated according to a material unit, for example, a user may upload a material unit that the user wants to generate the contour line material, and synthesize the contour line material according to the user material unit, that is, in an embodiment, before the step of rendering the contour line material in the contour grid to obtain the processed image including the image content of the image to be processed and the contour line material, the contour line drawing method provided in the embodiment of the present application may specifically further include:
acquiring a target material unit;
and generating contour line materials according to the target material units.
The target material unit may be a unit for combining into a contour line material, for example, may be a dot, a segment, a floret, two pandas, or the like, and the target material unit may be a preset material unit or a material unit uploaded by a user.
And splicing the target material units to obtain the contour line material.
In an embodiment, candidate material images including target material units may be acquired, the target material units are extracted from the candidate material images, and then the target material units are arranged at a certain pitch to obtain the contour line material.
For example, a user can upload a picture including pandas, a terminal or a server performs a matting process on the picture, a panda is scratched out of the picture, then the pandas are arranged at a certain interval, a contour line material can be obtained, the contour line material is rendered into a contour grid, and a panda ring contour can be drawn for a target object.
As can be seen from the above, the embodiment of the present application obtains the image to be processed; performing contour detection processing on a target object in an image to be processed to obtain object contour information of the target object; constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information; and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
According to the method and the device for drawing the contour line, through contour detection processing, object contour information of a target object can be accurately extracted, then, a contour grid is constructed according to the contour information, then, contour line materials are rendered in the contour grid, and therefore, the contour line can be automatically drawn for the target object in an image to be processed, user participation is not needed in the drawing process of the contour line, the drawing difficulty of the contour line is reduced, and the drawing effect of the contour line is better due to the fact that the object contour information is accurately obtained.
In order to facilitate better implementation of the contour line drawing method provided in the embodiments of the present application, in an embodiment, a contour line drawing device is also provided. Where the meaning of a noun is the same as in the above-described outline drawing method, specific implementation details may be referred to in the description of the method embodiment.
The contour drawing apparatus may be integrated in a computer device, as shown in fig. 7, and may include: the acquisition unit 301, the detection unit 302, the construction unit 303, and the rendering unit 304 are specifically as follows:
(1) The acquisition unit 301: for acquiring an image to be processed.
(2) The detection unit 302: and the contour detection processing is used for carrying out contour detection processing on the target object in the image to be processed to obtain object contour information of the target object.
In one embodiment, the detection unit 302 includes:
object detection subunit: the method comprises the steps of performing object detection on an image to be processed, and determining an image area where a target object in the image to be processed is located;
feature extraction subunit: and the method is used for extracting edge characteristics of the image area to obtain object contour information of the target object.
(3) The construction unit 303: for constructing a contour grid describing the contour shape of the target object in the image to be processed based on the object contour information.
In an embodiment, the object contour information comprises a plurality of contour points, the construction unit 303 comprises:
expansion subunit: the method comprises the steps of expanding each contour point in object contour information to obtain an expanded contour point corresponding to each contour point;
first mesh construction subunit: the contour grid is used for constructing the contour grid in the image to be processed according to the contour points in the contour information of the object and the extended contour points.
In one embodiment, an expansion subunit comprises:
the proportion determining module: the method comprises the steps of determining an image proportion of an image area containing a target object in an image to be processed;
and (3) determining expansion information: the method comprises the steps of determining the expansion direction and the expansion distance of contour points in object contour information according to image proportions;
contour point expansion: and the expansion device is used for expanding each contour point in the object contour information according to the expansion direction and the expansion distance to obtain an expansion contour point corresponding to each contour point.
In an embodiment, the building unit comprises:
sizing subunit: the method comprises the steps of determining a material size of a contour line material;
segmentation subunit: the method comprises the steps of carrying out segmentation processing on object contour information according to the size of a material to obtain sub-object contour information corresponding to at least two sections of contours of a target object;
second mesh construction subunit: and the contour network is used for constructing a corresponding contour network on the image to be processed according to the contour information of the sub-object corresponding to each section of contour.
(4) Rendering unit 304: and the processing module is used for rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
In an embodiment, the rendering unit 304 includes:
a pixel value acquisition subunit: the method comprises the steps of acquiring pixel values corresponding to pixels in an image to be processed;
color determination subunit: the method comprises the steps of determining a rendering color of a contour line material according to a distribution characteristic of pixel values;
an image rendering subunit: and the contour line material is used for rendering the rendering color in the contour grid to obtain a processed image containing the image content of the image to be processed and the contour line material.
In an embodiment, the contour drawing apparatus further includes:
a material acquisition unit: the method comprises the steps of acquiring a target material unit;
a material generation unit: for generating contour line material from the target material unit.
As can be seen from the above, the contour drawing device in the embodiment of the present application acquires the image to be processed through the acquiring unit 301; the detection unit 302 performs contour detection processing on a target object in the image to be processed to obtain object contour information of the target object; the construction unit 303 constructs a contour mesh describing the contour shape of the target object in the image to be processed, based on the object contour information; the rendering unit 304 renders the contour line material in the contour grid, resulting in a processed image in which the target object is drawn with a contour line.
According to the method and the device for drawing the contour line, through contour detection processing, object contour information of a target object can be accurately extracted, then, a contour grid is constructed according to the contour information, then, contour line materials are rendered in the contour grid, and therefore, the contour line can be automatically drawn for the target object in an image to be processed, user participation is not needed in the drawing process of the contour line, the drawing difficulty of the contour line is reduced, and the drawing effect of the contour line is better due to the fact that the object contour information is accurately obtained.
The embodiment of the present application further provides a computer device, which may be a terminal or a server, as shown in fig. 8, and shows a schematic structural diagram of the computer device according to the embodiment of the present application, specifically:
the computer device may include one or more processors 1001 of a processing core, one or more memories 1002 of a computer readable storage medium, a power supply 1003, and an input unit 1004, among other components. Those skilled in the art will appreciate that the computer device structure shown in FIG. 8 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components. Wherein:
the processor 1001 is a control center of the computer device, connects respective portions of the entire computer device using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 1002 and calling data stored in the memory 1002, thereby performing overall monitoring of the computer device. Optionally, the processor 1001 may include one or more processing cores; preferably, the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, a computer program, and the like, and the modem processor mainly processes wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 1001.
The memory 1002 may be used to store software programs and modules, and the processor 1001 executes various functional applications and data processing by executing the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a stored program area that may store an operating system, computer programs required for at least one function (such as a sound playing function, an image playing function, etc.), and a stored data area; the storage data area may store data created according to the use of the computer device, etc. In addition, memory 1002 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
The computer device also includes a power supply 1003 for powering the various components, preferably, the power supply 1003 is logically connected to the processor 1001 by a power management system, such that charge, discharge, and power consumption management functions are performed by the power management system. The power supply 1003 may also include one or more of any of a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
The computer device may also include an input unit 1004, which input unit 1004 may be used to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit or the like, which is not described herein. In particular, in this embodiment, the processor 1001 in the computer device loads executable files corresponding to the processes of one or more computer programs into the memory 1002 according to the following instructions, and the processor 1001 executes the computer programs stored in the memory 1002, so as to implement various functions, as follows:
acquiring an image to be processed;
performing contour detection processing on a target object in an image to be processed to obtain object contour information of the target object;
constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information;
and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
The specific implementation of each operation may be referred to the previous embodiments, and will not be described herein.
As can be seen from the above, the computer device in the embodiment of the present application may obtain an image to be processed; performing contour detection processing on a target object in an image to be processed to obtain object contour information of the target object; constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information; and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
According to the method and the device for drawing the contour line, through contour detection processing, object contour information of a target object can be accurately extracted, then, a contour grid is constructed according to the contour information, then, contour line materials are rendered in the contour grid, and therefore, the contour line can be automatically drawn for the target object in an image to be processed, user participation is not needed in the drawing process of the contour line, the drawing difficulty of the contour line is reduced, and the drawing effect of the contour line is better due to the fact that the object contour information is accurately obtained.
According to one aspect of the present application, there is provided a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the methods provided in the various alternative implementations of the above embodiments.
It will be appreciated by those of ordinary skill in the art that all or part of the steps of the various methods of the above embodiments may be performed by a computer program, or by computer program control related hardware, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present embodiments provide a computer readable storage medium in which a computer program is stored, the computer program being capable of being loaded by a processor to perform any of the contour drawing methods provided by the embodiments of the present application.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the computer-readable storage medium may comprise: read Only Memory (ROM), random access Memory (RAM, random Access Memory), magnetic or optical disk, and the like.
Since the computer program stored in the computer readable storage medium can execute any one of the contour line drawing methods provided in the embodiments of the present application, the beneficial effects that any one of the contour line drawing methods provided in the embodiments of the present application can achieve can be achieved, which are detailed in the previous embodiments and are not described herein.
The foregoing has described in detail the methods, apparatuses, computer devices and computer readable storage medium for contour drawing according to the embodiments of the present application, and specific examples have been applied to illustrate the principles and embodiments of the present application, where the foregoing examples are provided to assist in understanding the methods and core ideas of the present application; meanwhile, those skilled in the art will have variations in the specific embodiments and application scope in light of the ideas of the present application, and the present description should not be construed as limiting the present application in view of the above.

Claims (10)

1. A contour drawing method, characterized by comprising:
acquiring an image to be processed;
performing contour detection processing on a target object in the image to be processed to obtain object contour information of the target object;
constructing a contour grid describing the contour shape of the target object in the image to be processed according to the object contour information;
and rendering the contour line material in the contour grid to obtain a processed image of the target object drawn with the contour line.
2. The method according to claim 1, wherein the object contour information comprises a plurality of contour points, the constructing a contour grid describing a contour shape of the target object in the image to be processed from the object contour information comprising:
expanding each contour point in the object contour information to obtain an expanded contour point corresponding to each contour point;
and constructing a contour grid in the image to be processed according to the contour points in the object contour information and the extended contour points.
3. The method according to claim 2, wherein expanding each contour point in the object contour information to obtain an expanded contour point corresponding to each contour point comprises:
determining the image proportion of an image area containing the target object in the image to be processed;
determining the expansion direction and the expansion distance of the contour points in the object contour information according to the image proportion;
and expanding each contour point in the object contour information according to the expansion direction and the expansion distance to obtain an expansion contour point corresponding to each contour point.
4. The method according to claim 1, wherein constructing a contour grid describing a contour shape of the target object in the image to be processed from the object contour information comprises:
determining the material size of the contour line material;
carrying out segmentation processing on the object contour information according to the material size to obtain sub-object contour information corresponding to at least two sections of contours of the target object;
and constructing a corresponding contour network on the image to be processed according to the contour information of the sub-object corresponding to each section of contour.
5. The method according to any one of claims 1 to 4, wherein the performing contour detection on the target object in the image to be processed to obtain object contour information of the target object includes:
performing object detection on the image to be processed, and determining an image area where a target object in the image to be processed is located;
and extracting edge characteristics of the image area to obtain object contour information of the target object.
6. The method of claim 1, wherein before rendering contour line material in the contour grid to obtain a processed image comprising image content of the image to be processed and the contour line material, the method further comprises:
acquiring a target material unit;
and generating the contour line material according to the target material unit.
7. The method of claim 1, wherein rendering contour line material in the contour grid to obtain a processed image comprising image content of the image to be processed and the contour line material, comprises:
acquiring a pixel value corresponding to a pixel in the image to be processed;
determining the rendering color of the contour line material according to the distribution characteristics of the pixel values;
and rendering the contour line material of the rendering color in the contour grid to obtain the processed image containing the image content of the image to be processed and the contour line material.
8. A contour drawing apparatus, comprising:
an acquisition unit configured to acquire an image to be processed;
the detection unit is used for carrying out contour detection processing on the target object in the image to be processed to obtain object contour information of the target object;
a construction unit for constructing a contour grid describing a contour shape of the target object in the image to be processed according to the object contour information;
and the rendering unit is used for rendering the contour line materials in the contour grid to obtain a processed image of the target object drawn with the contour line.
9. A computer device comprising a memory and a processor; the memory stores a computer program, and the processor is configured to execute the computer program in the memory to perform the contour drawing method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer program being loaded by a processor to perform the contour drawing method according to any one of claims 1 to 7.
CN202310715409.0A 2023-06-15 2023-06-15 Contour line drawing method, contour line drawing device, computer equipment and storage medium Pending CN117726644A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310715409.0A CN117726644A (en) 2023-06-15 2023-06-15 Contour line drawing method, contour line drawing device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310715409.0A CN117726644A (en) 2023-06-15 2023-06-15 Contour line drawing method, contour line drawing device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117726644A true CN117726644A (en) 2024-03-19

Family

ID=90200359

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310715409.0A Pending CN117726644A (en) 2023-06-15 2023-06-15 Contour line drawing method, contour line drawing device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117726644A (en)

Similar Documents

Publication Publication Date Title
JP7176012B2 (en) OBJECT MODELING OPERATING METHOD AND APPARATUS AND DEVICE
CN111598998B (en) Three-dimensional virtual model reconstruction method, three-dimensional virtual model reconstruction device, computer equipment and storage medium
CN107993216B (en) Image fusion method and equipment, storage medium and terminal thereof
KR20180121494A (en) Method and system for real-time 3D capture and live feedback using monocular cameras
CN111652123B (en) Image processing and image synthesizing method, device and storage medium
EP4036790A1 (en) Image display method and device
CN113628327A (en) Head three-dimensional reconstruction method and equipment
CN111382618B (en) Illumination detection method, device, equipment and storage medium for face image
WO2023066120A1 (en) Image processing method and apparatus, electronic device, and storage medium
CN115100337A (en) Whole body portrait video relighting method and device based on convolutional neural network
US9019268B1 (en) Modification of a three-dimensional (3D) object data model based on a comparison of images and statistical information
CN113763242A (en) Image processing method and device and computer readable storage medium
CN112717414A (en) Game scene editing method and device, electronic equipment and storage medium
CN109448093B (en) Method and device for generating style image
CN111652795A (en) Face shape adjusting method, face shape adjusting device, live broadcast method, live broadcast device, electronic equipment and storage medium
CN117726644A (en) Contour line drawing method, contour line drawing device, computer equipment and storage medium
CN111652023B (en) Mouth-type adjustment and live broadcast method and device, electronic equipment and storage medium
CN111652807B (en) Eye adjusting and live broadcasting method and device, electronic equipment and storage medium
CN112926614A (en) Box labeling image expansion method and device and computer readable storage medium
CN116012666B (en) Image generation, model training and information reconstruction methods and devices and electronic equipment
Volino et al. Online interactive 4D character animation
CN116563505B (en) Avatar generation method, apparatus, electronic device, and storage medium
Lim et al. 3D caricature generation system on the mobile handset using a single photograph
CN116112716B (en) Virtual person live broadcast method, device and system based on single instruction stream and multiple data streams
Sumi et al. A production method of reusing existing 2D animation sequences

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination