Aligning traces to geometric shapes
By detecting corner points and performing curve sampling and similarity comparison using a geometric matching algorithm, the system solves the problems of low accuracy and efficiency in tracking precise geometric shapes in existing systems, and achieves more efficient curve tracking and storage optimization.
Patent Information
- Application Number
- CN202510722057.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-08-21
- Filing Date
- 2025-05-30
- Publication Date
- 2026-03-06
AI Technical Summary
Existing systems suffer from low accuracy and efficiency when generating or tracking curves with precise geometric shapes, especially when processing defective images, leading to excessive demands on computer storage and device interaction.
By employing a geometric matching algorithm, corner points in digital images are detected, and curve sampling and similarity comparison are used to generate curve segments that match candidate geometric shapes, reducing editing and interaction requirements and improving accuracy and efficiency.
It improves the accuracy and efficiency of curve tracking, reduces storage requirements and device interaction, and is better able to handle defective images.
Smart Images

Figure CN121616679A_ABST
Abstract
Description
Background Technology
[0001] In the field of graphic design, creating designs that incorporate geometric shapes is crucial and fundamental for generating multiple types of visual elements, ranging from simple to complex. From complex architectural patterns to the sleek silhouettes of modern logos, geometric influences shape and design across domains. Generating designs with precise geometric shapes (such as precise lines and arcs) is a complex but important task. Over the years, systems have been developed to generate curves and traces of object outlines. While existing systems offer some limited tools for tracing objects and generating curves, these systems exhibit several technical shortcomings, particularly regarding the accuracy and efficiency of generating or tracing curves for precise geometric shapes. Summary of the Invention
[0002] Embodiments of this disclosure provide benefits and / or solve one or more of the foregoing or other problems in the art by using geometric matching algorithms to snap curves to precise geometric shapes. For example, the geometric matching process of the disclosed system involves detecting corner points in a digital image and using an advanced geometric matching algorithm to match precise geometric shapes (such as arcs and lines) with curves spanning between the corner points in the digital image. In some embodiments, the geometric matching algorithm includes sampling the curve spanning between two corner points to generate a discrete set of points for comparison with corresponding points (e.g., lines and arcs) of candidate geometric shapes. In some cases, the geometric matching algorithm further includes determining an order for comparing the curve with candidate geometric shapes and performing such comparisons to determine the similarity between the curve and the candidate geometric shapes. In one or more embodiments, the disclosed system also utilizes the geometric matching algorithm to generate curve segments (e.g., based on input strokes or trajectories) that align with the selected geometric shape based on a snapping threshold indicating a degree of matching between the curve and the selected geometric shape. Additional features and advantages of one or more embodiments of this disclosure are set forth in the following description of the embodiments and will be apparent in part from those descriptions, or may be learned by practice of such exemplary embodiments. Attached Figure Description
[0003] With the aid of the accompanying drawings, the detailed embodiments provide one or more embodiments with additional features and details, as briefly described below.
[0004] Figure 1 The illustration depicts an example system environment in which a geometry matching system according to one or more embodiments operates.
[0005] Figure 2The illustration provides an example overview of determining and tracking matching geometry for curves in a digital image according to one or more embodiments.
[0006] Figure 3 An example of detecting corner points in a digital image according to one or more embodiments is illustrated.
[0007] Figure 4 An example diagram of a geometric matching algorithm according to one or more embodiments is illustrated.
[0008] Figure 5 An example curve for curve sampling is illustrated according to one or more embodiments.
[0009] Figure 6 An example diagram illustrating the order of determining similarity comparisons for candidate geometries according to one or more embodiments is shown.
[0010] Figure 7 The illustration shows an example diagram of performing a similarity comparison according to one or more embodiments.
[0011] Figure 8 The illustration shows examples of curve segments generated based on different similarity thresholds according to one or more embodiments.
[0012] Figure 9 An example curve tracing interface according to one or more embodiments is illustrated.
[0013] Figure 10 The illustration shows an example schematic diagram of a geometry matching system according to one or more embodiments.
[0014] Figure 11 The illustration depicts a series of example actions for determining and tracking matching geometry of curves in a digital image, according to one or more embodiments.
[0015] Figure 12 A block diagram of an example computing device for implementing one or more embodiments of the present disclosure is illustrated. Detailed Implementation
[0016] This disclosure describes one or more embodiments of a geometric matching system that uses advanced geometric matching algorithms to generate curves and align the curves to precise geometric shapes. Geometric shapes are often fundamental components of graphic design, and aligning curves or traces to geometric shapes provides a powerful tool for accurate and efficient graphic design generation. As part of aligning curves to geometric shapes, the geometric matching system uses geometric matching algorithms to sample the curves, sorts similarity comparisons of the curves relative to candidate geometries (e.g., lines and arcs), performs similarity comparisons sequentially, and generates an output curve in the form of the most similar candidate geometry based on the similarity comparisons. In some embodiments, the geometric matching system detects or determines corners depicted in a digital image and applies the geometric matching algorithm to a curve spanning between two detected corners. In some cases, the geometric matching system performs downstream processing on the generated curves, such as vectorizing or tracing the input strokes to align with candidate geometries.
[0017] As mentioned earlier, in some embodiments, the geometric matching system detects corners depicted in a digital image. For example, the geometric matching system analyzes a graphic design or digital image depicting one or more objects to determine or detect corners. In some cases, the geometric matching system detects corners by resizing or scaling an initial digital image (e.g., a raster image) and applying a corner detection algorithm that detects or determines the intersections or terminations of curves or edges of the depicted objects.
[0018] In some embodiments, the geometric matching system performs a geometric matching process by applying a geometric matching algorithm based on the detected corner points. For example, the geometric matching system utilizes a geometric matching algorithm that includes various stages, processes, or subroutines. In some cases, the geometric matching algorithm involves: i) sampling a curve that spans between two detected corners; ii) determining the order for performing a similarity comparison of the curve; iii) performing the similarity comparison to determine a geometric figure (e.g., a line or arc) that matches or is similar to the curve (in conjunction with a similarity threshold); and iv) generating a curve segment or stroke that aligns with or traces the matched geometric figure.
[0019] As suggested above, several conventional systems exhibit numerous shortcomings or drawbacks, particularly in accurately tracing geometry in digital images. To illustrate, many existing systems rely on hand-drawn tracing using digital pen tools, and while these systems may be able to trace the depicted object, crucial geometric information and the orientation of the underlying geometry are lost along the way. In fact, most existing systems treat the depicted object as a real or reference source for the tracing process, aligning input strokes with the object's edges. Depending on imperfections present in the object, such existing systems tend to perform imperfect tracing (by indiscriminately following defects) arising from gaps, holes, or deviations in the precise geometric shape found within the object. The inaccuracies of existing systems are even more pronounced when applied to images with curves containing defects in the geometric shape.
[0020] Many existing systems are also inefficient, at least in part, due to their inaccuracies. For example, some existing systems consume excessive computer memory and storage by generating (e.g., by tracing) curves composed of an excessive number of edited curve segments. In fact, due to the inaccuracies of their geometric tracking, some existing systems require an excessive number of device interactions to edit and improve the tracked curves to correct errors in alignment to the geometric shape. Thus, existing systems waste computer storage by utilizing bloated tracking data and excessive interactions that limit the curves tracked from images.
[0021] As suggested above, embodiments of the geometric matching system offer certain improvements or advantages over conventional systems. For example, embodiments of the geometric matching system improve the accuracy of curve detection and tracking of geometric shapes from digital images. This accuracy improvement is achieved by using geometric matching algorithms (in conjunction with corner detection algorithms) to identify and track geometric shapes (such as lines or arcs) that match curves within the digital image. By using geometric matching algorithms, compared to existing non-geometry-based systems, the geometric matching system more accurately tracks precise geometric shapes (and preserves geometric information and orientation), particularly for curves that are not exact matches but still meet a similarity threshold. The accuracy improvement of the geometric matching system is particularly significant in images where defects are depicted with other precise geometric shapes.
[0022] Implementations of geometric matching systems improve the efficiency of existing systems, at least in part, by increasing accuracy. For example, by using a geometric matching algorithm as the basis for tracking digital images, compared to over-edited curves in existing systems, geometric matching systems reduce the processing and storage requirements for tracking data. In effect, geometric matching systems generate curves or strokes that accurately track the geometric shapes depicted by the digital image (or within a threshold similarity range) without requiring the additional editing or thinning common in existing systems. Therefore, in some embodiments, geometric matching systems reduce the amount of editing data and device interactions used to perform editing compared to existing systems. Additionally, unlike existing systems that require multiple inputs to track image curves, geometric matching systems provide one-click tracking features to detect and track image curves using a single interaction.
[0023] Additional details regarding the geometric matching system will now be provided with reference to the accompanying drawings. For example, Figure 1 The illustration shows a schematic diagram of an example system environment for implementing a geometric matching system 102 according to one or more embodiments. About Figure 1 An overview of the described geometric matching system 102 is provided. Thereafter, more specific embodiments of the components and processes of the geometric matching system 102 are provided with reference to the following figures.
[0024] As shown, the environment includes server(s) 104, client(s) 108, database(s) 114, and network(s) 112. Each component of the environment communicates via network(s), and network(s) 112 is any suitable network on which computing devices communicate. The following is combined with... Figure 12 The example network will be discussed in more detail.
[0025] As mentioned, this environment includes client device 108. Client device 108 is one of a variety of computing devices, including smartphones, tablets, smart TVs, desktop computers, laptops, virtual reality devices, augmented reality devices, or related devices. Figure 12 Another computing device described. Although Figure 1 The illustration shows a single instance of client device 108, but in some embodiments, the environment includes multiple different client devices, each associated with a different user. Client device 108 communicates with server device(s) 104 and / or content editing system 106 via network 112. For example, client device 108 receives information from server device(s) 104 and provides information to server device(s) 104 regarding raster images, vector images, curves, corner points, and geometric shapes.
[0026] like Figure 1As shown, client device 108 includes client application 110. Specifically, client application 110 is a web application, a native application installed on client device 108 (e.g., a mobile application or desktop application), or a cloud-based application in which all or part of its functionality is performed by server devices(s) 104. Client application 110 presents or displays information to a user, including a content editing interface for using tracking tools to detect, modify, and / or track curves or edges of digital images.
[0027] Similarly, Figure 1 As illustrated, the environment includes server devices 104. Server devices 104 generate, track, store, process, receive, and transmit electronic data, such as raster images, vector images, corner points, curves, and / or vector data for tracking. For example, server devices 104 receive data from client devices 108 in the form of digital images and indications of curves depicted in the tracking digital images. In response, server devices 104 provide data to client devices 108 in the form of vectorized images and / or detected edges, as described herein. For example, server devices 104 communicate with database 114 to access pixel window algorithm 116 and trained neural networks, such as segmentation neural networks 118.
[0028] In some embodiments, server devices 104 communicate with client devices 108 to send and / or receive data via network 112. In some embodiments, server devices 104 include distributed servers, wherein server devices 104 include multiple server devices distributed across network 112 and located in different physical locations. Server devices 104 include content servers, application servers, communication servers, web hosting servers, multidimensional servers, or machine learning servers.
[0029] like Figure 1 As further shown, the server devices 104 also include a geometry matching system 102 as part of the content editing system 106. For example, in one or more implementations, the content editing system 106 stores, generates, modifies, edits, enhances, provides, distributes, and / or shares digital content such as digital images. For example, the content editing system 106 provides digital content for editing or other forms of digital processing. In some implementations, the content editing system 106 provides digital content to a specific digital profile associated with a client device (e.g., client device 108).
[0030] In one or more embodiments, server devices 104 include all or part of the geometry matching system 102. For example, the geometry matching system 102 operates on server devices 104 to detect corners, determine similar geometries of curves, and / or convert raster images into vector images through curve tracing or fitting. In some embodiments, client devices 108 include all or part of the geometry matching system 102. For example, client devices 108 generate, obtain (e.g., download), or use one or more aspects of the geometry matching system 102, such as corner detection algorithm 116 and / or geometry matching algorithm 118. In practice, in some implementations, such as... Figure 1 As illustrated, the geometry matching system 102 is wholly or partially located in client device 108 (e.g., as part of client application 110). For example, the geometry matching system 102 includes a web-hosted application that allows client device 108 to interact with server devices(s) 104. For illustration, in one or more implementations, client device 108 accesses web pages supported and / or hosted by server devices(s) 104.
[0031] In one or more embodiments, client device 108 and server devices(s) 104 work together to train and / or implement a model of geometry matching system 102. For example, in some embodiments, server devices(s) 104 train one or more neural networks (e.g., using a neural network to detect corners as part of corner detection algorithm 116) and provide the one or more neural networks to client device 108 for implementation. In some embodiments, server devices(s) 104 train one or more neural networks together with client device 108.
[0032] although Figure 1 The illustration shows a specific arrangement of the environment, but in some embodiments, the environment may have different component arrangements and / or different numbers or sets of components. For example, as mentioned, the geometry matching system 102 is implemented by the client device 108 (e.g., entirely or partially located on the client device 108). As another example, corner detection algorithm 116 and / or geometry matching algorithm 118 are stored in database 114. Furthermore, in one or more embodiments, the client device 108 communicates directly with the geometry matching system 102, bypassing network 112.
[0033] As mentioned, in one or more embodiments, the geometric matching system 102 tracks the geometric shape of a curve depicted in a digital image. Specifically, the geometric matching system 102 utilizes a geometric matching algorithm to determine and track the geometry corresponding to the curve in the digital image. Figure 2The illustrations provide an overview of examples according to one or more embodiments. Further details regarding these embodiments are provided below with reference to the accompanying drawings. Figure 2 Additional details on the various actions and processes described.
[0034] like Figure 2 As illustrated, a geometric matching system 102 identifies or receives a digital image 202. Specifically, the geometric matching system 102 receives the digital image 202 from a client device as an upload or selection. In some cases, the geometric matching system 102 receives the digital image 202 based on a selection from a digital image repository. In one or more embodiments, the digital image 202 is a raster image depicting raster content (e.g., non-vectorized image content) arranged in a grid of individual pixels having pixel values. In some cases, pixel values include or refer to a numerical representation of the magnitude or intensity corresponding to an aspect of the content depicted in the pixel (such as color or brightness). As shown, the digital image 202 is a line drawing of an elephant.
[0035] Similarly, Figure 2 As illustrated, the geometric matching system 102 detects or determines corner points 204 within the digital image 202. Specifically, for embodiments where the digital image 202 is a raster image, the geometric matching system 102 utilizes a corner detection algorithm. For detailed explanation, the geometric matching system 102 rescales the digital image 202 into multiple rescaled versions and applies a corner detection algorithm, including functionality such as Harris corner detection or Shi Tomasi corner detection (along with other processes), to detect corner points 204 in the rescaled versions based on an adaptive corner detection threshold. However, for embodiments where the digital image 202 is a vector image, the geometric matching system 102 does not use a corner detection algorithm to detect corner points 204 because corner points 204 are predefined, and the vector image data includes defined corner point data in its vector path and anchor points.
[0036] like Figure 2 As further illustrated, the geometric matching system 102 performs geometric matching 206. The geometric matching system 102 performs geometric matching 206 by applying a geometric matching algorithm based on corner points 204. For example, the geometric matching system 102 determines curves depicted in the digital image 202, where each curve spans between two corner points 204. For a given curve, the geometric matching system 102 generates a discrete set of points according to a curve sampling process involving distance-based sampling along the curve at intervals.
[0037] Furthermore, geometric matching 206 involves ordered similarity comparisons for each sampled curve. For example, geometric matching system 102 determines the order in which different geometries are compared to the curve, such that similarity comparisons are performed one after another in the determined order. In some cases, geometries include or refer to geometries such as straight lines, arcs (e.g., cross sections or segments of circles), or some other shape. Therefore, geometric matching system 102 performs similarity comparisons sequentially by performing pairwise comparisons of points along the curve with corresponding points along candidate geometries. In some embodiments, geometric matching system 102 also applies a similarity threshold to determine which candidate geometry most closely resembles the curve.
[0038] like Figure 2 As further illustrated, in some embodiments, the geometry matching system 102 performs hand-drawn tracing 208. Specifically, the geometry matching system 102 receives tracing input or strokes from a client device, determines a curve in the digital image corresponding to the tracing input, and snaps or aligns the tracing input to a geometry match for the curve. In some embodiments, the geometry matching system 102 uses one-click tracing 210 to generate or trace a curve of the matching geometry in response to a single user interaction selecting a one-click tracing option. Using hand-drawn tracing 208 or one-click tracing 210, the geometry matching system 102 traces or generates curve segments or strokes (e.g., in vector format) along the determined geometry corresponding to the curve. Thus, the geometry matching system 102 generates a vector image 212 depicting the tracing curve segments that follow the precise geometric shape.
[0039] As noted, in some of the described embodiments, the geometric matching system 102 detects corner points in a digital image. Specifically, the geometric matching system 102 determines corner point data for raster images using a corner detection algorithm or based on a cubic Bezier matrix of a vector image. Figure 3 The illustration shows the use of a corner detection algorithm to detect corners in a digital image according to one or more embodiments.
[0040] like Figure 3As shown, the geometric matching system 102 identifies or identifies the digital image 302. Additionally, as part of a corner detection algorithm, the geometric matching system 102 performs multi-level rescaling of the digital image 302 to generate multiple rescaled versions. For example, the geometric matching system 102 generates a rescaled image 304a at half the scale of the digital image 302, a rescaled image 304b at 1.5 times the scale of the digital image 302, and a rescaled image 304c at 2 times the scale of the digital image 302. In some cases, the geometric matching system 102 rescales the digital image 302 by performing Lanczos resampling to efficiently preserve edge information during scaling. Compared to existing systems, particularly in images with lower resolution and / or complex details, the use of multi-level rescaling improves the geometric matching system 102's ability to better visualize and handle fine details and corners.
[0041] Furthermore, as part of the corner detection algorithm, the geometric matching system 102 detects corners within the rescaled version. For example, the geometric matching system 102 detects corner 306a from the rescaled image 340a using a corner detection algorithm that identifies corners as points in a local neighborhood that at least show a threshold change in intensity in both orthogonal directions. In practice, the geometric matching system 102 uses the derivative of a Gaussian filter to determine the image gradient, determines the structure tensor based on the gradient, generates a matrix of structure tensors for each pixel in the image, and uses the determinant and trajectory of the matrix to determine the corner response. The geometric matching system 102 uses the corner detection algorithm to detect corners in regions where one or more gradients or tensors in the corner matrix satisfy a specific gradient threshold. Therefore, the geometric matching system 102 detects corner 306a by applying the corner detection algorithm to the rescaled image 304. The geometric matching system 102 also detects corner 306b from the rescaled image 304b and corner 306c from the rescaled image 304c. In some embodiments, the geometric matching system 102 also detects corner points from the digital image 302 at its initial scale.
[0042] like Figure 3As further illustrated, the geometric matching system 102 generates or determines the detected corner points 308. For detailed explanation, as part of the corner detection algorithm, the geometric matching system 102 combines or merges corner points 306a, 306b, and 306c (along with corner points detected from the digital image 302 at their initial resolution) into the detected corner point 308. As part of this process, the geometric matching system 102 scales the detected corner points (in their respective rescaled images) back to the initial size of the digital image 302. The geometric matching system 102 also normalizes the corner points and applies an adaptive corner threshold. Specifically, the geometric matching system 102 adaptively determines the corner threshold based on the standard deviation of the corner response (determined from the corner matrix) and a dynamic corner factor. The geometric matching system 102 derives a dynamic corner factor from the edge density of the digital image 302, thereby allowing the corner factor and the resulting corner threshold to vary based on image conditions. The geometric matching system 102 retains and stores corners that meet (e.g., meet or exceed) an adaptive corner threshold as detected corners 308, and discards or ignores other corners.
[0043] In some embodiments, the geometry matching system 102 performs or applies a corner detection algorithm represented by the following pseudocode:
[0044] Corner detection algorithm:
[0045] Data:Raster_Image
[0046] Result: Raster_Image with corners marked as circles
[0047] begin
[0048] Raster_Image_2x ← Resizes the input raster image to twice its original size.
[0049] Raster_Image_0.5x ← Resizes the input raster image to half its original size.
[0050] Raster_Image_1.5x ← Resizes the input raster image to 1.5 times its original size.
[0051] corners ← Corner data from the Harris algorithm on the Raster_Image.
[0052] corners_2x ← Corner data from the Harris algorithm for corners of Raster_Image_2x
[0053] corners_0.5x ← Corner data from the Harris algorithm on Raster_Image_2x.
[0054] corners_1.5x ← Corner data from the Harris algorithm for Raster_Image_2x.
[0055] corners←Based on different corner data at different scales (corners, corners_2x, corners_0.5x, corners_1.5), determine the combined corner data and remove duplicate corners. edgeData←Obtain the Edge Data of the RasterImage;
[0056] Normalized corner output
[0057] mean, stddev ← Scalars that yield the mean and standard deviation;
[0058] edgeDensity ← Calculates EdgeDensity(RasterImage, EdgeData);
[0059] factor ← Uninitialized floating-point value;
[0060] if edgeDensity < 0.05 then
[0061] factor = 1.5;
[0062] else if edgeDensity>0.2then
[0063] factor = 0.5;
[0064] else
[0065] factor = 1.0;
[0066] threshold←mean[0]+factor*stddev[0];
[0067] Draw circles around the corners of the image.
[0068] In these or other embodiments, the geometric matching system 102 determines the edge density of the digital image 302 to inform a dynamic corner factor, thereby informing an adaptive corner threshold. For example, the geometric matching system 102 determines the edge density according to an edge density algorithm represented by the following pseudocode:
[0069] Edge density algorithm :
[0070] Data:Raster_Image(cv::mat),Edge_Data(cv::Mat)
[0071] Result: Returns the density of edges in the image.
[0072] begin
[0073] edgePixels←cv::countNonZero(Edge_Data)
[0074] totalPixels←Raster_Image.rows×Raster_Image.cols
[0075] return edgePixels / totalPixels
[0076] end
[0077] As indicated above, in some embodiments, the geometric matching system 102 utilizes a geometric matching algorithm to generate or track precise geometric shapes based on corner points detected in a digital image. Specifically, the geometric matching system 102 determines a curve spanning between two corner points and further applies a geometric matching algorithm to determine and track the geometric shape corresponding to (e.g., matching or similar to) the curve. Figure 4 An example diagram of a geometric matching algorithm according to one or more embodiments is illustrated.
[0078] like Figure 4 As illustrated, the geometric matching system 102 performs sampling 402. For clarity, the geometric matching system 102 samples a curve spanning between two corner points depicted in a digital image. For example, the geometric matching system 102 samples the curve to generate a discrete set of points to approximate the continuous nature of the curve. In some embodiments, the geometric matching system 102 uses distance-based sampling to generate points in the set at uniform intervals along the curve.
[0079] like Figure 4As further illustrated, the geometric matching system 102 performs sorting 404. Specifically, the geometric matching system 102 determines the order in which similarity comparisons of the curves are performed. In practice, the geometric matching system 102 determines a set of candidate geometries for comparison with the curve, where one of the candidate geometries will ultimately be tracked. For example, the geometric matching system 102 determines candidate geometries (such as lines and arcs). Additionally, the geometric matching system 102 determines the order or sequence in which the candidate geometries are compared with the curve (e.g., by determining the comparison of first geometries, second geometries, etc.). As described in further detail below, the geometric matching system 102 determines the order by generating the centroids of the candidate geometries and comparing them with the centroids of the curve.
[0080] Additionally, such as Figure 4 As shown, the geometry matching system 102 performs a threshold 406. The geometry matching system 102 performs the threshold 406 as part of a similarity comparison with candidate geometries. For example, the geometry matching system 102 performs a first similarity comparison to determine the similarity of a curve with respect to a first candidate geometry (e.g., initially in the order determined via sorting 404). In some cases, the geometry matching system 102 determines similarity by performing pairwise comparisons of points in a discrete set sampled along the curve with corresponding points along the candidate geometry. As part of the similarity comparison, the geometry matching system 102 also applies a similarity threshold such that curves satisfying a similarity threshold associated with a candidate geometry are designated or limited to matching or corresponding to the candidate geometry. The geometry matching system 102 also applies thresholds for similarity comparisons with one or more subsequent candidate geometries.
[0081] like Figure 4 As further shown, the geometric matching system 102 performs drawing 408. Specifically, the geometric matching system 102 performs drawing 408 to generate curve segments or strokes that are aligned with or correspond to the curve's geometry. For example, if the geometric matching system 102 determines that a curve matches an arc between two corner points (via sampling 402, sorting 404, and thresholding 406), the geometric matching system 102 generates curve segments for tracing or aligning the arc. In practice, when receiving input strokes from a client device, the geometric matching system 102 generates curve segments to align or snap the input strokes to the arc as part of the tracing process.
[0082] As noted, in one or more embodiments, the geometric matching system 102 performs curve sampling as part of a geometric matching algorithm. Specifically, the geometric matching system 102 samples along a curve spanning between two corner points of a digital image to generate a set of discrete points along the curve. Figure 5The illustration shows example curve sampling according to one or more embodiments.
[0083] like Figure 5 As illustrated, the geometric matching system 102 samples curve 502 to generate a set of discrete points (indicated by hollow circles or dots) that resemble or reflect the shape of curve 502. In one or more embodiments, the geometric matching system 102 samples curve 502 using a uniform sampling method with respect to the intervals between sampling points. For example, the geometric matching system 102 performs uniform curve sampling according to the following function:
[0084] Point i =Start Point + i × Δx
[0085] Where Δx represents the distance between sampling points. In some cases, the geometric matching system 102 samples consecutive points along the domain of the curve function using an interval based on the curve itself. For example, the geometric matching system 102 uses a smaller interval for more complex curves (e.g., those with more directional variations and details) and a larger interval for less complex curves.
[0086] In some embodiments, the geometric matching system 102 represents or defines the curve between two corner points as a set of vector paths in cubic Bézier form. For a sample, the geometric matching system 102 uses sampling intervals, combined with the Bézier representation of the curve, to determine points selected along the domain at regular intervals. The geometric matching system 102 determines the location of points starting from a specific point and repeatedly adding sampling intervals, considering the next Bézier path at each step.
[0087] In one or more embodiments, the geometric matching system 102 adjusts sampling parameters. More specifically, the geometric matching system 102 adjusts the spacing between different curves for the same image based on curve features (e.g., changes in direction or other details). In some cases, the geometric matching system 102 stores or preserves a set of discrete points along the curve. For example, the geometric matching system 102 stores the set of discrete points in an array, list, or some other data structure. In one or more embodiments, the geometric matching system 102 samples the curve according to the following sampling algorithm to generate a set of discrete points:
[0088] Sampling algorithm :
[0089]
[0090]
[0091] As mentioned, in some of the described embodiments, the geometric matching system 102 determines the order for performing similarity comparisons as part of a geometric matching algorithm. Specifically, the geometric matching system 102 determines the order for comparing candidate geometric figures with curves. Figure 6 An example diagram is illustrated for determining the order of similarity comparisons according to one or more embodiments.
[0092] like Figure 6 As illustrated, the geometric matching system 102 determines curve 602. As described, the geometric matching system 102 identifies curve 602 as an edge or cubic Bézier curve spanning between two corner points in a digital image. Furthermore, the geometric matching system 102 determines an order 608 for comparing curve 602 with candidate geometries. To determine the order 608, the geometric matching system 102 performs a preliminary line comparison 604 and a preliminary arc comparison 606.
[0093] To perform the initial line comparison 604, the geometric matching system 102 determines the centroid of the curve and the centroid of the straight line spanning between two corner points of the same curve. In some embodiments, the centroid is the geometric center or average location of the curve or a set of discrete points sampled along the curve. For a curve 602 defined as a set of discrete points in a two-dimensional space (x, y), the geometric matching system 102 determines the centroid according to the following function:
[0094]
[0095] as well as
[0096]
[0097] Among them (C) x C y The centroid of curve 602 is represented by (). In practice, the geometric matching system 102 determines the centroid as the average of the x and y coordinates of points in the discrete set of points. Assuming each point has equal mass, the centroid represents the center of mass.
[0098] As part of line comparison 604, geometric matching system 102 also generates a line spanning between the same two corner points as curve 602 and generates a set of discrete points along that line. More specifically, geometric matching system 102 uses a unique line-point algorithm to generate discrete points starting from one corner point and extending along a straight line to another corner point. For example, geometric matching system 102 uses a line-point algorithm to sample lines at uniform intervals from the start corner point to the end corner point according to multiple divisions. In some embodiments, geometric matching system 102 implements a line-point algorithm represented by the following pseudocode:
[0099] Line-point algorithm :
[0100]
[0101] Additionally, as part of line comparison 604, geometric matching system 102 determines the centroid of the line based on the centroid function described above. Geometric matching system 102 also compares the centroid of the line with the centroid of curve 602. For example, geometric matching system 102 compares the positions of the two centroids. For example, geometric matching system 102 determines the Euclidean distance between the centroids according to the following formula:
[0102]
[0103] Among them (C) x1 C y1 (C) represents the centroid of the curve. x2 C y2 ) represents the centroid of the line (or vice versa).
[0104] Similarly, to perform the initial arc comparison 606, the geometric matching system 102 generates an arc spanning the same two corner points as curve 602, and generates a set of discrete points along the arc. More specifically, the geometric matching system 102 uses a unique arc point algorithm to generate discrete points that start from one corner point and extend into a perfect arc to another corner point. For example, the geometric matching system 102 uses an arc point algorithm to sample the arc at uniform intervals from the start corner point to the end corner point according to multiple divisions. In some embodiments, the geometric matching system 102 implements an arc point algorithm represented by the following pseudocode:
[0105] Arc point algorithm :
[0106]
[0107]
[0108] Similar to the description of line comparison 604, geometric matching system 102 also determines and compares the centroid of the arc with the centroid of the curve 602. For example, geometric matching system 102 determines the Euclidean distance from the centroid of the curve to the centroid of the arc according to the formula above, but (C x2 C y2 ) represents the centroid of the arc, not the line.
[0109] In one or more embodiments, the geometry matching system 102 also compares the distances between centroids. Specifically, the geometry matching system 102 compares the distance from the centroid of curve 602 to the centroid of the line with the distance from the centroid of curve 602 to the centroid of the arc. Furthermore, the geometry matching system 102 determines an order 608 based on the distance comparisons, where candidate geometries (e.g., arcs) have the shortest initial distance and candidate geometries (e.g., lines) have the longest final distance. By ordering according to this initial comparison, the geometry matching system 102 improves the efficiency of systems that might be computationally more expensive in determining curve similarity to candidate geometries.
[0110] As mentioned, in some of the described embodiments, the geometry matching system 102 determines the similarity of curves associated with candidate geometries. Specifically, the geometry matching system 102 compares the curves with a first candidate geometry and a second candidate geometry in a determined order as described. Figure 7 An example diagram is illustrated for determining the similarity of curves associated with candidate geometries according to one or more embodiments.
[0111] like Figure 7 As illustrated, the geometric matching system 102 accesses or identifies arc points 702. In practice, as described, the geometric matching system 102 generates arc points 702 between the same two corner points crossed by the curve. Using the arc points 702, the geometric matching system 102 determines or generates arc similarity 704. More specifically, the geometric matching system 102 determines the arc similarity 704 as a similarity score based on the pairwise distances between points on the curve and points on the arc. In some embodiments, the geometric matching system 102 determines pairwise point distances by determining the distances between similar points along the curve and the arc (e.g., in cases where points are sampled at equal intervals along each path and the same number of points exist between the corner points).
[0112] In one or more embodiments, the geometric matching system 102 uses L2 norm distance (or root mean square distance) for pairwise distances to determine arc similarity 704. For example, the geometric matching system 102 determines pairwise distances between corresponding points (such as Euclidean distances given in the formula above to indicate horizontal and vertical differences) and generates an average distance based on the pairwise distances. In some embodiments, the geometric matching system 102 determines smaller distances to indicate greater similarity between the curve and the candidate geometry.
[0113] Additionally, in some embodiments, the geometric matching system 102 determines or generates a success rate and anomaly rate for the two paths being compared (e.g., a curve and an arc). For example, the geometric matching system 102 samples the curve and arc at n points and identifies a plurality of n points with pairwise distances less than a limit value, and identifies a plurality of n points with pairwise distances greater than anomalies. In some cases, the geometric matching system 102 determines the success rate and anomaly rate according to the following formula:
[0114]
[0115] as well as
[0116]
[0117] Where SussessCount represents the number of n points whose distance is less than the limit value (adjustable or adaptive) and OutlierCount represents the number of n points whose distance is greater than the outlier value (adjustable or adaptive). In some embodiments, the geometric matching system 102 determines the similarity score in the form of a success rate or a combination of success rate and outlier rate.
[0118] In one or more embodiments, the geometric matching system 102 utilizes a matching ratio algorithm to determine the success rate and / or anomaly rate. For example, the geometric matching system 102 uses a matching ratio algorithm represented by the following pseudocode:
[0119] Matching ratio algorithm :
[0120]
[0121] like Figure 7 As further illustrated, the geometric matching system 102 accesses or determines line point 706. For example, the geometric matching system 102 determines line point 706 by sampling a line that spans between two corner points of the same target curve used for comparison. In practice, the geometric matching system 102 uses the line point algorithm described above to generate line points for comparison with a set of discrete points along the curve.
[0122] Furthermore, the geometric matching system 102 determines or generates line similarity 708. Similar to the discussion above regarding arc similarity 704, the geometric matching system 102 performs pairwise distance comparisons between line points 706 and corresponding points on the target curve (e.g., a curve with ridges as shown in the figure). The geometric matching system 102 determines line similarity 708 as a similarity score based on the pairwise distances between points on the curve and points on the arc. In some embodiments, the geometric matching system 102 determines pairwise point distances by determining the distances between similar points along curves and lines (e.g., where points are sampled at equal intervals along each path and the same number of points exist between corner points).
[0123] In one or more embodiments, the geometric matching system 102 uses L2 norm distance (or root mean square distance) for pairwise distances to determine line similarity 708. For example, the geometric matching system 102 determines pairwise distances between corresponding points (such as Euclidean distances given by the formula above to indicate horizontal and vertical differences) and generates an average distance based on the pairwise distances. In some embodiments, the geometric matching system 102 determines smaller distances to indicate greater similarity between the curve and the candidate geometry.
[0124] Additionally, in some embodiments, the geometric matching system 102 determines or generates a success rate and anomaly rate for the two paths being compared (e.g., a curve and a line). In practice, the geometric matching system 102 uses the success rate and anomaly rate formulas described above. In some embodiments, the geometric matching system 102 determines a similarity score in the form of a success rate or a combination of success rate and anomaly rate.
[0125] Although Figure 7 The illustration shows one possible order for determining similarity (arcs first, then lines), but in some embodiments, the geometric matching system 102 determines similarity in a different order. For example, the geometric matching system 102 determines a different order that indicates determining line similarity 708 before arc similarity 704.
[0126] As noted, in some embodiments, the geometry matching system 102 uses a threshold as part of the similarity determination between the curve and the candidate geometry. Specifically, based on determining that the similarity of the curve relative to the candidate geometry meets a similarity threshold, the geometry matching system 102 designates the curve as a match (or correspondence) to the candidate geometry. Figure 8 The illustration shows a collection of example images showing the results of comparing different similarity thresholds according to one or more embodiments.
[0127] like Figure 8 As illustrated, the geometric matching system 102 identifies or receives a distorted input image 802. As shown, the distorted input image depicts five overlapping rings, all of which are similar to circles, but none are perfectly circular. Each ring has bumps, distortion, and imperfections.
[0128] like Figure 8As further illustrated, the geometric matching system 102 generates a modified image 804 based on the distorted input image 802. Specifically, the geometric matching system 102 generates the modified image 804 by detecting corner points and using a geometric matching algorithm as described herein. As part of the geometric matching algorithm, the geometric matching system 102 uses a 50% threshold to designate curves in the distorted input image 802 as matches to candidate geometries. In detail, the geometric matching system 102 sets a similarity threshold to the degree to which a curve matches or aligns with a candidate geometry (e.g., a line or arc). In some cases, the similarity threshold indicates or represents a threshold percentage value for the success rate of a curve; in other cases, the similarity threshold indicates a threshold percentage value for a combination of success rate and anomaly rate. In either case, when a curve is determined to meet the similarity threshold associated with a candidate geometry, the geometric matching system 102 designates the curve as a match to the candidate geometry.
[0129] Furthermore, the geometry matching system 102 snaps curves to their matching geometries. For example, the geometry matching system 102 generates replacement curve segments or strokes to align or snap to corresponding geometries (such as lines or arcs). The geometry matching system 102 thus uses different similarity thresholds to generate modified images 804, 806, and 808. In some cases, the geometry matching system 102 uses a curve snapping algorithm represented by the following pseudocode:
[0130] Curve adsorption algorithm :
[0131]
[0132]
[0133]
[0134] like Figure 8 As further illustrated, the geometric matching system 102 adjusts or modifies the similarity threshold (e.g., setting the threshold based on interaction with the client device), which produces different outputs for the same input. Specifically, the geometric matching system 102 generates a modified image 804 using a 50% threshold, resulting in curves that match the first three loops of the arc from left to right. As shown, the modified image 804 displays perfect circles (or multiple combined arcs) for the first three loops because they meet the similarity threshold and the geometric matching system 102 generates curve segments or strokes to align with or trace the arcs in their positions.
[0135] However, the geometric matching system 102 determines through a geometric matching algorithm that the last two loops do not meet the 50% similarity threshold relative to the arc (meaning that at least 50% of the pairwise distance comparisons of the points meet the limit), and therefore they remain distorted. In effect, the geometric matching system 102 maintains loops 804a and 804b as distorted for not meeting the similarity threshold for the tracked arc. In some cases, if some curves of loops 804a and 804b meet the 50% threshold, the geometric matching system 102 replaces some of their curves between the corner points while keeping other curves untouched and undistorted.
[0136] Furthermore, the geometric matching system 102 generates a modified image 806 based on the distorted input image 802 using a 20% similarity threshold. In other words, the geometric matching system 102 performs a geometric matching algorithm and generates strokes to track geometric shapes that match the curves of the loops in the distorted input image 802, this time with a 20% similarity threshold. Accordingly, the geometric matching system 102 generates strokes to replace the original curves with points that satisfy at least a 20% success rate (or a combination of success rate and anomaly rate). As shown, the modified image 806 includes four loops that have been corrected and replaced by circles, while loops 806a remain distorted when the 20% similarity threshold fails.
[0137] like Figure 8 As further illustrated, the geometric matching system 102 generates a modified image 808 based on the distorted input image 802 using a 0% similarity threshold. Specifically, the geometric matching system 102 utilizes the 0% threshold to essentially force a binary decision between matching one geometry (e.g., an arc) or another geometry (e.g., a line). Therefore, for each curve, the geometric matching system 102 determines whether the curve is more similar to a line or an arc and designates the most similar geometry as the match. Thus, the geometric matching system 102 generates curve segments to replace the curves by tracing the lines or arcs (based on the most similar ones). As shown, the modified image 808 depicts all five loops with correction curves that follow perfect arcs or circles. In effect, the geometric matching system 102 uses the 0% similarity threshold to snap curves to candidate geometries.
[0138] In some embodiments, the geometry matching system 102 uses a 0% similarity threshold to snap curves to candidate geometries according to the following pseudocode:
[0139] Curve adsorption algorithm :
[0140]
[0141] As mentioned above, in some of the described embodiments, the geometry matching system 102 provides a curve tracing interface for tracing geometry corresponding to curves in a digital image. Specifically, the geometry matching system 102 provides interface tools for performing hand-drawn tracing and / or one-click tracing. Figure 9 An example computing device is illustrated according to one or more embodiments to display a curve tracing interface.
[0142] like Figure 9 As illustrated, the geometric matching system 102 generates and provides a curve tracing interface 902 for display on a client device 900. Within the curve tracing interface 902, the geometric matching system 102 provides a digital image 904 for display. In some cases, the digital image 904 is a raster image; in others, it is a vector image. Furthermore, the geometric matching system 102 analyzes or processes the digital image 904 to detect or otherwise identify corners using a corner detection algorithm, and uses a geometric matching algorithm to determine the matching geometry with the curve spanning the corners.
[0143] As shown, the geometry matching system 102 also generates tracking strokes 906 based on tracking input received from the client device 900 (e.g., via dragging a cursor or finger). In practice, the geometry matching system 102 determines the matching geometry (e.g., a line or arc) for each tracked segment using the described algorithm and aligns the input stroke with its matching geometry. In some cases, the geometry matching system 102 determines that the input stroke is within a threshold distance of the curve and therefore snaps the input trajectory to the matching geometry, even if the stroke does not precisely track or follow that geometry. As shown, the geometry matching system 102 snaps the tracking stroke 906 to two different arcs (one for each of the two tracking curves), one along the ear and the other along the elephant's head.
[0144] like Figure 9As further illustrated, the geometric matching system 102 provides a one-click option 908. In practice, in response to a user interaction that selects one-click option 908, the geometric matching system 102 tracks all curves in the digital image 904, rapidly tracing strokes to match the geometry of each curve. In some cases, the geometric matching system 102 generates traced strokes in vector format, thereby efficiently converting a raster image to a vector image when the digital image 904 is in raster form. For example, the geometric matching system 102 uses a tracking or curve fitting algorithm such as that described by G. Singhal et al. in U.S. Patent Application No. 18 / 483,919, filed October 10, 2023, entitled “VECTOR PATH TRAJECTORYIMITATION,” the entire contents of which are incorporated herein by reference.
[0145] In one or more embodiments, the geometry matching system 102 snaps the tracking input strokes (or existing curves of the digital image 904) to the matching geometry of the curve via a client device 900, based on one or more geometry-specific tracking algorithms. For example, the geometry matching system 102 uses an arc tracking algorithm represented by the following pseudocode:
[0146] Arc tracking algorithm :
[0147]
[0148]
[0149]
[0150]
[0151] In some embodiments, the geometry matching system 102 uses a line tracing algorithm represented by the following pseudocode:
[0152] Line tracking algorithm :
[0153]
[0154] Now see Figure 10 Additional details regarding the components and capabilities of the geometric matching system 102 will be provided. Specifically, Figure 10 The illustration shows an example schematic diagram of a geometry matching system 102 on an example computing device 1000 (e.g., one or more of client devices 108 and / or server devices 104). In some embodiments, computing device 1000 refers to a distributed computing system in which different managers reside on different devices, as described above. Figure 10 As shown, the geometric matching system 102 includes a corner detection manager 1002, a sorting manager 1004, a similarity manager 1006, a stroke tracking manager 1008, and a storage manager 1010.
[0155] As just mentioned, the geometric matching system 102 includes a corner detection manager 1002. Specifically, the corner detection manager 1002 manages, maintains, detects, identifies, generates, or identifies corners depicted in a digital image. In some embodiments, for raster images, the corner detection manager 1002 utilizes a corner detection algorithm to detect corners. In other embodiments, for vector images, the corner detection manager 1002 locates or identifies corner data defined from cubic Béziers of vectors having paths and anchor points.
[0156] As shown, the geometry matching system 102 also includes a sorting manager 1004. Specifically, the sorting manager 1004 manages, maintains, determines, generates, orders, sorts, or identifies the order in which similarity comparisons of curves and candidate geometries are performed. For example, the sorting manager 1004 compares a curve spanning two corner points with candidate geometries (e.g., lines and arcs, or some other geometric shape or path) spanning the same two corner points. In some cases, the sorting manager 1004 generates candidate geometries and samples the curve and candidate geometries to generate points for comparison. Based on these points, the sorting manager 1004 determines the centroids for comparison. Based on the centroid comparison, the geometry matching system 102 determines the order for similarity comparisons, with candidates having the most similarity (e.g., closest) centroid to the curve being compared first.
[0157] like Figure 10 As further illustrated, the geometric matching system 102 includes a similarity manager 1006. Specifically, the similarity manager 1006 manages, maintains, determines, generates, compares, or identifies the similarity between curves and candidate geometries. For example, the similarity manager 1006 utilizes a geometric matching algorithm to compare points sampled along the curve with points sampled along the candidate geometries (in the order determined from the sorting manager 1004). In some cases, the similarity manager 1006 performs pairwise comparisons of points along the curve and the geometries to determine a similarity score based on the success rate and / or anomaly rate of points within a threshold distance from each other.
[0158] Additionally, the geometric matching system 102 includes a tracking stroke manager 1008. Specifically, the tracking stroke manager 1008 manages, generates, tracks, snaps to, aligns to, or determines tracking strokes. For example, the tracking stroke manager 1008 snaps a digital image to a matching geometry. As another example, the tracking stroke manager 1008 snaps input tracking strokes from a client device to a matching geometry.
[0159] The geometry matching system 102 also includes a storage manager 1010. The storage manager 1010 operates in conjunction with, or includes, one or more storage devices such as a database (e.g., database 114) that store various types of data (such as raster images, vector images, detected corners, curves, matching geometry, and / or tracking data). As shown, the storage manager 1010 stores a corner detection algorithm 1012 that is accessible and usable by other components of the geometry matching system 102. In some cases, the storage manager 1010 also stores a geometry matching algorithm 1014 that is accessible and usable by other components of the geometry matching system 102. The storage manager 1010 communicates with other components of the geometry matching system 102 to facilitate the operation and functionality described herein.
[0160] In one or more embodiments, each component of the geometry matching system 102 communicates with each other using any suitable communication technology. Additionally, components of the geometry matching system 102 communicate with one or more other devices, including one or more client devices described above. It will be appreciated that while the components of the geometry matching system 102... Figure 10 The components are shown as separate, but any sub-component can be composed into fewer components, such as being combined into a single component, or divided into more components, such as serving a specific implementation. Furthermore, although... Figure 10 The components are described in relation to the geometry matching system 102, but at least some of the components for performing operations in conjunction with the geometry matching system 102 described herein may be implemented on other devices within the environment.
[0161] In one or more implementations, components of the geometry matching system 102 include software, hardware, or both. For example, components of the geometry matching system 102 include one or more instructions stored on a computer-readable storage medium and executable by a processor of one or more computing devices (e.g., computing device 1000). When executed by one or more processors, the computer-executable instructions of the geometry matching system 102 cause the computing device 1000 to perform the methods described herein. Alternatively, components of the geometry matching system 102 include hardware, such as dedicated processing devices that perform certain functions or groups of functions. Additionally or alternatively, components of the geometry matching system 102 include a combination of computer-executable instructions and hardware.
[0162] Furthermore, components of the geometry matching system 102 that perform the functions described herein can be, for example, implemented as part of a standalone application, implemented as a module of an application, implemented as a plugin for an application including a content management application, implemented as one or more library functions that can be called by other applications, and / or implemented as a cloud computing model. Therefore, components of the geometry matching system 102 can be implemented as part of a standalone application on a personal computing device or mobile device. Alternatively or additionally, components of the geometry matching system 102 can be implemented in any application that allows the creation and delivery of marketing content to users, including but not limited to… Experience Manager and Creative Applications in, such as and "ADOBE", "ADOBEEXPERIENCE MANAGER", "CREATIVE CLOUD", "PHOTOSHOP", "ILLUSTRATOR", and "INDESIGN" are registered trademarks or trademarks of Adobe Inc. in the U.S. and / or other countries.
[0163] Figures 1 to 10 The corresponding text and examples provide a variety of different systems, methods, and non-transitory computer-readable media for generating and tracking curve-matching geometry for digital images. In addition to the above, embodiments are describable in terms of flowcharts comprising actions for achieving specific results. For example, Figure 11 A flowchart illustrating an example sequence or series of actions according to one or more embodiments is provided.
[0164] Although Figure 11 The illustrations depict actions according to a particular embodiment, but alternative embodiments may omit, add, reorder, and / or modify them. Figure 11 Any action shown. Figure 11 Actions are sometimes performed as part of a method. Alternatively, non-transitory computer-readable media include instructions that, when executed by one or more processors, cause a computing device to perform... Figure 11 The system performs the action. In yet another embodiment, the system executes... Figure 11 The actions described herein may be repeated or performed in parallel with each other or with different instances of the same or other similar actions.
[0165] Figure 11The illustration depicts a series of example actions 1100 for generating and tracking curves in a digital image using matching geometry. Specifically, the series of actions 1100 includes an action 1102 for detecting corner points depicted in the digital image. For example, action 1102 involves generating a discrete set of points along a curve depicted in the digital image by sampling the curve spanning between a first and a second corner point. In some cases, action 1102 includes an action 1102a for rescaling the digital image. For example, action 1102a includes rescaling the digital image (e.g., a raster image) into multiple resized versions. Furthermore, action 1102 includes an action 1102b for applying a corner detection algorithm to the rescaled versions. For example, action 1102b involves utilizing a corner detection algorithm on one or more rescaled versions of the raster image.
[0166] like Figure 11 As illustrated, the series of actions 1100 includes action 1104 of generating discrete points along a curve in a digital image. Specifically, action 1104 involves generating a set of discrete points along a curve spanning a first and a second corner point among a plurality of corner points. Furthermore, in one or more embodiments, the series of actions 1100 includes action 1106 of determining an order of first and second comparisons of the curve. For example, action 1106 involves determining the order for comparing the set of discrete points with the first and second geometries by comparing the centroid of the curve with the centroids of the first and second geometries.
[0167] like Figure 11 As further illustrated, a series of actions 1100 includes actions 1108 that determine similarity to geometric figures in sequence. For example, action 1108 involves determining a first similarity between a curve and a first geometric figure and a second similarity between a curve and a second geometric figure by performing pairwise comparisons of discrete point sets in sequence. As shown, action 1108 includes action 1108a that performs pairwise comparisons of points. For example, action 1108a involves determining a first similarity between a curve and a line and a second similarity between a curve and an arc by performing pairwise comparisons (in sequence) of discrete point sets with corresponding points along lines and arcs.
[0168] Additionally, the series of actions 1100 includes action 1110 of generating curve segments aligned with the geometry based on similarity. For example, action 1110 involves generating a curve segment aligned with one of the first or second geometries based on a first similarity and a second similarity. In some cases, action 1110 involves generating a vector image from a raster image by fitting the curve segment to a vector path along one of the lines or arcs based on the first and second similarities. In these or other cases, action 1110 involves generating a curve segment that aligns the tracking input with one of the lines or arcs based on the first and second similarities.
[0169] In one or more embodiments, a series of actions 1100 includes generating a set of discrete points along a curve depicted in a digital image by uniformly sampling the curve according to a sampling interval between points in the set of discrete points. In these or other embodiments, the series of actions 1100 includes determining the order for comparing the set of discrete points by: generating a first set of points defining a first geometry spanning between a first corner point and a second corner point in the digital image according to a first point algorithm; generating a second set of points along a second geometry spanning between the first corner point and the second corner point in the digital image according to a second point algorithm; and determining the centroid of the first geometry from the first set of points and the centroid of the second geometry from the second set of points.
[0170] In some embodiments, the series of actions 1100 includes determining the order for comparing the set of discrete points by: comparing the centroid of the curve with the centroid of the first geometry by determining a first distance between the centroid of the curve and the centroid of the first geometry; comparing the centroid of the curve with the centroid of the second geometry by determining a second distance between the centroid of the curve and the centroid of the second geometry; and determining the order based on the first distance and the second distance.
[0171] In some embodiments, a series of actions 1100 includes generating a curve segment aligned with one of a first geometry or a second geometry by snapping the curve segment to the first geometry based on determining that a first similarity is higher than a second similarity, or by snapping the curve segment to the second geometry based on determining that a second similarity is higher than a first similarity. Furthermore, the series of actions 1100 includes rescaling the digital image and using a corner detection algorithm on one or more rescaled versions of the digital image to detect multiple corners depicted in the digital image. In some cases, the series of actions 1100 includes generating a curve segment aligned with one of the first geometry or the second geometry by receiving an input stroke from a client device to draw the curve depicted in the digital image, and aligning the input stroke with one of the first geometry or the second geometry upon receiving the input stroke.
[0172] In some embodiments, the series of actions 1100 includes actions that generate a vector image from a raster image by: determining a snapping threshold that defines the degree to which a curve matches a line or arc for snapping a curve segment to the line or arc; and generating a vector path fitted to the line or arc from the curve segment based on the determination that the curve meets the snapping threshold. In one or more cases, the series of actions 1100 includes actions that receive a user interaction defining the snapping threshold from a client device via a snapping threshold element.
[0173] In some cases, the series of actions 1100 includes setting an adsorption threshold to a zero-percentage adsorption threshold, which indicates adsorbing the curve segment onto any line or arc most similar to the curve based on a first similarity and a second similarity. In one or more embodiments, the series of actions 1100 includes detecting multiple corner points depicted in a raster image by: performing multi-level rescaling of the raster image to generate multiple rescaled versions of the raster image at corresponding scales; using a corner detection algorithm on the multiple rescaled versions of the raster image to identify the detected corner points; and combining the detected corner points from the multiple rescaled versions of the raster image by rescaling to the initial size of the raster image.
[0174] In some embodiments, the series of actions 1100 includes generating a set of discrete points along a curve depicted in a raster image by uniformly sampling the curve according to a sampling interval. In some cases, the series of actions 1100 includes determining the order for comparing the set of discrete points with the lines and arcs by comparing the centroid of the curve with the centroids of the lines and arcs, and determining a first similarity and a second similarity according to that order.
[0175] In one or more embodiments, a series of actions 1100 includes generating a curve segment by generating a vector image from a raster image by fitting a vector path along a line or arc based on a first similarity and a second similarity. Furthermore, the series of actions 1100 includes actions to determine the first similarity; including performing pairwise comparisons of points along the curve with corresponding points along the line; and actions to determine the second similarity, including performing pairwise comparisons of points along the curve with corresponding points along the arc.
[0176] In some embodiments, the series of actions 1100 includes actions to determine the order of comparing curves with lines and arcs by: generating a set of line points defining a line spanning between a first corner point and a second corner point in a raster image according to a line point algorithm; generating a set of arc points along an arc spanning between the first corner point and the second corner point in the raster image according to an arc point algorithm; and determining the centroid of the line based on the set of line points and determining the centroid of the arc from the set of arc points. Furthermore, the series of actions 1100 includes actions to determine a snap-in threshold that defines the degree to which a curve matches a line or arc for snapping the tracking input to the line or arc; and actions to generate a curve segment fitted to the line or arc based on determining that the curve meets the snap-in threshold. Further, the series of actions 1100 includes actions to set the snap-in threshold to a zero-percentage snap-in threshold that indicates snapping the curve segment to either the line or arc most similar to the curve based on a first similarity and a second similarity.
[0177] Embodiments of this disclosure may include or use a dedicated or general-purpose computer including computer hardware, such as, for example, one or more processors and system memory, as discussed in more detail below. Embodiments within the scope of this disclosure also include physical and other computer-readable media for carrying or storing computer-executable instructions and / or data structures. In particular, one or more processes described herein may be implemented at least in part as instructions implemented on a non-transitory computer-readable medium and executable by one or more computing devices (e.g., any media content access device described herein). Typically, a processor (e.g., a microprocessor) receives instructions from a non-transitory computer-readable medium (e.g., memory) and executes those instructions to perform one or more processes, including one or more processes described herein.
[0178] Computer-readable media can be any available medium accessible by a general-purpose or special-purpose computer system. A computer-readable medium storing computer-executable instructions is a non-transitory computer-readable storage medium (device). A computer-readable medium carrying computer-executable instructions is a transmission medium. Therefore, by way of example and not limitation, embodiments of this disclosure may include at least two significantly different types of computer-readable media: non-transitory computer-readable storage media (devices) and transmission media.
[0179] Non-transitory computer-readable storage media (devices) include RAM, ROM, EEPROM, CD-ROM, solid-state drives (“SSDs”) (e.g., RAM-based), flash memory, phase-change memory (“PCM”), other types of memory, other optical disc storage, disk storage or other magnetic storage devices, or any other medium that can be used to store desired program code in the form of computer-executable instructions or data structures and is accessible by a general-purpose or special-purpose computer.
[0180] "Network" is defined as one or more data links capable of transporting electronic data between computer systems and / or modules and / or other electronic devices. When information is transmitted or provided to a computer via a network or another communication connection (hardwired, wireless, or a combination of hardwired and wireless), the computer appropriately regards that connection as a transmission medium. A transmission medium may include networks and / or data links, which may be used to carry desired program code in the form of computer-executable instructions or data structures, and which may be accessible by general-purpose or special-purpose computers. The combinations described above should also be included within the scope of computer-readable media.
[0181] Furthermore, upon arrival at various computer system components, computer-executable instructions or data structures can be automatically transferred from the transport medium to a non-transitory computer-readable storage medium (device) (and vice versa). For example, computer-executable instructions or data structures received via a network or data link can be cached in RAM within a network interface module (e.g., a "NIC") and then ultimately transferred to the computer system RAM and / or a less volatile computer storage medium (device) at the computer system. Therefore, it should be understood that non-transitory computer-readable storage media (devices) can be included in computer system components that also (or even primarily) use the transport medium.
[0182] Computer-executable instructions include, for example, instructions and data that, when executed by a processor, cause a general-purpose computer, a special-purpose computer, or a special-purpose processing device to perform certain functions or groups of functions. In some embodiments, the computer-executable instructions are executed by a general-purpose computer to transform the general-purpose computer into a special-purpose computer that implements the elements of this disclosure. The computer-executable instructions may be, for example, binary code, intermediate format instructions such as assembly language, or even source code. Although the subject matter has been described in language specific to structural features and / or methodological actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the features or actions described above. Rather, the described features and actions are disclosed as exemplary forms of implementing the claims.
[0183] Those skilled in the art will appreciate that this disclosure can be practiced in networked computing environments with various types of computer system configurations, including personal computers, desktop computers, laptop computers, message processors, handheld devices, multiprocessor systems, microprocessor-based or programmable consumer electronics, network PCs, minicomputers, mainframes, mobile phones, PDAs, tablets, pagers, routers, switches, etc. This disclosure can also be practiced in distributed system environments, where tasks are performed on both local and remote computer systems connected via a network link (via a hardwired data link, a wireless data link, or a combination of hardwired and wireless data links). In a distributed system environment, program modules can reside on both local and remote memory storage devices.
[0184] Embodiments of this disclosure can also be implemented in a cloud computing environment. As used herein, the term "cloud computing" refers to a model for enabling on-demand network access to a shared pool of configurable computing resources. For example, cloud computing can be adopted in the market to provide ubiquitous and convenient on-demand access to a shared pool of configurable computing resources. The shared pool of configurable computing resources can be rapidly provisioned via virtualization and released with low management effort or service provider interaction, and scaled accordingly.
[0185] Cloud computing models can be composed of various characteristics, such as, for example, on-demand self-service, broad network access, resource pooling, rapid elasticity, and measurement services. Cloud computing models can also expose various service models, such as Software as a Service (“SaaS”), Platform as a Service (“PaaS”), and Infrastructure as a Service (“IaaS”). Cloud computing models can also be deployed using different deployment models such as private cloud, community cloud, public cloud, and hybrid cloud. Furthermore, as used herein, the term “cloud computing environment” refers to an environment in which cloud computing is employed.
[0186] Figure 12 The diagram illustrates a block diagram of an example computing device 1200 that can be configured to perform one or more of the processes described above. It will be understood that one or more computing devices, such as computing device 1200, can represent the computing devices described above (e.g., computing device 1000, server devices (multiple) 104, and / or client devices 108). In one or more embodiments, computing device 1200 can be a mobile device (e.g., mobile phone, smartphone, PDA, tablet, laptop, camera, tracker, watch, wearable device, etc.). In some embodiments, computing device 1200 can be a non-mobile device (e.g., desktop computer or another type of client device). Further, computing device 1200 can be a server device including cloud-based processing and storage capabilities.
[0187] like Figure 12 As shown, computing device 1200 may include one or more processors 1202, memory 1204, storage device 1206, input / output interface 1208 (or "I / O interface 1208"), and communication interface 1210, which can be communicatively coupled via communication infrastructure (e.g., bus 1212). Although computing device 1200 in Figure 12 It is shown in the middle, but Figure 12 The components illustrated are not intended to be limiting. Additional or alternative components may be used in other embodiments. Furthermore, in some embodiments, computing device 1200 includes more than Figure 12 The component shown is a component with fewer components. Figure 12 The components of the computing device 1200 shown will now be described in detail.
[0188] In a particular embodiment, processor(s) 1202 includes hardware for executing instructions, such as those that constitute a computer program. As an example and not a limitation of executing instructions, processor(s) 1202 may retrieve (or obtain) instructions from internal registers, internal caches, memory 1204, or storage device 1206, and decode and execute them.
[0189] Computing device 1200 includes memory 1204 coupled to processor(s) 1202. Memory 1204 can be used to store data, metadata, and programs executed by the processor(s). Memory 1204 may include one or more of volatile and non-volatile memory, such as random access memory (“RAM”), read-only memory (“ROM”), solid-state drive (“SSD”), flash memory, phase-change memory (“PMC”), or other types of data storage. Memory 1204 may be internal or distributed memory.
[0190] Computing device 1200 includes storage device 1206, which includes memory for storing data or instructions. By way of example and not limitation, storage device 1206 may include the non-transitory storage media described above. Storage device 1206 may include hard disk drives (HDDs), flash memory, universal serial bus (USB) drives, or combinations of these or other storage devices.
[0191] As shown, computing device 1200 includes one or more I / O interfaces 1208 provided to allow a user to provide input (such as user strokes) to computing device 1200, receive output from computing device 1200, and otherwise transmit data to and from computing device 1200. These I / O interfaces 1208 may include a mouse, keypad or keyboard, touchscreen, camera, optical scanner, network interface, modem, other known I / O devices, or combinations of these I / O interfaces 1208. Touchscreens can be activated by a stylus or finger.
[0192] I / O interface 1208 may include one or more devices for presenting output to a user, including but not limited to a graphics engine, a display (e.g., a screen), one or more output drivers (e.g., display drivers), one or more audio speakers, and one or more audio drivers. In some embodiments, I / O interface 1208 is configured to provide graphical data to the display for presentation to a user. The graphical data may be representing one or more graphical user interfaces and / or any other graphical content that may serve a particular implementation.
[0193] The computing device 1200 may also include a communication interface 1210. The communication interface 1210 may include hardware, software, or both. The communication interface 1210 provides one or more interfaces for communication (such as, for example, packet-based communication) between the computing device and one or more other computing devices or one or more networks. By way of example and not limitation, the communication interface 1210 may include a network interface controller (NIC) or network adapter for communicating with Ethernet or other wired-based networks, or a wireless NIC (WNIC) or wireless adapter for communicating with wireless networks such as Wi-Fi. The computing device 1200 may also include a bus 1212. The bus 1212 may include hardware, software, or both for connecting components of the computing device 1200 to each other.
[0194] In the foregoing description, the invention has been described with reference to specific exemplary embodiments thereof. Various embodiments and aspects of the invention have been described with reference to the details discussed herein, and the accompanying drawings illustrate various embodiments. The foregoing description and drawings are illustrative of the invention and should not be construed as limiting the invention. Several specific details have been described to provide a thorough understanding of various embodiments of the invention.
[0195] The invention may be practiced in other specific forms without departing from the spirit or essential characteristics thereof. The described embodiments are to be considered illustrative rather than restrictive in all respects. For example, the methods described herein may be performed with fewer or more steps / actions, or these steps / actions may be performed in a different order. Additionally, the steps / actions described herein may be repeated or performed in parallel with each other or with different instances of the same or similar steps / actions. Therefore, the scope of the invention is indicated by the appended claims rather than by the foregoing embodiments. All variations within the meaning and scope of the equivalents of the claims are included within their scope.
Claims
1. A method comprising: generating a set of discrete points along a curve depicted in a digital image by sampling across the curve between a first corner point and a second corner point depicted in the digital image; determining an order in which to compare the set of discrete points to a first geometric figure and a second geometric figure by comparing a centroid of the curve to a centroid of the first geometric figure and a centroid of the second geometric figure; determining a first similarity of the curve to the first geometric figure and a second similarity of the curve to the second geometric figure by performing pairwise comparisons of the set of discrete points according to the order; and generating a curve segment aligned with one of the first geometric figure or the second geometric figure according to the first similarity and the second similarity.
2. The method of claim 1, wherein generating the set of discrete points along the curve depicted in the digital image comprises: uniformly sampling the curve according to a sampling interval between points in the set of discrete points.
3. The method of claim 1, wherein determining the order in which to compare the set of discrete points comprises: generating a first set of points defining the first geometric figure across the digital image between the first corner point and the second corner point according to a first point algorithm; generating a second set of points along the second geometric figure across the digital image between the first corner point and the second corner point according to a second point algorithm; and determining the centroid of the first geometric figure from the first set of points and the centroid of the second geometric figure from the second set of points.
4. The method of claim 1, wherein determining the order in which to compare the set of discrete points comprises: comparing the centroid of the curve to the centroid of the first geometric figure by determining a first distance between the centroid of the curve and the centroid of the first geometric figure; comparing the centroid of the curve to the centroid of the second geometric figure by determining a second distance between the centroid of the curve and the centroid of the second geometric figure; and determining the order based on the first distance and the second distance.
5. The method of claim 1, wherein generating the curve segment aligned with one of the first geometric figure or the second geometric figure comprises: based on determining that the first similarity is higher than the second similarity, attracting the curve segment to the first geometric figure; or based on determining that the second similarity is higher than the first similarity, attracting the curve segment to the second geometric figure.
6. The method of claim 1, further comprising: detecting a plurality of corner points depicted in the digital image by rescaling the digital image and detecting the plurality of corner points depicted in the digital image using a corner detection algorithm on one or more rescaled versions of the digital image.
7. The method of claim 1, wherein generating the curve segment aligned with one of the first geometric figure or the second geometric figure comprises: receiving, from a client device, an input stroke drawing the curve depicted in the digital image; and aligning the input stroke with one of the first geometric figure or the second geometric figure as the input stroke is received.
8. A system comprising: a memory component; and one or more processing devices coupled to the memory component, the one or more processing devices performing operations comprising: detecting a plurality of corner points depicted in a raster image by rescaling the raster image and utilizing a corner detection algorithm on one or more rescaled versions of the raster image; generating a discrete set of points along a curve spanning between a first corner point and a second corner point of the plurality of corner points; determining a first similarity of the curve to a line and a second similarity of the curve to an arc by performing pairwise comparisons of the discrete set of points to corresponding points along the line and the arc; and generating a vector image from the raster image by fitting a curve segment to a vector path along one of the line or the arc according to the first similarity and the second similarity.
9. The system of claim 8, wherein generating a vector image from the raster image comprises: determining an adhesion threshold that defines a degree to which the curve matches the line or the arc for adhesion of the curve segment to the line or the arc; and generating the vector path from the curve segment that fits to the line or the arc based on determining that the curve satisfies the adhesion threshold.
10. The system of claim 9, wherein the operations further comprise: receiving a user interaction from a client device that defines the adhesion threshold via an adhesion threshold element.
11. The system of claim 9, wherein the operations further comprise: setting the adhesion threshold to a zero percent adhesion threshold that indicates adhesion of the curve segment to the one of the line or the arc that is most similar to the curve according to the first similarity and the second similarity.
12. The system of claim 8, wherein detecting the plurality of corner points depicted in the raster image comprises: performing multi-level rescaling of the raster image to generate a plurality of rescaled versions of the raster image at respective scales; identifying detected corner points using the corner detection algorithm on the plurality of rescaled versions of the raster image; and combining the detected corner points from the plurality of rescaled versions of the raster image by rescaling to an original size of the raster image.
13. The system of claim 8, wherein generating the set of discrete points along the curve depicted in the raster image comprises: uniformly sampling the curve according to a sampling interval.
14. The system of claim 8, wherein the operations further comprise: determining an order for comparing the discrete set of points to the line and the arc by comparing a centroid of the curve to a centroid of the line and a centroid of the arc; and determining the first similarity and the second similarity according to the order.
15. A non-transitory computer-readable medium storing instructions, wherein the instructions, when executed by a processing device, cause the processing device to perform operations comprising: detecting a plurality of corner points depicted in a raster image by rescaling the raster image and utilizing a corner detection algorithm on one or more rescaled versions of the raster image; determining an order in which to compare the curve to the line and the arc by comparing a centroid of the curve to a centroid of the line and a centroid of the arc; determining a first similarity of the curve to the line and a second similarity of the curve to the arc according to the order; and generating a curve segment that aligns the tracking input to one of the line or the arc according to the first similarity and the second similarity.
16. The non-transitory computer-readable medium of claim 15, wherein generating the curve segment comprises: generating a vector image from the raster image by fitting a vector path along one of the line or the arc according to the first similarity and the second similarity.
17. The non-transitory computer-readable medium of claim 15, wherein: determining the first similarity comprises performing pairwise comparisons of points along the curve to corresponding points along the line; and determining the second similarity comprises performing pairwise comparisons of points along the curve to corresponding points along the arc.
18. The non-transitory computer-readable medium of claim 15, wherein determining the order in which to compare the curve to the line and the arc comprises: generating a set of line points that define the line in the raster image that spans between the first corner point and the second corner point according to a line point algorithm; generating a set of arc points that follow the arc in the raster image that spans between the first corner point and the second corner point according to an arc point algorithm; and determining the centroid of the line from the set of line points and the centroid of the arc from the set of arc points.
19. The non-transitory computer-readable medium of claim 15, wherein the operations further comprise: determining a snap threshold that defines a degree to which the curve matches the line or the arc for snapping the tracking input to the line or the arc; and generating the curve segment that fits to the line or the arc from the tracking input based on determining that the curve satisfies the snap threshold.
20. The non-transitory computer-readable medium of claim 19, wherein the operations further comprise: setting the snap threshold to a zero-percent snap threshold that indicates snapping the curve segment to the line or the arc to the one that is most similar to the curve according to the first similarity and the second similarity.
Citation Information
Patent Citations
Vector path trajectory imitation
US20250117989A1