Adaptive line drawing
Shaorong Wang,Zhiqi Ao,Shuli Yao,Yisong Chen,Guoping Wang
DOI: https://doi.org/10.11834/jig.170376
2018-01-01
Journal of Image and Graphics
Abstract:Objective Generating line drawings based on reference images is the most common application of non-photorealistic rendering,which is widely used in creative arts,scientific graphing,animation,video games,and print advertisement During the creation of a line drawing,artists outline the contours of objects.The artists emphasize the main structure with long and thick lines and present the simple details with short and thin lines.Meanwhile,the artists barely use any ink for those unimportant regions on visual observation.A good line drawing successfully balances density and thickness features,thereby providing a sense of layering.Method A line-drawing-simulating algorithm initially analyzes the features and visual importance of an input image and subsequently detects the edges to generate a contour line and form a line drawing with a certain flavor.Given its simplicity,difference of Gaussians (DoG) may be calculated as a simple approximation of the Marr operator,which is widely used for edge detection.A flow-based anisotropic filtering framework is produced to improve the continuity of edges.The new filtering framework initially forms an edge tangent field and subsequently applies a flow-based difference of Gaussians (FDoG) on the intermediate results.Finally,the hyperbolic tangent function in the framework will soften the calculated result and link the detected edge points to form a line drawing.Different spatial parameters of DoG can only detect the edge of different scales in the image.DoG with small-scale parameter finds thin edges,but most probably takes noise as an edge.By contrast,DoG with large-scale parameter finds thick edges and is capable of ignoring some noise,but most probably takes neighboring edges as noise.Thus,selecting the appropriate parameters of DoG is important.For images with multiple edge scales,the FDoG method based on fixed parameters is not adapted to detect the edges,which leads to unsatisfactory line drawings.This study presents an adaptive non-photorealistic rendering technique for stylizing a photograph in the line drawing style.Generating the final line drawing has three main steps.1) We segment the reference image into different regions.In each region,we calculate the intensity variance and minimum distance to the region boundary of all of its pixels.We define the ratio of the intensity variance to the region boundary as its complexity.2)We use the preprocessed results to construct a smooth and direction-enhanced edge flow field to indicate the visual significance of the region.3) We use the flow field to guide the line drawing process with anisotropy Gaussian filter,in which the parameters are adaptively determined.Finally,the hyperbolic tangent function in the framework will soften the calculated result and link the detected edge points to form a line drawing.Several improvements have been made on the three steps.During the procedure acquiring the edge flow field,the tangential vector of each pixel is the weighted mean of the tangential vector of its neighbor.The tangent vectors from the same category have a similar direction,whereas the tangent vectors from different categories may behave differently.We introduce a new weight item to balance the weight of these vectors.If the pixel of the neighbor and the reference pixel are located in the same segmented region,then the weight is strong.During the DoG filtering process,the scale parameter of each pixel is based on the regional complexity of the pixel and the precomputed minimum distance between the pixel and the region boundary.If a pixel is in a detailed area or near the region boundary,then a small-scale parameter is set and weak and thin lines are highlighted.By applying this strategy,we prevent the formation of thick curves from thin curves.During Gaussian filtering of the DoG flow,if a pixel is in a detailed area or near the region boundary,then the scale parameter is small and short and thin lines are observed in complex areas.Thus,we have an improved chance of decreasing the possibility of incorrectly highlighting long and thick lines.Result Experimental results show that the thickness and shade of the line produced by our approach change with the complexity of the image.Therefore,our approach can produce attractive and impressive line illustrations with a variety of photographs.Conclusion Compared with the fixed-parameter line drawing algorithm,our line drawing algorithm is more adaptive and has better results.