Intelligent nesting method considering texture direction constraint for solid wood furniture boards
By using deep neural networks and iterative optimization methods, the problem of texture direction constraint in solid wood furniture board nesting was solved, achieving efficient and aesthetically pleasing part layout, and solving the problems of resource waste and optimization difficulties in existing technologies.
Patent Information
- Application Number
- CN202610094734.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-01
AI Technical Summary
Existing technologies struggle to effectively handle complex texture direction constraints in solid wood furniture panel nesting, leading to wasted panel resources and reduced aesthetic value. Furthermore, optimization algorithms exhibit slow convergence speed or insufficient optimization accuracy in high-dimensional non-convex solution spaces.
A deep neural network is used to generate pixel-level defect segmentation maps and texture orientation fields. Combined with iterative optimization process and artificial potential field method, a comprehensive value map is constructed. The optimal placement pose of parts on the sheet metal is found through hybrid optimization strategy, taking into account texture orientation and defect avoidance.
It achieves the best match between part layout and sheet material texture, improving process quality and aesthetic value. At the same time, it efficiently finds the global or near-global optimal layout scheme under complex constraints, simplifying the algorithm logic.
Smart Images

Figure 04E0F2C8-72DC-4662-8CD6-66C23BA77248 
Figure 0D314B58-5903-4561-A5C4-BBFE076E19B0 
Figure 13BBB14D-A2A3-4983-AD70-6BFC3A010884
Abstract
Description
A Smart Nesting Method for Solid Wood Furniture Panels Considering Grain Direction Constraints Technical Field
[0001] This invention relates to the fields of computer vision and industrial automation technology, and in particular to an intelligent nesting method for solid wood furniture panels that takes into account texture direction constraints. Background Technology
[0002] Intelligent nesting of solid wood furniture panels is a crucial step in the wood processing industry, with the core objective of maximizing panel utilization while meeting process requirements. With the development of computer technology, automated nesting methods have gradually replaced traditional manual planning. Early automation technologies relied primarily on traditional image processing algorithms, such as edge detection, threshold segmentation, and morphological operations, to identify macroscopic defects on the panels, such as knots and cracks. After identifying the geometric contours of the defects, heuristic algorithms such as BLF (Bottom-Left-Fill) or global optimization algorithms such as Genetic Algorithms (GA) were used to nest the parts within the usable area after removing defects. These methods improved production efficiency to some extent and laid the foundation for automated nesting. In recent years, the rise of deep learning technology, especially the successful application of convolutional neural networks (CNNs) in image segmentation, has made pixel-level accurate perception of heterogeneous and irregular defects possible, further improving the robustness and accuracy of defect identification.
[0003] However, existing technologies still have significant limitations when dealing with the inherent complex constraints of solid wood panels. First, most methods typically treat defect perception and nesting optimization as two independent sequential processes. For example, some solutions, after accurately segmenting defect areas using deep learning, treat them merely as "holes" in a rigid constraint. The optimization algorithm itself cannot determine the proximity of the part to the defect edge, potentially creating unnecessary safety gaps around the defect and wasting board resources. Second, existing technologies generally fail to adequately address the crucial aesthetic constraint of wood grain. Some solutions completely ignore grain direction, resulting in a messy surface texture on the final assembled product, reducing its aesthetic value. Other solutions, while considering this, typically use globally uniform or manually specified constraints, failing to adapt to the natural and continuous variations in grain direction within a single board. Furthermore, at the optimization algorithm level, purely heuristic algorithms are prone to getting trapped in local optima, while traditional global optimization algorithms often face slow convergence or insufficient optimization accuracy when dealing with high-dimensional, non-convex solution spaces containing continuous rotation angles, making it difficult to efficiently find globally optimal or near-optimal layout schemes under complex constraints. Summary of the Invention
[0004] The purpose of this section is to outline some aspects of embodiments of the present invention and to briefly describe some preferred embodiments. Simplifications or omissions may be made in this section, as well as in the abstract and title of this application, to avoid obscuring the purpose of these documents; however, such simplifications or omissions should not be construed as limiting the scope of the invention.
[0005] In view of the aforementioned existing problems, this invention is proposed. Therefore, this invention provides an intelligent nesting method for solid wood furniture panels that considers grain direction constraints, in order to solve the problems mentioned in the background art.
[0006] To address the aforementioned technical problems, this invention provides the following technical solution: a smart nesting method for solid wood furniture boards considering texture direction constraints, comprising: acquiring digital images of solid wood furniture boards; processing the digital images using a pre-trained deep neural network to simultaneously generate a pixel-level defect segmentation map and a pixel-level texture direction field, wherein the defect segmentation map is used to identify the location and region of different defect types on the board, and the texture direction field is used to represent the main direction of the wood texture of each pixel within the usable area of the board; based on the defect segmentation map and the texture direction field, constructing a unique comprehensive value map for each part to be nested; for each part in the list of parts to be nested, determining its optimal placement pose on the board through an iterative optimization process based on its corresponding comprehensive value map, wherein the pose includes position and rotation angle; after determining the optimal placement pose of a part, updating the state of the usable area of the board, and repeating the iterative optimization process until all parts are nested.
[0007] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, the deep neural network includes: a shared feature encoder and two parallel, independent decoder branches, wherein the first decoder branch is used to output the defect segmentation map and the second decoder branch is used to output the texture direction field.
[0008] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, the texture direction field represents the main texture direction of each pixel as a two-dimensional vector, and the two components of the two-dimensional vector are determined by the cosine and sine values corresponding to twice the angle of the main direction, thereby achieving a unique representation of the wood texture without directionality.
[0009] As a preferred embodiment of the intelligent nesting method for solid wood furniture panels considering texture direction constraints described in this invention, the process of constructing the comprehensive value map includes: generating a defect repulsion field, wherein the value of each point in the repulsion field depends on the distance between the point and the nearest defect area, and the closer the distance, the higher the repulsion value; generating a texture coordination map, wherein the value of each point in the coordination map is obtained by calculating the degree of consistency between the local texture direction of the point and the preset target texture direction of the part to be nested; and fusing the defect repulsion field and the texture coordination map to generate the comprehensive value map.
[0010] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, generating the defect repulsion field includes: performing a distance transformation operation on the defect segmentation map, obtaining the Euclidean distance from each non-defect pixel to the nearest defect region, and inputting the Euclidean distance into a preset attenuation function to calculate the repulsion value.
[0011] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, generating the texture coordination map includes: calculating the dot product of the local texture direction vector of each pixel in the texture direction field and the target texture direction vector of the part, and using the square of the dot product as the texture coordination value of the pixel.
[0012] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, the method involves fusing the defect repulsion field with the texture compatibility map, including multiplying the value of the texture compatibility map with the inverse value of the defect repulsion field, so that the final value of the high repulsion region approaches zero.
[0013] As a preferred embodiment of the intelligent nesting method for solid wood furniture panels considering texture direction constraints described in this invention, the process of determining the optimal placement posture adopts the artificial potential field method, and the part to be nested is regarded as a rigid body moving on the comprehensive value map, and the rigid body is simultaneously subjected to two generalized forces.
[0014] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, the two generalized forces include: a first generalized force is the attractive force and torque originating from the spatial gradient of the comprehensive value map, which guides the parts to move and rotate towards areas with higher value in the map; the second generalized force is the repulsive force and torque generated when a part approaches the board boundary or other placed parts, which is used to prevent overlap and boundary crossing between parts.
[0015] As a preferred embodiment of the intelligent nesting method for solid wood furniture boards considering texture direction constraints described in this invention, the iterative optimization process further includes a global search mechanism. This mechanism probabilistically accepts non-optimal part pose changes to assist the artificial potential field method in escaping local optima, thereby seeking the global optimal solution for part layout across the entire board.
[0016] Compared with existing technologies, the beneficial effects of this solution are as follows: 1. By constructing a dedicated comprehensive value map, discrete defect constraints (hard constraints) and continuously changing texture aesthetic requirements (soft constraints) are unified into a continuous and smooth decision space. Unlike existing technologies that treat defects as simple "holes" and ignore local texture changes, this invention not only achieves flexible avoidance of defects (moving away rather than simply avoiding them), but also enables the part layout to actively seek the best match with the local texture of the sheet metal, thereby improving the process quality and aesthetic value of the final product.
[0017] 2. The hybrid optimization strategy combining the artificial potential field method and simulated annealing employed in this invention fully leverages the rapid local search capability of the artificial potential field method based on gradients and the global escape capability of simulated annealing. Compared to the problems of traditional heuristic algorithms easily getting trapped in local optima, or the slow convergence of purely global optimization algorithms in high-dimensional non-convex spaces, this invention can more efficiently and robustly find the global or near-global optimal layout scheme in complex solution spaces containing continuous positions and rotation angles.
[0018] 3. Furthermore, this invention cleverly unifies the anti-overlap constraints between parts with the defect avoidance constraints of the original sheet metal by dynamically updating the placed parts to "temporary defects." This design allows the entire multi-part nesting process to proceed within a unified, iterative framework, eliminating the need for independent collision detection and response mechanisms for different types of obstacles. This greatly simplifies the algorithm logic and achieves a higher level of end-to-end automation. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Specifically: Figure 1 is a general flowchart of the intelligent nesting method for solid wood furniture boards considering texture direction constraints according to an embodiment of the present invention. Detailed Implementation
[0020] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of the present invention.
[0021] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0023] This invention is described in detail with reference to the schematic diagrams. When detailing the embodiments of this invention, for ease of explanation, the cross-sectional views illustrating the device structure may be partially enlarged, not adhering to the usual scale. Furthermore, the schematic diagrams are merely examples and should not be construed as limiting the scope of protection of this invention. In actual fabrication, the three-dimensional spatial dimensions of length, width, and depth should be included.
[0024] Furthermore, in the description of this invention, it should be noted that the terms "upper," "lower," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. These terms are used solely for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. In addition, the terms "first," "second," or "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0025] Unless otherwise explicitly specified and limited, the terms "installation," "connection," and "joining" in this invention should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; similarly, they can refer to mechanical connections, electrical connections, or direct connections, or indirect connections through an intermediate medium, or internal connections between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0026] Example 1 refers to Figure 1, which is the first embodiment of the present invention. This embodiment provides a smart nesting method for solid wood furniture boards that considers texture direction constraints, including: S1, acquiring a digital image of the solid wood furniture board, processing the digital image using a pre-trained deep neural network, and generating a pixel-level defect segmentation map and a pixel-level texture direction field. The defect segmentation map is used to identify the location and region of different defect types on the board, and the texture direction field is used to represent the main direction of the wood texture of each pixel in the usable area of the board.
[0027] Furthermore, high-resolution RGB digital images of solid wood furniture panels are acquired using industrial line scan or area scan cameras under uniform, shadowless lighting conditions. To ensure the integrity of detailed information, in this embodiment, the image resolution is typically set to no less than 10 pixels per millimeter.
[0028] Furthermore, the acquired digital images are input into a specially designed and pre-trained deep neural network. To fully consider the inherent correlation and differences between the two tasks of defect segmentation and texture orientation estimation, the neural network structurally includes a shared feature encoder and two parallel, independent decoder branches, namely the first decoder branch and the second decoder branch.
[0029] Specifically, for the shared feature encoder, advanced convolutional neural network structures such as ConvNeXt or EfficientNet are used as the backbone network to extract multi-scale feature maps from the input RGB image, ranging from low-level (such as edges and colors) to high-level (such as shape and semantics).
[0030] It should be noted that this shared encoder allows two tasks to reuse most of the feature extraction computation, thereby improving the overall operating efficiency of the neural network.
[0031] Specifically, for the first decoder branch (defect segmentation), this branch receives the feature map from the shared encoder and outputs a multi-scale feature map. This multi-scale feature map is then gradually restored to its resolution through a series of upsampling and convolution operations, ultimately resulting in a multi-channel pixel-level defect segmentation map. The segmentation map has the same size as the input image, and its number of channels is... It equals the number of predefined defect categories plus the number of background categories. (At location) At this point, the channel index with the largest value indicates the category to which the pixel belongs, such as live knot, dead knot, crack, blue stain, or available background.
[0032] Specifically, for the second decoder branch (texture orientation field), this branch also receives feature maps from the shared encoder, but its goal is to regress a continuous vector field. To address the 180° ambiguity of wood texture orientation (i.e., a line without a directional arrow), the present invention does not directly regress angle values. Instead, it uses the texture orientation field output by the decoder... The principal direction of the texture at each pixel is represented as a two-dimensional unit vector. That is, if the angle between the local texture of a pixel and the horizontal direction is... Then the texture direction at that point is uniquely represented as a vector. Therefore, the output of the second decoder branch is a two-channel floating-point tensor, with each channel corresponding to one of the two components of a vector. This method cleverly maps the angle space onto a continuous manifold without singularities, enabling the neural network to learn and predict more stably.
[0033] Furthermore, in order for deep neural networks to achieve the above functions, we also need to train them sufficiently.
[0034] Specifically, a large number of board images are annotated at the pixel level using manual or semi-automatic annotation tools to generate a multi-channel mask image that perfectly corresponds to the output format of the first decoder branch. Since there is no intuitive annotation method for texture direction, this invention employs a method based on structural tensor analysis to automatically generate high-quality ground truth labels. That is, for the brightness channel of the image In a local neighborhood of each pixel Internally, construct the structure tensor matrix. : in, and Is the image in and gradient in direction, It is a Gaussian weighted kernel used to emphasize the influence of the center pixel in the neighborhood.
[0035] Specifically, for the matrix Eigenvalue decomposition yields two eigenvectors. The eigenvector associated with the smaller eigenvalue is... This indicates the direction of the slowest local gradient change, which is the main direction of the wood grain at that point. Subsequently, this feature vector... Converted to the aforementioned The form serves as the truth label for that pixel.
[0036] Furthermore, the goal of the deep neural network training process is defined as minimizing a composite loss function. The function consists of two weighted parts: in, and These are hyperparameters used to balance the learning progress of the two tasks, and they follow... . It is a defect segmentation loss, which usually uses a combination of focus loss and dice loss to effectively handle the severe class imbalance problem between defects and background. It is a texture orientation loss, which penalizes the texture vectors predicted by the network. With truth vector The angular deviation between them is represented by the following loss form: in, This means taking the average value over all available pixels. It is the dot product of two unit vectors, i.e., the cosine of the angle between them. Squaring it ensures that the loss function does not penalize two vectors with completely opposite directions (180° apart), perfectly matching the physical characteristics of texture direction. Furthermore, this loss... The range of values is Between these two points, when the prediction direction is parallel to or opposite to the true value direction, the loss is 0; when they are perpendicular, the loss reaches its maximum value of 1.
[0037] Furthermore, in one feasible embodiment, the training process described above is as follows: We collected over 5000 high-resolution solid wood board images of different tree species and under different lighting conditions. Using the semi-automatic annotation tool and structural tensor analysis method, corresponding defect segmentation masks and texture orientation field ground truth values were generated for each image. The dataset was divided into training, validation, and test sets in an 8:1:1 ratio. The shared feature encoder uses EfficientNet-B4 as the backbone network. The first decoder branch (defect segmentation) adopts a U-Net-like upsampling structure, gradually restoring resolution through transposed convolutions and skip connections. The second decoder branch (texture orientation field) also adopts a similar structure, but uses the Tanh activation function in the output layer to ensure that the two output component values are between [-1, 1]. The AdamW optimizer was used to optimize the network parameters, with an initial learning rate set to 1e-4, and a cosine annealing strategy was used to dynamically adjust the learning rate. The batch size was set to 8. In the loss function, the weight hyperparameter was set to... , The focus was on improving the accuracy of defect segmentation. The entire network was trained on four NVIDIA Tesla V100 GPUs for 100 epochs. During training, the loss on the validation set was monitored, and the weights of the best-performing neural network model were saved as the final pre-trained neural network model.
[0038] S2. Based on the defect segmentation map and texture direction field, a unique comprehensive value map is constructed for each part to be nested.
[0039] It should be noted that the constructed comprehensive value map no longer uses the traditional method of simply dividing the sheet metal into "usable" and "unusable" areas. Instead, it assigns a quantified "value" score to each pixel on the sheet metal. This "value" score intuitively reflects the suitability of placing the reference point of the part to be nested at that pixel, thus transforming the complex, multi-constrained nesting problem into a numerical optimization problem of finding the optimal solution on this value map.
[0040] Specifically, the process of constructing this map includes generating a defect repulsion field, generating a texture compatibility map, and fusing the two. However, since different parts may have different texture requirements (for example, table legs require vertical textures, while tabletops require horizontal textures), this comprehensive value map is constructed "exclusively" for each part to be nested.
[0041] Furthermore, the binarized defect segmentation map generated in step S1 is... It transforms into a continuous repulsive potential field. The function of this repulsive potential field is to enable the optimization algorithm used in this invention not only to avoid the defect area, but also to actively move away from the defect edge, so as to reserve the necessary processing safety margin, thereby achieving flexible obstacle avoidance.
[0042] Specifically, for the defect segmentation map Perform an Euclidean Distance Transform (EDT). This operation calculates the Euclidean distance from each non-defective pixel to its nearest defective pixel, generating a distance map. Then, the distance map Each distance value in Input a preset decay function To calculate the repulsive force value at that point. The attenuation function must be designed to satisfy the principle that "the closer the distance, the higher the repulsive force." In this embodiment, a piecewise function with an influence radius is used as the attenuation function: in, It is a pixel. Euclidean distance to the nearest defect. This is the preset defect influence radius, representing the maximum effective range of the repulsive field. When the distance between a pixel and the defect exceeds this radius, the repulsive force value is zero, indicating that the point is sufficiently safe. This value can be adjusted according to the precision requirements of the specific processing technology. Within the defect area (i.e.) A maximum repulsive force value is set at the edge to ensure that no part overlaps with the defect. It is a positive exponent used to control the degree of repulsive force decay. The larger the value, the faster the repulsive force decreases with increasing distance.
[0043] It should be noted that the generated defect repulsion field can transform discrete defect constraints into a smoothly changing continuous field, providing effective guidance information for subsequent gradient-based optimization algorithms.
[0044] Furthermore, the degree of matching between the wood grain at each location on the board and the process requirements of the part to be nested is quantified, generating a texture compatibility map. .
[0045] Specifically, for the parts currently awaiting nesting. Define a target texture direction. This direction is typically specified by product design or process documents; for example, it may be required that the texture run along the length of the part. We also represent this target texture direction as a unit vector using the double-angle vector notation from step S1. The specific method for calculating the texture compatibility map is as follows: for the texture direction field of the board material... Each pixel in Its local texture direction vector is Calculate the local texture vector and the target texture vector of the part. The dot product of the two pixels is used, and the square of this dot product is taken as the texture compatibility value for that pixel. Mathematically, this can be expressed as: in, The result is the cosine of the angle between two double-angle vectors, denoted as . , It is the angle between the actual physical texture directions. Squaring this dot product yields... This cleverly solves the 180° ambiguity problem in terms of direction. Regardless of whether the local texture and the target texture are in the same direction ( ) or the opposite ( The compatibility value is 1 for both, representing a perfect match. When the angle between the two is 45 degrees ( The compatibility value is 0 when the two are perpendicular. The coordination value is also 1.
[0046] Furthermore, in a preferred embodiment of this invention, in order to make the compatibility value monotonically change between 0 (perpendicular) and 1 (parallel), the following calculation method can be used. This method is also based on dot product operations and better reflects the monotonically changing relationship of compatibility with angle: It should be noted that this formula converts the dot product result from... Linear mapping to Here, 1 represents perfect parallelism, 0 represents perpendicularity, and 0.5 represents a 45° angle, which better aligns with general measurements of compatibility. The final generated... That is, a normalized graph whose range is The closer the value is to 1, the better the texture direction at that point matches the requirements of the part.
[0047] Furthermore, the aforementioned generated defect repulsive field Texture Coordination Map By integrating these elements, a final comprehensive value map can be obtained. It is important to emphasize that the principle of fusion is that regions with high texture compatibility are "ideal" regions, while regions with high repulsion are "penalized" regions. Based on this, the present invention employs a multiplicative fusion strategy, specifically, multiplying the value of the texture compatibility map with the inverse value of the defect repulsion field. In practice, this can be manifested as transforming the repulsion field into a penalty factor field. Its range is And with repulsive force value They exhibit an inverse relationship. In this embodiment, a typical conversion function is an exponential decay function: in, It is a positive coefficient used to adjust the sensitivity of the penalty. When the repulsive force... When it is very large, the penalty factor It approaches 0; when the repulsive force is 0, the penalty factor is 1, which has no effect.
[0048] Furthermore, the texture compatibility map is multiplied pixel-by-pixel with the penalty factor map to obtain the final comprehensive value map: It should be noted that, through the above operations, the final value of a region depends simultaneously on the suitability of its texture and its safe distance from defects. Even if the texture coordination of a region is very high ( But if it is near a defect (leading to...) ), its ultimate value It will also approach zero, thus being naturally "filtered out" during the optimization process. This achieves the technical effect of "making the final value of high repulsion regions approach zero," ensuring the comprehensiveness and security of layout decisions.
[0049] S3. For each part in the list of parts to be nested, based on its corresponding comprehensive value map, determine its optimal placement posture on the sheet metal through an iterative optimization process. This posture includes position and rotation angle.
[0050] Furthermore, for the parts currently to be processed, a highly non-convex comprehensive value map is constructed. The goal is to find a globally optimal or near-optimal placement pose. The placement orientation must not only ensure that the part is entirely within the high-value area, but also ensure that it does not interfere with the boundaries of the sheet metal or other already placed parts.
[0051] Specifically, the present invention employs the artificial potential field method as the basic framework for iterative optimization. Specifically, the part to be nested is abstracted as a rigid body with a specific geometric shape, and the comprehensive value map... This is then considered an attractive potential field. Or, more precisely, we define the negative value of the value map as an attractive potential energy field. In this way, the objective of the component's motion in the potential field becomes finding the global minimum of potential energy, which is completely equivalent to finding the maximum value on the value map. Then, the component's pose... In the iterative process (which can be considered as discrete time) The algorithm is continuously updated until it converges.
[0052] Furthermore, in the present invention, the generalized force (including translational force and torque) driving the movement of the parts consists of two parts: the attractive force and torque derived from the comprehensive value map (first generalized force), and the repulsive force and torque used for collision prevention (second generalized force).
[0053] Furthermore, regarding the first generalized force, this force primarily guides the part to move and rotate towards areas of higher value. To calculate the resultant force and resultant moment acting on the entire rigid body of the part, we first define a "placement evaluation function". It indicates the position of the part. At that time, the total comprehensive value of the area it covers: in, Represents the position of the part The pixel area occupied by the part. In discrete digital images, this integration operation can be achieved by summing the values of all pixels covered by the part.
[0054] Furthermore, due to the attractive force of the pattern, this force drives the center of mass of the part towards the energy source. The direction with the fastest overall improvement is the translation. This direction is precisely where the evaluation function is placed. Regarding location coordinates The gradient direction. Therefore, this attraction. It can be represented as: It should be emphasized that, in actual calculations, this gradient can be approximated by making a small virtual translation of the part, or by using a comprehensive value map. The gradient map in the pixel area occupied by the part The result is obtained by integration within the range.
[0055] Furthermore, because of the attraction moment of the spectrum (denoted as...) It can drive the part to rotate around its center of mass to achieve a state that allows The maximum orientation. Therefore, the magnitude and direction of this torque can be determined by the placement evaluation function. For rotation angle The partial derivatives determine: It should be noted that this partial derivative can also be calculated by performing a small virtual rotation on the part. The rate of change is used to approximate the numerical value.
[0056] Furthermore, the second generalized force is used to prevent the part from overlapping with the plate boundary or other placed parts. Its calculation method is similar to that used in step S2 to generate the defect repulsion field, but the object of action is dynamic.
[0057] Furthermore, for the part currently being optimized, we discretize its boundary into a series of sampling points. For each sampling point Calculate the minimum distance to the nearest obstacle (the boundary of the plate or other existing part). When this distance is less than the preset collision safety threshold At that time, a repulsive force It originates at this point, its direction is perpendicular to the obstacle boundary and points inward into the part, and its magnitude is inversely proportional to the distance: in, It is a repulsion coefficient. Pointing from the nearest obstacle point The unit vector. The sum of the repulsive forces acting on the entire part is the vector sum of the repulsive forces at all boundary points: in, This represents a repulsive force to prevent collisions.
[0058] Furthermore, due to the repulsive force at each boundary point All of these will generate a torque on the center of mass of the part. Therefore, the total repulsive torque for collision avoidance... That is, the vector sum of all these torques: in, From the centroid of the part to the boundary point (assuming the current sampling point) The position vector of the boundary point.
[0059] Furthermore, since the artificial potential field method is essentially a gradient ascent (or descent) algorithm, it is prone to getting trapped in local optima. For example, a part may be stable in a high-value region, but globally there exists a position with even higher value but separated by low-value regions. To address this issue, this invention embeds the artificial potential field method into a global search framework of simulated annealing (SA), thus forming a hybrid optimization strategy. The artificial potential field method is responsible for efficient and directional searching locally, while simulated annealing gives the search process the ability to escape local optima. Specifically, the implementation process of this strategy is as follows: S301, randomly generate an initial pose for the current part. Set an initial temperature. A termination temperature and a temperature decay rate (Usually close to 1, such as 0.99). Current optimal solution .
[0060] S302, at the current temperature The following iterations are performed: (i) at the current pose Based on this, a small random perturbation (translation and rotation) is applied to obtain a neighborhood pose. Then, with Starting from this point, perform several steps (e.g., 5-10 steps) of the aforementioned artificial potential field method iterative optimization to obtain a new candidate pose. This step utilizes the gradient information from the APF to quickly move the part to a nearby "hill".
[0061] (ii) Calculate the placement evaluation value (energy) for the current pose and candidate poses. and Calculate the increment of the evaluation value. .
[0062] (iii) Meets the Metropolis acceptance criterion: if This indicates that the candidate pose is better, and the move is accepted unconditionally. .
[0063] if This indicates that the candidate pose is worse, and therefore, with a certain probability... Accept the move: The specific operation is to generate a Random numbers between ,if Then accept the move. Otherwise, maintain the current pose. *Logical explanation: At high temperatures... hour, The smaller the absolute value, the lower the probability of accepting a worse solution. The algorithm has a high degree of exploration capability, and can "climb over" "valleys" of lower value to explore the entire solution space.
[0064] S303. After completing the above iterations, the temperature is decayed: .
[0065] S304. Repeat steps S302 and S303 until the temperature reaches... Reduce to the termination temperature The algorithm has now converged.
[0066] Furthermore, in one implementable embodiment of this embodiment, the parameters in the hybrid optimization strategy are set as follows: the repulsion coefficient for collision avoidance. Set to 100.0, collision safety threshold Set to 5 mm (corresponding to 50 pixels in the image). In each iteration, the generalized force applied to the part is multiplied by a step factor (e.g., 0.1) to control the magnitude of the pose update, ensuring the stability of the iteration. Initial temperature The value of the termination temperature is set based on the variance of the initial random layout's evaluation values to ensure a high probability of accepting suboptimal solutions in the initial stage; for example, it could be set to 1000. Set to 1e-3. Temperature decay rate. The value is set to 0.99 to ensure slow cooling and sufficient search of the solution space. At each temperature, the internal iteration count (Metropolis sampling count) is set to 200. Simultaneously, the applied random perturbation has its translation component sampled from a Gaussian distribution with a mean of 0 and a standard deviation of 10 pixels, and its rotation component sampled from a Gaussian distribution with a mean of 0 and a standard deviation of 2°.
[0067] Furthermore, when the algorithm converges, the historical best solution is recorded. This refers to the optimal placement of the part on the sheet metal.
[0068] It should be noted that the above hybrid optimization strategy not only takes advantage of the fast convergence of the artificial potential field method, but also enhances the global optimization ability of the algorithm through the probabilistic acceptance mechanism of simulated annealing, effectively addressing the complexity and non-convexity of the nesting problem.
[0069] S4. After determining the optimal placement pose of a part, update the available area state of the sheet metal and repeat the iterative optimization process until all parts are nested.
[0070] Furthermore, after a part is successfully laid out, the space it occupies is excluded from the available decision space of subsequent parts, and a new round of optimization process is started for the next part to be nested, until all parts are processed.
[0071] Specifically, once step S3 is for the current part Its optimal placement pose was determined. The part and its pose are considered a fixed, unchangeable layout result. This is to ensure the layout of subsequent parts... When performing layout optimization, it will not be related to If overlap occurs, the "available area status" of the board material must be updated in real time.
[0072] Furthermore, in this invention, the real-time update process treats already placed parts as new, permanent "defects," thereby unifying the anti-overlap constraint with the defect avoidance mechanism established in step S2. The specific implementation is as follows: Based on the parts... The geometric shape data and its optimal placement pose On a canvas of the same size as the digital image of the board material, a binary part mask is generated using rasterization technology in computer graphics. In this mask, the parts are... The value is 1 for the covered pixel area and 0 for other areas.
[0073] Update the global defect map: Add the newly generated part mask Compared with the current global defect segmentation map Merge the components. If we consider the entire nesting process as an iterative process, let... It is in the placement of the first The global defect map of each part (where, (This is the defect segmentation diagram of the original plate generated by step S1), then place the... New global defect map after each part Updated using the following logical operations: in," "Represents a pixel-level logical OR operation. This operation will divide the parts..." The occupied area is permanently marked as an unusable area, and has the same status as original defects such as knots and cracks at the data level.
[0074] It should be noted that by dynamically adding placed parts to the defect graph, the present invention simplifies the algorithm's complexity. When subsequent parts are being optimized, there is no need to design a separate collision detection and repulsion force calculation logic for handling "placed parts." Instead, the process of step S2 can be reused: when optimizing the next part... When constructing its own comprehensive value map, the input defect map naturally already includes it. area In this way, the newly generated defect repulsive field will automatically... A repulsive potential field is formed around it, and the optimization algorithm will naturally avoid this area, thus achieving an efficient and robust anti-overlap function.
[0075] Furthermore, after updating the sheet metal status, the list of parts to be nested will be updated. Select the next part and repeat the complete optimization process of steps S2 and S3 for it. This process is repeated until all parts in the list have been attempted to be placed.
[0076] Specifically, since the placement order of the parts to be nested has a significant impact on the final material utilization rate, this is a typical heuristic strategy selection problem. Therefore, in this embodiment, to improve the overall layout compactness, a descending sorting strategy based on "area priority, shape assistance" is adopted. Before nesting begins, a list of parts to be nested is prepared. All parts are pre-sorted. The primary key of the sorting is the area of the parts, arranged in descending order; the secondary key is the shape factor of the parts, such as the aspect ratio of its smallest bounding rectangle, prioritizing parts with a narrower and longer shape (aspect ratio far from 1).
[0077] It's important to explain that larger parts are prioritized because they have the most demanding requirements for remaining space on the sheet metal. Finding suitable locations for them early on prevents them from becoming unsuitable for placement later due to space fragmentation. When parts are of similar size, elongated parts are prioritized because they are easier to fit into corner spaces formed by other irregular parts, which helps improve the compactness of the layout.
[0078] Specifically, input a pre-sorted list of parts. The initial defect segmentation map generated by step S1 and texture direction field The simplified pseudocode for the process is as follows: for k from 1 to N: / / Step S2 for part Based on the current defect map and texture map To construct its own comprehensive value map ; / / Step S3 in The above uses a hybrid optimization strategy to determine Optimal placement pose / / Step S4if is valid: / / Check if the location was successfully found. Generate part mask Update the global defect graph: ;Record The layout result; else: will Marked as "Current board cannot be placed"; / / The defect diagram remains unchanged further when the list of parts to be nested remains unchanged. Once all parts have been processed (regardless of whether they were successfully placed), the entire nesting process terminates. The final output includes the layout schemes of successfully placed parts (i.e., their pose list) and the list of parts that failed to be placed.
[0079] Furthermore, during the optimization process of step S3, there may be a certain component... It is impossible to find a placement location that meets the minimum value threshold within the remaining available space. For example, the placement evaluation value corresponding to its optimal solution is... The error rate remains very low, or the algorithm fails to converge to a solution that avoids collisions. In this case, the system will determine the part... Placement on the current sheet material failed. In this case, as shown in the pseudocode above, the part will be skipped, the global defect map will not be updated, and the algorithm will continue to try to place the next part in the list. This ensures that the entire nesting process can be completed reliably even with extremely crowded or irregular remaining space.
[0080] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The solutions in the embodiments of this application can be implemented using various computer languages, such as the object-oriented programming language Java and the interpreted scripting language JavaScript.
[0081] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will 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 program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0082] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0083] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0084] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0085] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for intelligent nesting of solid wood furniture panels considering grain direction constraints, characterized in that, include: A digital image of the solid wood furniture board is acquired, and a pre-trained deep neural network is used to process the digital image to generate a pixel-level defect segmentation map and a pixel-level texture orientation field. The defect segmentation map is used to identify the location and region of different defect types on the board, and the texture orientation field is used to represent the main direction of the wood texture of each pixel in the usable area of the board. Based on the defect segmentation map and the texture orientation field, a unique comprehensive value map is constructed for each part to be nested. For each part in the list of parts to be nested, its optimal placement pose on the board is determined through an iterative optimization process based on its corresponding comprehensive value map. This pose includes position and rotation angle. After determining the optimal placement pose of a part, update the available area state of the sheet metal and repeat the iterative optimization process until all parts are nested.
2. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 1, characterized in that, The deep neural network includes: a shared feature encoder and two parallel, independent decoder branches, wherein the first decoder branch is used to output the defect segmentation map and the second decoder branch is used to output the texture orientation field.
3. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 1, characterized in that, The texture direction field represents the main texture direction of each pixel as a two-dimensional vector. The two components of the two-dimensional vector are determined by the cosine and sine values corresponding to twice the angle of the main direction, thereby achieving a unique representation of the wood texture without directionality.
4. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 1, characterized in that, The process of constructing the comprehensive value map includes: generating a defect repulsion field, wherein the value of each point in the repulsion field depends on the distance between the point and the nearest defect area, and the closer the distance, the higher the repulsion value; generating a texture coordination map, wherein the value of each point in the coordination map is obtained by calculating the degree of consistency between the local texture direction of the point and the preset target texture direction of the part to be nested; and fusing the defect repulsion field and the texture coordination map to generate the comprehensive value map.
5. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 4, characterized in that, Generating the defect repulsion field includes: performing a distance transformation operation on the defect segmentation map, obtaining the Euclidean distance from each non-defect pixel to the nearest defect region, and inputting the Euclidean distance into a preset decay function to calculate the repulsion value.
6. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 4, characterized in that, Generating the texture compatibility map includes: calculating the dot product of the local texture direction vector of each pixel in the texture direction field and the target texture direction vector of the part, and using the square of the dot product as the texture compatibility value of the pixel.
7. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 4, characterized in that, The process of fusing the defect repulsion field with the texture compatibility map includes multiplying the value of the texture compatibility map with the inverse value of the defect repulsion field, so that the final value of the high repulsion region approaches zero.
8. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 1, characterized in that, The process of determining the optimal placement posture adopts the artificial potential field method, which treats the part to be nested as a rigid body moving on the comprehensive value map, and the rigid body is simultaneously subjected to two generalized forces.
9. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 8, characterized in that, The two generalized forces include: the first generalized force is the attraction and torque originating from the spatial gradient of the comprehensive value map, which guides the parts to move and rotate towards areas with higher value in the map; the second generalized force is the repulsive force and torque generated when the parts approach the plate boundary or other placed parts, which is used to prevent the parts from overlapping and crossing the boundary.
10. The intelligent nesting method for solid wood furniture panels considering grain direction constraints as described in claim 9, characterized in that, The iterative optimization process also includes a global search mechanism, which probabilistically accepts non-optimal part pose changes to help the artificial potential field method escape local optima and thus seek the global optimal solution for part layout across the entire sheet metal.