Stone pattern splicing method and device, storage medium and electronic equipment
By automating the acquisition and matching of stone pattern information, the problem of stone pattern splicing relying on manual labor has been solved, achieving efficient and high-precision stone pattern splicing and providing a variety of splicing solutions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2026-03-31
AI Technical Summary
In existing technologies, stone pattern splicing relies on manual identification, which is inefficient and lacks accuracy.
By acquiring the pattern information of the stone, the system automatically determines the second stone that matches the first stone from multiple candidate stones, so that the pattern after splicing forms a continuous pattern. The system uses an image detection model to pre-generate the pattern information of the candidate stones and generates a stone splicing image based on the matched pattern information.
It improves the efficiency and accuracy of matching stone patterns, reduces manual intervention, shortens splicing time, and provides a variety of splicing options.
Smart Images

Figure CN121767174A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of building materials technology, and more specifically, to a method for splicing stone patterns, a device for splicing stone patterns, a storage medium, and an electronic device. Background Technology
[0002] Stone pattern splicing is widely used in modern architecture, such as for flooring, wall decoration, and countertops, to showcase exquisite designs through splicing. Related technologies typically involve manually identifying the stone's pattern information, finding stones with matching patterns, and then splicing them together. This method relies on manual labor, resulting in low matching efficiency and insufficient accuracy. Summary of the Invention
[0003] This application provides a method for splicing stone patterns, a device for splicing stone patterns, a storage medium, and an electronic device. The method of this application can improve matching efficiency and matching accuracy.
[0004] Firstly, this embodiment provides a method for splicing stone patterns, including:
[0005] Obtain the pattern information of the first stone;
[0006] A second stone is selected from multiple candidate stones that matches the pattern information of the first stone, so that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the multiple candidate stones is pre-generated based on the images of the candidate stones;
[0007] A stone mosaic image is generated based on the pattern information of the first stone and the pattern information of the second stone.
[0008] Optionally, the pattern information includes information characterizing whether the pattern extends to the edge of the stone, and determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone includes:
[0009] Given that the pattern information of the stone indicates that the pattern extends to the edge of the stone, a second stone that matches the pattern information of the first stone is determined from a plurality of candidate stones.
[0010] Optionally, the pattern information of the candidate stone is pre-generated based on the image of the candidate stone, including:
[0011] Acquire images of the candidate stones;
[0012] The image of the candidate stone is input into the pattern information detection model to obtain the pattern information of the candidate stone.
[0013] Optionally, the pattern information includes the geometric information of the stone, and determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone includes:
[0014] If the geometric information of the second stone matches the geometric information of the first stone, a second stone that matches the pattern information of the first stone is determined from multiple candidate stones.
[0015] Optionally, the pattern information also includes the width of the pattern at the edge of the stone and the distance from the pattern to the vertex of the stone; obtaining the pattern information of the first stone includes:
[0016] Obtain the first width of the first pattern of the first stone and the first distance from the first pattern to the vertex of the first stone;
[0017] The step of determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone includes:
[0018] Based on the first width and the first distance, the second stone is determined from a plurality of candidate stones.
[0019] Optionally, the vertex of the stone is the stone vertex adjacent to the pattern in the set rotation direction of the pattern, and the step of determining the second stone from multiple candidate stones based on the first width and the first distance includes:
[0020] Obtain the second width of the second pattern on the second stone and the second distance from the second pattern to the vertex of the second stone;
[0021] Calculate the difference between the first width and the second width, and the sum of the first distance, the second distance, and the first width;
[0022] If the difference is less than or equal to a first preset threshold, and the difference between the sum and the edge length of the first stone corresponding to the first pattern is less than or equal to a second preset threshold, then the pattern information of the second stone is determined to match the pattern information of the first stone.
[0023] Optionally, generating a stone mosaic image based on the pattern information of the first stone and the pattern information of the second stone includes:
[0024] The pattern information of the first stone and the pattern information of the second stone are associated and stored in the stone splicing set;
[0025] If the number of elements in the stone mosaic set meets the requirements or all of the candidate stones have been traversed, a stone mosaic image is generated based on the stone mosaic set.
[0026] Secondly, this embodiment provides a stone pattern splicing device, including:
[0027] The acquisition module is used to acquire the pattern information of the first stone.
[0028] The determining module is used to determine a second stone from a plurality of candidate stones that matches the pattern information of the first stone, such that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the plurality of candidate stones is pre-generated based on the image of the candidate stones;
[0029] The generation module is used to generate a stone splicing image based on the pattern information of the first stone and the pattern information of the second stone.
[0030] Thirdly, this embodiment provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described in any one of the first aspects of this application.
[0031] Fourthly, this embodiment provides an electronic device, including a memory and a processor, wherein the memory is used to store computer instructions, and the processor is used to invoke the computer instructions from the memory to perform the method as described in any one of the first aspects of this application.
[0032] This application first generates pattern information for multiple candidate stones based on images of candidate stones. Then, it identifies a second stone from the pattern information of the multiple candidate stones that matches the pattern information of the first stone, so that the pattern of the second stone and the first stone, when spliced together, forms a continuous pattern, thereby generating a stone splicing image. The method of this application can automatically identify stones with matching pattern information from candidate stones without relying on manual labor, greatly improving matching efficiency and accuracy. Furthermore, splicing images of stones with matching pattern information to generate a stone splicing image allows users to easily determine whether their needs are met.
[0033] Other features and advantages of this application will become clear from the following detailed description of exemplary embodiments with reference to the accompanying drawings. Attached Figure Description
[0034] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments of the present application and, together with their description, serve to explain the principles of the present application.
[0035] Figure 1 A schematic diagram of a stone processing production line provided in one embodiment of this application is shown.
[0036] Figure 2It shows as Figure 1 A magnified view of a portion of the image.
[0037] Figure 3 A schematic flowchart of a stone pattern splicing method provided in an embodiment of this application is shown.
[0038] Figure 4 A schematic diagram of a stone pattern provided in one embodiment of this application is shown.
[0039] Figure 5 This illustration shows a schematic diagram of stone pattern matching provided in one embodiment of this application.
[0040] Figure 6 This illustration shows a schematic diagram of stone pattern splicing according to an embodiment of this application.
[0041] Figure 7 A schematic diagram of stone pattern matching provided in another embodiment of this application is shown.
[0042] Figure 8 A schematic diagram of stone pattern splicing provided in another embodiment of this application is shown.
[0043] Figure 9 A schematic block diagram of an electronic device provided in an embodiment of this application is shown.
[0044] in:
[0045] 100. Stone firing device;
[0046] 200. Conveyor line;
[0047] 300. Stone bush-hammered finish processing equipment;
[0048] 400. Material handling mechanism;
[0049] 500. Material handling mechanism;
[0050] 600. Cutting mechanism;
[0051] 700. Testing institution; 7001. First support; 7002. Test piece;
[0052] 800, Thickness Measurement Unit. Detailed Implementation
[0053] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application.
[0054] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.
[0055] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0056] In all the examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0057] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0058] This application addresses the problems caused by manual matching of stone patterns by proposing an automated method for splicing stone patterns. This stone pattern splicing method can be applied to the cutting process of stone slabs of specified dimensions obtained in an automated stone processing production line. For ease of understanding, a stone processing production line applicable to this application embodiment is first described.
[0059] like Figure 1 As shown, the stone processing production line may include a feeding and handling mechanism 400, a conveyor line 200, an inspection mechanism 700, a cutting mechanism 600, and a discharging and handling mechanism 500. The stone processing production line may also include at least one of a stone flamed surface device 100 and a stone bush-hammered surface processing device 300.
[0060] The conveyor line 200 is used to transport the stone. The conveyor line 200 is typically made of wear-resistant and corrosion-resistant metal materials, and its length and width can be matched to the scale of the production line and the size of the stone. For example, the conveyor line 200 may include belt rollers, sprockets, chains, etc., and can be driven by a motor or cylinder to achieve continuous and stable transport of the stone it carries.
[0061] The conveyor line 200 may have a loading station and a unloading station, which are usually arranged sequentially along the conveying direction of the conveyor line 200 to facilitate the handling and transfer of stone. The conveyor line 200 may also have a cutting station, along the conveying direction of the conveyor line 200. The loading station, cutting station, and unloading station are arranged sequentially.
[0062] The loading station is used to place the stone onto the conveyor line 200, and the unloading station is used to remove the stone from the conveyor line 200. The loading and handling mechanism 400 is located near the loading station and is used to transport the stone to the loading station. The unloading and handling mechanism 500 is located near the unloading station and is used to remove the stone from the unloading station. The loading and handling mechanism 400 can be a robotic arm, robot, or similar mechanism, and can transport the stone using grippers, suction cups, or other similar methods. The unloading and handling mechanism 500 can also be a robotic arm, robot, or similar mechanism, and can transport the stone using grippers, suction cups, or other similar methods.
[0063] In one embodiment, both the loading and unloading conveying mechanism 400 and the unloading conveying mechanism 500 include at least one suction cup, which can grip the upper surface of the stone for transport. In this embodiment, the loading and unloading conveying mechanism 400 may include one or more suction cups, which can grip the upper surface of the stone for transport. The multiple suction cups can be arranged side-by-side, in an array, or in other arrangements. Similarly, the unloading conveying mechanism 500 may also include one or more suction cups, which can grip the upper surface of the stone for transport. The multiple suction cups can be arranged side-by-side, in an array, or in other arrangements.
[0064] The cutting mechanism 600 may include a cutter for cutting the raw stone to obtain stone slabs of the specified dimensions. The raw stone may be natural stone or stone processed by techniques such as flamed and / or bush-hammered finish.
[0065] The inspection unit 700 can be positioned close to the cutting unit 600. The inspection unit 700 can be used to inspect the stone at the cutting station. See also... Figure 1 and Figure 2The detection mechanism 700 includes, but is not limited to, cameras and sensors. On one hand, the detection mechanism 700 can detect parameters such as the outline or size of the original stone before cutting, so as to arrange the stone within the candidate layout area to obtain the target layout. The control unit controls the cutting path of the cutting mechanism 600 according to the target layout, thereby obtaining the required stone slab. On the other hand, the detection mechanism 700 can also detect parameters such as the position or size of the cut stone slab, so that the control unit can control the material handling mechanism 500 to perform corresponding stacking operations. Furthermore, the detection mechanism 700 can also acquire images of the stone slab to identify the stone's pattern information, such as the width and position of the patterns. The detection mechanism 700 can also be used to detect the stone in the stacking area. The detection mechanism 700 can also acquire images of the stone slab in the stacking area after the material handling mechanism 500 has performed the stacking operation.
[0066] In one embodiment, the testing mechanism 700 includes a first support 7001 and a testing element 7002. The testing element 7002 is disposed on the first support 7001 and is used to test the original stone before cutting and / or the stone after cutting.
[0067] See Figure 2 The first support 7001 is located above the cutting station. The first support 7001 is used to support and install one or more detection elements 7002, so that the detection elements 7002 can detect the stone before and after cutting, thereby facilitating the control unit to make corresponding instructions. The detection elements 7002 include, but are not limited to, cameras and sensors.
[0068] In one embodiment, the testing mechanism 700 includes two testing elements 7002, one testing element 7002 for testing the stone before cutting to plan the cutting path, and the other testing element 7002 for testing the stone after cutting.
[0069] See Figure 2 This embodiment has two detection elements 7002. One detection element 7002 faces the stone before cutting. This detection element 7002 can identify parameters such as the shape, outline, or size of the stone before cutting and can transmit these parameters to the control unit. This allows the control unit to perform stone layout to obtain the target layout and control the cutting mechanism 600 to cut along the cutting path indicated by the target layout, thereby obtaining a stone slab of the required specifications. In other words, the detection mechanism 700, the control unit, and the cutting mechanism 600 are linked together.
[0070] Another detection element 7002 faces the cut stone and can identify the cut stone slabs. This element 7002 can also identify the coordinates and other positional information of the stone slabs and transmit this information to the control unit. The control unit then controls the material handling mechanism 500 to stack the stone slabs, ensuring that the gap between adjacent slabs is within a set range for compact stacking. Furthermore, this element 7002 can also capture images of the stone slabs and input these images to an image detection unit for pattern detection, thus determining the pattern information.
[0071] The stone pattern splicing method of this embodiment can be applied to stone slabs cut by the cutting mechanism 600. First, the detection mechanism 700 acquires an image of the stone slab, determines its pattern information based on the image, and stores this pattern information in the candidate stone pattern information. Then, matching stones are identified from the pattern information of multiple candidate stones, and the patterns are spliced to generate a stone splicing image. By using the stone pattern splicing method of this embodiment as candidate stones from an automated stone processing line for pattern matching to generate a stone splicing image, a wider range of splicing options can be provided to users, thereby improving the user experience.
[0072] The stone layout method according to embodiments of this application is described below, such as... Figure 3 As shown, the method may include steps S110 to S130.
[0073] Step S110: Obtain the pattern information of the first stone.
[0074] In this embodiment, the first stone is a pre-defined initial stone. The first stone can be a user-specified stone. For example, the first stone can be a stone specified by the user from multiple candidate stones. Alternatively, the first stone can be a stone provided by the user. The first stone can also be a stone randomly selected from multiple candidate stones, or a stone obtained by traversing multiple candidate stones in a specific order. For example, during the first traversal of multiple candidate stones, the first stone can be the first stone among the multiple candidate stones. During the second traversal of multiple candidate stones, the first stone can be the second stone among the multiple candidate stones. The candidate stones can be stone slabs, such as stone slabs obtained through cutting processes in automated stone processing lines.
[0075] The shape of the first stone is not specifically limited; for example, it can be rectangular.
[0076] Stone pattern information refers to information that characterizes the width and position of the pattern at the edges of the stone surface. This information may include the width of the pattern at the stone's edge, the identifier of the pattern's location on the stone's edge, and the distance from the pattern to the stone's apex. For example... Figure 4 As shown, as an example, the stone pattern corresponds to the shaded area. The stone pattern information may include information such as identifier 1, which indicates that the pattern is located on the edge of the stone, the pattern width w on the stone edge 1, and the distance d from the pattern to the stone vertex; and identifier 2, which indicates that the pattern is located on the edge of the stone, the pattern width on the stone edge 2, and the distance between the stone vertex and the pattern.
[0077] The width and position information of the pattern can be the actual width and position information of the pattern at the edge of the stone, or the width and position information of the pattern in the stone image.
[0078] In this embodiment, the edges of the stone can be pre-marked. As an example, the first edge of the stone can be designated first, and then the edges can be marked sequentially according to a set rotation direction. Figure 4 For example, the right edge of the stone is designated as the first edge of the stone and marked as 1. Then, the edges of the stone are marked sequentially according to the set rotation direction. Figure 4 The pattern is located on edge 1 and edge 2 of the stone, where the width of the pattern on edge 1 is w.
[0079] The distance between the stone vertex and the pattern can be defined as the distance between the first stone vertex and the pattern within the set rotation direction of the pattern. The set rotation direction can be clockwise or counter-clockwise. Figure 4 For example, assuming the rotation direction is set to clockwise, the distance between the stone vertex and the pattern can be the distance d between the pattern and the stone vertex A.
[0080] In this embodiment, images of the stone slabs obtained during the cutting process can be acquired and stored as candidate stone images. Based on the candidate stone images, pattern information of the candidate stones is generated in advance.
[0081] In this embodiment, the pattern information of the candidate stone can be associated with the candidate stone corresponding to each pattern information and stored in the database. The pattern information of the candidate stone can be queried in the database.
[0082] Step S120: Determine a second stone from multiple candidate stones that matches the pattern information of the first stone, so that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the multiple candidate stones is pre-generated based on the images of the candidate stones.
[0083] In this embodiment, a second stone that matches the pattern information of a first stone can be determined based on the pattern information of multiple pre-generated candidate stones. As an example, a second stone that matches the pattern information of the first stone can be queried from a database that pre-stores information on candidate stones and their corresponding pattern information.
[0084] In this embodiment, "matching" can be understood as meeting preset matching conditions. Matching pattern information means that both the information representing the pattern width and the information representing the distance between the stone vertex and the pattern meet the preset matching conditions.
[0085] Step S130: Generate a stone splicing image based on the pattern information of the first stone and the pattern information of the second stone.
[0086] A first and second stone with matching patterns are pieced together according to the positions of the matching patterns to form a continuous pattern. By piecing together the first and second stones according to their matching patterns, a stone mosaic image can be generated. As an example, such as... Figure 5 As shown, the pattern of the first stone a is located on edge 1. The pattern of the second stone b is located on edge 3. When the width aw of the pattern of the first stone on edge 1 and the width bw of the pattern of the second stone b on edge 3 match, and the distance ad of the pattern of the first stone a on edge 1 to vertex A and the distance bd of the pattern of the second stone b on edge 3 to vertex B match, the patterns of edge 1 of the first stone a and edge 3 of the second stone b are joined together to generate the pattern shown below. Figure 6 The image shown shows a mosaic of stone materials.
[0087] The method described in this application can automatically identify stones with matching pattern information from candidate stones without relying on manual labor, greatly improving matching efficiency and accuracy. Furthermore, by stitching together images of stones with matching pattern information, a stone mosaic image is generated, allowing users to easily determine whether their requirements are met. For example, if there are 1000 candidate stones in the database and 9 stones are needed to stitch together a pattern, the original manual stitching time was 2 days; using this algorithm, the time is reduced to 5 seconds.
[0088] In some embodiments, the pattern needs to extend to the edge of the stone before it can be joined with other stones. Therefore, the pattern information in this embodiment may also include information indicating whether the pattern extends to the edge of the stone.
[0089] Step S120 may include: determining a second stone from a plurality of candidate stones whose pattern information indicates that the pattern extends to the edge of the stone. In this embodiment, it can be understood that the pattern information of the first stone also extends to the edge of the first stone.
[0090] If the pattern information of the stone does not extend to the edge of the stone, skip the currently selected stone and continue to traverse the next stone.
[0091] The pattern does not extend to the edge of the stone, which is understandable, as the pattern is distributed in the inner area of the stone and there is no pattern at the edge.
[0092] Before matching pattern information, this embodiment first determines the distribution area of the pattern and whether the pattern extends to the edge of the stone. Matching is only performed if the pattern extends to the edge of the stone, and no matching is required if the pattern does not extend to the edge of the stone. This can improve matching efficiency.
[0093] In some embodiments, the stone pattern information may further include the stone's geometric information. In this embodiment, the geometric information of the candidate stones may be the same or different. Step S120 may include: if the geometric information of the second stone matches the geometric information of the first stone, determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone.
[0094] In this embodiment, matching the geometric information of the second stone with the geometric information of the first stone can mean that the geometric information of the second stone and the first stone are the same, or that they meet a preset geometric information matching condition. The geometric information of the stone can at least include the shape and size of the stone. When the geometric information of the second stone and the first stone are the same, the shape and size of the second stone are also the same as the shape and size of the first stone.
[0095] Preset geometric information matching conditions can be set according to actual needs. As an example, such as... Figure 6 As shown, the geometric information of the first stone shows that the stone shape is rectangular, and the geometric information of the second stone shows that the shape is square. The side where the pattern of the first stone is located is the side along the length of the rectangle, and the length of the first stone is twice the side length of the second stone.
[0096] The dimensions of stone can include its length, width, and thickness.
[0097] In some embodiments, such as Figure 1 As shown, a stone processing production line applicable to embodiments of this application may further include a thickness measuring unit 800. The thickness measuring unit 800 may be located on the side of the cutting mechanism 600 away from the unloading station. The thickness measuring unit 800 is used to measure the thickness of the stone, and the cutting mechanism 600 can cut the stone according to the thickness. After obtaining the stone slabs of the specified dimensions, before pattern matching, the thickness of the candidate stones can be matched first. If the stone thickness meets the preset thickness matching conditions, pattern matching can then be performed, thereby further improving matching efficiency.
[0098] In this embodiment, before matching pattern information, the geometric information of the stone is checked for matching. Pattern information matching is only performed if the geometric information of the stone matches. If the geometric information of the stone does not match, there is no need to perform pattern information matching, which can further improve the matching efficiency.
[0099] In some embodiments, the step of pre-generating the pattern information of candidate stones based on the image of the candidate stones may include: acquiring the image of the candidate stones; inputting the image of the candidate stones into the pattern information detection model to obtain the pattern information of the candidate stones.
[0100] In an embodiment where the stone pattern information is the relative width and relative position information of the pattern at the edge of the stone, an image of the candidate stone can be obtained, and the image of the candidate stone can be input into the pattern information detection model to obtain the relative pattern information of the candidate stone.
[0101] In an embodiment where the stone pattern information is the actual width and position of the pattern at the edge of the stone, the actual dimensions of the stone specification slab are first obtained, and then the actual width and position of the pattern in the stone specification slab are obtained by performing pattern detection on the image of the stone specification slab.
[0102] The steps to obtain the actual dimensions of the stone slab specifications may include: obtaining the actual dimensions of the stone slab specifications recorded in the automated processing production line system.
[0103] The steps to obtain the actual dimensions of the stone slab can also include: scanning the stone slab using a line scan industrial camera to obtain the actual dimensions of the stone slab.
[0104] Optionally, the detection mechanism 700 (e.g., a camera) can be pre-calibrated to determine the correspondence between pixels and actual sizes in images acquired by the camera at a set height and angle. For example, one pixel value in the image corresponds to an actual size of N millimeters. In this embodiment, a first detection is performed on the acquired image of the stone specification slab to determine its position in the image. Then, a second detection is performed on the pixels occupied by the stone specification slab at the stated position to determine the pixel value occupied by the stone specification slab in the image. Based on the correspondence between image pixel values and actual sizes, the actual size of the stone specification slab corresponding to the image is determined. In this embodiment, the images of candidate stones are all acquired by a detection mechanism at a set height and angle, which can improve the accuracy of the detection.
[0105] After determining the actual dimensions of the stone slab, a pattern detection (i.e., third detection) is performed on the image of the stone slab to determine the actual width and position information of the pattern at the edge of the stone slab.
[0106] In this embodiment, at least one of the first, second, and third detections of the stone slab image can be performed using a pre-trained detection model to improve the speed and efficiency of the method. In one example, the detection model can be a YOLOv5 series model, such as the YOLOv5-s model.
[0107] Taking the pattern detection model as an example, at least 1000 images of stone slabs, the actual dimensions of the stone slabs corresponding to each image, and the pattern information of the stone slabs corresponding to each image can be pre-acquired as a training dataset. The YOLOv5-s model is trained with a training-to-validation ratio of 0.8 to obtain the target YOLOv5-s model. The images of candidate stones and the actual dimensions of the corresponding stone slabs are input into the target YOLOv5-s model to perform pattern detection on the stone slab images, identify the pattern positions, and output the coordinate data of the patterns. The actual pattern information of the candidate stones is calculated using the pattern coordinate data.
[0108] The pattern information detection model provided in this application embodiment can quickly and accurately obtain the pattern information of stone, thereby further improving the efficiency of stone pattern splicing.
[0109] In some embodiments, the stone pattern information may include the width of the pattern at the edge of the stone and the distance from the pattern to the vertex of the stone. Figure 4 For example, the distance from the pattern to the vertex of the stone can be the distance from the pattern to any vertex of the stone. Preferably, the distance from the pattern to the vertex of the stone is the distance between the stone vertex adjacent to the pattern and the pattern in the set rotation direction of the pattern.
[0110] In this embodiment, step S110 may include step S111: obtaining the first width of the first pattern of the first stone and the first distance from the first pattern to the vertex of the first stone. Step S120 may include step S121: determining a second stone from a plurality of candidate stones based on the first width and the first distance.
[0111] In step S121, a second stone matching the first width and the first distance can be obtained from multiple candidate stones. As an example, in a database that pre-stores pattern information of multiple candidate stones, pattern information matching the first width and the first distance is queried. After finding matching pattern information, the stone corresponding to that pattern information is selected as the second stone.
[0112] In this embodiment, step S121 may include steps S122 to S124.
[0113] Step S122: Obtain the second width of the second pattern of the second stone and the second distance from the second pattern to the vertex of the second stone.
[0114] Step S123: Calculate the difference between the first width and the second width, and the sum of the first distance, the second distance, and the first width.
[0115] Step S124: If the difference between the first width and the second width is less than or equal to a first preset threshold, and the difference between the sum and the side length of the edge of the first stone corresponding to the first pattern is less than or equal to a second preset threshold, then the pattern information of the second stone is determined to match the pattern information of the first stone.
[0116] In this embodiment, the difference between the edge length of the first stone corresponding to the first pattern and the edge length of the second stone corresponding to the second pattern can be within the third threshold range. As an example, such as... Figure 5 As shown, the pattern information of the first stone can include the pattern width aw of stone a located on edge 1 and the distance ad between the pattern on edge 1 and vertex A. The pattern information of the second stone includes the pattern width bw of stone b located on edge 3 and the distance bd between the pattern on edge 3 and vertex B. The edge of the first stone corresponding to the first pattern is edge 1, and its side length is e. When abs(aw-bw) is less than or equal to a first preset threshold and abs(e-(ad+bd+aw)) is less than or equal to a second preset threshold, it is determined that the pattern information of the stone at this time matches the pattern information of the first stone, and the stone at this time is used as the second stone.
[0117] The edge length of the first stone corresponding to the first pattern can also be greater than the edge length of the second stone corresponding to the second pattern, and the difference is outside the third threshold range. For example... Figure 7 As shown, in this embodiment, when abs(aw-bw) is less than or equal to the first preset threshold and abs(e–(ad+bd+aw)) is less than or equal to the second preset threshold, it is determined that the pattern information of the stone at this time matches the pattern information of the first stone, and the stone at this time is used as the second stone.
[0118] If the edge length of the first stone corresponding to the first pattern is less than the edge length of the second stone corresponding to the second pattern, and the difference is outside the range of the third threshold, step S124 can also be: if the difference between the first width and the second width is less than or equal to the first preset threshold, and the difference between the sum and the edge length of the second stone corresponding to the second pattern is less than or equal to the second preset threshold, then determine that the pattern information of the second stone matches the pattern information of the first stone.
[0119] The specific values of the first, second, and third preset thresholds can be set according to the error of pattern detection and can be dynamically adjusted according to actual needs. No specific limits are set here.
[0120] In some embodiments, step S130 may include steps S131 to S132.
[0121] Step S131: Associate and store the pattern information of the first stone and the pattern information of the second stone in the stone splicing set.
[0122] Step S132: If the number of elements in the stone splicing set meets the requirements or multiple candidate stones have been traversed, generate a stone splicing image based on the stone splicing set.
[0123] In this embodiment, the stone splicing set may include a first identifier of a first stone, a first edge identifier of the pattern matching edge of the first stone, a second identifier of a second stone that matches the first edge identifier, and a second edge identifier of the pattern matching edge of the second stone. Step S132 may include: determining the image of the first stone corresponding to the first identifier and the image of the second stone corresponding to the second identifier; using the edge corresponding to the first edge identifier in the image of the first stone and the edge corresponding to the second edge identifier in the image of the second stone as splicing edges to generate a stone splicing image.
[0124] In a stone mosaic collection, each matching combination can be stored in a tuple or list, or other formats. Figure 7 For example, the first identifier of the first stone, the first edge identifier of the pattern matching edge of the first stone, the second identifier of the second stone that matches the first edge identifier, and the second edge identifier of the pattern matching edge of the second stone can be stored in a tuple. For example, the stone splicing set can be {(a:1, b:3)}. Here, (a:1, b:3) represents the matching of the pattern information of edge 1 of the first stone and the pattern information of edge 3 of the second stone.
[0125] In this embodiment, the number of stones to be spliced can be set, i.e., how many stone slabs are needed to form a continuous pattern. A second stone matching the pattern information of the first stone is searched from the candidate stones. Then, the pattern information matching method described in the above embodiment is used to continue searching for a third stone matching the pattern information of the second stone, until the set number of stones to be spliced is obtained or each candidate stone has been traversed. A stone splicing set is then generated and output. In this embodiment, the stone splicing set may include a first identifier of the first stone, a first side identifier of the first stone matching the pattern of the second stone, a second side identifier of the first stone matching the pattern of the third stone, a second identifier of the second stone, a third side identifier of the second stone matching the pattern of the first stone, a fourth side identifier of the second stone matching the pattern of the third stone, a third identifier of the third stone, a fifth side identifier of the third stone matching the pattern of the first stone, and a sixth side identifier of the third stone matching the pattern of the second stone.
[0126] As an example, such as Figure 8 As shown, the pattern information of the first stone edge 1 matches the pattern information of the second stone edge 3, and the pattern information of the second stone edge 2 matches the pattern information of the third stone edge 4. In this example, the first identifier of the first stone is a, the first edge identifier 1 of the first stone that matches the pattern of the second stone, the second identifier b of the second stone, the third edge identifier 3 of the second stone that matches the pattern of the first stone, the fourth edge identifier 2 of the second stone that matches the pattern of the third stone, the third identifier c of the third stone, and the sixth edge identifier 4 of the third stone that matches the pattern of the second stone.
[0127] In this example, the stone splicing set can be {(a:1, b:3), (b:3, c:4)}. Here, (a:1, b:3) represents the matching of the pattern information of edge 1 of the first stone with the pattern information of edge 3 of the second stone, and (b:3, c:4) represents the matching of the pattern information of edge 3 of the second stone with the pattern information of edge 4 of the third stone.
[0128] This embodiment does not specifically limit the method of generating images by stitching; all existing image stitching methods are applicable to this embodiment.
[0129] In some embodiments, the pattern splicing method described above can be repeated multiple times to generate multiple stone splicing images, allowing users to select the stone splicing image that meets their needs from among the multiple stone splicing images.
[0130] The method described in this embodiment can dynamically determine combinations of stones with matching pattern information from candidate stones, thereby improving pattern matching efficiency and accuracy. Furthermore, by repeatedly executing the pattern splicing method described in this embodiment, users can be provided with a variety of optional stone splicing images, further increasing user engagement.
[0131] This application embodiment also provides a stone pattern splicing device, including:
[0132] The acquisition module is used to acquire the pattern information of the first stone.
[0133] The determining module is used to determine a second stone from a plurality of candidate stones that matches the pattern information of the first stone, such that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the plurality of candidate stones is pre-generated based on the image of the candidate stones;
[0134] The generation module is used to generate a stone splicing image based on the pattern information of the first stone and the pattern information of the second stone.
[0135] The stone pattern splicing device and stone pattern splicing method in this application correspond to each other and will not be described again here.
[0136] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the method as described in any of the above embodiments of the stone pattern splicing method.
[0137] This application also provides an electronic device, such as... Figure 9 As shown, the electronic device 100 includes a memory 110 and a processor 120.
[0138] The memory 110 is used to store computer instructions, and the processor 120 is used to retrieve the computer instructions from the memory 110 to execute the method as described in any of the above embodiments of the stone pattern splicing method.
[0139] The various embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and apparatus embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0140] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0141] This application may be a system, method, and / or computer program product. A computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of this application.
[0142] Computer-readable storage media can be tangible devices capable of holding and storing instructions for use by an instruction execution device. Computer-readable storage media can be, for example—but not limited to—electrical storage devices, magnetic storage devices, optical storage devices, electromagnetic storage devices, semiconductor storage devices, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), static random access memory (SRAM), portable compact disc read-only memory (CD-ROM), digital multifunction disc (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or recessed protrusions storing instructions thereon, and any suitable combination thereof. The computer-readable storage media used herein are not to be construed as transient signals themselves, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (e.g., light pulses through fiber optic cables), or electrical signals transmitted through wires.
[0143] The computer-readable program instructions described herein can be downloaded from computer-readable storage media to various computing / processing devices, or downloaded via a network, such as the Internet, local area network, wide area network, and / or wireless network, to an external computer or external storage device. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. A network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards them to the computer-readable storage media in the respective computing / processing device.
[0144] The computer program instructions used to perform the operations of this application may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as the "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or may be connected to an external computer (e.g., via the Internet using an Internet service provider). In some embodiments, electronic circuitry, such as programmable logic circuitry, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), is personalized by utilizing the status information of the computer-readable program instructions. This electronic circuitry can execute the computer-readable program instructions to implement various aspects of this application.
[0145] Various aspects of this application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0146] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0147] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0148] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions. It will be well known to those skilled in the art that implementation in hardware, implementation in software, and implementation using a combination of software and hardware are equivalent.
[0149] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.
Claims
1. A method for splicing stone patterns, characterized in that, include: Obtain the pattern information of the first stone; A second stone is selected from multiple candidate stones that matches the pattern information of the first stone, so that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the multiple candidate stones is pre-generated based on the images of the candidate stones; A stone mosaic image is generated based on the pattern information of the first stone and the pattern information of the second stone.
2. The method according to claim 1, characterized in that, The pattern information includes information characterizing whether the pattern extends to the edge of the stone. The step of determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone includes: Given that the pattern information of the stone indicates that the pattern extends to the edge of the stone, a second stone that matches the pattern information of the first stone is determined from a plurality of candidate stones.
3. The method according to claim 1, characterized in that, Based on the image of the candidate stone, the pattern information of the candidate stone is generated in advance, including: Acquire images of the candidate stones; The image of the candidate stone is input into the pattern information detection model to obtain the pattern information of the candidate stone.
4. The method according to claim 1, characterized in that, The pattern information includes the geometric information of the stone, and the step of determining a second stone from multiple candidate stones that matches the pattern information of the first stone includes: If the geometric information of the second stone matches the geometric information of the first stone, a second stone that matches the pattern information of the first stone is determined from multiple candidate stones.
5. The method according to claim 4, characterized in that, The pattern information also includes the width of the pattern at the edge of the stone and the distance from the pattern to the vertex of the stone; obtaining the pattern information of the first stone includes: Obtain the first width of the first pattern of the first stone and the first distance from the first pattern to the vertex of the first stone; The step of determining a second stone from a plurality of candidate stones that matches the pattern information of the first stone includes: Based on the first width and the first distance, the second stone is determined from a plurality of candidate stones.
6. The method according to claim 5, characterized in that, The vertex of the stone is the stone vertex adjacent to the pattern in the set rotation direction of the pattern. The step of determining the second stone from multiple candidate stones based on the first width and the first distance includes: Obtain the second width of the second pattern on the second stone and the second distance from the second pattern to the vertex of the second stone; Calculate the difference between the first width and the second width, and the sum of the first distance, the second distance, and the first width; If the difference is less than or equal to a first preset threshold, and the difference between the sum and the edge length of the first stone corresponding to the first pattern is less than or equal to a second preset threshold, then the pattern information of the second stone is determined to match the pattern information of the first stone.
7. The method according to any one of claims 1 to 6, characterized in that, The step of generating a stone mosaic image based on the pattern information of the first stone and the pattern information of the second stone includes: The pattern information of the first stone and the pattern information of the second stone are associated and stored in the stone splicing set; If the number of elements in the stone mosaic set meets the requirements or all of the candidate stones have been traversed, a stone mosaic image is generated based on the stone mosaic set.
8. A stone pattern splicing device, characterized in that, include: The acquisition module is used to acquire the pattern information of the first stone. The determining module is used to determine a second stone from a plurality of candidate stones that matches the pattern information of the first stone, such that the pattern of the second stone and the first stone after splicing together forms a continuous pattern; wherein, the pattern information of the plurality of candidate stones is pre-generated based on the image of the candidate stones; The generation module is used to generate a stone splicing image based on the pattern information of the first stone and the pattern information of the second stone.
9. A storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1 to 7.
10. An electronic device, characterized in that, Including memory and processor, The memory is used to store computer instructions, and the processor is used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1 to 7.