Scatter diagram generation method based on object profile diagram

By generating scatter plots that match the contours of course icons using a contour matching algorithm, the problems of low efficiency and substandard visual effects in existing technologies are solved, achieving efficient and accurate scatter plot generation and improving the visualization effect of knowledge graphs.

CN121170069APending Publication Date: 2025-12-19SHANGHAI ABLE DIGITAL & TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511076593.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing technologies for generating scatter plots of course identifiers in knowledge graphs are inefficient, struggle to accurately match preset outlines and a fixed number of scatter points, resulting in long construction cycles and substandard visual effects.

Method used

Through contour matching algorithms, including contour preprocessing, uniform sampling and initial scatter point generation, scatter point-contour matching optimization and deduplication of non-closed contours, a scatter point layout scheme adapted to the course logo contour is generated, ensuring that the total number of scatter points strictly matches the number of knowledge points, thereby enhancing the restoration accuracy and visual recognizability of the logo contour.

Benefits of technology

It significantly improves the efficiency of scatter plot generation, supports automatic alignment of a fixed number of scatter points with complex contours, avoids human error, and enhances the visualization value of knowledge graphs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121170069A_ABST
    Figure CN121170069A_ABST
Patent Text Reader

Abstract

The invention provides a scatter diagram generation method based on an object contour diagram, and belongs to the technical field of graphic processing, and the method comprises the steps: contour preprocessing: carrying out the smooth denoising processing of a contour diagram, carrying out the Gaussian blurring of the contour diagram, converting the contour diagram into a binary image, extracting a contour set of a connected region in the binary image, and carrying out the Gaussian blurring of the contour image; calculating the surrounding area of each contour and carrying out noise filtering; uniform sampling and initial scatter point generation: constructing a pixel point set, and calculating a maximum distance and a minimum distance of sampling; and scatter-contour matching optimization: traversing the contour line and the scatter set, and eliminating interference scatters to obtain a final scatter diagram of the object contour. Through the methods of uniform sampling, contour point matching, repeated point de-duplication and the like, a specified number of uniformly distributed scatter points can be quickly generated for a contour map. According to the method, the defect of scatter point generation in the current method is overcome, model training is not needed, generalization is high, and the method can be widely used in profile diagrams of various graphs.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present specification relates to the technical field of image processing, in particular to a scatter plot generation method based on object contour map. BACKGROUND

[0002] In the visualization construction of the knowledge graph, the scatter points corresponding to the course knowledge points need to be arranged according to the course logo contour to improve the beauty and recognition of the graph. However, the existing technology relies on manual arrangement of scatter points, which has the problems of low efficiency, difficulty in accurately matching the preset contour and fixed number of scatter points, resulting in long construction period and substandard visual effect.

[0003] The existing Chinese patent CN115619866A relates to a SEM image contour positioning method, a contour positioning system and a computer medium. The SEM image contour positioning method includes: obtaining a SEM scan image and extracting discrete feature points of the contour in the scan original image; generating an auxiliary line segment connected to each discrete feature point based on the initial position of each discrete feature point; translating or rotating each discrete feature point in a preset direction in the plane in which it is located until the auxiliary line segment intersects the original image, and calculating a loss value based on the total motion distance of each discrete point; repeating the preset number of times of motion and loss value calculation, continuously comparing the size of the loss value obtained each time until the preset number of times of motion is completed; obtaining the final position of each discrete feature point based on the minimum loss value after the preset number of times of motion; adjusting the corresponding discrete feature point based on the final position to obtain the optimized contour of the SEM scan image and perform positioning. This method reduces the amount of calculation, improves the operation efficiency, and further improves the contour extraction efficiency of the SEM image.

[0004] The above-mentioned technology is for the contour positioning of SEM images in the game field, and there is an essential difference between SEM images and course logos in the knowledge graph, so the contour scanning method in the above-mentioned existing technology cannot be directly used.

[0005] Therefore, it is necessary to provide a scatter plot generation method based on object contour map for the identification and extraction of course logo contour. SUMMARY

[0006] The present application provides a scatter plot generation method based on object contour map, which can quickly generate a scatter point arrangement scheme adapted to the course logo contour through a contour matching algorithm, and can ensure that the total number of scatter points strictly matches the number of knowledge points, avoiding redundancy or loss. In addition, through scatter point space distribution optimization, the restoration degree and visual recognition of the logo contour are enhanced.

[0007] In some embodiments, a scatter plot generation method based on object contour map includes, Contour preprocessing: the contour graph is smoothed and denoised, then the contour graph is Gaussian blurred, the contour graph is converted into a binary image, the contour set of the connected region in the binary image is extracted, and the noise is filtered by calculating the enclosed area of each contour; Uniform sampling and initial scatter point generation: a pixel point set is constructed, and the maximum distance and minimum distance of sampling are calculated; Scatter point-contour matching optimization: the contour line is traversed with the scatter point set, and the final scatter point graph of the object contour is obtained after removing the interference scatter points.

[0008] Further, the construction of the pixel point set specifically includes obtaining the set M of non-zero pixel points in the binary image, and the initial scatter point generation specifically includes the following steps: S1: initialize the scatter point set N, and randomly select an element in the set M to add to the set N; S2: iteratively calculate the minimum distance from the remaining points in the set M to the set N, add the point with the maximum distance to the set N and remove it from the set M; S3: repeat the iteration until the number of scatter points in the set N reaches n.

[0009] Further, the scatter point-contour matching optimization specifically includes the following steps: SA1: traverse all contour lines C, detect adjacent contour points of the scatter point set N, form a local contour point set C_part and a corresponding adjacent scatter point subset N_part; SA2: select the same number of points in the local contour point set C_part as the scatter point subset N_part at equal intervals to generate an optimized scatter point subset P; SA3: remove the scatter point subset N_part from the set N, and add the scatter point subset P to the final scatter point set O.

[0010] Further, step SA1 further includes non-closed contour de-duplication processing, specifically, SA11: traverse the optimized contour point set C_part, and calculate the Euclidean distance between each point and other points; SA12: if there is a neighboring point with a distance less than 2 times the average distance of the scatter points, and the index offset is within ±2, then it is determined to be adjacent points; SA13: if the index offset exceeds the threshold, it is determined to be a duplicate point, and the redundant point with a larger index value is deleted.

[0011] Further, in the contour preprocessing, the contour graph is sent to the image operation end as input, and the preprocessing of the contour graph is completed through the modules set on the image operation end.

[0012] Further, in the contour preprocessing, the contour graph is Gaussian blurred by using the GaussianBlur module.

[0013] Furthermore, the contour preprocessing also includes dynamically adjusting the threshold according to the image grayscale distribution, and converting the contour map into a binary image through the adaptiveThreshold module.

[0014] Furthermore, the findContours module is used to extract the contour set of all connected regions in the binary image, which contains all contour lines C.

[0015] The beneficial effects of this invention are: 1. Solve the problem of uneven density of generated scatter points and repeated points for non-closed contours in the existing technology; 2. Overcome the shortcomings of existing technologies that use neural networks to directly predict contour point coordinates from images, such as insufficient smoothness and poor generalization. Attached Figure Description

[0016] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein: Figure 1 This is a schematic diagram illustrating the working principle of contour drawing preprocessing according to embodiments of this specification; Figure 2 This is a schematic diagram of the initial scatter points shown according to some embodiments of this specification; Figure 3 This is a schematic diagram of scatter points after processing according to some embodiments shown in this specification; Figure 4 This is a schematic diagram illustrating non-closed contour deduplication processing according to some embodiments of this specification. Detailed Implementation

[0017] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0018] It should be understood that the terms “system,” “device,” “unit,” and / or “module” used herein are one way to distinguish different components, elements, parts, sections, or assemblies at different levels. However, if other terms can achieve the same purpose, they may be replaced by other expressions.

[0019] As indicated in this specification and claims, unless the context clearly indicates otherwise, the words "a," "an," "an," and / or "the" do not specifically refer to the singular and may also include the plural. Generally speaking, the terms "comprising" and "including" only indicate the inclusion of expressly identified steps and elements, which do not constitute an exclusive list, and the method or apparatus may also include other steps or elements.

[0020] Flowcharts are used in this specification to illustrate the operations performed by the system according to embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed in exact order. Instead, the steps can be processed in reverse order or simultaneously. Furthermore, other operations can be added to these processes, or one or more steps can be removed from them.

[0021] Example: The scatter plot distribution of an object's contour contains core features of a two-dimensional graphic (such as shape, size, and topology). These features can be accurately extracted through scatter plot generation, serving graphic recognition, classification, or analysis. This invention provides a method for generating scatter plots based on object contour maps, comprising the following steps: Step S1: Contour Map Preprocessing 1. Image Denoising: Smooth the contour image by applying Gaussian blur to the input contour image using the GaussianBlur method from the OpenCV tool library; 2. Adaptive Binarization: The threshold is dynamically adjusted according to the grayscale distribution of the image. The OpenCV tool library is used to call the adaptiveThreshold method to convert the contour map into a binary image. 3. Contour extraction and noise filtering: (1) Use the findContours method of the OpenCV library to extract the contour set C of all connected regions in the binary image; (2) Calculate the bounding area of ​​each contour, identify areas with an area less than a preset threshold as noise, and set the corresponding binary image area to zero.

[0022] The Gaussian Blur module (or Gaussian Blur module) in OpenCV is the core function for implementing Gaussian blur. Its working principle is based on Gaussian filtering. Essentially, it performs a convolution operation on the image using a Gaussian kernel to achieve the effect of smoothing the image and removing noise. The Gaussian kernel is a square matrix of size (k_size, k_size) (k_size is usually an odd number, such as 3×3, 5×5, 7×7, etc.). Each element value in the matrix is ​​represented by a two-dimensional Gaussian function. The center of the Gaussian kernel is aligned with each pixel in the image. The kernel's range covers the neighborhood around the pixel (the size of the neighborhood is determined by the kernel size k_size, such as a 3×3 kernel covering the center pixel and the surrounding 8 pixels). The weight of each position in the kernel is calculated and multiplied by the corresponding image pixel value. All products are then summed, and the result is used as the new value of the center pixel. The above process is repeated until the kernel slides over every pixel of the image (edge ​​pixels are usually handled by padding with zeros, copying edges, etc. to avoid going out of bounds).

[0023] The Adaptive Threshold method (or the Adaptive Threshold module) is a thresholding method for images with uneven lighting. Unlike fixed thresholding (such as the threshold function), it automatically calculates the threshold based on the brightness of local regions of the image, thus more effectively segmenting the foreground and background under complex lighting conditions. Adaptive Threshold solves this problem through locally adaptive thresholding: the threshold of each pixel is determined by the pixel values ​​of its surrounding neighborhood, thereby adapting to local lighting variations. For each pixel (x, y) in the image, a statistic (mean or Gaussian weighted mean) is calculated for a neighborhood centered on it (such as an 11×11 window), and the threshold of that pixel is determined based on the statistic. The image is divided into multiple overlapping local neighborhoods (usually squares, with the size specified by the blockSize parameter, such as 3×3, 5×5, 11×11, etc., and must be an odd number). For each pixel (x, y), the threshold of each neighborhood is calculated according to the parameter adaptive Method. For each pixel (x, y), its gray value is compared with the threshold of its neighborhood.

[0024] The `findContours` method involves tracing the boundaries of foreground connected regions in a binary image. It records a continuous set of boundary points by traversing pixels and, based on parameter settings, records the hierarchical relationship of the contours or compresses redundant points. It transforms "regions" in an image into "quantifiable sets of points".

[0025] Step S2: Uniform sampling and initial scatter point generation, please refer to...Figure 2 , 1. Pixel set construction: Obtain the set M of non-zero pixels in the binary image; 2. Maximum and minimum distance sampling: Uniformly sample a set N of scattered points of a specified number n from a set M, specifically including: (1) Initialize the scatter set N, and randomly select an element from M to add to N; (2) Iteratively calculate the minimum distance from the remaining points in M ​​to N, add the point with the largest distance to N and remove it from M; (3) Repeat the iteration until the number of scattered points of N reaches n.

[0026] Step S3: Scatter Point-Contour Matching Optimization 1. Contour matching detection: Please refer to... Figure 1 , (1) Traverse all contour lines C, detect contour points adjacent to the scatter point set N, and form a local contour point set C_part and the corresponding adjacent scatter point subset N_part; (2) Select points at equal intervals in C_part, with the same number of points as N_part, to generate an optimized scatter subset P; (3) Remove N_part from N and add P to the final scatter set O; 2. Multi-contour traversal: Repeat step S3.1 until all contour lines have been processed, and output the scatter point set O. Please refer to... Figure 3 This yields a smoothed scatter plot.

[0027] Step S4: Deduplication of non-closed contours For the issue of repeated scattered points on non-closed contours, please refer to... Figure 4 Perform the following operations after S3-1-1: 1. Neighbor point detection: Traverse the optimized contour point set C_part and calculate the Euclidean distance between each point and other points; Set a distance threshold d_threshold (based on the image resolution, such as 5 pixels). For each point p in the scatter set N, iterate through all contour lines Cⱼ and calculate the shortest distance d(p, Cⱼ) from p to each point on Cⱼ. If d(p, Cⱼ) ≤ d_threshold, then p is determined to be an adjacent point of Cⱼ and is assigned to N_part; at the same time, the point on Cⱼ that is closest to p and the k consecutive points before and after it (k is set according to the contour density, such as 3-5) are assigned to C_part, forming a corresponding relationship (N_part, C_part). If a scatter point p is adjacent to multiple contours at the same time, the contour with the smallest distance is selected as the matching object.

[0028] 2. Duplicate point identification and removal: (1) If a point has a neighboring point whose distance is less than twice the average distance of the scattered points, and the index offset is within ±2, then it is determined to be a neighboring point; (2) If the index offset exceeds the threshold, it is determined to be a duplicate point, and the redundant point with the larger index value is deleted.

[0029] This embodiment also includes knowledge point weight mapping: adjusting the size of the scatter plots according to the importance of the knowledge points (the higher the weight, the larger the plot), and ensuring that important knowledge points are preferentially distributed in the visual focal area of ​​the outline (such as the center or prominent edge of the logo). Multi-course comparison: Scatter plots of logo outlines for multiple courses were generated using the same sampling and optimization parameters. Different courses were distinguished by color, facilitating horizontal comparison of knowledge point coverage. Notably, the 2D outlines were expanded to 3D model surface outlines. The scatter points were distributed in 3D space according to the model surface outline. N was generated by sampling the maximum and minimum distances in space, and the position of point P was optimized using the normal vector of the 3D outline. This upgrade from "planar scatter points" to "3D scatter points" is suitable for the visualization of 3D logos and product models. At the technical level, Python combined with OpenCV and NumPy libraries can be used to implement the relevant functions. OpenCV is used for image reading, binarization, contour extraction, and other operations, while NumPy can efficiently handle numerical operations such as storing pixel sets and calculating distances, improving algorithm execution efficiency. For scenarios requiring real-time interaction, GUI libraries such as PyQt or Tkinter can be used to build interactive interfaces, allowing users to intuitively set parameters and view processing results. In the maximum and minimum distance sampling process, the KD-tree data structure can be used to index the pixel set, accelerating distance calculation. KD-trees can efficiently perform nearest neighbor search, reducing unnecessary distance calculations, especially when processing large-scale point sets. For equal-interval sampling in contour matching detection, linear interpolation can be used to accurately calculate the coordinates of sampling points, ensuring that the generated optimized scatter subset P accurately fits the contour.

[0030] It is worth noting that, through further extension, this technology includes, but is not limited to, naked-eye 3D scatter projection: converting the coordinates of the final scatter set O into holographic projection signals, and using light field rendering technology to reconstruct a three-dimensional scatter array in physical space. Users can trigger the dynamic reorganization of the scatter points through gesture interaction (such as waving their hand across the outline area), intuitively experiencing the process of knowledge points unfolding hierarchically according to the logo outline, which is suitable for immersive teaching or brand display; Biofeedback Adaptive Display: Combining eye-tracking devices, this feature analyzes the contour region the user is focusing on (e.g., the top left corner of a logo) and adjusts the display precision of scattered points in that region in real time (e.g., magnifying local scattered points and displaying detailed information). Simultaneously, it reduces the density of non-focused areas, maximizing information transmission efficiency with limited visual resources. Quantum Annealing Sampling: Drawing inspiration from the superposition principle of quantum computing, this feature represents the "selection status" of a pixel as a superposition of qubits in maximum-minimum distance sampling. The quantum annealing algorithm finds the globally optimal n points, avoiding the pitfalls of traditional iterative methods (e.g., excessively dense scattered points in contour depressions), making it particularly suitable for handling complex contours such as fractal structures. Entangled Scattered Network: Establishes quantum entangled relationships for points in a scattered set O. When the coordinates of a point are adjusted due to contour changes (such as stretching or rotation), the associated points will automatically update their positions according to preset topological constraints (such as maintaining symmetric distance), without the need to re-execute the full process sampling, thus improving processing efficiency by 3 to 5 times.

[0031] In summary, a scatter plot generation method based on contour maps is proposed, which can not only significantly improve efficiency, replace manual operation, and shorten the knowledge graph construction cycle, but also support the automatic alignment of a fixed number of scatter plots with complex contours, avoiding human error. Furthermore, it can enhance visualization value: by arranging highly accurate marker contours, it can improve the professionalism of the knowledge graph and the user's cognitive experience.

[0032] The computer-readable storage medium includes, for example, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0033] Based on the same inventive concept, embodiments of the present invention provide an engineering cost and schedule management system, including a memory and a processor, wherein the memory stores information that can run on the processor to implement the following... Figures 1 to 4 The procedure for any method.

[0034] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0035] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of apparatuses or units may be electrical, mechanical, or other forms.

[0036] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0037] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0038] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.

[0039] The embodiments described herein are preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape, and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. A method for generating scatter plots based on object contour maps, characterized in that, include, Contour preprocessing: The contour image is smoothed and denoised, then Gaussian blurred to convert it into a binary image. The contour set of connected regions in the binary image is extracted, and the bounding area of ​​each contour is calculated for noise filtering. Uniform sampling and initial scatter point generation: Construct a set of pixels and calculate the maximum and minimum sampling distances; Scatter-contour matching optimization: Traverse the contour line and the scatter point set, and remove interfering scatter points to obtain the final scatter plot of the object contour.

2. The scatter plot generation method based on object contour map as described in claim 1, characterized in that, Constructing the pixel set specifically involves obtaining the set M of non-zero pixels in the binary image, and generating the initial scatter plot specifically includes the following steps: S1: Initialize the scatter set N, and randomly select an element from set M to add to set N; S2: Iteratively calculate the minimum distance from the remaining points in set M to set N, add the point with the largest distance to set N and remove it from set M; S3: Repeat the iteration until the number of scattered points in set N reaches n.

3. The scatter plot generation method based on object contour map as described in claim 2, characterized in that, Scatter-contour matching optimization specifically includes the following steps: SA1: Traverse all contour lines C, detect contour points adjacent to the scatter point set N, and form a local contour point set C_part and the corresponding adjacent scatter point subset N_part; SA2: Select points at equal intervals from the local contour point set C_part, with the same number of points as the scatter point subset N_part, to generate an optimized scatter point subset P; SA3: Remove the scatter subset N_part from set N and add the scatter subset P to the final scatter set O.

4. The scatter plot generation method based on object contour map as described in claim 3, characterized in that, Step SA1 also includes deduplication of non-closed contours, specifically, SA11: Traverse the optimized contour point set C_part and calculate the Euclidean distance between each point and other points; SA12: If a point has a neighboring point whose distance is less than twice the average distance of the scattered points, and the index offset is within ±2, then it is determined to be a neighboring point. SA13: If the index offset exceeds the threshold, it is determined to be a duplicate point, and redundant points with larger index values ​​are deleted.

5. The scatter plot generation method based on object contour map as described in claim 4, characterized in that, In contour preprocessing, the contour image is sent as input to the image processing terminal, and the preprocessing of the contour image is completed by the modules set on the image processing terminal.

6. The scatter plot generation method based on object contour map as described in claim 5, characterized in that, In the contour preprocessing, the contour image is Gaussian blurred using the GaussianBlur module.

7. The scatter plot generation method based on object contour map as described in claim 6, characterized in that, Contour preprocessing also includes dynamically adjusting the threshold based on the image's grayscale distribution, and converting the contour map into a binary image using the adaptiveThreshold module.

8. The scatter plot generation method based on object contour map as described in claim 6, characterized in that, The findContours module extracts the contour set of all connected regions in a binary image, containing all contour lines C.

Citation Information

Patent Citations

  • SEM image contour positioning method, contour positioning system and computer medium

    CN115619866A