Screen dot pattern generation method and computer readable medium
By using the original image as a reference image, the coordinates of the dots are generated based on multiple conversion parameters and random operations, the problem of difficult to accurately present the original image details and software inconvenient operation in the prior art is solved, and the rapid and convenient generation of rich details is achieved.
Patent Information
- Application Number
- CN202311624804.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2023-10-25
- Filing Date
- 2023-11-30
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to accurately present the details of the original image, and it is not convenient for users to design in software operation, resulting in less use of frequency modulation outlets and composite outlets in contact lens pattern design.
By using the pre-designed original image as a reference image, the coordinates of the dots are generated based on multiple conversion parameters and random operations, and the generation of dot patterns is realized. The method includes generating a grayscale value weight based on the reference image, inputting the dot size range, the total number of dots and the number of iteration operations, randomly generating initial random coordinates, and adjusting the dot distribution through iterative operations to generate the final dot pattern.
After the original image design is completed, dot patterns are quickly and conveniently generated that accurately presents the original image details, solving the shortcomings of dot patterns in the prior art in detail performance and software operation.
Smart Images

Figure CN119887958A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for generating a dot pattern and a computer-readable medium, and in particular to a method for converting a reference image file according to a plurality of conversion parameters and a random operation (random algorithm) to generate a dot pattern, wherein the computer-readable medium stores a program code for executing the above method. Background Art
[0002] In the current technology, for example, dot patterns can be applied to the pattern design of contact lenses, wherein the dot patterns include halftone dot patterns, and there are three types of halftone dots: amplitude modulation dots, frequency modulation dots, and composite dots.
[0003] AM dot is a dot printing technology that can convert the original image (reference image) into an image with a fixed center distance of each dot but adjustable dot size. By adjusting the size of the dot, AM dot can simulate the color depth and thickness of the original image to achieve the desired visual effect. However, compared with the original image, AM dot has the defect of not being able to accurately present the details of the pattern.
[0004] Frequency modulated dots are another dot printing technology. In frequency modulated dots, the size of each dot is the same, and the center distance of each dot is adjustable. However, since frequency modulated dots are inconvenient for users to design in software operation, it is not common to use frequency modulated dots in contact lens pattern design. In addition, if a large number of dots are used to pursue pattern details, it will cause production problems.
[0005] Compared with the first two technologies, composite dots are a newer technology that combines the characteristics of AM dots and FM dots. However, similar to FM dots, composite dots are not easy for users to design in software operation. Therefore, it is not common to use composite dots in contact lens pattern design.
[0006] In summary, the current pattern design of contact lenses is dominated by AM dots, which can achieve a certain degree of pattern effect, but are limited in detail expression. Compared with AM dots, FM dots and composite dots are less used because they are not convenient for users to design in software operation. In addition, the dot patterns designed by FM dots or composite dots are actually difficult to put into production application.
[0007] In summary, there is still a lack of a dot pattern generation technology that can accurately present the details of the original image and is easy for users to design in software operation. Summary of the invention
[0008] In view of this, the present invention provides a method for generating a dot pattern and a computer-readable medium. A computer device can access the computer-readable medium and execute the dot pattern generating method of the present invention. The dot pattern generated by the dot pattern generating method can be applied to contact lenses. With the dot pattern generating method provided by the present invention, a user can provide a pre-designed original image as a reference image to a computer device, and the computer device can generate a grayscale value weight corresponding to the reference image based on the reference image, and then input multiple conversion parameters (conversion parameters include, for example, dot size range, total number of dots, and number of iteration operations, etc.) and convert the reference image based on multiple conversion parameters and random operations (random algorithms), and generate the coordinates of the dots in a random operation manner to generate a dot pattern. In this way, after the original image design is completed, the user can quickly and conveniently use the original image as a reference image, accurately present the details of the original image and generate a dot pattern corresponding to the original image.
[0009] The dot pattern generation method provided by the present invention is suitable for a computer device, wherein the dot pattern generation method comprises: generating grayscale value weights according to a reference image file; inputting a plurality of conversion parameters, wherein the conversion parameters comprise: a dot size range, a total number of dots, and a number of iterative operations; generating a plurality of initial random coordinates corresponding to a plurality of dots by random operations according to the grayscale value weights, the dot size range, and the total number of dots; and performing dot distribution processing on the dots according to the number of iterative operations, the grayscale value weights, and the initial random coordinates to generate a plurality of iterative random coordinates, and generating a dot pattern by means of the iterative random coordinates, wherein the dot pattern comprises the dots.
[0010] In an embodiment of the present invention, the above-mentioned method for generating a halftone pattern further includes: storing the halftone pattern in a vector image file format.
[0011] In one embodiment of the present invention, in the above-mentioned method for generating a halftone dot pattern, the halftone dot size ranges from 0.001 mm to 1 mm.
[0012] In one embodiment of the present invention, in the above-mentioned method for generating a halftone dot pattern, the total number of halftone dots is between 10 and 10,000.
[0013] In one embodiment of the present invention, in the above-mentioned method for generating halftone patterns, the number of iterative operations is between 0 and 1000.
[0014] The computer-readable medium provided by the present invention is used to store program codes including the above-mentioned halftone pattern generation method, and the processing unit of the computer device can execute the program codes.
[0015] In summary, according to the dot pattern generation method of the present invention, after the original image design is completed, the user can use the original image as a reference image file, quickly and conveniently generate the coordinates of the dots in a random calculation manner according to multiple conversion parameters, and then generate a dot pattern. Compared with the conventional technology, the dot pattern generation method of the present invention can more accurately present the details of the original image and generate a dot pattern corresponding to the original image.
[0016] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following specifically cites a preferred embodiment and describes it in detail with the accompanying drawings as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A block diagram of a computer device provided by an embodiment of the present invention;
[0018] Figure 2 A flowchart of the steps of a method for generating a halftone pattern provided by an embodiment of the present invention;
[0019] Figure 3A A schematic diagram of an original image (reference image file) provided by an embodiment of the present invention;
[0020] Figure 3B , 4A , 4B, 5A, 5B, 5C, 6A, 6B, and 6C are schematic diagrams of dot patterns generated by the dot pattern generation method according to the present invention. DETAILED DESCRIPTION
[0021] Please refer to Figure 1 , Figure 1 A block diagram of a computer device 1 provided according to an embodiment of the present invention.
[0022] In this embodiment, the computer device 1 of the present invention comprises: a storage unit 11 , a processing unit 12 , and an input unit 13 . The processing unit 12 is connected to the storage unit 11 and the input unit 13 .
[0023] In this embodiment, the computer device 1 can access the storage unit 11 (computer readable medium) and be used to execute the halftone pattern generating method.
[0024] In the present embodiment, the storage unit 11 can store reference images, grayscale value weights, multiple conversion parameters (for example, the conversion parameters may include: dot size range, total number of dots, and number of iterations), random operation algorithms, iterative operation algorithms, dot distribution processing, program codes, and dot patterns, etc. The storage unit 11 may include non-volatile memory (NVM) and / or volatile memory. For example, the storage unit 11 may be a traditional hard disk, a solid state drive, a memory, a memory card, etc., or other devices with data storage functions. The types of storage units 11 listed are only examples, and the present invention is not limited thereto.
[0025] In this embodiment, the processing unit 12 is a device with computing capabilities, which can access the data stored in the storage unit 11 and execute algorithms, program codes, data transmission, etc. For example, the processing unit 12 can be a single-chip microcomputer (MCU), a central processing unit (CPU), etc., or other devices with the same functions. The types of processing units listed are only examples, and the present invention is not limited thereto.
[0026] In this embodiment, the user can input a plurality of conversion parameters through the input unit 13, and the conversion parameters may include: dot size range, total number of dots, and number of iteration operations, etc. For example, the input unit 13 may be an input device such as a keyboard, a mouse, or other devices with the same function. The types of processing units listed are only examples, and the present invention is not limited thereto.
[0027] Next, please refer to Figure 2 . Figure 2 This is a flowchart of a method for generating a dot pattern according to an embodiment of the present invention, wherein the steps include:
[0028] Step S101: Generate grayscale value weights according to the reference image file; please refer to Figure 3A , Figure 3AA schematic diagram of an original image (reference image file) provided by one embodiment of the present invention. For example, a user can use drawing software to create a canvas with a resolution of 2048x2048 pixels in advance, and then design an image original in the drawing area of the canvas, wherein the image original can be freely designed according to the needs of the user, and the file format can be a non-vector image format such as JPG or PNG. Then, the user can provide the designed image original as a reference image file to the computer device 1, and the computer device 1 can generate grayscale value weights corresponding to each pixel in the reference image file. In one embodiment, the computer device 1 can treat multiple adjacent pixels in the reference image file as a pixel group and generate grayscale value weights corresponding to the pixel group. In one embodiment, the reference image file can be a color image file, and the computer device 1 can first convert the reference image file into grayscale values and then generate grayscale value weights.
[0029] Step S103: Input multiple conversion parameters, including: dot size range, total number of dots, and number of iterations; the user can input multiple conversion parameters through the input unit 13 to complete parameter settings, and the overall structure and detail features of the generated dot pattern can be further controlled by adjusting these parameters. For example, the dot size range can be between 0.001 mm and 1 mm, the total number of dots can be between 10 and 10,000, and the number of iterations can be between 0 and 1,000.
[0030] For the dot size range, please refer to Figure 4A ,as well as Figure 4B When the total number of dots is set to 2000 and the number of iterations is set to 10, Figure 4A Shows the pattern generated using only a single dot size of 0.05 mm. Figure 4B The pattern generated by dot sizes ranging from 0.05 mm to 0.15 mm is shown. It can be observed that Figure 4B There is a significant improvement in contrast and detail. Compared with dots of a single size, dots generated within a given range of dot sizes are more conducive to improving contrast and making the dot pattern closer to the reference image.
[0031] For the total number of outlets, please refer to FIG. 5A to FIG. 5C When the dot size range is set to 0.05 mm and the number of iterations is set to 10, FIG. 5A to FIG. 5C It is used to compare the effects of placing 1000, 2000 and 3000 dots, and shows the effect of the total number of dots on the generated dot pattern. Increasing the total number of dots helps to present the details of the original.
[0032] For details about the number of iterations, please refer to FIG. 6A to FIG. 6C The number of iterations affects the distribution of dots. When the dot size range is 0.05 mm and the total number of dots is 2000, FIG. 6A to FIG. 6C It is used to compare and show the effects of 0, 10 and 20 iterations (dot distribution processing). Fig. 6A and Figure 6B It can be clearly seen that the dot distribution is adjusted to be close to the reference image through iterative calculation (dot distribution processing). Compared with this, Figure 6B and Figure 6C There is not much difference in the dot distribution. The main reason is that 10 iterations (dot distribution processing) are enough to adjust the position of the dots to a constant value. Therefore, even if the iterations (dot distribution processing) are performed multiple times later, it will not cause much difference in the dot distribution.
[0033] Step S105: Generate multiple initial random coordinates corresponding to multiple dots by random operation according to the grayscale value weight, dot size range, and total number of dots; for example, the random operation can be to use any random number generation algorithm, and preliminarily generate multiple random coordinates corresponding to multiple dots within a specified range according to the grayscale value weight, and use these random coordinates as the initial random coordinates of the random dots. These random coordinates have a high degree of randomness and uniformity, so that the generated dot pattern presents random number characteristics. This implementation mainly regards the grayscale value of the reference image as a probability distribution, and uses random operation to generate the coordinates of the dots according to the dot size range and the total number of dots input by the user, and uses them as the initial random coordinates for the subsequent dot distribution processing, so that the subsequent dot distribution processing can more quickly adjust the position of the dots to be close to the reference image.
[0034] Step S107: Perform dot distribution processing on the dots according to the number of iterations, the grayscale value weight, and the initial random coordinates to generate a plurality of iteration random coordinates, and generate a dot pattern by using the iteration random coordinates; in this embodiment, the processing unit 12 can perform dot distribution processing multiple times according to the grayscale value weight, the number of iterations input by the input unit 13, and the initial random coordinates (and / or iteration random coordinates), and generate a plurality of iteration random coordinates, and then generate a dot pattern by using the iteration random coordinates to adjust the position of the dots to be close to the reference image file. The iteration random coordinates refer to the coordinates obtained by performing dot distribution processing (i.e., iteration calculation) multiple times based on the initial random coordinates. In one embodiment, the dot distribution processing can further include: random distribution processing and uniform distribution processing. The user can select random distribution processing and / or uniform distribution processing according to the preferred dot presentation method to generate a dot pattern closer to the user's preferences.
[0035] Step S109: Output the dot pattern and store it in a vector image file format; output the generated random dot pattern as a digital image file or other supported vector file format for subsequent post-processing, modification or preservation. This output format has wide compatibility and scalability, and is easy to apply to various design tools and output media. For example, the dot pattern can be output as a vector image file format such as an SVG file to facilitate subsequent further modification.
[0036] The dot pattern generation method of the present invention is different from the composite dot. The dot pattern generated by the dot pattern generation method of the present invention has a high degree of randomness and complexity, and can be flexibly adjusted according to different design requirements and application scenarios. The dot pattern generation method of the present invention can be applied to various software applications and image design tools, providing a simple and effective creation tool, while providing users with a larger creative space. The dot pattern generation method of the present invention has a wide range of application value in the field of contact lens pattern design, bringing more design possibilities and creative inspiration to users.
[0037] In summary, according to the dot pattern generation method of the present invention, after the original image design is completed, the user can use the original image as a reference image file, quickly and conveniently generate the coordinates of the dots in a random calculation manner according to multiple conversion parameters, and then generate a dot pattern. Compared with the conventional technology, the dot pattern generation method of the present invention can more accurately present the details of the original image and generate a dot pattern corresponding to the original image.
[0038] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment as above, it is not used to limit the present invention. Any technician familiar with this profession can make some changes or modifications to equivalent embodiments of equivalent changes by using the methods and technical contents disclosed above without departing from the scope of the technical solution of the present invention. However, any simple modification, equivalent change and modification made to the above embodiments according to the technical essence of the present invention without departing from the content of the technical solution of the present invention still fall within the scope of the technical solution of the present invention.
Claims
1. A method for generating a dot pattern, characterized in that: Applicable to a computer device, the dot pattern generation method comprises: Generate a grayscale value weight according to a reference image file; Input a plurality of conversion parameters, the conversion parameters including: a dot size range, a total number of dots, and an iterative operation number; Generate a plurality of initial random coordinates corresponding to a plurality of dots by a random operation according to the grayscale value weight, the dot size range, and the total number of dots; and A dot distribution process is performed on the dots according to the iterative operation times, the grayscale value weight, and the initial random coordinates to generate a plurality of iterative random coordinates, and a dot pattern is generated by the iterative random coordinates, wherein the dot pattern includes the dots.
2. The method for generating a halftone pattern according to claim 1, wherein: The dot pattern generation method further includes: The dot pattern is stored in a vector image file format.
3. The method for generating a halftone pattern according to claim 1, wherein: The dot size range is between 0.001 mm and 1 mm.
4. The method for generating a halftone pattern according to claim 1, wherein: The total number of outlets ranges from 10 to 10,000.
5. The method for generating a halftone pattern according to claim 1, wherein: The number of iterations is between 0 and 1000.
6. A computer-readable medium, characterized in that A program code is stored and a processing unit executes the program code; Wherein, the program code includes: the dot pattern generation method according to any one of claims 1 to 5.