Sketched drawings can provide solid foundations for completed drawings and may even be used by themselves as stylized finished products. Since sketches can be completed in a relatively short time while providing a broad view of the most important visual elements, sketches are a valuable planning tool for artists, animators, modelers, engineers, draftsmen, and other professions that may produce paintings, figures, flowcharts, models, and other drawings and diagrams. Moreover, since sketching is a process that almost everyone is comfortable and familiar with, sketching may be advantageously employed by people at all artistic skill levels.
However, to transition from an initial rough sketch to an intermediate or finished drawing, it is essential to segment portions of the sketch into specific regions or layers. Once separated into layers, many tasks towards the completion of the drawing are readily solved or greatly assisted, including object occlusion, moving and deforming of parts, animation inbetweening or tweening, line or path stroking with color, and area shading with colors or patterns such as textures, hatching or screen tone. Conventionally, such layer segmentation is done manually by the user, often a time-consuming, tedious, and error-prone process, particularly for sketched drawings and for users unfamiliar with working with multiple drawing layers.
The present disclosure is directed to smart scribbles for sketch segmentation, substantially as shown in and/or described in connection with at least one of the figures, as set forth more completely in the claims.
The following description contains specific information pertaining to implementations in the present disclosure. One skilled in the art will recognize that the present disclosure may be implemented in a manner different from that specifically discussed herein. The drawings in the present application and their accompanying detailed description are directed to merely exemplary implementations. Unless noted otherwise, like or corresponding elements among the figures may be indicated by like or corresponding reference numerals. Moreover, the drawings and illustrations in the present application are generally not to scale, and are not intended to correspond to actual relative dimensions.
While computing device 110, input device 116, and display 118 are shown as separate elements in diagram 100, some implementations may combine the elements in diagram 100. For example, display 118 and input device 116 may be the same device for a pen display or touch screen, which may further be combined with computing device 110 for an integrated tablet computer.
User sketch data 124 may be generated while user 130 interacts with drawing application 120. Thus, user sketch data 124 may include lines, curves, and other geometric primitives as user 130 draws them using input device 116. Each geometric primitive may also include time stamps to indicate time of creation or modification, along with stroke characteristics such as speed, pressure, direction and curvature. User sketch data 124 may be rendered as raster data for outputting to display 118, allowing user 130 to view user sketch data 124.
After user sketch data 124 is completed, it is desirable to generate sketch segmentation 128 to organize user sketch data 124 into specific regions or layers. As previously discussed, once user sketch data 124 is separated into layers by sketch segmentation 128, many tasks towards the completion of the drawing are readily solved or greatly assisted. Accordingly, user 130 or another user may provide input scribbles 126 to interactively generate sketch segmentation 128 from user sketch data 124 via smart scribble library 122, which may be a built-in feature or external plug-in of drawing application 120. Smart scribble library 122 may generate sketch segmentation 128 by organizing the above inputs into an energy minimization problem to be solved by a high-speed graph-cut optimization, as further discussed below.
The problem of assigning labels L, or sketch segmentation 128, to stroke segments in S, or user sketch data 124, based on scribble segments in R, or input scribbles 126, can be formulated as an energy minimization problem, or equation (1) below:
wherein the goal is to find a labeling or assignment φ of the labels in L to every stroke segment in S that minimizes the energy function E, where Vi,j is a smoothness term representing a cost with respect to a similarity between stroke segments i and j, where Di is a data term measuring the affinity between scribble segments and stroke segments, and where the parameter λ adjusts the relative weight of the smoothness and data terms.
The smoothness term of equation (1) may be defined more specifically as equation (2) below:
where σg represents an adjustment parameter for each similarity term, as discussed further in
With regards to the similarity terms, the inclusion of proximity in the similarity terms leverages the intuitive idea that related strokes will be in close spatial proximity to each other. The inclusion of direction and curvature in the similarity terms effectively matches strokes with similar stroke direction and shape. The inclusion of time in the similarity terms takes advantage of temporal proximity during a typical sketch drawing process. For example, it is more likely that an artist will draw the details of each section separately and sequentially rather than jumping from section to section at random. Thus, strokes that are close in time may be more closely matched than those distant in time. The similarity terms provided above are only one example, and other implementations may also add or remove terms.
Moving to the data term of the energy function, the data term of equation (1) may be more specifically defined as equation (4) below:
where R(φi) denotes a set of scribble segments r with label φi. Affinity A(i, r) between a stroke segment i and a scribble segment r is defined as equation (5) below:
As with the smoothness term, comparisons are between segments, rather than the original strokes or scribbles. However, since time information is not recorded for input scribbles 126, the set of similarity terms is reduced to Gdata={prox, dir, curv}⊂G. This is in line with user expectations, as the labeling result from an input scribble should be consistent regardless of the specific time when the user provides the input scribble. Additionally, curv may be redefined as an oriented curvature to differentiate between similar curve shapes with different orientations:
curv(i,j)=∥{right arrow over (c)}i−{right arrow over (c)}j∥
With regards to the data terms, the inclusion of proximity flows from the intuitive notion that the user will place the input scribble in close spatial proximity to the desired strokes to be labeled. The inclusion of direction and curvature matches input scribbles with strokes having similar stroke orientation and shape. However, as noted above, time is omitted from the data terms, as the inclusion of time would violate user expectations of consistent results regardless of input scribble creation time. Again, as with the similarity terms, the specific data terms may vary from the specific example provided above.
Each stroke S may form any arbitrarily complex path, and in some cases may overlap itself, cross over itself, or densely fill an area. Each scribble R may also be similarly complex. Accordingly, to keep processing manageable, each stroke S and scribble R may be resampled into smaller, approximately linear segments. For example, as shown in diagram 200, each scribble R is resampled into three (3) smaller scribble segments, and the stroke S is resampled into seven (7) smaller stroke segments including the middle segment i and the outer segments j. Locally defined properties of the larger scribbles or strokes may be readily transferred to the smaller segments during the resampling procedure.
With the energy minimization problem defined as above, a solution can be framed in terms of solving a multi-way cut on a specific graph, as described in the publication titled “Markov random fields with efficient approximations” (Boykov, et al. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (1998), pp. 648-655), which is hereby incorporated fully into the present application by reference.
Thus,
Since the graph G in diagram 210 only has two terminals l1 and l2, the multi-way cut problem simplifies to a single max-flow or min-cut problem, for which efficient solutions exist in polynomial time, as known in the art. However, for N-terminal graphs where N>2, which will be the case when the user requires more than two segmentation labels, the problem becomes NP-hard. While advanced techniques such as a expansion and α/β swap are known for solving such graphs, implementations are quite costly and are therefore less suitable for interactive applications.
To provide an efficient solution suitable for real-time or near real-time interactive applications, N-terminal graphs can be simplified using a divide-and-conquer heuristic into a sequence of N−1 binary graph cut (max-flow or min-cut) problems, as described in the publication titled “LazyBrush: Flexible painting tool for hand-drawn cartoons” (Sykora, et al. Computer Graphics Forum 28, 2 (2009), 599-608), which is hereby incorporated fully into the present application by reference. The greedy multi-way cut algorithm utilized in LazyBrush provides an efficient optimization of the energy minimization problem in polynomial time, suitable for interactive applications such as graphics editing software. Thus, each of the stroke segments in S may be assigned a label in L within polynomial time, even when the number of terminals N is greater than 2.
Next,
To provide an artist-friendly user interface consistent with user expectations, it is thus desirable to provide a user defined level of locality control, thereby allowing the user to select only a smaller portion of the user sketch data, for example only the head area of a character sketch, or only a particular element of a diagram. If the fall-off function in equation (3) is used as-is without modifications, locality control η is equivalent to 0.0, resulting in sketch segmentation 328a for any first input scribble 326. Thus, a new fall-off function may be defined as equation (6) below:
χ(i,r,g,σg)=max(0,γ·δ*(r,g,σg)) (6)
The function δ* of equation (6) is defined in equation (7) below:
δ*(r,g,σg)=(1+η(r))·δ(g,σg)−η(r)·δ(g,σg)ω (7)
where ω is a parameter to adjust the energy transfer curve.
Moving to
To provide the user control of the locality control, the recorded input speed or input pressure of the associated input scribble 326 may be utilized to calculate η(r) in equation (8) below:
Moving to
Next,
Assuming that the shapes of user sketch 424 are each drawn at distinct time periods, the temporal proximity of the associated strokes may be utilized in equation (3) to help determine the correct labeling. Even if an incorrect labeling is provided, for example too small or too large, the user can simply provide additional input scribbles to refine the labeling by broadening or narrowing the selection as necessary.
Next, processor 112 of computing device 110 receives input scribbles 126 for segmenting user sketch data 124 (520). Thus, user 130 may provide one or more input scribbles 126 through input device 116 to guide the sketch segmentation process. Input scribbles 126 may be stored in a similar format as user sketch data 124, with the exception that time stamps may be omitted from input scribbles 126 as previously discussed. Further, as previously discussed, both user sketch data 124 and input scribbles 126 may be resampled into smaller segments for simplified processing. Note that it may not be the same user 130 that provides both user sketch data 124 and input scribbles 126. For example, user sketch data 124 may be recorded and provided by a different user from user 130.
Next, processor 112 of computing device 110 minimizes an energy function to assign a plurality of labels to the plurality of strokes (530). The energy function corresponds to equation (1) as described above, with a smoothness term and a data term described in equations (2) and (4) respectively. Further, the energy function may be modified to provide user controlled locality control, as described in
Next, processor 112 of computing device 110 shows, on display 118, the assigning of the plurality of labels to the plurality of strokes (540). For example, the strokes may be placed in layers according to their assigned label, colored or shaded according to their assigned label, or otherwise visually segmented within a user interface of drawing application 120 shown on display 118. From this point, user 130 may use the labeling indicated on display 118 to attain various goals using drawing application 120, including object occlusion, moving and deforming of parts, animation inbetweening or tweening, line or path stroking with color, area shading with colors or patterns such as textures, hatching or screen tone, and many other application goals.
From the above description it is manifest that various techniques can be used for implementing the concepts described in the present application without departing from the scope of those concepts. Moreover, while the concepts have been described with specific reference to certain implementations, a person of ordinary skill in the art would recognize that changes can be made in form and detail without departing from the spirit and the scope of those concepts. As such, the described implementations are to be considered in all respects as illustrative and not restrictive. It should also be understood that the present application is not limited to the particular implementations described herein, but many rearrangements, modifications, and substitutions are possible without departing from the scope of the present disclosure.
Number | Name | Date | Kind |
---|---|---|---|
5633955 | Bozinovic et al. | May 1997 | A |
5832528 | Kwatinetz et al. | Nov 1998 | A |
7227993 | Xu | Jun 2007 | B2 |
8200014 | Wilensky et al. | Jun 2012 | B2 |
8498482 | Varekamp | Jul 2013 | B2 |
20040037463 | Calhoun et al. | Feb 2004 | A1 |
20050281467 | Stahovich | Dec 2005 | A1 |
20110293181 | Napper et al. | Dec 2011 | A1 |
Entry |
---|
Feng, et al “2D Cartoon Character Deformation by Sketch Skeleton” 2010 Third International Joint Conference on Computational Science and Optimization. IEEE Computer Society. 5 Pgs. |
Patterson, et al “Computer Assisted Animation: 2D or Not 2D?” The Computer Journal, vol. 37, No. 10, 1994. 11 Pgs. |
Wolin, et al “A Pen-based Tool for Efficient Labeling of 2D Sketches” EUROGRAPHICS Workshop on Sketch-Based Interfaces and Modeling (2007) M. van de Panne, E. Saund (Editors) 8 Pgs. |
Mao, et al “A Sketch-based approach to human body modeling” Computers & Graphics 33 (2009) pp. 521-541. |
Herold, et al “SpeedSeg: A technique for segmenting pen strokes using pen speed” Computers & Graphics 35 (2011) pp. 250-264. |
Sykora, et al “As-Rigid-As-Possible Image Registration for Hand-drawn Cartoon Animations” Proceedings of the 7th International Symposium on Non-Photorealistic Animation and Rendering. pp. 25-33. |
Han, et al: “Coarse classification of Chinese characters via stroke clustering method” Pattern Recognition Letters 16 (1995). pp. 1079-1089. |
Seah, et al “Computer-assisted coloring by matching line drawings” The Visual Computer, vol. 16, No. 5, 16 Pgs. |
Grabli, et al “Density Measure for Line-Drawing Simplification” Proceedings of Pacific Graphics (2004) 10 Pgs. |
Ghani, Dahlan Abdul “Wayang Kulit: Digital Puppetry Character Rigging Using Maya MEL Language” 4th International Conference on Modeling, Simulation and Applied Optimization (ICMSAO), 2011. 5 Pgs. |
Shesh, et al “Efficient and Dynamic Simplification of Line Drawings” EUROGRAPHICS 2008, vol. 27, No. 2. 9 Pgs. |
Saund, Eric “Finding Perceptually Closed Paths in Sketches and Drawings” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 25, No. 4, Apr. 2003. pp. 475-491. |
Saund, Eric “Finding Perceptually Salient Closed Paths in Sketches and Drawings” IEEE Transactions on Pattern Analysis and Machine Intelligence, vol. 34, No. 8, 2012. 5 Pgs. |
Barla, et al “Geometric Clustering for Line Drawing Simplification” Proceedings of the Eurographics Symposium on Rendering—2005. 1 pg. |
Saund, Eric “Identifying Salient Circular Arcs on Curves” Journal CVGIP: Image Understanding archive vol. 58, Issue 3, Nov. 1993 45 Pgs. |
Kang, et al “Interactive Sketch Generation” The Visual Computer vol. 21, Nos. 8-10 (2005), 8 Pgs. |
Baxter, et al “Latent Doodle Space” EUROGRAPHICS 2006, vol. 25, No. 3. 9 Pgs. |
Saund, Eric “Labeling of Curvilinear Structure Across Scales by Token Grouping” IEEE Computer Society Conference on Computer Vision and Pattern Recognition, 1992. 30 Pgs. |
Saund, Eric “Logic and MRF Circuitry for Labeling Occluding and Thinline Visual Contours” NIPS. 2006. [62] 8 Pgs. |
Saund, et al “Minimizing Modes for Smart Selection in Sketching/Drawing Interfaces” Sketch-based Interfaces and Modeling 2011, Part 1. pp. 55-80. |
Baxter, Bill “N-Way morphing for 2D animation” Computer Animation and Virtual Worlds (proc. CASA 2009), 2009. 24 Pgs. |
Saund, et al “Perceptual Organization as a Foundation for Intelligent Sketch Editing” In AAAI Spring Symposium on Sketch Understanding, 2002. 8 Pgs. |
Saund, et al “Perceptual Organization in an Interactive Sketch Editing Application” Proceeding ICCV '95 Proceedings of the Fifth International Conference on Computer Vision pp. 597-604. |
Sarkar, et al “Perceptual Organization in Semantic Role Labeling” SDIUT 05 (Symposium on Document Image Understanding Technology) 6 Pgs. |
Saund, et al “Perceptual Organization of Occluding Contours of Opaque Surfaces” Computer Vision and Image Understanding, vol. 76, No. 1, Oct. 1999. pp. 70-82. |
Saund, et al “ScanScribe: Perceptually Supported Diagram Image Editing” Diagrams 2004—International Conference on the Theory and Applications of Diagrams. 4 Pgs. |
Saund, et al “Perceptually-Supported Image Editing of Text and Graphics” Proc. UIST '03 (ACM Symposium on User Interface Software and Technology), 10 Pgs. |
Lank, et al “Sloppy selection: Providing an accurate interpretation of imprecise selection gestures” Computer & Graphics 29 (2005) 11 Pgs. |
Stahovich, Thomas F. “Segmentation of Pen Strokes Using Pen Speed” AAAI Fall Symposium Series 2004: Making Pen-Based Interaction Intelligent and Natural. 7 Pgs. |
Zheng, et al “Sketching-Based Skeleton Generation” 3rd IEEE International Conference on Ubi-media Computing (U-Media), 2010. pp. 179-186. |
Lank, et al “Sloppy Selection: Providing an Accurate Interpretation of Imprecise Selection Gestures” Computers and Graphics, Sepcial Issue on Pen Computing V. 29, No. 4, Aug. 2005, 7 Pgs. |
Liu, et al “Stroke Correspondence Construction for Vector-based 2D Animation Inbetweening” 4 Pgs. |
Saund, et al “Stylus Input and Editing Without Prior Selection of Mode” Proceedings of the 16th annual ACM symposium on User interface software and technology. 4 Pgs. |
Saund, et al “PixLabeler: User Interface for Pixel-Level Labeling of Elements in Document Images” 10th International Conference on Document Analysis and Recognition, 2009. 5 Pgs. |
Number | Date | Country | |
---|---|---|---|
20130241934 A1 | Sep 2013 | US |