Path optimization method, system and equipment for flexible material deformation and medium
By detecting feature points in the flexible material image and building an affine transformation matrix, and adjusting the clipping path, the problem of unqualified sheet cutting caused by deformation during the cutting process of flexible material is solved, and precise processing is achieved.
Patent Information
- Application Number
- CN202510309462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-17
- Publication Date
- 2025-04-15
AI Technical Summary
The sheet quality of flexible materials is unqualified due to deformation and instability during the cutting process, and it is difficult for the prior art to effectively adjust the cutting path to adapt to the actual deformation state of the material.
By obtaining the image of the flexible material, pre-processing and detecting the feature points of the target clip, building an array of target features, matching it with the reference CAD graph, and building an affine transformation matrix to adjust the clipping path.
Reasonable compensation for local deformation of flexible materials is achieved, cutting paths are optimized, path offset problems caused by material deformation are overcome, and cutting quality is improved.
Smart Images

Figure CN119831113A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of path optimization, and in particular to a path optimization method, system, equipment and medium for flexible material deformation. Background Art
[0002] The existing automatic flexible material cutting table cuts the flexible material laid on its cutting table according to a preset reference cutting path to obtain cut pieces.
[0003] However, flexible materials tend to deform and become unstable when laid flat. The main reasons are: 1. Low rigidity and high elasticity: Flexible materials have low rigidity and are easily deformed under external forces; flexible materials have high elasticity and are easily stretched or compressed when subjected to force, resulting in unstable shape; 2. Surface friction: Uneven friction between the material and the workbench may cause some areas to move poorly, resulting in wrinkles or ripples; some flexible materials tend to adhere to the workbench or equipment, increasing the difficulty of tiling; 3. Uneven thickness and density: Inconsistent material thickness will lead to uneven force, and thinner parts are prone to deformation; uneven density distribution will cause different mechanical properties of the material in different areas, affecting the paving effect; 4. Environmental factors: Temperature changes cause thermal expansion and contraction, humidity changes cause hygroscopic expansion or dry shrinkage, affecting the size and shape of the material; air flow may cause thin materials to move or curl; 5. Influence of self-weight: When large or oversized flexible materials are laid flat, their own weight may cause them to sag in the middle or warp at the edges; 6. Static electricity effect: Flexible materials are prone to generate static electricity, absorb dust or fold themselves, making tiling more difficult.
[0004] Therefore, in the actual cutting operation of flexible materials, if the standard cutting path is always used to cut the flexible materials, the cut pieces obtained by cutting will be unqualified and cannot enter the subsequent cutting piece sewing stage. Therefore, it is very necessary to adjust the standard cutting path according to the actual deformation state of the flexible material during the cutting operation of the flexible material cutting bed to improve the cutting quality of the flexible material cutting bed. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a path optimization method, system, equipment and medium for deformation of flexible materials, which can reasonably compensate for the local deformation of the flexible material to optimize the cutting path.
[0006] In order to solve the above technical problems, the present invention provides a path optimization method for flexible material deformation, comprising: obtaining a flexible material image of a flexible material to be matched; preprocessing the flexible material image; performing feature point detection on a target cut piece in the preprocessed flexible material image, and constructing a target feature array according to the detected feature points; extracting a CAD graphic matching the flexible material image according to the detected feature points, and constructing a reference feature array and a reference path array according to preset feature points of the CAD graphic; performing feature point matching processing on the target feature array and the reference feature array; constructing an affine transformation matrix according to the matched target feature array and the reference feature array; performing affine transformation processing on the reference path array according to the affine transformation matrix to generate a target path array; and constructing a cutting path according to the target path array.
[0007] As an improvement of the above scheme, the step of preprocessing the flexible material image includes: performing color conversion processing on the flexible material image; performing grayscale processing on the flexible material image after color processing; performing binarization processing on the flexible material image after grayscale processing; and performing fuzzy processing on the flexible material image after binarization processing.
[0008] As an improvement of the above solution, the step of preprocessing the flexible material image further includes: performing edge correction processing on the flexible material image after blur processing.
[0009] As an improvement of the above scheme, the step of detecting feature points of the target piece in the preprocessed flexible material image includes: detecting the edge of the target piece in the flexible material image by an edge detection method; optimizing the edge of the piece by a quadratic function interpolation method of a gradient modulus; correcting the optimized edge of the piece in the horizontal and vertical directions respectively by a median interpolation method; and extracting feature points of the target piece from the corrected and optimized flexible material image.
[0010] As an improvement of the above-mentioned scheme, the step of constructing an affine transformation matrix based on the matched target feature array and the reference feature array includes: extracting at least three target feature points from the target feature array; extracting reference feature points corresponding one-to-one to the target feature points in the reference feature array; constructing a matrix of a set of equations based on the target feature points and the reference feature points to calculate affine transformation matrix parameters; and constructing an affine transformation matrix based on the affine transformation matrix parameters.
[0011] Correspondingly, the present invention also provides a path optimization system for flexible material deformation, comprising: an acquisition module, used to acquire a flexible material image of a flexible material to be matched; a preprocessing module, used to preprocess the flexible material image; a first array construction module, used to perform feature point detection on a target cut piece in the preprocessed flexible material image, and construct a target feature array based on the detected feature points; a second array construction module, used to extract a CAD graphic matching the flexible material image based on the detected feature points, and construct a reference feature array and a reference path array based on preset feature points of the CAD graphic; a matching module, used to perform feature point matching processing on the target feature array and the reference feature array; a matrix construction module, used to construct an affine transformation matrix based on the matched target feature array and the reference feature array; an affine transformation module, used to perform affine transformation processing on the reference path array based on the affine transformation matrix to generate a target path array; and a path module, used to construct a cutting path based on the target path array.
[0012] As an improvement of the above scheme, the first array construction module includes: a detection unit, which is used to detect the edge of the target piece in the flexible material image by an edge detection method; an interpolation unit, which is used to optimize the edge of the piece by a quadratic function interpolation method of a gradient modulus; a correction unit, which is used to correct the optimized edge of the piece in the horizontal direction and the vertical direction respectively by a median interpolation method; an extraction unit, which is used to extract the feature points of the target piece from the corrected and optimized flexible material image; and a first construction unit, which is used to construct a target feature array according to the detected feature points.
[0013] As an improvement of the above-mentioned scheme, the matrix construction module includes: a first extraction unit, used to extract at least three target feature points from the target feature array; a second extraction unit, used to extract reference feature points corresponding one-to-one to the target feature points in the reference feature array; a calculation unit, used to construct a matrix of a set of equations based on the target feature points and the reference feature points to calculate affine transformation matrix parameters; and a construction unit, used to construct an affine transformation matrix based on the affine transformation matrix parameters.
[0014] Correspondingly, the present invention further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the above-mentioned path optimization method for flexible material deformation when executing the computer program.
[0015] Correspondingly, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned path optimization method for flexible material deformation.
[0016] The implementation of the present invention has the following beneficial effects: The present invention combines edge detection technology, feature point matching technology, and affine transformation technology to ensure that when the flexible material is locally deformed by force, the cutting path can be intelligently adjusted in real time according to the flexible material image, thereby overcoming the path deviation problem caused by local deformation of the flexible material during the production process and achieving precise processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of an embodiment of a path optimization method for flexible material deformation according to the present invention; Figure 2 It is a schematic diagram of the structure of an embodiment of the path optimization system for flexible material deformation of the present invention. DETAILED DESCRIPTION
[0018] In order to make the objectives, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings.
[0019] See also Figure 1 , Figure 1 The flowchart of an embodiment of the path optimization method for flexible material deformation of the present invention is shown, which includes: S101, obtaining a flexible material image of a flexible material to be matched; The flexible material image of the laid flexible material to be matched is captured by a camera.
[0020] S102, preprocessing the flexible material image; Further, the step of preprocessing the flexible material image includes: (1) Perform color conversion on flexible material images; It should be noted that RGB images correspond to hardware output, while HSV images are more in line with the intuitive vision of the human eye. Therefore, when processing images, RGB images are often converted to HSV images first, and the images are processed in the HSV color space. After processing, the HSV images are converted back to RGB images.
[0021] The present invention converts the RGB channels of the RGB image into HSV (hue, saturation, brightness) channels, and screens out the image that needs to be identified by adjusting HSV (the three parameters have a maximum and minimum range, and the range can be adjusted by a software slider), thereby filtering out interference items outside the required HSV range.
[0022] (2) grayscale processing of the color-processed flexible material image; It should be noted that color photos are generally three-channel (RGB), and each pixel is composed of three color components. In order to reduce the amount of calculation and interference, the three channels can be processed as a single channel, and the color relationship is converted into a brightness relationship. Each vector is determined by only one component, and 0~255 corresponds to dark to bright.
[0023] In the present invention, the RGB image can be converted into a grayscale image according to the following formula: Gray=0.299*R+0.587*G+0.114*B in, Gray is the gray value; R is the value of the R channel; G is the value of the G channel; B is the value of the B channel.
[0024] (3) Binarization of the grayscale processed flexible material image; After grayscale processing, if you still want to filter out suitable graphics and leave only black and white images, you can dynamically adjust the threshold of the image through the slider. For pixels with grayscale values greater than the set threshold, directly change the grayscale value to the maximum (the maximum value can be set by yourself, and the maximum setting range can only be 255), and adjust the grayscale of pixels less than the set threshold to the minimum 0.
[0025] (4) Fuzzy the binary image of the flexible material.
[0026] After grayscale processing, the color difference of the boundary is more obvious, but there are still pixel aliasing and noise. The present invention adds Gaussian blur, uses a convolution kernel Kernel, scans each pixel in the image, and replaces the value of the central pixel with the weighted average grayscale value of the pixels in the neighborhood determined by the convolution kernel to achieve a filtering effect, so that the identified edge is smoother.
[0027] Furthermore, the blurred flexible material image may be subjected to edge correction processing to remove burrs on the edges.
[0028] S103, performing feature point detection on the target cut piece in the preprocessed flexible material image, and constructing a target feature array according to the measured feature points; The steps of detecting feature points of the target piece in the preprocessed flexible material image include: (1) Detect the edge of the target piece in the flexible material image by edge detection method; The edge of the target piece can be detected by the Canny edge detection method.
[0029] (2) Optimizing the edge of the cut piece by using the quadratic function interpolation method of the gradient modulus; Since the edges detected by the Canny edge detection method are at the pixel level, the accuracy is low and it is easy to produce jagged edges; the present invention optimizes the edge of the cut piece by calculating the quadratic function interpolation of the gradient modulus values at three adjacent points in the gradient direction, instead of using the non-maximum suppression method in the Canny edge detection method to achieve optimization.
[0030] (3) The optimized edges of the cut pieces are corrected in the horizontal and vertical directions using the median interpolation method.
[0031] The jittered lines are corrected by interpolating intermediate values in the horizontal and vertical directions to make the lines fit more closely, so that the acquired points can reach the sub-pixel level.
[0032] (4) Extract the feature points of the target piece from the modified and optimized flexible material image.
[0033] Finally, put the detected feature points into the target feature array.
[0034] S104, extracting a CAD graphic that matches the flexible material image according to the detected feature points, and constructing a reference feature array and a reference path array according to the preset feature points of the CAD graphic; The CAD graphics library stores a variety of CAD graphics, which are undeformed reference graphics (i.e., geometric models under theoretical design conditions) with preset feature points, which can be corner points, transition points, etc., and can be set according to actual conditions.
[0035] Based on the detected feature points, a preset CAD graphic that matches the target piece can be extracted from the CAD graphic library, the preset feature points of the CAD graphic can be read and interpreted, and the preset feature points can be placed in the reference feature array; at the same time, based on the preset feature points, reference line information can be constructed and placed in the reference path array.
[0036] When performing pattern matching, the following key steps are taken: Rigid transformation alignment: Rotate the CAD graphic around its geometric center so that its main direction is consistent with the direction of the deformation area of the flexible material image; Translation normalization: Calculate the centroid coordinates of the feature point set in the deformation area, and make the center point of the CAD figure coincide with the centroid of the deformation area through translation transformation to eliminate the deviation of the clamping position; Establish a mapping field: store the preset feature points of the CAD graphics that have completed pose calibration into the reference feature array. At the same time, the preset feature points can be connected to construct the reference line information, and the topological connection relationship between the preset feature points can be recorded to generate the reference path array as the reference system for deformation compensation calculation.
[0037] S105, performing feature point matching processing on the target feature array and the reference feature array; Specifically, feature point matching can be performed using the ORB (Oriented FAST and Rotated BRIEF) algorithm, which combines FAST key point detection and BRIEF descriptors and introduces processing for rotation and scale changes.
[0038] 1. FAST key point detection: ORB uses the FAST algorithm for key point detection. Its core idea is to detect corners based on pixel brightness differences. The FAST algorithm takes pixel p as the center and examines 16 neighboring pixels with a radius of 3 around it. If the brightness of n consecutive pixels is either brighter than p (greater than a certain threshold) or darker than p, then p is a corner point.
[0039] 2. Pixel comparison formula: or
[0040] in: Center pixel The brightness value of Center pixel No. The brightness value of the neighboring pixels, =1,2,...,16; is the brightness difference threshold.
[0041] 3. Key point direction calculation: ORB introduces direction information and uses the grayscale centroid method of the key point neighborhood to calculate the direction. The key point direction is the direction from the key point to the centroid. The centroid calculation formula is:
[0042]
[0043] in: The centroid coordinate; The centroid coordinate; For point The gray value at .
[0044] It should be noted that in the ORB algorithm, the (x, y) coordinates mentioned when calculating the direction of the key point can be understood as the position of each pixel point in a circular area delineated with the feature point as the center. The origin of the coordinates here is set at the feature point itself, which is equivalent to establishing a local coordinate system with the feature point as the center. For example, if the neighborhood radius is set to r, then the absolute values of the x and y coordinates of all pixels do not exceed r, that is, the position of each pixel is within this circular range.
[0045] Specifically, the centroid is a "brightness center" obtained by weighted average of the grayscale values of all pixels in the area. For example, when the pixels on the left side of a region are brighter overall, the x-coordinate of the centroid will be biased to the left, forming a direction vector pointing from the center of the feature point to the centroid. This direction calculation makes the ORB feature rotationally invariant, that is, no matter how the image is rotated, the main direction of the feature can be accurately captured by the offset direction of the centroid.
[0046] 4. BRIEF descriptor: ORB uses the rotation-invariant BRIEF descriptor, which is a binary feature descriptor obtained by comparing random pairs of pixels near a keypoint; each descriptor consists of a set of simple brightness comparisons:
[0047] in: and is a pair of pixels randomly selected within the neighborhood of the keypoint; yes The brightness value; yes The brightness value of the
[0048] 5. Multi-scale FAST detection: In order to increase scale invariance, ORB uses pyramid images (using the pyramid down-sampling method to continuously reduce the image resolution, and then loop the contour recognition process for 7 times, and rotate the various identified points according to the set rotation step (rotation accuracy)) to detect FAST key points at different scales to adapt to image scaling.
[0049] S106, constructing an affine transformation matrix according to the matched target feature array and the reference feature array; The affine transformation is represented by a 2×3 matrix in the form:
[0050] in: is the coordinate point in the original image; is the coordinate point after transformation; , , , Control image rotation, scaling, translation, and shearing; , is the image translation amount.
[0051] Accordingly, the affine transformation can be decomposed into a combination of the following operations: Scale: Stretch or scale the image.
[0052] Rotate: Rotate the image around the origin.
[0053] Pan: Pans the image to a new location.
[0054] Shear: Skew the image in a certain direction.
[0055] It should be noted that given three non-collinear points of two images, the affine transformation matrix can be uniquely determined. Therefore, to estimate the affine transformation matrix, it is usually calculated from a set of points in the source image and corresponding points in the target image.
[0056] Further, the step of constructing an affine transformation matrix according to the matched target feature array and the reference feature array includes: (1) Extract at least three target feature points from the target feature array; (2) extracting reference feature points that correspond one-to-one to the target feature points in the reference feature array; Through feature point matching algorithms (such as SIFT, ORB, etc.), at least three pairs of corresponding points in the image can be found, that is, and ,in, The reference feature point The coordinates of The reference feature point The coordinates of the corresponding target feature points.
[0057] (3) Constructing a matrix of equations based on the target feature points and the reference feature points to calculate the affine transformation matrix parameters; Each pair of points produces two linear equations, given a set of source points and the corresponding target point , the linear equation of the affine transformation is:
[0058]
[0059] Substituting the three pairs of points into the above formula, we can get six equations, which can be used to solve the unknown affine transformation matrix parameters. , , , , , .
[0060] (4) Construct an affine transformation matrix based on the affine transformation matrix parameters.
[0061] For example, there are three points , , and target point , , , then the system of equations can be written in the form of a 6x6 matrix:
[0062] S107, performing affine transformation processing on the reference path array according to the affine transformation matrix to generate a target path array; Through the affine transformation matrix, the reference path array is affine transformed to be similar to the feature points of the target feature array.
[0063] S108, constructing a cutting path according to the target path array.
[0064] Specifically, the key points of the cutting area can be determined through the target path array, and a continuous path can be generated through the coordinates of each key point, thereby defining a cutting path.
[0065] In addition, the cutting path is output as visual line information and displayed on the display interface, allowing the operator to check the final matching effect. After confirmation, the cutting machine can be driven to start cutting according to the cutting path.
[0066] Therefore, the present invention preprocesses the input flexible material image to extract the geometric features of the target piece, and then matches it with the feature point information in the reference CAD figure, and finally calculates the deformation parameters of the flexible material through affine transformation and compensates and adjusts the path.
[0067] See also Figure 2 , Figure 2 The specific structure of the path optimization system 100 for flexible material deformation of the present invention is shown, which includes: The acquisition module 1 is used to acquire the flexible material image of the flexible material to be matched; when working, the flexible material image of the laid flexible material to be matched can be photographed by a camera, and the flexible material image can be sent to the acquisition module 1.
[0068] A preprocessing module 2, used for preprocessing the flexible material image; The first array construction module 3 is used to detect feature points of the target cut piece in the preprocessed flexible material image, and to construct a target feature array according to the detected feature points; The second array construction module 4 is used to extract the CAD graphics matching the flexible material image according to the detected feature points, and to construct the reference feature array and the reference path array according to the preset feature points of the CAD graphics; it should be noted that the CAD graphics library stores a variety of CAD graphics, and the CAD graphics are undeformed reference graphics (i.e., geometric models under theoretical design conditions), which are provided with preset feature points, which can be corner points, transition points, etc., and can be set according to actual conditions. The second array construction module 4 extracts the preset CAD graphics matching the target piece from the CAD graphics library, reads and interprets the preset feature points of the CAD graphics, and puts the preset feature points into the reference feature array; at the same time, the reference line information can be constructed according to the preset feature points, and the reference line information is put into the reference path array.
[0069] When performing graphic matching, the following key steps are adopted: rigid transformation alignment: rotate the CAD graphic around its geometric center so that its main direction is consistent with the direction of the deformation area of the flexible material image; translation normalization: calculate the centroid coordinates of the feature point set in the deformation area, and make the center point of the CAD graphic coincide with the center of gravity of the deformation area through translation transformation to eliminate the clamping position deviation; establish a mapping field: store the preset feature points of the CAD graphic that has completed posture calibration into the reference feature array. At the same time, connecting the preset feature points can construct the reference line information, and recording the topological connection relationship between the preset feature points can generate the reference path array as the reference system for deformation compensation calculation.
[0070] A matching module 5 is used to perform feature point matching processing on the target feature array and the reference feature array; A matrix construction module 6 is used to construct an affine transformation matrix according to the matched target feature array and the reference feature array; The affine transformation module 7 is used to perform affine transformation processing on the reference path array according to the affine transformation matrix to generate a target path array; therefore, through the affine transformation matrix, the reference path array can be affine transformed to a point similar to the feature points of the target feature array.
[0071] The path module 8 is used to construct a cutting path according to the target path array.
[0072] Specifically, the key points of the cutting area can be determined through the target path array, and a continuous path can be generated through the coordinates of each key point, thereby defining a cutting path.
[0073] Therefore, the cutting path can be output as visual line information and displayed on the display interface; at this time, the operator checks the final matching effect, and after confirming that it is correct, the cutting machine can be driven to start cutting according to the cutting path.
[0074] The preprocessing module 2, the first array building module 3, the matching module 5 and the matrix building module 6 are described in detail below: 1. Preprocessing module The preprocessing module 2 includes a color conversion unit, a grayscale unit, a binarization unit and a fuzzy unit. Specifically: The color conversion unit is used to perform color conversion processing on the flexible material image; it should be noted that the RGB image corresponds to the hardware output, while the HSV image is more in line with the intuitive vision of the human eye. Therefore, when processing the image, the RGB image is often converted into the HSV image first, and the image is processed in the HSV color space. After the processing is completed, the HSV image is converted into the RGB image. The present invention converts the RGB channel of the RGB image into the HSV (hue, saturation, brightness) channel, and screens out the image of the part that needs to be identified by adjusting the HSV (the three parameters have a maximum and minimum range, and the range can be adjusted by the software slider), thereby filtering out interference items outside the required HSV range.
[0075] Grayscale unit is used to grayscale the color-processed flexible material image. It should be noted that color photos are generally three-channel (RGB), and each pixel is composed of three color components. In order to reduce the amount of calculation and interference, the three channels can be processed into a single channel, and the color relationship is converted into a brightness relationship. Each vector is determined by only one component, and 0~255 corresponds to dark to bright. In the present invention, the RGB image can be converted into a grayscale image according to the following formula: Gray=0.299*R+0.587*G+0.114*B; Gray is the grayscale value; R is the value of the R channel; G is the value of the G channel; B is the value of the B channel.
[0076] The binarization unit is used to perform binarization on the flexible material image after grayscale processing. After grayscale processing, if you still want to filter out suitable graphics and leave only black and white images, you can dynamically adjust the threshold of the image through the slider. For pixels with grayscale values greater than the set threshold, the grayscale value is directly changed to the maximum (the maximum value can be set by yourself, and the maximum setting range can only be 255), and the grayscale of pixels less than the set threshold is adjusted to the minimum 0.
[0077] The blur unit is used to blur the image of the flexible material after binary processing; after grayscale processing, the boundary color difference is already obvious, but there are still pixel aliasing and noise. The present invention adds Gaussian blur, uses a convolution kernel Kernel, scans each pixel in the image, and replaces the value of the central pixel with the weighted average grayscale value of the pixels in the neighborhood determined by the convolution kernel to achieve a filtering effect, so that the identified edge is smoother.
[0078] 2. The first array building block The first array construction module 3 includes a detection unit, an interpolation unit, a correction unit and a first construction unit, specifically: The detection unit is used to detect the cutting edge of the target cutting piece in the flexible material image by using an edge detection method; specifically, the detection unit can detect the cutting edge of the target cutting piece by using a Canny edge detection method.
[0079] The interpolation unit is used to optimize the edge of the cut piece by using the quadratic function interpolation method of the gradient modulus value. Since the edge detected by the Canny edge detection method is at the pixel level, the accuracy is low and it is easy to produce jagged edges, the interpolation unit calculates the quadratic function interpolation of the gradient modulus values at three adjacent points in the gradient direction to optimize the edge of the cut piece.
[0080] The correction unit is used to correct the optimized edge of the cut piece in the horizontal direction and the vertical direction respectively by the median interpolation method; the correction unit corrects the jittered lines by interpolating the intermediate values in the horizontal direction and the vertical direction to make the lines fit more closely, so that the acquired points can reach the sub-pixel level.
[0081] An extraction unit, used for extracting characteristic points of a target cut piece from the modified and optimized flexible material image; The first construction unit is used to construct a target feature array according to the detected feature points, that is, to put the detected feature points into the target feature array.
[0082] 3. Matching module The matching module 5 can perform feature point matching through the ORB (Oriented FAST and Rotated BRIEF) algorithm. The ORB algorithm combines FAST key point detection and BRIEF descriptor, and introduces the processing of rotation and scale changes.
[0083] (1) FAST key point detection: ORB uses the FAST algorithm for key point detection. Its core idea is to detect corners based on pixel brightness differences. The FAST algorithm takes pixel p as the center and examines the 16 pixels around it with a radius of 3. If the brightness of n consecutive pixels is either brighter than p (greater than a certain threshold) or darker than p, then p is a corner.
[0084] (2) Pixel comparison formula: or
[0085] in: Center pixel The brightness value of Center pixel No. The brightness value of the neighboring pixels, =1,2,...,16; is the brightness difference threshold.
[0086] (3) Calculation of key point direction: ORB introduces direction information and uses the grayscale centroid method of the key point neighborhood to calculate the direction. The key point direction is the direction from the key point to the centroid. The centroid calculation formula is:
[0087]
[0088] in: The centroid coordinate; The centroid coordinate; For point The gray value at .
[0089] It should be noted that in the ORB algorithm, the (x, y) coordinates mentioned when calculating the direction of the key point can be understood as the position of each pixel point in a circular area delineated with the feature point as the center. The origin of the coordinates here is set at the feature point itself, which is equivalent to establishing a local coordinate system with the feature point as the center. For example, if the neighborhood radius is set to r, then the absolute values of the x and y coordinates of all pixels do not exceed r, that is, the position of each pixel is within this circular range.
[0090] Specifically, the centroid is a "brightness center" obtained by weighted average of the grayscale values of all pixels in the area. For example, when the pixels on the left side of a region are brighter overall, the x-coordinate of the centroid will be biased to the left, forming a direction vector pointing from the center of the feature point to the centroid. This direction calculation makes the ORB feature rotationally invariant, that is, no matter how the image is rotated, the main direction of the feature can be accurately captured by the offset direction of the centroid.
[0091] (4) BRIEF descriptor: ORB uses the rotation-invariant BRIEF descriptor, which is a binary feature descriptor obtained by comparing random pairs of pixels near a keypoint; each descriptor consists of a set of simple brightness comparisons:
[0092] in: and is a pair of pixels randomly selected within the neighborhood of the keypoint; yes The brightness value; yes The brightness value of the
[0093] (5) Multi-scale FAST detection: In order to increase scale invariance, ORB uses pyramid images (using the pyramid down-sampling method to continuously reduce the image resolution, and then loop the contour recognition process for 7 times, and rotate the various identified points according to the set rotation step (rotation accuracy)) to detect FAST key points at different scales to adapt to image scaling.
[0094] Matrix Building Blocks The matrix construction module 6 includes a first extraction unit, a second extraction unit, a calculation unit and a construction unit, specifically: A first extraction unit, used to extract at least three target feature points from the target feature array; A second extraction unit is used to extract reference feature points corresponding to the target feature points in the reference feature array; A calculation unit, used for constructing a matrix of an equation group according to target feature points and reference feature points to calculate affine transformation matrix parameters; A construction unit is used to construct an affine transformation matrix according to affine transformation matrix parameters.
[0095] It should be noted that the affine transformation is represented by a 2×3 matrix in the form of:
[0096] in: is the coordinate point in the original image; is the coordinate point after transformation; , , , Control image rotation, scaling, translation, and shearing; , is the image translation amount.
[0097] Accordingly, the affine transformation can be decomposed into a combination of the following operations: Scale: Stretch or scale the image.
[0098] Rotate: Rotate the image around the origin.
[0099] Pan: Pans the image to a new location.
[0100] Shear: Skew the image in a certain direction.
[0101] It should be noted that given three non-collinear points of two images, the affine transformation matrix can be uniquely determined. Therefore, to estimate the affine transformation matrix, it is usually calculated from a set of points in the source image and corresponding points in the target image.
[0102] Through feature point matching algorithms (such as SIFT, ORB, etc.), at least three pairs of corresponding points in the image can be found, that is, and ,in, The reference feature point The coordinates of The reference feature point The coordinates of the corresponding target feature points.
[0103] Each pair of points produces two linear equations, given a set of source points and the corresponding target point , the linear equation of the affine transformation is:
[0104]
[0105] Substituting the three pairs of points into the above formula, we can get six equations, which can be used to solve the unknown affine transformation matrix parameters. , , , , , .
[0106] For example, there are three points , , and target point , , , then the system of equations can be written in the form of a 6x6 matrix:
[0107] Therefore, the present invention combines edge detection technology, feature point matching technology, and affine transformation technology to ensure that when the flexible material is locally deformed by force, the cutting path can be intelligently adjusted according to real-time flexible material image feedback, thereby overcoming the path deviation problem caused by local deformation of the flexible material during the production process and achieving precise processing.
[0108] Correspondingly, the present invention also discloses a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the above-mentioned path optimization method for flexible material deformation when executing the computer program.
[0109] At the same time, the present invention also discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the above-mentioned path optimization method for flexible material deformation.
[0110] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. A path optimization method for flexible material deformation, characterized in that: include: Acquire a flexible material image of the flexible material to be matched; Preprocessing the flexible material image; Performing feature point detection on the target cut piece in the preprocessed flexible material image, and constructing a target feature array according to the detected feature points; Extracting a CAD graphic that matches the flexible material image according to the detected feature points, and constructing a reference feature array and a reference path array according to the preset feature points of the CAD graphic; Performing feature point matching processing on the target feature array and the reference feature array; Constructing an affine transformation matrix according to the matched target feature array and reference feature array; Performing affine transformation processing on the reference path array according to the affine transformation matrix to generate a target path array; Construct a cutting path according to the target path array.
2. The path optimization method for flexible material deformation according to claim 1, characterized in that: The step of preprocessing the flexible material image comprises: Performing color conversion processing on the flexible material image; Performing grayscale processing on the color-processed image of the flexible material; Performing binarization processing on the grayscale processed flexible material image; The binary processed flexible material image is blurred.
3. The path optimization method for flexible material deformation according to claim 2, characterized in that: The step of preprocessing the flexible material image further includes: performing edge correction processing on the blurred flexible material image.
4. The path optimization method for flexible material deformation according to claim 1, characterized in that: The step of detecting feature points of the target cut piece in the preprocessed flexible material image comprises: Detecting the edge of the target cut piece in the flexible material image by an edge detection method; Optimizing the edge of the cut piece by using a quadratic function interpolation method of a gradient modulus; Correcting the optimized edges of the cut pieces in the horizontal and vertical directions respectively by using a median interpolation method; Extract feature points of the target cut piece from the modified and optimized flexible material image.
5. The path optimization method for flexible material deformation according to claim 1, characterized in that: The step of constructing an affine transformation matrix according to the matched target feature array and the reference feature array comprises: Extracting at least three target feature points from the target feature array; Extracting reference feature points corresponding to the target feature points one by one in the reference feature array; Constructing a matrix of equations according to the target feature points and the reference feature points to calculate affine transformation matrix parameters; An affine transformation matrix is constructed according to the affine transformation matrix parameters.
6. A path optimization system for flexible material deformation, characterized in that: include: An acquisition module, used for acquiring a flexible material image of the flexible material to be matched; A preprocessing module, used for preprocessing the flexible material image; A first array construction module is used to detect feature points of a target cut piece in the preprocessed flexible material image, and to construct a target feature array according to the detected feature points; A second array construction module is used to extract a CAD graphic that matches the flexible material image according to the detected feature points, and to construct a reference feature array and a reference path array according to the preset feature points of the CAD graphic; A matching module, used for performing feature point matching processing on the target feature array and the reference feature array; A matrix construction module, used to construct an affine transformation matrix according to the matched target feature array and the reference feature array; An affine transformation module, used for performing affine transformation processing on the reference path array according to the affine transformation matrix to generate a target path array; The path module is used to construct a cutting path according to the target path array.
7. The path optimization system for flexible material deformation according to claim 6, characterized in that: The first array building module comprises: A detection unit, configured to detect the edge of the target cut piece in the flexible material image by an edge detection method; An interpolation unit, used for optimizing the edge of the cut piece by using a quadratic function interpolation method of a gradient modulus; A correction unit, used for correcting the optimized edge of the cut piece in the horizontal direction and the vertical direction respectively by using a median interpolation method; An extraction unit, used for extracting characteristic points of a target cut piece from the modified and optimized flexible material image; The first construction unit is used to construct a target feature array according to the detected feature points.
8. The path optimization system for flexible material deformation according to claim 6, characterized in that: The matrix building module includes: A first extraction unit, used to extract at least three target feature points from the target feature array; A second extraction unit, used to extract reference feature points corresponding to the target feature points in the reference feature array; A calculation unit, used for constructing a matrix of an equation group according to the target feature points and the reference feature points to calculate affine transformation matrix parameters; A construction unit is used to construct an affine transformation matrix according to the affine transformation matrix parameters.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the path optimization method for flexible material deformation according to any one of claims 1 to 5 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the path optimization method for flexible material deformation according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Intelligent identification cutting method, device and system
CN115625435A
Component Based Correspondence Matching for Reconstructing Cables
US20140211989A1
Cited By
Radioactive large tank intelligent cutting control method and system based on machine vision
CN120962435A