Machine tool assembly intelligent acceptance method and system based on image generation
By using image generation technology to collect and analyze machine tool assembly node images, identify and enhance edge features, and reconstruct boundary paths, the problem of insufficient assembly accuracy assessment in existing technologies is solved, enabling efficient assembly acceptance and accurate boundary representation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG TIDE PRECISION MASCH TOOL CO LTD
- Filing Date
- 2026-02-11
- Publication Date
- 2026-06-23
AI Technical Summary
Existing technologies rely on manual measurement and experience-based judgment in machine tool assembly, which makes it difficult to comprehensively assess assembly accuracy and rapid positioning issues. They also fail to effectively reflect the irregular boundaries and complex connections of component structures and lack image data support, resulting in insufficient information on assembly differences.
By collecting image data of component assembly nodes, dividing image regions, extracting brightness distribution features, analyzing edge response graphics, identifying connection methods and structural differences, generating component classification maps, enhancing edge pixel contrast, constructing connected pixel chains, reconstructing boundary paths, and establishing a machine tool assembly acceptance boundary map.
It achieves high-precision identification and efficient processing of machine tool assembly, enhances the structural identification accuracy and processing efficiency of assembly acceptance, and comprehensively expresses component boundaries and types through image generation technology, providing an objective assessment of assembly status.
Smart Images

Figure CN122265322A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of edge detection and segmentation technology, and in particular to an intelligent acceptance method and system for machine tool assembly based on image generation. Background Technology
[0002] Edge detection and segmentation technology involves image analysis methods for identifying and extracting target boundaries and structural features from images. Core aspects include edge detection, contour segmentation, and target region identification and annotation. It is widely used in target recognition, size measurement, defect detection, and scene understanding, and is a crucial link in image analysis. This technology extracts the structural boundaries of target objects through grayscale gradient analysis, edge filtering operators, and image segmentation algorithms, and has been widely applied in industrial visual inspection, medical image diagnosis, and remote sensing image processing. Traditional intelligent acceptance methods for machine tool assembly refer to the technical methods for confirming and accepting the assembly quality after the machine tool assembly is completed. These methods typically use manual inspection, mechanical measuring tools, or laser measurement to obtain the positional and dimensional data of machine tool components, and judge the assembly quality by comparing it with standard assembly parameters. This process relies heavily on manual intervention and standardized measurement steps, mainly including using calipers to measure key assembly dimensions, manually comparing assembly drawings to determine the error range, and using measuring instruments to obtain the spatial positional relationships of components.
[0003] Existing technologies mainly rely on manual visual inspection and physical measurement to obtain assembly dimensions and position parameters. The processing method depends on single-point contact and standardized benchmark comparison, which is difficult to cover irregular boundaries in the component structure and complex connection relationships at assembly nodes. Structural transition areas cannot be effectively reflected by measurement, assembly difference information lacks image data support, and it is difficult to establish a complete expression of boundary orientation and spatial distribution. Component classification relies on experience judgment and lacks objective basis to support the identification process. In multi-component combination scenarios, it is impossible to clearly restore the assembly state and boundary contours, resulting in insufficient data dimensions and incomplete feature analysis, which limits the comprehensive assessment of assembly accuracy and rapid problem localization. Summary of the Invention
[0004] To achieve the above objectives, the present invention adopts the following technical solution: an intelligent acceptance method for machine tool assembly based on image generation, comprising the following steps:
[0005] S1: Collect image data of component assembly nodes, divide the image area according to the assembly area, extract the brightness distribution characteristics of each image area, analyze the direction and change amplitude, and construct the component edge response graphics;
[0006] S2: Call the component edge response graphics, analyze the continuity of the image contour jump position, determine the boundary change segment caused by the connection method and structural difference, identify the component type according to the image spatial distribution and local structural contour features, and generate a component classification map;
[0007] S3: Call the component classification map, extract the target area containing the component edge features, adjust the brightness contrast between the edge pixels and the adjacent background area, cover the enhanced edge pixels onto the original image, and generate a component boundary contrast image;
[0008] S4: Call the component boundary comparison image, analyze the continuity of pixel distribution, construct a connected pixel chain based on the stability of boundary direction and response intensity, identify the direction of the outer boundary of the component assembly node, and connect the edge contours to generate the component boundary line graphic;
[0009] S5: Call the component boundary line graphics, perform boundary aggregation and position reconstruction on the closed lines, perform spatial alignment and image structure fusion of the boundary areas in the component assembly nodes, and construct the machine tool assembly acceptance boundary map.
[0010] As a further aspect of the present invention, the component edge response graphic includes brightness difference features, directional gradient features, and edge transition features; the component classification map includes assembly area identifiers, component type labels, and structural contour information; the component boundary comparison image includes boundary pixel contrast, brightness difference enhancement area, and contour recognition clarity; the component boundary line graphic includes boundary connectivity chain, contour direction information, and line direction structure; and the machine tool assembly acceptance boundary map includes boundary position coordinates, image space mapping relationship, and assembly node alignment information.
[0011] As a further aspect of the present invention, the identification of the outer boundary direction of the component assembly node refers to verifying the direction path of the outer contour of the component assembly node by analyzing the continuity, directional stability and response intensity of pixels in the component boundary image.
[0012] As a further aspect of the present invention, the determination of boundary change segments caused by differences in connection methods and structures refers to identifying boundary feature regions caused by differences in connection methods and component structures based on the continuity of the image contour jump position.
[0013] As a further aspect of the present invention, the specific steps of S1 are as follows:
[0014] S101: Obtain component assembly node image data, divide the assembly area in the image frame, extract the spatial coordinates and brightness values of pixels in the area, construct a set of brightness information of local image areas based on the data, and generate an image division area matrix.
[0015] S102: Call the brightness value in the image region division matrix, calculate the brightness difference of adjacent pixels in the horizontal and vertical directions, statistically analyze the frequency and distribution characteristics of the direction vector, construct a set of direction change data for each region, and obtain the local brightness direction parameter set.
[0016] S103: Based on the directional distribution characteristics and brightness difference in the local brightness direction parameter group, perform gradient difference calculation of boundary pixels, extract the edge trajectory of gradient abrupt change points and perform aggregation encoding to establish component edge response graphics.
[0017] As a further aspect of the present invention, the specific steps of S2 are as follows:
[0018] S201: Call the component edge response graphic, perform position continuity retrieval on all edge trajectories in the image, extract the set of positions where adjacent edge directions change, and judge the angle difference between the edge direction vectors before and after the change to generate a set of edge direction change positions.
[0019] S202: Based on the set of edge direction jump positions, combined with the spatial distribution of jump points and the boundary structure contour features of local areas, determine whether there are non-closed structures and differences in connection methods in the edge configuration of the continuous jump segment, and mark the position segments that meet the preset jump rules to obtain the component assembly boundary difference segments.
[0020] S203: Based on the spatial positioning information of the component assembly boundary difference segment and the structural contour features of the corresponding region in the image, extract the morphological contour and structural size information of the image region, perform a fitting degree matching operation between the region feature vector and the component type feature template, and construct a component classification map.
[0021] As a further aspect of the present invention, the specific steps of S3 are as follows:
[0022] S301: Call the component classification map, locate the boundary contours of the regions identified as components in the image, extract the pixel intensity values between the boundary pixels within the component region and the adjacent background region, perform extraction operations on the boundary positions of each region, and obtain the component boundary pixel set;
[0023] S302: Based on the brightness values of the boundary pixels and the neighboring background pixels in the component boundary pixel set, normalize the brightness difference and set the brightness adjustment gain parameter. Perform brightness value adjustment on pixels with contrast enhancement coefficient greater than the mean value of pixel difference distribution to obtain the boundary brightness difference matrix.
[0024] S303: Based on the pixel position of each component region in the boundary brightness difference matrix, perform brightness coverage update processing on the corresponding pixel points in the original image, write the processed pixel content into the corresponding position region of the original image frame, and generate a component boundary comparison image.
[0025] As a further aspect of the present invention, the specific steps of S4 are as follows:
[0026] S401: Call the component boundary comparison image, traverse the two-dimensional position index of all pixels in the image frame in row priority order, extract the brightness response intensity value of the boundary position, and make a continuity judgment on the brightness difference fluctuation range of adjacent pixels in the horizontal row and vertical column to obtain the pixel continuity feature set.
[0027] S402: Based on the boundary direction information and response intensity value of the pixel continuity feature concentration region, preset the direction deviation angle threshold and intensity density threshold, and cluster the pixel sequences that satisfy the boundary direction stability and response intensity concentration to generate edge connected pixel chains.
[0028] S403: Based on the position sequence in the edge-connected pixel chain, retrieve the arrangement trajectory of the connected region in the image space, extract the boundary direction of all component assembly nodes, and perform line construction processing on the connected edge segments to construct the component boundary line graphics.
[0029] As a further aspect of the present invention, the specific steps of S5 are as follows:
[0030] S501: Call the component boundary line graphic, determine the continuity of the start and end positions of all line pixels in the image, determine the closure of the line based on whether the Euclidean distance between the pixel coordinates is less than the set closure threshold, and merge the line segments that meet the closure conditions to obtain the closed component boundary line set.
[0031] S502: Based on the pixel coordinate sequence of the concentrated lines of the boundary line of the closed component, perform spatial position alignment operation on the component assembly node area, reconstruct the boundary area layout structure according to the positional relationship of the boundary lines in the image, verify the fusion processing of the boundary area and the image structure, and generate the component boundary spatial position set.
[0032] S503: Based on the correspondence between the boundary pixel coordinates and image coordinate indices in the component boundary spatial location set, perform unified encoding mapping on all component boundary positions, and form a searchable boundary and coordinate correspondence data structure to construct a machine tool assembly acceptance boundary map.
[0033] An image-based intelligent acceptance system for machine tool assembly includes:
[0034] The edge response map construction module is used to implement S1: collect image data of component assembly nodes, divide the image area according to the assembly area, extract the brightness distribution features of each image area, analyze the direction and change amplitude, and construct the component edge response map;
[0035] The component classification and recognition module is used to implement S2: call the component edge response graphics, analyze the continuity of the image contour jump position, determine the boundary change segment caused by the connection method and structural difference, identify the component type according to the image spatial distribution and local structural contour features, and generate a component classification map;
[0036] The boundary contrast enhancement module is used to implement S3: call the component classification map, extract the target region containing the component edge features, adjust the brightness contrast between the edge pixels and their neighboring background regions, cover the enhanced edge pixels onto the original image, and generate a component boundary contrast image.
[0037] The boundary line extraction module is used to implement S4: call the component boundary comparison image, analyze the continuity of pixel distribution, construct a connected pixel chain based on the boundary direction stability and response intensity, identify the direction of the outer boundary of the component assembly node, and connect the edge contours to generate the component boundary line graphic;
[0038] The assembly acceptance map construction module is used to implement S5: call the component boundary line graphics, perform boundary aggregation and position reconstruction on the closed lines, perform spatial alignment and image structure fusion of the boundary areas in the component assembly nodes, and construct the machine tool assembly acceptance boundary map.
[0039] Compared with the prior art, the advantages and positive effects of the present invention are as follows:
[0040] In this invention, a response graphic is constructed by extracting brightness direction and analyzing pixel gradient. By combining edge continuity and direction change detection, boundary transition regions are identified. The structural contour is extracted to complete the type identification in the image. The pixel contrast of the boundary region is adjusted to improve the contour differentiation effect. The boundary path is extracted by constructing connectivity based on directional stability and response intensity. The coordinate mapping is established by combining image structure alignment to realize the boundary expression, type differentiation and position positioning of components in the image, thereby enhancing the accuracy and efficiency of structural identification in assembly acceptance. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0042] Figure 1This is a schematic diagram of the steps of the present invention;
[0043] Figure 2 This is a detailed schematic diagram of S1 of the present invention;
[0044] Figure 3 This is a detailed schematic diagram of S2 of the present invention;
[0045] Figure 4 This is a detailed schematic diagram of S3 of the present invention;
[0046] Figure 5 This is a detailed schematic diagram of S4 of the present invention;
[0047] Figure 6 This is a detailed schematic diagram of S5 of the present invention;
[0048] Figure 7 This is a system module diagram of the present invention. Detailed Implementation
[0049] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0050] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0051] Please see Figure 1 This invention provides an intelligent acceptance method for machine tool assembly based on image generation, comprising the following steps:
[0052] S1: Acquire image data of component assembly nodes through image acquisition, perform image segmentation according to assembly area, extract direction and analyze change amplitude of brightness distribution features in each image area, and construct component edge response graphics based on pixel brightness differences and gradient distribution trends;
[0053] S2: Call the component edge response graphics, perform contour jump analysis in the image, make a continuity judgment on the position where the direction of adjacent edges changes, verify the boundary change section caused by the connection method and structural differences during the component assembly process, and perform image identification processing of component type based on image spatial distribution and local structural contour features to construct a component classification map;
[0054] S3: Call the component classification image, extract the regions with component boundary features, adjust the pixel contrast between the internal boundary of the region and the background, adjust the brightness difference discrimination and cover the adjusted pixel content into the original image to obtain the component boundary contrast image;
[0055] S4: Call the component boundary comparison image, analyze the continuity of pixel distribution, construct connected pixel chains for pixels with stable boundary direction and concentrated response intensity, identify the outer boundary direction of component assembly nodes, and construct component boundary line graphics through edge contour connection processing;
[0056] S5: Call the component boundary line graphics, perform boundary aggregation and position reconstruction on the closed lines formed by the components, perform spatial alignment and image structure fusion operations on the boundary areas in the component assembly nodes, establish the mapping relationship between the component boundary position and image coordinates, and construct the machine tool assembly acceptance boundary map.
[0057] The component edge response graphics include brightness difference features, directional gradient features, and edge transition features; the component classification map includes assembly area identification, component type label, and structural contour information; the component boundary comparison image includes boundary pixel contrast, brightness difference enhancement area, and contour recognition clarity; the component boundary line graphics include boundary connectivity chain, contour direction information, and line direction structure; and the machine tool assembly acceptance boundary map includes boundary position coordinates, image space mapping relationship, and assembly node alignment information.
[0058] Please see Figure 2 The specific steps of S1 are as follows:
[0059] S101: Obtain component assembly node image data, divide the assembly area in the image frame, extract the spatial coordinates and brightness values of pixels in the area, construct a set of brightness information of local image areas based on the data, and generate an image division area matrix.
[0060] First, the system initiates continuous frame-by-frame imaging of the component assembly nodes under constant light conditions to acquire high-resolution raw RGB image data. The bit depth of this image data is set to 24 bits, and the resolution is set to 4096 pixels multiplied by 3072 pixels. Upon receiving the raw image frames, the processor immediately performs grayscale processing. It reads the values of the red, green, and blue channels for each pixel using a weighted average method, multiplies the red channel value by 0.3, the green channel value by 0.59, and the blue channel value by 0.11, and then adds the three products to obtain the single-channel brightness value for that pixel. Subsequently, the process divides the grayscale image into gridded regions, setting the grid cell size to 16 pixels multiplied by 16 pixels, thus dividing the entire image into multiple non-overlapping local image regions. For each local image region, the process traverses all pixels within the region, extracting the x and y coordinates of each pixel as spatial location data, and simultaneously reading the corresponding single-channel brightness value. All extracted data is organized and stored in a three-dimensional array. The first dimension represents the region index, the second dimension represents the sequence number of the pixel within the region, and the third dimension stores the x-coordinate, y-coordinate, and brightness value. In this way, a set of brightness information for local image regions covering the entire image is constructed, ultimately generating an image region division matrix that includes spatial distribution and brightness attributes.
[0061] S102: Call the brightness value in the image region division matrix, calculate the brightness difference of adjacent pixels in the horizontal and vertical directions within the region, statistically analyze the frequency and distribution characteristics of the direction vector, construct the direction change data set of each region, and obtain the local brightness direction parameter set.
[0062] The process calls an image region segmentation matrix and performs fine-grained pixel-level gradient calculations for each defined local region. Within each local region, the process selects the central pixel as a reference and searches for its horizontal right-hand neighbor and vertical lower-hand neighbor. The process subtracts the reference pixel's brightness value from the brightness value of the horizontally adjacent pixels to obtain the horizontal brightness difference; similarly, it subtracts the reference pixel's brightness value from the brightness value of the vertically adjacent pixels to obtain the vertical brightness difference. Based on these two differences, the process further calculates the gradient direction at that point. Specifically, it calculates the ratio of the vertical brightness difference to the horizontal brightness difference and performs an arctangent operation on this ratio to obtain the angle of brightness change direction for that pixel. The process statistically analyzes the angles of all pixels within the region, creating an angle histogram with 10-degree increments and counting the number of pixels falling into each increment. The process calculates the frequency of each increment, i.e., the number of pixels in that increment divided by the total number of pixels in the region. Simultaneously, the process calculates the average of the absolute values of the horizontal and vertical brightness differences for all pixels within the region. Finally, the directional angle, angular distribution variance, horizontal average difference, and vertical average difference corresponding to the main peak value are combined to construct a directional change data set for each region, thereby obtaining a local brightness directional parameter set. For example, in a local region, if the reference pixel brightness is 100, the brightness of the horizontally adjacent pixels is 110, and the brightness of the vertically adjacent pixels is 100, then the horizontal difference is 10, the vertical difference is 0, and the calculated directional angle is 0 degrees. If the frequency of the 0-degree direction in this region is 0.6, and the distribution variance is 0.1, these values constitute the parameter set for that region.
[0063] S103: Based on the directional distribution characteristics and brightness difference in the local brightness direction parameter group, perform gradient difference calculation of boundary pixels, extract the edge trajectory of gradient abrupt change points and perform aggregation encoding to establish component edge response graphics;
[0064] Based on the local brightness direction parameter set, regions with variance below 0.2 and main direction frequency above 0.5 in the directional distribution characteristics are identified as edge candidate regions. Within these candidate regions, the process uses the Sobel operator principle to calculate the gradient magnitude. Specifically, the process defines a 3x3 convolution kernel. For each pixel in the image, the brightness values of its eight neighboring pixels are multiplied by the corresponding weights of the horizontal and vertical convolution kernels, and then summed to obtain the horizontal and vertical gradient components, respectively. The process adds the squares of the horizontal and vertical gradient components and takes the square root of the sum to obtain the gradient magnitude of that pixel. Subsequently, the process sets a gradient threshold, which is 2.5 times the average gradient magnitude of the entire image. Pixels with gradient magnitudes exceeding this threshold are identified as gradient abrupt change points. The process records the coordinates of these abrupt change points and connects them according to the continuity of the gradient direction. The specific connection rule is as follows: for a mutation point, search for the next nearest mutation point in the direction perpendicular to its gradient direction. If the distance between the two is less than 1.5 pixels, then link them. Through this point-by-point tracking and aggregation encoding, discrete edge points are transformed into continuous trajectory lines, ultimately establishing the component edge response graphics. As shown in Table 1, this table lists some measured data in gradient calculation. For example, if a pixel has a calculated horizontal gradient component of 30 and a vertical gradient component of 40, after square root operations, the gradient magnitude is 50. If the set gradient threshold is 45, then this point is marked as a gradient mutation point and included in the edge trajectory.
[0065] Table 1. Measured data for edge gradient calculation
[0066]
[0067] Actual test data shows that by setting a dynamic threshold (such as 2.5 times the average value), background noise can be effectively removed and physical edges can be accurately extracted.
[0068] Please see Figure 3 The specific steps of S2 are as follows:
[0069] S201: Call the component edge response graphics, perform position continuity retrieval on all edge trajectories in the image, extract the set of positions where adjacent edge directions change, and judge and process the angle difference between the edge direction vectors before and after the change to generate a set of edge direction change positions.
[0070] The process iterates through all edge trajectory lines stored in the image. Following the order of pixel connections, it sequentially reads three adjacent points on each edge trajectory, denoted as points A, B, and C. First, it constructs a first direction vector pointing from point A to point B, and a second direction vector pointing from point B to point C. Then, it calculates the angle between these two vectors. The calculation method is as follows: the first and second direction vectors are multiplied to obtain the dot product; the magnitudes of the two vectors are calculated separately and multiplied to obtain the magnitude product; the dot product is divided by the magnitude product to obtain the cosine value; finally, the cosine value is inversely cosineed to obtain the angle value. The process sets an angle jump threshold of 30 degrees. If the calculated angle value is greater than this threshold, point B is determined to be a location where an edge direction jump occurs, i.e., a corner or inflection point. The process extracts the coordinates of all points B in the entire image that meet the conditions and stores them in a location set. Simultaneously, the process calculates the average curvature of the edge segment before and after the jump, and then calculates the difference between the two. Finally, combining the coordinate position, angle change value, and curvature difference, a set of edge direction jump positions is generated. For example, if vector AB is (1, 0) and vector BC is (0, 1), with a dot product of 0 and a magnitude product of 1, the included angle is calculated to be 90 degrees. Since 90 degrees is greater than the set threshold of 30 degrees, point B is identified as the jump point and recorded.
[0071] S202: Based on the set of edge direction jump positions, combined with the spatial distribution of jump points and the boundary structure contour features of local areas, determine whether there are non-closed structures and differences in connection methods in the edge configuration of the jump continuous segment, and mark the position segments that meet the preset jump rules to obtain the component assembly boundary difference segments.
[0072] Based on the set of edge direction jump locations, a microstructural analysis is performed on a local area within a 20-pixel radius around each jump point. The process extracts all edge pixels within this local area to construct a local contour map. The process defines a closure detection rule: starting from the jump point, a bidirectional search is performed along the edge trajectory. If another jump point can be found within a 50-pixel path length, and the edge segment between the two jump points is uninterrupted, it is considered a closed connection. If the search path terminal does not connect to any known feature point or another edge line, it is determined to be a non-closed structure or a suspended endpoint. The process also calculates the difference in connection methods, specifically comparing the deviation between the included angle at the current jump point and a preset standard right angle (90 degrees) or obtuse angle (135 degrees) for the component. If the absolute value of the deviation exceeds 5 degrees, and the area is determined to be non-closed, the jump location segment is marked as a potential assembly defect or boundary difference. The process uniformly marks all location segments that meet the above "non-closed and angle deviation exceeding the standard" rule to obtain component assembly boundary difference segments. For example, if the measured angle at a certain transition point is 80 degrees, which deviates from the standard 90 degrees by 10 degrees, and the extended edge line is interrupted at 30 pixels, this area is marked as a difference segment.
[0073] S203: Based on the spatial positioning information of the component assembly boundary difference segment and the structural contour features of the corresponding region in the image, extract the morphological contour and structural size information of the image region, perform a fitting degree matching operation between the region feature vector and the component type feature template, and construct a component classification map;
[0074] Based on the spatial positioning information (i.e., center coordinates and coverage area) of the determined component assembly boundary difference segments, the corresponding region of interest (ROI) is extracted from the original image. The ROI is binarized to extract its morphological contour. The geometric feature vector of this contour is calculated, containing three components: the area (total number of pixels within the region), the perimeter (total number of pixels at the boundary), and the roundness (4 times pi multiplied by the area and divided by the square of the perimeter). Simultaneously, a standard component type feature template is retrieved from the database, which also contains standard area, perimeter, and roundness data. A goodness-of-fit matching operation is performed using a weighted Euclidean distance method. The difference between the extracted feature vector and the template feature vector at each component is calculated, squared, and multiplied by preset weights (area weight 0.4, perimeter weight 0.3, roundness weight 0.3). The weighted squared differences are summed and the square root is taken to obtain the matching distance. The smaller the matching distance, the higher the goodness of fit. The template type with the smallest matching distance is selected as the classification result for the component in that region, and the classification labels are mapped back to the image space to construct a component classification map. For example, if the extracted area is 1000 and the standard template area is 1020, the difference is 20; other components are calculated similarly. If the final weighted Euclidean distance is 5.2, and this value is the smallest among all templates, then the area is determined to belong to the component type corresponding to that template.
[0075] Please see Figure 4 The specific steps of S3 are as follows:
[0076] S301: Call the component classification map, locate the boundary contours of the regions identified as components in the image, extract the pixel intensity values between the boundary pixels within the component region and the adjacent background region, perform extraction operations on the boundary positions of each region, and obtain the component boundary pixel set;
[0077] The process calls upon the component classification map, using the classification labels as mask indices to precisely locate the boundary contours of regions identified as components in the image. For each pixel on the contour, the process defines it as the center point and establishes a 5-pixel multi-pixel local sampling window. Within the window, the process identifies the set of pixels belonging to the component's interior and the set of pixels belonging to the adjacent background region. The process calculates the average brightness value of the pixel set inside the component and the average brightness value of the pixel set in the adjacent background region, respectively. Subsequently, the process stores these two average values as attribute data for that boundary location, thereby traversing the entire contour to obtain the component boundary pixel set containing positional information and internal / external brightness contrast information. For example, at a certain boundary point, the average brightness on the component side within the sampling window is 200, and the average brightness on the background side is 50. These two values, along with the coordinates (X, Y) of the point, are stored in the set.
[0078] S302: Based on the brightness values of the boundary pixels and the neighboring background pixels in the component boundary pixel set, normalize the brightness difference and set the brightness adjustment gain parameter. Perform brightness value adjustment on pixels with contrast enhancement coefficient greater than the mean value of pixel difference distribution to obtain the boundary brightness difference matrix.
[0079] The process reads data from the pixel set of the component boundaries. For each boundary point, it calculates the difference between its internal average brightness and the background average brightness, denoted as the original contrast. The process statistically analyzes the original contrast of all boundary points in the entire image, calculating their distribution mean and standard deviation. Then, it performs normalization, subtracting the minimum contrast from the original contrast of each point and dividing by the difference between the maximum and minimum contrast to obtain the normalized difference. The process sets a brightness adjustment gain parameter to 2.0. It then filters out pixels with original contrast greater than the distribution mean and performs brightness enhancement on these points. The enhancement calculation logic is: the target brightness value equals the original brightness value plus (the normalized difference multiplied by the brightness adjustment gain parameter multiplied by a baseline step size, e.g., 10). The process limits the calculated target brightness value to the range of 0 to 255. For points that do not meet the filtering criteria, the original value remains unchanged. This calculation process generates a boundary brightness difference matrix recording the adjusted brightness values. Table 2 shows the brightness adjustment calculation process for some boundary points.
[0080] Table 2 Calculation data for boundary brightness adjustment
[0081]
[0082] Experimental data show that the adaptive enhancement described above improves the recognizability of subsequent processing.
[0083] S303: Based on the pixel position of each component region in the boundary brightness difference matrix, perform brightness coverage update processing on the corresponding pixels in the original image, write the processed pixel content into the corresponding position region of the original image frame, and generate a component boundary comparison image.
[0084] Based on the generated boundary brightness difference matrix, the corresponding position in the original image frame is located using the pixel coordinate index recorded in the matrix. The process adopts a point-by-point writing method, directly overwriting the brightness data of the corresponding pixel in the original image with the enhanced brightness value calculated in the matrix. For color images, the process only adjusts the brightness channel (such as the L component in HSL space) or proportionally increases the values of the three RGB channels to maintain chromaticity. During the overlay process, a 3*3 Gaussian smoothing filter is applied to fine-tune the modified boundary pixels and their immediate neighbors to eliminate the jagged effect caused by forced numerical modification. After updating all boundary points, the process outputs the processed new image, i.e., the generated component boundary comparison image. For example, if the pixel brightness at coordinates (50, 50) in the original image is 120, and the new brightness at the corresponding position in the difference matrix is 150, the process directly modifies the pixel value at that position to 150 and performs weighted average smoothing on its eight surrounding points.
[0085] Please see Figure 5 The specific steps of S4 are as follows:
[0086] S401: Call the component boundary comparison image, traverse the two-dimensional position index of all pixels in the image frame in row priority order, extract the brightness response intensity value of the boundary position, and make a continuity judgment on the brightness difference fluctuation range of adjacent pixels in the horizontal row and vertical column to obtain the pixel continuity feature set.
[0087] The process calls the component boundary comparison image and directly accesses pixels according to the image's row and column structure. Each pixel is processed pixel-by-pixel according to the image's natural row and column storage order, extracting the enhanced brightness response intensity value and calculating the brightness difference with its neighboring pixels, then performing a difference continuity judgment. The process then performs a difference continuity judgment: for the current pixel, it calculates the brightness difference between it and its right-hand neighbor and its bottom neighbor. If the difference is within a preset fluctuation range (e.g., [-5, +5] brightness units), then brightness continuity is determined to exist in that direction. The process records the continuity status (yes / no) of each pixel in the horizontal and vertical directions, obtaining a pixel continuity feature set. For example, if pixel P1 has a brightness of 150, and the right-hand pixel P2 has a brightness of 153, the difference of 3 is within the range, and horizontal continuity is marked as "yes"; the bottom pixel P3 has a brightness of 100, and the difference of 50 is outside the range, so vertical continuity is marked as "no".
[0088] S402: Based on the boundary direction information and response intensity value of the pixel continuity feature concentration region, preset the direction deviation angle threshold and intensity density threshold, and cluster the pixel sequence that satisfies the boundary direction stability and response intensity concentration to generate edge connected pixel chain;
[0089] Based on the pixel continuity feature set, boundary direction information is further incorporated. The process sets two key thresholds: a directional deviation angle threshold of 15 degrees and an intensity density threshold of 0.6 (i.e., the proportion of effective edge points per unit length). The process employs a density-based clustering logic for pixel connection. Starting with a seed point with high response intensity, the process searches its 8-neighborhood for all pixels that meet the following two conditions: first, brightness continuity is marked as "yes"; second, the difference between the gradient direction of this point and the gradient direction of the seed point is less than the directional deviation angle threshold. If a neighboring point meeting these conditions is found, it is added to the current cluster, and this neighboring point is used as a new seed point to continue growing outwards until no more neighboring points meeting these conditions can be found. This process connects discrete pixels into a continuous chain, generating an edge-connected pixel chain. For example, starting from a strong edge point with a gradient direction of 45 degrees, it can continuously connect 50 pixels with directions between 40 and 50 degrees and continuous brightness, forming a 50-pixel edge chain.
[0090] S403: Based on the position sequence in the edge connected pixel chain, retrieve the arrangement trajectory of the connected region in the image space, extract the boundary direction of all component assembly nodes, and perform line construction processing on the connected edge segments to construct the component boundary line graphics;
[0091] Based on the position sequence data in the edge-connected pixel chains, geometric analysis is performed on each chain. The process first uses the least squares method to fit the pixel coordinates on the chain to a straight line or curve. A linear equation y=ax+b is established, and the slope 'a' and intercept 'b' are calculated by minimizing the sum of the squares of the perpendicular distances from all points on the chain to the line. If the fitting error exceeds a preset standard, a piecewise fitting strategy is adopted, breaking the long chain into multiple straight lines or arcs. The process extracts the fitted line trajectories, clarifying their starting point coordinates, ending point coordinates, and direction vector in image space. Finally, the process draws these fitted lines on a blank canvas, setting the line width to 1 pixel, the pixel value to 255 (white), and the background to 0 (black), thus constructing a clear component boundary line graphic. For example, through calculation, a pixel chain is fitted as a straight line segment with a slope of 1.5 and an intercept of 20, starting at (10, 35) and ending at (100, 170), and this line segment is drawn in the resulting graphic.
[0092] Please see Figure 6 The specific steps of S5 are as follows:
[0093] S501: Call the component boundary line graphic, determine the continuity of the start and end positions of all line pixels in the image, determine the closure of the line based on whether the Euclidean distance between the pixel coordinates is less than the set closure threshold, and merge the line segments that meet the closure conditions to obtain the closed component boundary line set.
[0094] The process calls the component boundary line graphic and performs endpoint analysis on all line segments in the drawing. The procedure iterates through the start and end coordinates of each line. For the end point of line L1 and the start point of line L2, the procedure calculates the Euclidean distance between them. Specifically, it calculates the square root of the square of the difference between the x-coordinates and the square of the difference between the y-coordinates. The procedure sets a closure criterion threshold of 5 pixels. If the calculated Euclidean distance is less than this threshold, the procedure determines that the two lines should be connected in space and performs a merge operation, treating them as part of the same component boundary. The procedure repeats this logic until a set of lines is found that are connected end-to-end to form a closed loop, or the traversal ends and no closure is found. For line groups that successfully form a closed loop, the procedure marks it as an independent closed unit and obtains the closed component boundary line set. For example, the distance between the end point (100, 100) of line A and the start point (102, 101) of line B is 2.236, which is less than 5, so a connection is determined, and A and B are merged.
[0095] S502: Based on the pixel coordinate sequence of the concentrated lines of the boundary line of the closed component, perform spatial position alignment operation on the assembly node area of the component, reconstruct the boundary area layout structure according to the positional relationship of the boundary lines in the image, verify the fusion processing of the boundary area and the image structure, and generate the component boundary spatial position set.
[0096] Based on the set of boundary lines of closed components, they are mapped back to the original component assembly node area space. The process utilizes affine transformation logic to convert pixel coordinates into physical space coordinates (e.g., millimeters) according to calibration parameters during image acquisition (e.g., scale, rotation angle). The process checks the arrangement structure of the boundary areas after reconstruction to confirm the existence of overlap or interference. The process calculates the centroid coordinates and principal axis direction of the closed area and performs alignment operations with the theoretical positions in the design drawings. The verification logic is as follows: calculate the distance between the measured centroid and the theoretical centroid; if it is less than the tolerance (e.g., 1 mm), the verification passes; otherwise, a position correction alarm is triggered. Finally, it is confirmed that all boundary areas are correctly integrated with the image structure, generating a set of component boundary space positions containing precise physical coordinates. For example, pixel coordinates (1000, 1000) are transformed into physical coordinates (100mm, 100mm) after a scale transformation of 0.1mm / pixel, and verification confirms that this position conforms to the assembly logic.
[0097] S503: Based on the correspondence between the boundary pixel coordinates and image coordinate indices in the component boundary spatial location set, all component boundary locations are uniformly encoded and mapped, forming a searchable boundary and coordinate correspondence data structure, and constructing a machine tool assembly acceptance boundary map.
[0098] Based on the set of component boundary spatial locations, the final data storage structure is established. The process creates a hash table or key-value database, using each component's unique identifier (ID) as the key and its boundary physical coordinate sequence, geometric dimensions (length, width, radius), classification type, and assembly status (normal / defective) as values for associated storage. The process performs unified encoding and mapping on all data, ensuring that the corresponding component information can be quickly retrieved via spatial coordinates, and that its position in the image can be looked up using the component ID. This structured data set constitutes the completed machine tool assembly acceptance boundary map, which can be directly used for subsequent automated quality inspection report generation or robotic arm guidance. For example, the component with ID "Gear-01" includes a set of 100 coordinate points describing its circular outline, a diameter of 50mm, and an acceptance status of "qualified".
[0099] Please see Figure 7 An image-based intelligent acceptance system for machine tool assembly includes:
[0100] The edge response map construction module is used to implement S1: collect image data of component assembly nodes, divide the image area according to the assembly area, extract the brightness distribution features of each image area, analyze the direction and change amplitude, and construct the component edge response map;
[0101] The component classification and recognition module is used to implement S2: call the component edge response graphics, analyze the continuity of the image contour transition position, determine the boundary change segment caused by the connection method and structural difference, identify the component type according to the image spatial distribution and local structural contour features, and generate a component classification map;
[0102] The boundary contrast enhancement module is used to implement S3: call the component classification map, extract the target region containing the edge features of the component, adjust the brightness contrast between the edge pixels and its neighboring background region, cover the enhanced edge pixels onto the original image, and generate a component boundary contrast image.
[0103] The boundary line extraction module is used to implement S4: call the component boundary comparison image, analyze the continuity of pixel distribution, construct a connected pixel chain based on the stability and response intensity of the boundary direction, identify the direction of the outer boundary of the component assembly node, and connect the edge contours to generate the component boundary line graphics;
[0104] The assembly acceptance map construction module is used to implement S5: call the component boundary line graphics, perform boundary aggregation and position reconstruction on closed lines, perform spatial alignment and image structure fusion of the boundary areas in the component assembly nodes, and construct the machine tool assembly acceptance boundary map.
[0105] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the technical solution.
Claims
1. A machine tool assembly intelligent acceptance method based on image generation, characterized in that, Includes the following steps: S1: Collect image data of component assembly nodes, divide the image area according to the assembly area, extract the brightness distribution characteristics of each image area, analyze the direction and change amplitude, and construct the component edge response graphics; S2: Call the component edge response graphics, analyze the continuity of the image contour jump position, determine the boundary change segment caused by the connection method and structural difference, identify the component type according to the image spatial distribution and local structural contour features, and generate a component classification map; S3: Call the component classification map, extract the target area containing the component edge features, adjust the brightness contrast between the edge pixels and the adjacent background area, cover the enhanced edge pixels onto the original image, and generate a component boundary contrast image; S4: Call the component boundary comparison image, analyze the continuity of pixel distribution, construct a connected pixel chain based on the stability of boundary direction and response intensity, identify the direction of the outer boundary of the component assembly node, and connect the edge contours to generate the component boundary line graphic; S5: Call the component boundary line graphics, perform boundary aggregation and position reconstruction on the closed lines, perform spatial alignment and image structure fusion of the boundary areas in the component assembly nodes, and construct the machine tool assembly acceptance boundary map.
2. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that: The component edge response graphic includes brightness difference features, directional gradient features, and edge transition features. The component classification map includes assembly area identifiers, component type labels, and structural contour information. The component boundary comparison image includes boundary pixel contrast, brightness difference enhancement area, and contour recognition clarity. The component boundary line graphic includes boundary connectivity chain, contour direction information, and line direction structure. The machine tool assembly acceptance boundary map includes boundary position coordinates, image space mapping relationship, and assembly node alignment information.
3. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that: The identification of the outer boundary direction of the component assembly node refers to verifying the direction path of the outer contour of the component assembly node by analyzing the continuity, directional stability and response intensity of pixels in the component boundary image.
4. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that: The determination of boundary change segments caused by differences in connection methods and structures refers to identifying boundary feature regions caused by differences in connection methods and component structures based on the continuity of the image contour jump position.
5. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Obtain component assembly node image data, divide the assembly area in the image frame, extract the spatial coordinates and brightness values of pixels in the area, construct a set of brightness information of local image areas based on the data, and generate an image division area matrix. S102: Call the brightness value in the image region division matrix, calculate the brightness difference of adjacent pixels in the horizontal and vertical directions, statistically analyze the frequency and distribution characteristics of the direction vector, construct a set of direction change data for each region, and obtain the local brightness direction parameter set. S103: Based on the directional distribution characteristics and brightness difference in the local brightness direction parameter group, perform gradient difference calculation of boundary pixels, extract the edge trajectory of gradient abrupt change points and perform aggregation encoding to establish component edge response graphics.
6. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Call the component edge response graphic, perform position continuity retrieval on all edge trajectories in the image, extract the set of positions where adjacent edge directions change, and judge the angle difference between the edge direction vectors before and after the change to generate a set of edge direction change positions. S202: Based on the set of edge direction jump positions, combined with the spatial distribution of jump points and the boundary structure contour features of local areas, determine whether there are non-closed structures and differences in connection methods in the edge configuration of the continuous jump segment, and mark the position segments that meet the preset jump rules to obtain the component assembly boundary difference segments. S203: Based on the spatial positioning information of the component assembly boundary difference segment and the structural contour features of the corresponding region in the image, extract the morphological contour and structural size information of the image region, perform a fitting degree matching operation between the region feature vector and the component type feature template, and construct a component classification map.
7. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Call the component classification map, locate the boundary contours of the regions identified as components in the image, extract the pixel intensity values between the boundary pixels within the component region and the adjacent background region, perform extraction operations on the boundary positions of each region, and obtain the component boundary pixel set; S302: Based on the brightness values of the boundary pixels and the neighboring background pixels in the component boundary pixel set, normalize the brightness difference and set the brightness adjustment gain parameter. Perform brightness value adjustment on pixels with contrast enhancement coefficient greater than the mean value of pixel difference distribution to obtain the boundary brightness difference matrix. S303: Based on the pixel position of each component region in the boundary brightness difference matrix, perform brightness coverage update processing on the corresponding pixel points in the original image, write the processed pixel content into the corresponding position region of the original image frame, and generate a component boundary comparison image.
8. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Call the component boundary comparison image, traverse the two-dimensional position index of all pixels in the image frame in row priority order, extract the brightness response intensity value of the boundary position, and make a continuity judgment on the brightness difference fluctuation range of adjacent pixels in the horizontal row and vertical column to obtain the pixel continuity feature set. S402: Based on the boundary direction information and response intensity value of the pixel continuity feature concentration region, preset the direction deviation angle threshold and intensity density threshold, and cluster the pixel sequences that satisfy the boundary direction stability and response intensity concentration to generate edge connected pixel chains. S403: Based on the position sequence in the edge-connected pixel chain, retrieve the arrangement trajectory of the connected region in the image space, extract the boundary direction of all component assembly nodes, and perform line construction processing on the connected edge segments to construct the component boundary line graphics.
9. The intelligent acceptance method for machine tool assembly based on image generation according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Call the component boundary line graphic, determine the continuity of the start and end positions of all line pixels in the image, determine the closure of the line based on whether the Euclidean distance between the pixel coordinates is less than the set closure threshold, and merge the line segments that meet the closure conditions to obtain the closed component boundary line set. S502: Based on the pixel coordinate sequence of the concentrated lines of the boundary line of the closed component, perform spatial position alignment operation on the component assembly node area, reconstruct the boundary area layout structure according to the positional relationship of the boundary lines in the image, verify the fusion processing of the boundary area and the image structure, and generate the component boundary spatial position set. S503: Based on the correspondence between the boundary pixel coordinates and image coordinate indices in the component boundary spatial location set, perform unified encoding mapping on all component boundary positions, and form a searchable boundary and coordinate correspondence data structure to construct a machine tool assembly acceptance boundary map.
10. An intelligent acceptance system for machine tool assembly based on image generation, characterized in that, The system is used to implement the image-based intelligent acceptance method for machine tool assembly as described in any one of claims 1-9, and the system includes: The edge response map construction module is used to implement S1: collect image data of component assembly nodes, divide the image area according to the assembly area, extract the brightness distribution features of each image area, analyze the direction and change amplitude, and construct the component edge response map; The component classification and recognition module is used to implement S2: call the component edge response graphics, analyze the continuity of the image contour jump position, determine the boundary change segment caused by the connection method and structural difference, identify the component type according to the image spatial distribution and local structural contour features, and generate a component classification map; The boundary contrast enhancement module is used to implement S3: call the component classification map, extract the target region containing the component edge features, adjust the brightness contrast between the edge pixels and their neighboring background regions, cover the enhanced edge pixels onto the original image, and generate a component boundary contrast image. The boundary line extraction module is used to implement S4: call the component boundary comparison image, analyze the continuity of pixel distribution, construct a connected pixel chain based on the boundary direction stability and response intensity, identify the direction of the outer boundary of the component assembly node, and connect the edge contours to generate the component boundary line graphic; The assembly acceptance map construction module is used to implement S5: call the component boundary line graphics, perform boundary aggregation and position reconstruction on the closed lines, perform spatial alignment and image structure fusion of the boundary areas in the component assembly nodes, and construct the machine tool assembly acceptance boundary map.