A computer stippling method based on circle stacking
Through the computer point etching method based on circular stacking, the problems of low computing efficiency and low blue noise quality in the prior art are solved, and a tight and non-overlapping point distribution is achieved, which is suitable for a variety of image scenarios, and flexible parameter adjustment is provided to meet different needs.
Patent Information
- Application Number
- CN202411678611.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-11-22
AI Technical Summary
The existing digital dot tiling methods are difficult to take into account both the computing efficiency and the quality of blue noise, and are not very scalable, and have their own limitations.
The computer point etching method based on circle stacking is adopted to achieve a tight and overlap-free point distribution through adaptive spatial division and circle stacking layout, and improve computing efficiency and blue noise quality.
It realizes efficient calculation and good blue noise performance, suitable for different types of image scenarios, and users can adjust parameters according to their needs to obtain different visual effects.
Smart Images

Figure CN119205730B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image processing, and in particular to a computer stippling method based on circle stacking. Background Art
[0002] Stippling is a form of artistic expression, whose basic principle is similar to halftone technology. It expresses the texture and shadow of the image by controlling the density, size and spacing of dots, as well as the color and brightness changes of dots. It distributes the dots in a random but expressive way, and is widely used in the printing field because of its remarkable practicality and artistry. Digital stippling is an attempt to reproduce this form of artistic expression using computers. Research in this area revolves around making the computer distribute dots with the necessary characteristics, and using different mathematical methods and technical solutions to better reproduce and surpass the manual stippling process. Through the development of digital stippling, we have a better understanding of the characteristics of traditional stippling. In some cases, developments in this field have even created new forms of expression that were previously impossible (for example, animated stippling of 3D shapes, scalable stippled images, and stippling of volumetric models).
[0003] Sampling is a basic technique in computer science that converts continuous signals into their discrete counterparts, or selects subsets from a discrete signal set so that the signal can be effectively represented and processed by a computer. Blue noise refers to any noise with minimal low-frequency components and no energy-concentrated spikes. Among all sampling techniques, blue noise sampling is the most studied sampling method in recent years. There are currently many classic techniques for generating uniformly randomly distributed point sets. Among them, adaptive blue noise sampling is an important implementation idea for digital point engraving, which aims to reconstruct the grayscale distribution of an image using points with different spatial frequencies.
[0004] After continuous research and development, blue noise sampling methods can be roughly divided into the following three types according to their uses.
[0005] The first is based on Poisson disk sampling. Poisson disk sampling is a classic technique for generating uniformly randomly distributed point sets. The traditional Poisson disk sampling method is called the dart method, which was first proposed by Cook: given a sampling domain and a sampling radius, the algorithm randomly generates disks in the sampling domain. If the currently generated disk conflicts with any previously sampled disk, the disk is rejected, otherwise the disk is accepted; the process is repeated until a continuous number of rejections is observed. For example, Dunbar and Humphreys applied a data structure called a fan-shaped sector to record the active front end of the sampled disk set, which reduced the algorithm's running time complexity, but there was a sampling bias; White et al. first proposed using a quadtree structure to accelerate the sampling process, and the subsequent work of Ebeida et al. further accelerated the sampling process by sampling flat fragment arrays instead of using hierarchical quadtrees; Jones first proposed an unbiased maximum Poisson disk sampling algorithm, which used the Voronoi diagram to extract gaps in the sampling domain and further resampled to achieve the maximum sampling characteristics in an unbiased manner. However, most algorithms of this type of method can only handle uniform sampling and cannot accurately control the number of sampling points. In addition, the running cost is very high for a large number of point sets with uneven density, and it is difficult to take into account the characteristics of fast, unbiased, and strong scalability.
[0006] The second is sampling based on relaxation iteration. The Lloyd method provides the basic mechanism of this method. Its main goal is to evenly distribute the points while avoiding over-closeness. This method continuously moves the points to the center line of the Voronoi diagram, relying on this repeated relaxation process to form the final centroid Voronoi diagram. After generating the initial point set, the point position is optimized using Lloyd iteration until convergence. For example, Deussen et al. proposed the weighted LBG method, starting from the initial point distribution derived from the halftone technique, and applying relaxation based on the centroid voronoi diagram locally using a manually controlled brush according to the light and dark parts of the image; Secord made substantial improvements on this basis, and he proposed the weighted centroid voronoi diagram (WVS), which weighed the calculation in the region according to the image tone (color or grayscale value) to be reproduced, and then proposed a fast stippling process based on pre-calculated stippling point distribution to reduce the computational cost; Balzer et al. introduced capacity constrained Voronoi tessellation (CCVT) to generate point sets with excellent blue noise characteristics, solving a major problem of WVS, namely the presence of regularity artifacts; de Goes et al. reformulated CCVT as a continuous constrained minimization problem based on optimal transport (BNOT), using power maps instead of Voronoi diagrams to perform density-adaptive sampling. Such methods are very suitable for algorithmic stippling, but in order to obtain better blue noise performance, this method relies on the ability of discretization, converges slowly, and even if implemented on GPUs, it is still inefficient for large-scale optimization problems.
[0007] The third type is based on tile or tile sampling. The core of this sampling method is to pre-calculate one or more tiles and then place them adjacent to each other to form a point set of arbitrary size. For example, Hiller et al. first used Wang tiles to generate non-periodic point sets with blue noise characteristics; Ostromoukhov et al. proposed using non-periodic Penrose tiling to generate blue noise patterns on 2D domains. This technique is very suitable for the generation of non-uniform sampling patterns, but produces quite strong artifacts in the spectral domain; Kalantari and Sen proposed other effective methods for quickly generating a large number of blue noise samples. The main idea is to first use existing methods to generate a set of initial Poisson disk samples, and then use the convolution theorem to replicate this set at different positions in the final space. This type of method is very fast and can generate a large number of point sets in a short time, but due to its approximation, its blue noise performance is not as good as the two sampling methods mentioned above, and the sampling quality is sacrificed.
[0008] In summary, the existing digital stippling methods cannot take into account both computational efficiency and blue noise quality, have low scalability, and have their own limitations. This problem urgently requires the emergence of methods with better performance. Summary of the invention
[0009] In view of the shortcomings of the prior art, the object of the present invention is to provide a computer stippling method based on circle stacking.
[0010] In order to achieve the above object, the present invention provides the following technical solutions:
[0011] A computer stippling method based on circle stacking comprises the following steps:
[0012] Adaptively divide the input original image into different spaces;
[0013] Constructing initial nodes for grayscale reconstruction for the divided image;
[0014] The initial nodes are re-layouted using a circle stacking layout method to achieve a compact and non-overlapping layout effect.
[0015] In the present invention, preferably, the adaptive spatial division of the input original image specifically comprises the steps of:
[0016] Convert the input original image from a color image to a grayscale image,
[0017] Initialize the nodes of the grayscale image, set the initial level to 0, and create a priority queue to store the nodes to be processed.
[0018] Calculate the grayscale statistics of each node and calculate its grayscale score;
[0019] When the grayscale of a node is lower than the set threshold, it is added to the array Gray and further segmentation of the node is terminated;
[0020] When the size of a node is greater than twice the minimum split size, it is split into four child nodes and the child nodes are added to the priority queue;
[0021] Otherwise, add the node to the array Gray and update the maximum level;
[0022] The nodes in the priority queue are classified according to their size. When the size of the node is greater than the maximum size, the node is added to the new queue, otherwise it is added directly to the Gray array;
[0023] Continue to refine the nodes in the new queue until the new queue is empty, and add all remaining nodes to the Gray array.
[0024] In the present invention, preferably, the conversion into a grayscale image is specifically obtained by using a weighted average calculation formula:
[0025] , R, G, B represent the intensity values of the red, green, and blue channels respectively.
[0026] In the present invention, preferably, the step of constructing an initial node for grayscale reconstruction from the divided image specifically comprises the following steps:
[0027] Based on the width of the grid ,high , minimum grid area and adjust the node number scaling factor Determine the number and initial positions of nodes in each grid region;
[0028] Generate the drawing radius of the node;
[0029] Generate a placeholder node.
[0030] In the present invention, preferably, the drawing radius of the generated node Specific steps:
[0031] Calculated based on the principle that the area ratio is the same as the perceived density Perceived Density The mapping of ;
[0032] by The sum of the areas drawn for the nodes of the radius is multiplied by the perceived density and the scale factor , the result is equal to the area of the grid, that is, , .
[0033] In the present invention, preferably, the circular stacking layout method is used to re-layout the initial nodes to achieve a compact and non-overlapping layout effect, which specifically includes the following steps:
[0034] Front chain initialization construction;
[0035] Locate the initial placeholder node placement position;
[0036] Traverse and search for the final placement location;
[0037] Filter placeholder nodes and adjust the size of nodes.
[0038] In the present invention, preferably, the front chain initialization construction steps are:
[0039] The initial front chain consists of the three nodes closest to the center of the canvas. , , composition;
[0040] Will round and circle The center of the circle is placed on axis, making the circle With circle Tangent, and the tangent point is the center of the canvas, circle and , All of them are tangent, and these three points are connected into a circular chain list, which serves as the front chain for the subsequent placement of new circles;
[0041] During the stacking process, the front chain is a doubly linked list consisting of the outermost circle of nodes that are tangent to each other;
[0042] Both placeholder nodes and nodes participate in the stacking process. The initial placement positions may overlap, and the initial positions will be adjusted in subsequent traversal searches.
[0043] In the present invention, preferably, the specific steps of locating the initial placeholder node placement position are:
[0044] The line connecting the node position and the center point of the canvas is recorded as ,calculate and Angle of positive axis , was recorded as the target angle;
[0045] The line connecting the preset placement position and the center is recorded as ,satisfy and The position with the smallest angle is the initial placement position;
[0046] Each node is divided into in ascending order one by one according to the Corner placement to get the initial placement of all nodes.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] The method of the present invention obtains different visual effects by adjusting parameters, and the user can conveniently adjust the visualization scale according to actual needs; it is suitable for different types of image scenes such as landscapes, buildings and characters, and has better adaptability and effect than other methods; it realizes point engraving based on the circle stacking algorithm, and optimizes the previous circle stacking algorithm of the present invention, and has high calculation efficiency; it uses the quadtree adaptive partitioning method to create a grid to generate engraved points, which can finely depict the grayscale changes in the image. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a schematic diagram of the method flow of the present invention.
[0050] Figure 2 It is a schematic diagram of the flow of the grayscale-based adaptive space division method of the present invention.
[0051] Figure 3 It is a schematic diagram of the initial node construction process of the present invention.
[0052] Figure 4 It is a schematic diagram of the flow of the circle stacking layout method of the present invention.
[0053] Figure 5 Schematic diagram of actual and ideal scenarios for node stacking.
[0054] Figure 6 for 、 Schematic diagram comparing the impact of parameters.
[0055] Figure 7 The figure shows the effect of processing a figure using the method of the present invention.
[0056] Figure 8 It is a schematic diagram for comparing the results of the present invention, the WVS method and the Poisson disk method on a landscape image.
[0057] Fig. 9 It is a schematic diagram for comparing the results of the present invention, the WVS method and the Poisson disk method on a building image.
[0058] Fig.10 It is a schematic diagram comparing the time consumption curves of the present invention and other methods.
[0059] Fig.11 It is a comparison diagram of the uniform grid layout and the quadtree space partitioning results adopted by the present invention. DETAILED DESCRIPTION
[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0061] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0062] See also Figure 1A preferred embodiment of the present invention provides a computer stippling method based on circle stacking. The method mainly converts the original image into a grayscale image, and then controls the quadtree segmentation grid according to the difference in grayscale values, thereby spatially dividing the image to achieve accurate analysis and processing of local features of the image, and then reconstructs the grayscale of the original image according to the grid filling points, and uses the circle stacking method under polar coordinates to reposition the generated points, and finally obtains the stippled image. The method has good computational efficiency, and the results tend to high-quality blue noise point distribution. At the same time, the generated points do not overlap with each other, are suitable for different scenes and have good visual effects, and users can easily adjust parameters to change the visualization effect according to actual needs, which solves the problems of low operating efficiency, poor visual effects, and poor scalability in related technologies.
[0063] The specific steps include:
[0064] a. Adaptive spatial division of the input original image: convert the input original color image into a grayscale image, and then use the quadtree algorithm to perform adaptive spatial division. The process of quadtree segmentation grid is controlled by the difference of grayscale values, and the distribution and density of the grid are optimized to better reflect the detailed features of the image.
[0065] b. The divided image constructs the initial nodes for grayscale reconstruction, maps the grayscale information of the image to the perceptual density, and generates a node set for image reconstruction. According to the area and grayscale of the grid, the number of nodes in each grid, the node occupancy radius, and the drawing radius are determined. The nodes in the entire layout form a node point set for subsequent deduplication processing.
[0066] c. The stacking layout method re-layouts the initial nodes to achieve a compact and non-overlapping layout effect; the circular stacking layout method is used to re-layout the node positions in the generated point set to ensure that the points do not overlap and are arranged as closely as possible. Through the front chain initialization construction, initial placement position positioning, and final placement position traversal search, a compact and non-overlapping layout effect is achieved. The filtering of placeholder nodes and the adjustment of node size can maintain the integrity and continuity of visualization and optimize the rendering effect.
[0067] Specifically, Figure 2 As shown, step a, adaptively dividing the input original image into two parts, specifically includes:
[0068] a1. The input original image is converted from a color image to a grayscale image, and the grayscale value is calculated using the weighted average formula:
[0069] . Among them, R, G, and B represent the intensity values of the red, green, and blue channels respectively.
[0070] a2. Initialize the nodes of the grayscale image, that is, initialize the root node that contains the entire grayscale image area, set the initial level to 0, and create a priority queue , used to store nodes to be processed;
[0071] a3. Collect the grayscale statistics of each node, including the average grayscale value and grayscale deviation, and calculate its grayscale score. First, traverse each pixel in the grid node to obtain the grayscale value array. , whose average value is The grayscale standard deviation of the grid area is ,Right now . The discrete degree of gray value in the region is quantified, thus reflecting the gray uniformity of the region. Then the gray value of the grid node is calculated, that is, .in, and are the width and height of the grid respectively.
[0072] If the grayscale of the grid node is lower than the set grayscale threshold , it is added to the final grid array and further splitting of this grid node is terminated. If the size of the grid node is greater than twice the minimum split size ( ), it is split into four sub-grid nodes and the sub-grid nodes are added to the queue If the size of a grid node is less than twice the minimum split size and the score does not meet the threshold condition, then add it to the array and update the maximum level ,The maximum level is used to limit the depth of segmentation;
[0073] a4. Process the remaining nodes in the priority queue, classify the nodes in the priority queue according to their size, and add the node to the new queue when the size of the node is larger than the maximum size. Otherwise, add it directly to the array Gray, indicating that the size of the area meets the requirements. If the new queue is empty, terminate the process. The maximum size is used to control the coarseness of the segmentation.
[0074] a5. Continue to refine the nodes in the new queue until the new queue is empty, and add all remaining nodes to the array Gray. By dividing the image into adaptive grids and calculating the gray value of each grid, this method can accurately analyze the local features of the image and optimize the distribution and density of points. The use of the quadtree structure ensures the flexibility and accuracy of segmentation and can handle various complex image features.
[0075] By calculating the grayscale value of each grid and controlling the size of the grid, the image is segmented into adaptive grids. This method can accurately analyze the local features of the image and optimize the distribution and density of points. The use of the quadtree structure ensures the flexibility and accuracy of segmentation and can handle various complex image features: more grids are divided in areas with obvious grayscale changes for subsequent grayscale reconstruction, presenting the grayscale changes of the area in more detail. Areas with less obvious grayscale changes are divided into fewer and larger grids to improve the efficiency of subsequent grayscale reconstruction.
[0076] Specifically, Figure 3 As shown, step b, construct the initial node for grayscale reconstruction for the divided image, and generate a set of engraved points for image reconstruction by mapping the grayscale information of the image to the perceived density. The grayscale value is directly mapped to the perceived density to reflect the density of the image area. Specifically, the perceived density refers to the number of engraved points per unit area, which is inversely proportional to the grayscale value: the higher the grayscale value, the lower the perceived density, and vice versa. Through this association, we can convert the grayscale value into the distribution density of the engraved points, and then determine the number and position of the engraved points. The specific steps include:
[0077] b1. According to the width of the grid ,high , the minimum grid area min_area and the node number scaling factor multiple determine the number of nodes num per grid area:
[0078] , α∈{1.5, 2, 2.5, 3⋯⋯};
[0079] The properties of the node include the center position ( ), footprint radius , Draw Radius and Grayscale , used to represent the occupied area, colored area and colored grayscale in the engraved point. The center position ( ) is randomly generated in the grid area through a random number function, Determined by the size of the area and the number of points to be calculated. The sum of the areas occupied by the nodes with a radius equals the area of the grid where they are located. The occupancy radius of each node in the grid is the same, and the center of the circle is randomly distributed in the grid area. A circle with radius may intersect the mesh border.
[0080] b2. Drawing radius of generated nodes: calculated based on the principle of equal area ratio and perceived density Perceived Density The mapping of . Perceived Density The value range is , from 0 to 1 corresponds to pure white to pure black, The value range is , from 1 to 255 corresponding to pure black to pure white. This ensures that the grayscale and perceived density are consistent from a macroscopic perspective of the entire image. The sum of the areas drawn for the nodes of the radius is multiplied by the perceived density and the scale factor , the result is equal to the area of the grid, that is, , The drawing radius of each node is the same, and the scale factor can be changed Adjust the drawing radius of nodes in the entire layout;
[0081] b3. Generate placeholder nodes: based on perceived density Less than threshold Placeholder nodes are added to the area to ensure that each grid has at least a certain number of nodes. The properties of the placeholder nodes include the center position ( ) and footprint radius , only participate in the layout of nodes, and will be filtered out in subsequent rendering. Placing placeholder nodes can avoid large blank areas with missing nodes in the layout, maintaining the integrity and continuity of the visualization.
[0082] Specifically, Figure 4 As shown, step c, the initial nodes are re-layouted using the circular stacking layout method to achieve a compact and non-overlapping layout effect. The circular stacking layout method is mainly used to re-layout the initial node positions generated in the first step to ensure that the points do not overlap and are arranged as closely as possible to reconstruct the grayscale distribution of the original image as much as possible. This method achieves the ability to quickly find the target position through sector division and front chain construction, and adopts the strategy of traversal search and placeholder node filtering to improve the efficiency and accuracy of the algorithm. Specifically including the steps:
[0083] c1. Initialization of the front chain. The initial front chain consists of three nodes closest to the center of the canvas. , , When constructing the initial front chain, the circle and circle The center of the circle is placed on axis, making the circle With circle Tangent, and the tangent point is the center of the canvas. and , These three points are connected into a circular linked list, which serves as the front chain for placing new circles. In the stacking process, the front chain is a doubly linked list consisting of the outermost circle of nodes that are tangent to each other. Both the placeholder nodes and the nodes participate in the stacking process, and the initial placement positions may overlap. The initial positions will be adjusted in the subsequent traversal search.
[0084] c2. Initial placement position positioning. First, record the line connecting the node position and the center point of the canvas as ,calculate and Angle of positive axis , is recorded as the target angle. The line connecting the possible placement positions and the center is recorded as ,satisfy and The position with the smallest angle is the initial placement position. Place each node according to its distance from the center in ascending order one by one according to the Corner placement to get the initial placement of all nodes.
[0085] c3, the final placement traversal search, this step traverses the entire front chain to find the chain and the node The node with the smallest target angle difference , which is considered to be the initial In the best case scenario, It should be However, in many cases, when When it is in the ideal position, it will intersect with other nodes on the chain. The figure shows two typical cases. Therefore, during the search process, a stage threshold is set. is 50, which is used to control the number of comparisons during the traversal search process. The center is The front chain window is gradually moving away from Try all possible Yes, until you find one that meets your requirements. right.
[0086] c4. Filtering placeholder nodes and adjusting node size. Placeholder nodes only serve to fill blank spaces and should not be rendered in the final visualization. Therefore, after participating in the layout, these nodes are filtered out in this step. In addition, the size of the nodes can be adjusted globally or locally as needed to change the density perception of the layout and make the visual effect more in line with actual needs.
[0087] Through the above steps, the circle stacking layout method for deduplication of engraved points can efficiently process a large amount of circular data and achieve a compact and non-overlapping layout effect, thereby effectively reconstructing the grayscale distribution of the original image.
[0088] In this embodiment, in the initial node construction method for grayscale reconstruction, the number of nodes in the point set is recorded as . Assign center coordinates to data points in the grid, , the time complexity of this step is .
[0089] The time complexity of the circle stacking layout method for node deduplication is relatively complex. In step c2, the time complexity of calculating the distance and angle of each node is The time complexity of sorting all nodes by distance is In step c3, the entire front chain is traversed to determine The time complexity is , m is the length of the current front chain. The length of the truncation window is fixed to , so determine the eligible The upper limits on the number of attempts required and the number of intersections to check for each attempt are and . is a constant that is independent of the node attributes, so the time complexity of finding the final placement position in the truncation window is Therefore, for each node to be placed, the time complexity of determining its final placement is , As the stacking continues to grow, the growth pattern of the front chain length is proved below: , is the number of nodes currently placed, and proves that placement The time complexity of step c3 for nodes is .
[0090] As the stacking progresses, the front chain gets longer and longer, but its growth pattern is not linear. Considering the radius distribution and placement order of the input nodes, the front chain is almost a standard circle in the macroscopic sense during the entire stacking process. The radius of the current front chain circle is , the number of nodes that have been placed is , the radius of the i-th circle in the placement sequence is Yes, the number of nodes on the front chain is .like Figure 5 As shown, assuming an ideal situation - the radius of all placed nodes is the average value , which can be considered as an ideal situation for all practical complex situations. The size of is, the following two equations hold:
[0091]
[0092]
[0093] We can get:
[0094]
[0095] Then the growth pattern of the front chain is Then, in step 3, in order to find And need
[0096] The total number of nodes traversed is:
[0097]
[0098] Therefore, the time complexity of step 3 is .
[0099] The time complexity of step c4 filtering placeholder nodes is obviously Given that Therefore, the time complexity of the circular stacking layout algorithm for node deduplication is .
[0100] In this embodiment, the user can adjust the parameters to obtain different visual effects, and the user can easily adjust the visualization scale according to actual needs. The user can intuitively and simply control the number of engraved points and the generated effect of the picture, thereby generating visual abstractions of different scales. This flexibility not only improves the applicability of the algorithm, but also makes the present invention easier to operate and control in practical applications, and can be adjusted to meet the diverse needs of different users. The physical meaning of each parameter and its impact on the image effect are as follows:
[0101] 1. The grayscale threshold used to determine whether a node is a placeholder node.
[0102] The parameter participates in the grayscale reconstruction of the original image, affecting the sensitivity of the grayscale of the original image during the initial point construction. The larger the parameter value, the more placeholder nodes are determined and the stronger the contrast, which can simulate the high-contrast overexposure effect.
[0103] 2. The minimum size of the grid, which affects the rendering of details. The default value is 16.
[0104] : The maximum size of the grid, which controls the coarseness of the segmentation. The default value is 128.
[0105] [ , ] parameter participates in the quadtree segmentation process, affecting the maximum and minimum values of the segmentation grid width, which is determined by Figure 6 It can be seen that the changes and When the grid size is adjusted, the number of points changes, and the appropriate grid size parameter can balance the display of foreground details and the overall background. Appropriately tightening the grid size range can make the overall grayscale change more obvious, but some foreground details may be lost.
[0106] 3. α: Controls the number of points in each divided square, which is modified in multiples. The default value is 1.5.
[0107] The α parameter participates in the initial point construction process and directly affects the number of points. The larger the α, the more points there are and the clearer the details. However, if the parameter value is too large, the density of points in each divided square will be too high, forming a mosaic-like block blur.
[0108] In addition, the number of points directly affects the resolution and detail of the image. The number of points can be adjusted by changing the above parameters. Increasing the number of points can improve the clarity and detail expression of the image, but it may also lead to a longer calculation time.
[0109] It can be seen from the comparison chart of the test results that the method of the present invention is applicable to different types of image scenes such as landscapes, buildings and people, and has better adaptability and effect than other methods. Figure 7 As shown, the effect supports scaling, and targets are generated by engraved dots of different sizes. Whether it is a macro layout or micro details, the present invention can provide an excellent visual product, making the point painting performance more vivid and intuitive.
[0110] like Figure 8 As shown, for landscape images, the stipple results using the method of the present invention can effectively express the difference between light and dark in the landscape images, and the details are well preserved.
[0111] like Fig. 9 As shown in the figure, for architectural images, our method can restore the architectural structure well and accurately depict the grayscale of the original image.
[0112] For human images, our method can effectively capture facial features and skin color changes, restore details well, and accurately depict grayscale.
[0113] Compared with the existing methods, when the number of stippling remains similar, the method of the present invention can provide better visual effects while maintaining image details.
[0114] The present invention implements stippling based on the circle stacking algorithm, optimizes the previous circle stacking algorithm, and innovates in the details of the algorithm. Traditional circle stacking algorithms usually face the problem of excessive computational complexity when processing large-scale data, resulting in excessively long running times. In order to solve this problem, the present invention introduces a data-independent truncation threshold, which is carefully adjusted to ensure that the algorithm can run efficiently and stably under various conditions, thereby significantly improving the computational efficiency of the stacking algorithm. Through this improvement, it only takes about 10 seconds to layout 1 million nodes using a single CPU, and it shows extremely high stability and computational efficiency in practical applications. This makes the algorithm not only suitable for static image processing, but also for dynamic scenes such as video stippling. Efficient computing power can significantly reduce processing time and improve real-time performance. When processing images with the same resolution, the algorithm of the present invention can complete calculations in a shorter time. Such as Fig.10 The efficient computing capability enables the method of the present invention to be widely used in scenarios requiring real-time processing, such as video surveillance and dynamic visual effect generation.
[0115] The overall idea of the method of the present invention is simple and clear, easy to understand and implement. The core idea is to place the generated points of the quadtree adaptive partitioning method through a circle stacking algorithm. This method is not only suitable for the current application scenario, but can also be expanded and adjusted according to actual needs to adapt to different application needs. In addition, superpixel segmentation can be used instead of the quadtree algorithm to perform space partitioning to generate points.
[0116] like Fig.11 As shown, the present invention uses the quadtree adaptive partitioning method to create a grid to generate points, which can finely depict the grayscale changes in the image. Different from the uniform grid layout, the quadtree space partition is divided according to the intensity of the grayscale changes in the image, and the density of points is increased in the area where the grayscale changes drastically, which can more accurately capture the detail changes. Fig.11 The figure shows the comparison of the effects of uniform grid layout and quadtree space division in areas with drastic grayscale changes, under the premise that the overall number of points is similar. It can be seen that the boundary depiction on the right is clearer and cleaner, indicating that quadtree space division can provide more detailed depiction when dealing with areas with drastic grayscale changes.
[0117] In some other preferred embodiments of the present invention, a computer-readable storage medium is provided, storing a computer program. When the computer program is executed by a processor, the processor executes the steps of the method described in the above embodiment.
[0118] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0119] The above description is a detailed description of the preferred feasible embodiments of the present invention, but the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modified changes completed under the technical spirit suggested by the present invention should fall within the patent scope covered by the present invention.
Claims
1. A computer stippling method based on circle stacking, characterized in that: Includes steps: Adaptively divide the input original image into two parts: Convert the input original image from a color image to a grayscale image, Initialize the nodes of the grayscale image, set the initial level to 0, and create a priority queue to store the nodes to be processed. Calculate the grayscale statistics of each node and calculate its grayscale score; When the grayscale of a node is lower than the set threshold, it is added to the array Gray and the segmentation of the node is terminated; When the size of a node is greater than twice the minimum split size, it is split into four child nodes and the child nodes are added to the priority queue; Otherwise, add the node to the Gray array and update the maximum level, which is used to limit the depth of segmentation; Classify the nodes in the priority queue according to their size. When the size of the node is greater than the maximum size, add the node to the new queue, otherwise add it to the Gray array; Continue to split the nodes in the new queue until the new queue is empty, and add all the remaining nodes to the Gray array; Construct the initial node for grayscale reconstruction for the divided image: Based on the width of the grid ,high , minimum grid area and adjust the node number scaling factor Determine the number of nodes num and initial position of each grid area, The properties of the node include the center position ( ), footprint radius , Draw Radius and Grayscale , used to represent the occupied area, colored area and colored grayscale in the node; The drawing radius of the generated node : Grayscale is calculated based on the principle that the area ratio and perceived density are the same Perceived Density The mapping of , Grayscale The value range is , from 1 to 255 corresponds to pure black to pure white; The drawing radius of the node for: , scaling factor ; Generating placeholder nodes: In terms of perceived density Less than threshold Add placeholder nodes to the area; The initial nodes are re-layouted using the circle stacking layout method to achieve a compact and non-overlapping layout effect: Initialize the front chain construction. The initial front chain consists of the three nodes closest to the center of the canvas. , , composition; Locate the initial node placement position; Traverse to find the final placement of the search node; Filter placeholder nodes and adjust the size of nodes.
2. A computer stippling method based on circle stacking according to claim 1, characterized in that: The conversion to grayscale image is specifically obtained by using a weighted average calculation formula: , R, G, B represent the intensity values of the red, green, and blue channels respectively.
3. The computer stippling method based on circle stacking according to claim 1, characterized in that: The steps for initializing the front chain are: The initial front chain consists of the three nodes closest to the center of the canvas. , , composition; Will round and circle The center of the circle is placed on axis, making the circle With circle Tangent, and the tangent point is the center of the canvas, circle With circle ,round All of them are tangent, and these three points are connected into a circular chain list, which serves as the front chain for the subsequent placement of new circles; In the stacking process, the front chain is a doubly linked list consisting of the outermost circles that are tangent to each other; Both placeholder nodes and nodes participate in the stacking process. When the initial placement positions overlap, the initial positions are adjusted in the subsequent traversal search.
4. The computer stippling method based on circle stacking according to claim 2, characterized in that: The specific steps for locating the initial node placement are: The line connecting the node position and the center point of the canvas is recorded as ,calculate and Angle of positive axis , was recorded as the target angle; The line connecting the preset placement position and the center point of the canvas is recorded as ,satisfy and The position with the smallest angle is the initial placement position; Each node is divided into in ascending order one by one according to the Corner placement to get the initial placement of all nodes.
Citation Information
Patent Citations
Large-scale scatter diagram overlap removing method based on circle stacking
CN118552464A