Method and system for generating specified pattern
By acquiring the pixels at the edge of the image and stepping their normals to the outside or inside to generate patterns, the problems of slow pattern generation speed and lack of adaptability in the prior art are solved, and fast and diverse pattern generation is achieved, improving the user experience and pattern effect.
Patent Information
- Application Number
- CN202311185928.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-03-14
AI Technical Summary
Existing pattern generation methods require complex calculations and manual operations when processing original images, which are slow, cannot provide real-time feedback, and lack adaptability, making it difficult to adapt to the needs of different edge shapes and sizes of images.
By acquiring pixels at the edge of the image, the normals of each pixel are obtained based on each pixel and its adjacent pixels, and the normals are stepped outside or inside the image to generate a designated pattern. The method includes generating a high-circumferential pattern, a stroke pattern, and superimposing a surface material effect on the pattern.
It has achieved rapid generation of diverse and innovative decorative effects, is suitable for various flat patterns, simplified the operation process, significantly improved the user experience, and enhanced the layering, three-dimensional and visual impact of the patterns.
Smart Images

Figure CN119625123A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of pattern design, and in particular relates to a method and system for generating a specified pattern. Background Art
[0002] In recent years, image processing technology has made great progress. Pattern generation is one of the important research fields and is widely used in many industries, such as interior design, textile manufacturing, and artistic creation. Existing methods mainly focus on using computer algorithms to process and transform images to generate various unique patterns.
[0003] However, there are some problems with existing pattern generation methods. For example, when processing the original image, it is often necessary to first segment the edge area of interest and generate the corresponding pattern based on the area. When designing complex patterns, tedious manual drawing is required. These processes usually require complex calculations and manual operations, are relatively slow, and cannot provide real-time feedback. They have certain limitations in scenarios where decorative effects need to be generated and displayed quickly, and the results may often be unsatisfactory.
[0004] In addition, traditional methods generally lack the ability to adapt to different image edge shapes and sizes, and are difficult to adapt to the needs of pattern generation processes such as embossing, high frequency, and gluing. Moreover, traditional methods are usually limited to specific pattern design and decoration processes, and it is difficult to expand and adjust the generated patterns, and cannot provide more diverse and innovative decorative effects. Summary of the invention
[0005] In order to overcome the defects of the prior art, the present invention proposes a method for generating a specified pattern, characterized in that the method comprises:
[0006] Obtaining pixels at the edge of the first image;
[0007] Obtaining a normal of each pixel based on each pixel and its neighboring pixels;
[0008] The normal of each of the pixels is stepped toward the outside of the first image and / or toward the inside of the first image to generate a specified pattern.
[0009] Specifically, the stepping of the normal line of each pixel toward the outside of the first image and / or toward the inside of the first image by a specified distance to generate a specified pattern includes:
[0010] Stepping the normal of each pixel into the first image by a specified distance to generate a high-frequency pattern or a stroke pattern;
[0011] And / or, the normal line of each pixel is stepped outward of the first image by a specified distance to generate a stroke pattern.
[0012] Furthermore, the method further comprises:
[0013] Overlay surface material effects on the generated high frequency pattern and / or stroke pattern.
[0014] Preferably, superimposing the surface material effect on the generated high frequency pattern and / or stroke pattern comprises:
[0015] Moving the high-frequency pattern and / or the stroke pattern to separate the high-frequency pattern from the stroke pattern;
[0016] A surface material effect is superimposed on the separated high frequency pattern and / or the stroke pattern.
[0017] Furthermore, the method further comprises:
[0018] A weighted average is performed on the material of the high frequency pattern and / or the stroke pattern and the surface material.
[0019] Preferably, the weighted average of the material of the high-frequency pattern and / or the stroke pattern and the surface material is achieved by adjusting a slider and / or a mask map.
[0020] Preferably, “making the normal of each pixel step outside the first image and / or inside the first image to generate a specified pattern” comprises:
[0021] Stepping the normal of each of the pixels toward the outside of the first image and / or toward the inside of the first image to generate a first pattern;
[0022] The first pattern is processed by a Gaussian filter of a specified radius to generate the specified pattern.
[0023] Furthermore, the method further comprises:
[0024] The first image is replaced by the second image to generate a designated pattern based on the second image again in the same manner and with the same parameters as the designated pattern is generated based on the first image.
[0025] The present invention also proposes a system for generating a specified pattern, the system comprising:
[0026] An acquisition module, used for acquiring pixels at the edge of the first image;
[0027] A line drawing module, used for obtaining a normal line of each pixel based on each pixel and its adjacent pixels;
[0028] A generating module is used to make the normal of each pixel step outside the first image and / or inside the first image to generate a specified pattern.
[0029] Furthermore, the system further comprises:
[0030] The replacement module is used to replace the first image with the second image, so that the acquisition module, the line drawing module and the generation module generate the specified pattern based on the second image again in the same way and with the same parameters as the specified pattern generated based on the first image.
[0031] The present invention has at least the following beneficial effects:
[0032] The solution proposed in the present invention can obtain accurate specified patterns by capturing edges, and can expand on the original patterns to generate patterns with various effects according to user needs. The solution can be applicable to various types of flat patterns, and is convenient for realizing processes such as embossing, high frequency, and gluing that require pattern generation. The operation is relatively simple and the time required for pattern generation is short, which significantly improves the user experience.
[0033] Furthermore, the designated patterns of this scheme include a variety of effects such as high-frequency patterns, stroke patterns and superimposed surface materials, and can create richer, more personalized and unique visual effects by separating patterns, weighted averaging, etc., making the design more personalized and distinctive, emphasizing the hierarchical relationship between high-frequency patterns and stroke patterns to highlight the overall or partial patterns, and enhancing the layering, three-dimensional sense, detail expression and visual impact of the patterns. On this basis, it can also directly inherit the completed design scheme on the new pattern by replacing the pattern, which has the advantages of convenience and speed.
[0034] Therefore, the present invention provides a method and system for generating a specified pattern. This scheme can design a complex pattern process based on a plane pattern. The operation is simple and easy for users to use. In addition, the scheme has extremely high flexibility, adaptability and scalability, which is convenient for users to make corresponding adjustments according to their needs, so as to further enhance the decorative effect while expanding the possibility of generating patterns. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 A schematic flow chart of a method for generating a specified pattern provided in Example 1;
[0037] Figure 2 is an example image of the first image;
[0038] Figure 3 Example diagram for extracting pixels of the first image
[0039] Figure 4 To obtain the example diagram of the tangent line of each pixel;
[0040] Figure 5 To get the example graph of normals for each pixel;
[0041] Figure 6 This is an example of the height map generated after the iteration is completed;
[0042] Figure 7 A schematic diagram of a process for generating a specified pattern;
[0043] Figure 8 An example diagram for generating embossing patterns;
[0044] Fig. 9 An example image for generating a stroke pattern;
[0045] Fig.10 This is a flow chart of superimposing surface material effects;
[0046] Fig.11 This is an example diagram for separating embossed patterns from stroke patterns;
[0047] Fig.12 This is an example of overlaying the surface material effect on the separated pattern;
[0048] Fig.13 This is a schematic diagram of the module structure of the system for generating a specified pattern proposed in Example 2.
[0049] Reference numerals
[0050] 21 - acquisition module; 22 - line drawing module; 23 - generation module; 24 - replacement module; 231 - embossing unit; 232 - stroke unit; 233 - movement unit; 234 - superposition unit; 235 - all-finger unit. DETAILED DESCRIPTION
[0051] 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.
[0052] Hereinafter, various embodiments of the present invention will be described more fully. The present invention may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present invention to the specific embodiments disclosed herein, but the present invention should be understood to cover all adjustments, equivalents and / or alternatives falling within the spirit and scope of the various embodiments of the present invention.
[0053] Hereinafter, the term "include" or "may include" used in various embodiments of the present invention indicates the presence of disclosed functions, operations or elements, and does not limit the addition of one or more functions, operations or elements. In addition, as used in various embodiments of the present invention, the terms "include", "have" and their cognates are intended only to indicate specific features, numbers, steps, operations, elements, components or combinations of the foregoing items, and should not be understood as first excluding the presence of one or more other features, numbers, steps, operations, elements, components or combinations of the foregoing items or the possibility of adding one or more features, numbers, steps, operations, elements, components or combinations of the foregoing items.
[0054] In various embodiments of the present invention, the expression "or" or "at least one of A or / and B" includes any combination or all combinations of the words listed at the same time. For example, the expression "A or B" or "at least one of A or / and B" may include A, may include B, or may include both A and B.
[0055] The expressions (such as "first", "second", etc.) used in various embodiments of the present invention may modify the various constituent elements in various embodiments, but may not limit the corresponding constituent elements. For example, the above expressions do not limit the order and / or importance of the elements. The above expressions are only used for the purpose of distinguishing an element from other elements. For example, the first user device and the second user device indicate different user devices, although both are user devices. For example, without departing from the scope of various embodiments of the present invention, the first element may be referred to as the second element, and similarly, the second element may also be referred to as the first element.
[0056] It should be noted that in the present invention, unless otherwise clearly specified and defined, the terms such as "installation", "connection", "fixation" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0057] In the present invention, those skilled in the art need to understand that the terms indicating orientation or positional relationship herein are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0058] The terms used in various embodiments of the present invention are only used for the purpose of describing specific embodiments and are not intended to limit various embodiments of the present invention. As used herein, the singular form is intended to also include the plural form, unless the context clearly indicates otherwise. Unless otherwise limited, all terms used here (including technical terms and scientific terms) have the same meaning as the meaning generally understood by those of ordinary skill in the art to which the various embodiments of the present invention belong. The terms (such as the terms defined in the dictionary generally used) will be interpreted as having the same meaning as the contextual meaning in the relevant technical field and will not be interpreted as having an idealized meaning or an overly formal meaning, unless clearly defined in various embodiments of the present invention.
[0059] Example 1
[0060] See also Figure 1-3 This embodiment proposes a method for generating a specified pattern, which can design a complex pattern process based on a plane pattern. The method includes:
[0061] S100: Acquire pixels at the edge of a first image.
[0062] S200: Obtaining a normal of each pixel based on each pixel and its adjacent pixels.
[0063] Alternatively, see Figure 4-5 , step S200 includes: obtaining a tangent line of each pixel based on the slope of each pixel and an adjacent pixel, and rotating the tangent line corresponding to the pixel by 90 degrees with each pixel as a rotation center to obtain a normal line;
[0064] Or, based on the normal vectors of each pixel and its adjacent pixels, the normal of each pixel is obtained by normal mapping.
[0065] It should be noted that the calculation method of obtaining the tangent of any pixel based on the slope between the pixel and its adjacent pixels has been mentioned in the prior art and will not be described in detail in this embodiment.
[0066] It should also be noted that normal mapping is a computer graphics rendering technology used to increase surface details and enhance visual effects. It uses normal maps to simulate small concave and convex surface structures to make the surface produce more realistic effects in lighting calculations.
[0067] S300: Step the normal of each pixel toward the outside of the first image and / or toward the inside of the first image to generate a designated pattern.
[0068] It should be noted that stepping is used to describe the operation or process of moving with a fixed step size. Stepping according to the normal direction of the pixel is an iterative algorithm, which can refer to the operation of traversing an array or list by increasing or decreasing a fixed value each time.
[0069] In a specific embodiment, the distance of each step is a pixel unit. After each step is completed, the pixel of this step is counted and the coordinate of the pixel is recorded. For example, the pixel count of the first step is 0 and the coordinate is (0, 1), the pixel count of the second step is 1 and the coordinate is (0, 1), and the pixel count of the third step is 2 and the coordinate is (0, 2).
[0070] After the iteration is completed, a new image is generated based on the recorded coordinates and counts, and a similar image can be obtained. Figure 6 The height diagram shown; wherein, the stepping distance and the number of steps can be adjusted accordingly according to user needs, and adjusting the number of steps will also adjust the number of iterations accordingly. For example, when the number of steps is set to 10 times, 10 iterations will be performed accordingly.
[0071] Specifically, see Figure 7-9 , step S300 includes:
[0072] S310: Stepping the normal line of each pixel toward the inside of the first image by a specified distance to generate a high-frequency pattern or a stroke pattern; and / or stepping the normal line of each pixel toward the outside of the first image by a specified distance to generate a stroke pattern.
[0073] It should be noted that in this embodiment, the high-frequency pattern includes but is not limited to embossing pattern, hot stamping pattern, cutting pattern, welding pattern and printing pattern. Figure 8 The pattern example shown in is an embossed pattern.
[0074] Specifically, step S310 is implemented by processing the height map mentioned above through Gaussian filtering. By adjusting the radius of the Gaussian filter, a hard corner or rounded corner effect can be formed. Among them, the area with a smaller radius of the Gaussian filter will form a hard corner effect, and the area with a larger radius of the Gaussian filter will form a rounded corner effect. Users can adjust the radius of the Gaussian filter in different areas according to their needs to obtain the ideal hard corner or rounded corner effect.
[0075] It should be noted that sharp and fillet are terms commonly used to describe the edge treatment of objects. They are often used in engineering design, architectural design, product design and other fields to improve the appearance and function of objects and enhance their safety and comfort in use.
[0076] Chamfering refers to cutting off a certain angle or length from the corners of an object to make it a bevel. Chamfering will make the generated high-frequency pattern and stroke pattern have a right-angle effect, can generate a clear and concise edge effect, will not produce too many curves or deformations, and make the generated high-frequency pattern and stroke pattern more accurate and regular. It is suitable for designs that need to emphasize straight lines and clear boundaries. The purpose is to reduce sharp edges and corners, and avoid the situation where the sharp edges of the decorative pattern are easily damaged or cause harm to the human body when the method for generating a specified pattern proposed in this scheme is applied to generate decorative patterns on fabrics and accessories. The chamfer can be a straight line shape or a diagonal line shape;
[0077] Rounded corners refer to adding a certain curvature to the edges and corners of an object to make it an arc shape. This can avoid generating overly sharp edges, reduce tactile discomfort, improve comfort and safety, and make the generated high-frequency patterns and stroke patterns have a soft effect. It can visually create a smooth transition and a sense of continuity, making the pattern more natural and harmonious. It is suitable for designs that need to increase the sense of softness and fluidity. The purpose of rounded corners is to increase the aesthetics of the object while providing a smooth transition and reduce the pressure concentration caused by the edges and corners. The rounded corners can be of different radii, depending on the effect to be achieved and the design requirements.
[0078] Furthermore, step S300 further includes:
[0079] S320: Overlaying a surface material effect on the generated high-frequency pattern and / or stroke pattern.
[0080] It should be noted that the surface material effects in this embodiment include but are not limited to glitter, brushed patterns, and embossed effects, and the surface material effects can be superimposed only on the high-frequency pattern, only on the stroke pattern, or on both the high-frequency pattern and the stroke pattern.
[0081] Surface material effects can add unique visual effects to patterns, such as metal texture, leather texture, etc., thereby giving the design more texture and feel. At the same time, they can produce effects such as light and dark contrast, light and shadow changes, etc., increasing the sense of hierarchy and artistic beauty of the design, making the work more vivid and three-dimensional, enhancing the viewing experience, and achieving the effect of attracting attention to make the design more prominent and eye-catching.
[0082] Specifically, see Figure 10-12 , step S320 includes:
[0083] S321: moving the high frequency pattern and / or the stroke pattern to separate the high frequency pattern from the stroke pattern.
[0084] S322: Overlaying a surface material effect on the separated high-frequency pattern and / or stroke pattern.
[0085] Separating the high-frequency pattern from the stroke pattern can make it easier for users to choose to overlay the corresponding surface material effects on any of the patterns separately, meet different design needs and visual requirements, and create a richer, more personalized and unique visual effect. In addition, different surface material effects can be used to emphasize the hierarchical relationship between the high-frequency pattern and the stroke pattern to highlight the overall or partial pattern, thereby enhancing the pattern's detail expression and visual impact.
[0086] Preferably, step S300 further includes:
[0087] S330: Perform weighted averaging on the material of the high frequency pattern and / or the stroke pattern and the surface material.
[0088] In this embodiment, step S330 is achieved by weighted averaging the maps of the high frequency pattern and / or stroke pattern and the maps of the surface material. The maps of the high frequency pattern, stroke pattern, and surface material include but are not limited to color maps, normal maps, displacement maps, metalness maps, smoothness maps, and transmittance maps.
[0089] Furthermore, if at least two patterns are generated simultaneously in step S310, some maps need to merge all the patterns before obtaining. For example, if a high-frequency pattern is generated by stepping inward and a stroke pattern is generated by stepping inward in step S310, and it is necessary to perform weighted averaging on the high-frequency pattern, the stroke pattern, the normal map and the displacement map of the surface material, then it is necessary to process these two steps separately through corresponding Gaussian filtering to obtain two different height maps, and then merge the two height maps to obtain the normal map and the displacement map of the high-frequency pattern and the stroke pattern.
[0090] It should be noted that the color map is used to describe the color information of the object surface. The color map defines the color and texture of the object in different parts. By applying the color map to the model surface, the object can be given visual color and texture effects.
[0091] Normal maps are used to simulate the concave and convex details and normal direction changes of the object surface. Normal maps record the normal direction information of each pixel and encode the normal direction by using red, green, and blue channels. Normal maps can change the normal direction in the lighting calculation during rendering, thereby producing lighting effects for surface details.
[0092] Displacement maps are used to modify the geometry of a model by changing the vertex positions of the model according to height differences. Unlike normal maps, displacement maps directly modify the geometric details of the model, allowing the surface of the model to present a more realistic depth effect.
[0093] Metalness map is used to control the metalness property of an object. Metalness map defines the distribution of metal and non-metal parts of an object on each pixel, and represents the metalness of different areas through grayscale value or color. Metalness map can affect the reflection and refraction of light during rendering, making the object look more realistic.
[0094] Smoothness map is used to control the smoothness property of the object surface. Smoothness map defines the smoothness of the object surface at each pixel point, expressed by grayscale value or color. Smoothness map can affect the scattering and reflection effect of light and the object surface during rendering, thereby adjusting the visual performance of the object;
[0095] Transparency maps are used to control the transparency properties of objects. Transparency maps define the transparency value of the object at each pixel, usually represented by grayscale values. Brighter areas represent higher transparency. Transparency maps can make certain parts of an object appear transparent during rendering, thereby achieving complex transparency effects such as glass, water surface, etc.
[0096] Through this solution, the visual effects between the high-frequency pattern, the material of the stroke pattern and the surface material can be balanced, and a layer-based adjustment method can be achieved, which can effectively prevent one or some design elements from being too prominent or losing focus, and thus ensure the coordination and unity of the pattern design without affecting the overall aesthetics of the pattern;
[0097] In addition, the solution can also highlight specific elements according to the requirements of high-frequency patterns, stroke pattern materials and surface material weights, thereby creating a unique visual effect and making the design more personalized and distinctive. By integrating the characteristics of different elements through weighted averaging, the layering and three-dimensional sense of the design can be increased, and the intended design goals can be better achieved.
[0098] In this embodiment, step S500 can perform weighted averaging of the material of the high-frequency pattern and / or stroke pattern and the surface material by adjusting the slider or mask map to achieve fine design adjustment and personalized effects, thereby meeting the user's specific needs for visual effects.
[0099] It should be noted that the adjustment slider is a tool for adjusting values or weights, which is used to control the relative display strength between different design elements. Users can use the adjustment slider to adjust parameters such as the display ratio between the high-frequency pattern, the material of the stroke pattern, and the surface material to make one element more prominent or softer;
[0100] A mask map is a special kind of texture map. A mask map can control the visibility or effect of a specific area based on its pattern and grayscale value. By applying a mask map to a design element, the user can selectively control the display range and effect of high-frequency patterns, stroke pattern materials, and surface materials in the design, such as displaying strokes only in specific areas or applying surface materials to certain parts of the high-frequency pattern.
[0101] By applying the method for generating a specified pattern proposed in this embodiment, the effect of designing a complex pattern process by inputting only one plane pattern can be achieved in the image design software. Since the steps of each process in this solution are programmed, the same process with different patterns can be generated by directly replacing the pattern under the same parameters. Therefore, preferably, the method proposed in this embodiment also includes:
[0102] S400: Replace the first image with the second image, so as to generate the designated pattern based on the second image again in the same manner and with the same parameters as those for generating the designated pattern based on the first image.
[0103] Example 2
[0104] See also Fig.13 This embodiment proposes a system for generating a specified pattern, which is used to implement the method for generating a specified pattern proposed in Embodiment 1. The system includes:
[0105] An acquisition module 21, used to acquire pixels at the edge of the first image;
[0106] A line drawing module 22, for obtaining a normal line of each pixel based on each pixel and its adjacent pixels;
[0107] The generating module 23 is used to make the normal of each pixel step outside the first image and / or inside the first image to generate a specified pattern.
[0108] Optionally, the line drawing module 22 obtains the tangent of each pixel based on the slope of each pixel and the adjacent pixels, and rotates the tangent corresponding to the pixel 90 degrees with each pixel as the rotation center to obtain the normal; or obtains the normal of each pixel by normal mapping based on the normal vector of each pixel and the adjacent pixels.
[0109] Specifically, the generation module 23 includes:
[0110] An embossing unit 231, for causing the normal of each pixel to step a specified distance into the first image to generate a high frequency pattern or a stroke pattern;
[0111] The stroke unit 232 is used to make the normal of each pixel step outward of the first image by a specified distance to generate a stroke pattern.
[0112] Preferably, the manner in which the embossing unit 231 makes the normal line of each pixel step toward the inside of the first image and the stroking unit 232 makes the normal line of each pixel step toward the outside of the first image includes hard corner stepping and round corner stepping.
[0113] Furthermore, the generating module 23 also includes:
[0114] A moving unit 233, used for moving the high frequency pattern and / or the stroke pattern to separate the high frequency pattern from the stroke pattern;
[0115] An overlay unit 234, for overlaying a surface material effect on the separated high frequency pattern and / or stroke pattern;
[0116] The averaging unit 235 is used to perform weighted averaging on the material of the high frequency pattern and / or the stroke pattern and the surface material.
[0117] In this embodiment, the surface material effects that can be superimposed include but are not limited to glitter, brushed patterns, and embossed effects, and the surface material effects can be superimposed only on the high-frequency pattern, only on the stroke pattern, or on both the high-frequency pattern and the stroke pattern.
[0118] The visual effects between the high-frequency pattern, the material of the stroke pattern and the surface material can be balanced by the average unit 235, and a layer-based adjustment method can be implemented, which can effectively prevent one or some design elements from being too prominent or losing focus, and thus ensure the coordination and unity of the design of the pattern without affecting the overall aesthetics of the pattern;
[0119] In addition, users can also use the average unit 235 to highlight specific elements according to the required high-frequency pattern, stroke pattern material and surface material weight, thereby creating a unique visual effect and making the design more personalized and distinctive. By combining the characteristics of different elements through weighted averaging, the layering and three-dimensional sense of the design can be increased, and the intended design goals can be better achieved.
[0120] Optionally, the averaging unit 235 includes an adjustment slider and / or a mask map.
[0121] Furthermore, the system for generating a specified pattern proposed in this embodiment also includes:
[0122] The replacement module 24 is used to replace the first image with the second image, so that the acquisition module 21, the line drawing module 2 and the generation module 23 generate the designated pattern based on the second image again in the same manner and with the same parameters as the designated pattern generated based on the first image.
[0123] In summary, the present invention provides a method and system for generating a specified pattern. This solution can design complex pattern processes based on plane patterns. The operation is simple and easy for users to use. The solution has extremely high flexibility, adaptability and scalability, which is convenient for users to make corresponding adjustments according to their needs, so as to further enhance the decorative effect while expanding the possibility of generating patterns.
[0124] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for generating a specified pattern, characterized in that: The method comprises: Obtaining pixels at the edge of the first image; Obtaining a normal of each pixel based on each pixel and its neighboring pixels; The normal of each of the pixels is stepped toward the outside of the first image and / or toward the inside of the first image to generate a specified pattern.
2. The method for generating a specified pattern according to claim 1, characterized in that: The stepping of the normal line of each pixel toward the outside of the first image and / or toward the inside of the first image by a specified distance to generate a specified pattern comprises: Stepping the normal of each pixel into the first image by a specified distance to generate a high-frequency pattern or a stroke pattern; And / or, the normal line of each pixel is stepped outward of the first image by a specified distance to generate a stroke pattern.
3. The method for generating a specified pattern according to claim 2, characterized in that: The method further comprises: Overlay surface material effects on the generated high frequency pattern and / or stroke pattern.
4. The method for generating a specified pattern according to claim 3, characterized in that: The superimposing of the surface material effect on the generated high frequency pattern and / or stroke pattern comprises: Moving the high-frequency pattern and / or the stroke pattern to separate the high-frequency pattern from the stroke pattern; A surface material effect is superimposed on the separated high frequency pattern and / or the stroke pattern.
5. The method for generating a specified pattern according to claim 3, characterized in that: The method further comprises: A weighted average is performed on the material of the high frequency pattern and / or the stroke pattern and the surface material.
6. The method for generating a specified pattern according to claim 5, characterized in that: The weighted average of the material of the high frequency pattern and / or the stroke pattern and the surface material is achieved by adjusting a slider and / or a mask map.
7. The method for generating a specified pattern according to claim 1, characterized in that: The “making the normal of each pixel step outside the first image and / or inside the first image to generate a specified pattern” includes: The normal of each pixel is stepped toward the outside of the first image and / or toward the inside of the first image to generate a height map, and the height map is processed by a Gaussian filter with a specified radius to generate the specified pattern.
8. The method for generating a specified pattern according to any one of claims 1 to 7, characterized in that: The method further comprises: The first image is replaced by the second image to generate a designated pattern based on the second image again in the same manner and with the same parameters as the designated pattern is generated based on the first image.
9. A system for generating a specified pattern, characterized in that: The system comprises: An acquisition module, used for acquiring pixels at the edge of the first image; A line drawing module, used for obtaining a normal line of each pixel based on each pixel and its adjacent pixels; A generating module is used to make the normal of each pixel step outside the first image and / or inside the first image to generate a specified pattern.
10. The system for generating a designated pattern according to claim 9, characterized in that: The system further comprises: The replacement module is used to replace the first image with the second image, so that the acquisition module, the line drawing module and the generation module generate the specified pattern based on the second image again in the same way and with the same parameters as the specified pattern generated based on the first image.