A machine vision-based plastic particle size data management method

CN122887977APending Publication Date: 2026-10-09ANHUI KAILUO NEW MATERIALS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610950361.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-29
Publication Date
2026-10-09

AI Technical Summary

Benefits of technology

本发明能够在同一检测批次内建立颗粒尺寸数据、位置数据、颗粒归属关系和网格尺寸数据之间的对应关系,使单颗粒检测结果与空间区域汇总结果保持可追溯关联,从而提高塑料颗粒尺寸数据存储和调用过程中的完整性;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122887977A_ABST
    Figure CN122887977A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on machine vision's plastic particle size data management method, it is related to the field of plastic particle processing, including: obtaining particle size data and position data, according to multiple groups of row and column number division basic detection grid and form grid size data;By continuous X row, continuous Y column basic detection grid forms detection area, so that detection area moves horizontally or vertically and returns starting detection area, and selects horizontal and vertical grid belt replacement relationship combination that is connected with reference to basic detection grid row and column number;Two same direction grid belts are extracted to establish grid belt replacement relationship.The application can establish the corresponding relationship between particle size data, position data, particle attribution relationship and grid size data in the same detection batch, so that single particle detection result and spatial area summary result maintain traceable association, thereby improve the integrity in the process of plastic particle size data storage and call.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of plastic pellet processing, specifically to a method for managing plastic pellet size data based on machine vision. Background Technology

[0002] During the production, screening, packaging, and quality inspection of plastic granules, it is usually necessary to detect the size and distribution of the granules. Machine vision inspection can obtain the size and location data of individual plastic granules through image acquisition, contour segmentation, and size conversion, and can generate corresponding data records according to the inspection batch. As the number of granules in the field of view increases, the granule size data usually needs to be collected according to spatial regions in order to manage the number of granules, granule size, and data distribution in different regions. When using spatial grids to divide the detection field of view, the number of grid rows and columns, the location of grid boundaries, and the location of the centroid of the particle outline all affect the relationship between the particle and the basic detection grid. When the same particle is adjacent to a grid boundary or grid vertex, the region division results under different combinations of row and column numbers may differ. When the detection area moves within the grid, the set of coverage grids corresponding to different locations also changes. Therefore, in addition to obtaining the size data of a single particle, it is also necessary to maintain the correspondence between particle size data, location data, particle belonging relationship, and grid size data to support subsequent data verification and traceability. Furthermore, after grid aggregation, regional transfer, and batch writing, plastic particle size data may simultaneously exist as multiple layers of data objects, including single particle data, grid aggregation data, and regional correlation data. These layers of data have sequential relationships, and changes in local data may affect the data results of adjacent grids or related regions. Therefore, a data management method is needed that can combine spatial partitioning relationships to perform cross-validation of particle size data and grid size data, and classify and store the validation results to improve the correlation between detection data and the certainty of subsequent retrieval. Consequently, this invention proposes a machine vision-based plastic particle size data management method. Summary of the Invention

[0003] The purpose of this invention is to provide a machine vision-based method for managing plastic particle size data, in order to solve the problems mentioned in the background section.

[0004] This invention can be achieved through the following technical solution: a machine vision-based method for managing plastic particle size data, comprising: Step 1: Obtain particle size and location data, divide the basic detection grid according to multiple sets of rows and columns, and form grid size data; form a detection area by continuous X rows and continuous Y columns of basic detection grid, move the detection area horizontally or vertically grid by grid and return to the starting detection area, and select the combination of rows and columns of the reference basic detection grid with the replacement relationship of horizontal and vertical grid bands that are connected. Step 2: Extract two unidirectional grid bands and establish grid band replacement relationships; the two horizontal grid bands share X-1 basic detection grids, and the two vertical grid bands share Y-1 basic detection grids, and each contains one differential basic detection grid; Step 3: Summarize the particle size data and grid size data to form the direct size value and reconstructed size value of the grid band, compare them to form the difference of the directional grid band, and form the grid band replacement difference from the difference of the same directional grid band; verify with reference to the basic detection grid, and set the data transfer difference that has passed the verification to zero; Step 4: Starting from the reference base detection grid, form a horizontal difference response and a vertical difference response based on the grid band replacement difference along the horizontal and vertical grid band replacement relationship; when both types of difference responses are within the allowable range of size data consistency, or when the directions are consistent and the difference in the difference amount is within the range, form a grid difference fingerprint, and use this to review and correct the grid size data or particle attribution relationship; Step 5: Write the data that passed and failed the verification into the size data set and the record to be reviewed, respectively.

[0005] A further technical improvement of the present invention lies in: the method for forming multiple sets of row and column numbers and grid size data in step one, including: Read the horizontal dimension of the detection field of view, the vertical dimension of the detection field of view, the total number of plastic particles, the upper limit of the number of particles that can be contained, and the minimum horizontal dimension and the minimum vertical dimension of the basic detection grid. The ratio of the total number of plastic granules to the upper limit of the granule capacity is rounded up to form the lower limit of the total number of basic detection grids. The ratio of the vertical dimension of the detection field to the minimum vertical dimension of the basic detection grid is rounded down to form the upper limit of the number of candidate grid rows. The ratio of the horizontal dimension of the detection field to the minimum horizontal dimension of the basic detection grid is rounded down to form the upper limit of the number of candidate grid columns. Within the upper limit of the number of candidate grid rows and the upper limit of the number of candidate grid columns, form combinations of candidate grid row and column numbers, and delete combinations whose product of row and column numbers is less than the lower limit of the total number of basic detection grids; The basic detection grid is divided according to the remaining combinations. The number of grid particles is counted based on the location data. Combinations in which the number of grid particles does not exceed the upper limit of particle capacity are retained. The grid particles are then arranged in ascending order of the absolute difference between the ratio of the number of grid columns to the number of grid rows and the ratio of the horizontal dimension to the vertical dimension of the detection field of view. If the absolute differences are the same, the particles are arranged in ascending order of the product of the number of rows and columns. The first two groups are selected as the number of rows and columns for multiple groups. The centroid position of each plastic particle is read from the location data. Each plastic particle is uniquely assigned to the corresponding basic detection grid based on its centroid position. The particle size data in each basic detection grid is then summarized according to the preset size summary method to form the corresponding grid size data.

[0006] A further technical improvement of the present invention is that: in step one, the method of moving the detection area horizontally or vertically grid by grid and returning to the initial detection area includes: A set of movable positions is formed based on the row and column boundaries of the basic detection grid and the coverage of the detection area. The set of movable positions includes at least two movable positions in both the horizontal and vertical directions. The detection area located at the corner of the movable position set is determined as the initial detection area. The detection area moves back and forth horizontally and advances vertically to form an initial movement sequence, and the initial movement sequence is used as the current movement sequence. Read adjacent movable positions in the current movement sequence in sequence. Based on the movement direction of the detection area, determine the basic detection grid that changes from uncovered to covered or from covered to uncovered. Write the corresponding basic detection grid identifier into the horizontal coverage status change record or the vertical coverage status change record respectively, and write the same identifier only once in the same record. Screen the basic detection grids that have not simultaneously written two types of coverage state change records, determine the movement direction corresponding to the missing records, and determine the candidate insertion positions that can cause the screened basic detection grids to change their coverage state when moving along the movement direction to the adjacent movable position from the current movement sequence. When a candidate insertion position exists, the device moves from the candidate insertion position to the corresponding adjacent movable position and returns to the candidate insertion position, forming a candidate supplementary moving segment; when no candidate insertion position exists, the identifier of the selected basic detection grid is written into the coverage status record of the corresponding moving direction. The candidate supplementary moving segments that have been formed are arranged in descending order of the number of basic detection grids with newly added coverage status change records. If the number is the same, they are arranged in ascending order of the number of repeated movable positions. The candidate supplementary moving segments that are arranged first are selected and inserted into the current moving sequence. Re-establish horizontal and vertical coverage status change records until the identifiers of each basic detection grid are written into the corresponding coverage status change records or coverage status maintenance records in the horizontal and vertical directions, respectively. Following the reverse order of the initial movement sequence, the detection area returns to the starting detection area grid by grid.

[0007] A further technical improvement of the present invention is that the method for selecting the basic detection grid in step one includes: For each group of rows and columns corresponding to the basic detection grid, the number of grid particles in each basic detection grid is counted. When there is a basic detection grid with a number of grid particles of not less than two, the basic detection grid with a number of grid particles of not less than two is retained; when there is no basic detection grid with a number of grid particles of not less than two, the basic detection grid with the largest number of grid particles is retained; and the median value of the number of grid particles in each retained basic detection grid is formed. Calculate the number deviation of each retained basic detection grid from the median value, and retain the basic detection grids whose number deviation is not greater than the median value of all number deviations to form a set of number-stable grids; The centroid of the particle position is formed based on the position data of plastic particles in each basic detection grid in the stable grid set. The distance from the centroid of the particle position to each boundary of the corresponding basic detection grid is calculated, and the minimum value is taken as the centroid boundary distance. Calculate the distance between the position data of each plastic particle and the centroid of the corresponding particle position, and use the median value of the obtained distance as the particle position discretization; For each set of stable grids corresponding to a number of rows and columns, they are arranged in order of increasing quantity deviation, decreasing centroid boundary distance, and increasing particle position dispersion. When the arrangement results are the same, they are arranged in order of increasing row and column order in the corresponding row and column combination. The basic detection grid that is arranged first is determined as the reference basic detection grid for the corresponding row and column combination.

[0008] A further technical improvement of the present invention lies in the method for arranging the difference-based detection grid in step two, including: Read the horizontal and vertical position coordinates from the position data, determine the direction of increase of the horizontal position coordinates as the direction of increase of the grid column coordinates, determine the direction of increase of the vertical position coordinates as the direction of increase of the grid row coordinates, and form the grid column coordinates and grid row coordinates according to the arrangement order of each basic detection grid in the two increasing directions. Read the differential detection grids contained in each of the two co-directional grid bands, and obtain the grid row coordinates and grid column coordinates of the two differential detection grids; When two grid bands in the same direction are horizontal grid bands, the two differential base detection grids are arranged in ascending order of grid column coordinates. If the grid column coordinates are the same, they are arranged in ascending order of grid row coordinates. When two grid bands in the same direction are vertical grid bands, the two differential base detection grids are arranged in ascending order of grid row coordinates. If the grid row coordinates are the same, they are arranged in ascending order of grid column coordinates. The difference detection grid arranged at the beginning is defined as the first difference detection grid, the difference detection grid arranged at the end is defined as the second difference detection grid, the same-direction grid band containing the first difference detection grid is defined as the first grid band, and the same-direction grid band containing the second difference detection grid is defined as the second grid band. The direction from the first grid band to the second grid band is determined as the grid band replacement direction, and the first grid band, the second grid band, and the grid band replacement direction are written into the grid band replacement direction record.

[0009] A further technical improvement of the present invention is that the verification method referring to the basic detection grid in step three includes: Read the grid boundaries of the reference base detection grid, and read the grid boundaries of each base detection grid from another combination of rows and columns that is different from the combination of rows and columns to which the reference base detection grid belongs; Identify the basic detection grids that share a common coverage area with the reference basic detection grid, and form the common coverage area between each basic detection grid and the reference basic detection grid; Based on the location data, determine the plastic particles whose centroid positions fall within each common coverage area, write the determined plastic particles into the cross-check particle set, and write the same plastic particle only once. The particle size data in the cross-check particle set is summarized according to the preset size summarization method used when forming the grid size data, and the cross-check size data of the reference base detection grid is formed. Calculate the difference between the cross-verification size data and the corresponding grid size data of the reference base detection grid to form the reference grid verification difference; When the verification difference of the reference grid is within the allowable range of dimensional data consistency, a verification pass record is generated, and the data transfer difference of the reference base detection grid is set to zero.

[0010] A further technical improvement of the present invention is that: in step four, the determination of the consistency of direction between the lateral difference response and the longitudinal difference response includes: For the basic detection grid to be judged, read the grid band replacement relationship used when forming the lateral and longitudinal difference responses, as well as the connection order from the reference basic detection grid to the basic detection grid to be judged; Read the horizontal and vertical mesh replacement relationships step by step from the base detection mesh to the reference base detection mesh. Select the mesh replacement relationship that first satisfies the condition that the mesh replacement difference is within the allowable range of dimensional data consistency, the difference base detection mesh on the side closer to the reference base detection mesh is not the reference base detection mesh, and the difference response in the corresponding direction is within the allowable range of dimensional data consistency. When both horizontal and vertical grid replacement relationships are selected, and the number of intervals between the two selected grid replacement relationships and the base detection grid to be judged is the same, and the corresponding differential base detection grids are different, the difference response in the corresponding direction of the two differential base detection grids is determined as the horizontal reference value and the vertical reference value, respectively; if this condition is not met, the data transfer difference of the reference base detection grid is determined as the horizontal reference value and the vertical reference value, respectively. Subtract the lateral reference value from the lateral difference response of the basic detection grid to be judged to form the lateral relative difference value; subtract the longitudinal reference value from the longitudinal difference response of the basic detection grid to be judged to form the longitudinal relative difference value. When both the lateral relative difference and the longitudinal relative difference are greater than the upper limit of the allowable range for dimensional data consistency, or both are less than the lower limit of the allowable range for dimensional data consistency, the lateral difference response and the longitudinal difference response are determined to be in the same direction.

[0011] A further technical improvement of the present invention is that: in step four, the method for correcting particle attribution relationships and grid size data based on grid difference fingerprint verification includes: Read the location data, particle size data, and particle affiliation of plastic particles within the basic detection grid to be judged and the basic detection grid that shares grid boundaries or grid vertices with it to form the grid difference fingerprint. Read the centroid position of the contour from the location data and form the row order position and column order position according to the row and column arrangement order of the basic detection grid. Based on the position of the centroid of the profile, the basic detection grid corresponding to each plastic particle is redefined, and plastic particles that are inconsistent with the original particle affiliation are screened. Plastic particles whose column order changes between the original base detection grid and the newly determined base detection grid, and whose one of them is the base detection grid to be judged, are identified as horizontal particles to be verified. Plastic particles whose row order changes, and whose one of them is the base detection grid to be judged, are identified as vertical particles to be verified. Under the condition that only the transverse particles to be verified and only the longitudinal particles to be verified are assigned to the newly determined basic detection grid, while the remaining plastic particles maintain their original particle assignment relationships, the grid size data before and after the adjustment of the basic detection grid to be judged are generated according to the method of grid size data formation, and the difference is calculated to form the transverse assignment change and the longitudinal assignment change. When the lateral assignment change and the lateral relative difference are in the same direction and the difference is within the allowable range of dimensional data consistency, and the longitudinal assignment change and the longitudinal relative difference are in the same direction and the difference is within the range, the particle assignment relationship of the lateral and longitudinal particles to be verified is corrected according to the position of the centroid of the contour; if the condition is not met, the original particle assignment relationship is retained. The grid size data of the basic detection grid involved is reconstructed according to the current particle affiliation. The difference between the reconstructed grid size data and the corresponding reference grid size data is calculated to form the grid size update difference. When the grid size update difference exceeds the allowable range of size data consistency, the corresponding grid size data is updated with the reconstructed grid size data.

[0012] Compared with the prior art, the present invention has the following beneficial effects: This invention can establish a correspondence between particle size data, location data, particle affiliation and grid size data within the same testing batch, so that the single particle testing result and the spatial area summary result can be traced and linked, thereby improving the integrity of plastic particle size data storage and retrieval process; Furthermore, this invention can utilize correlation results in different spatial directions to cross-validate grid size data, identify the transmission of local data differences between adjacent regions, and distinguish the data impact caused by local deviations, directional consistency deviations, and changes in particle affiliation, thereby improving the accuracy of abnormal size data location and affiliation verification. On the other hand, the present invention can retain valid data, correct the particle attribution relationship and grid size data that meet the conditions according to the verification results, and write the data that fails the verification separately into the record to be verified, so that the data that passes the verification and the data to be verified have clear data status and record boundaries, which facilitates subsequent quality analysis, batch traceability and manual verification. Attached Figure Description To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings.

[0013] Figure 1 This is a schematic diagram of the method logic of the present invention. Detailed Implementation

[0014] To further illustrate the technical means and effects of the present invention in achieving its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of the present invention, in conjunction with the accompanying drawings and preferred embodiments, is provided.

[0015] Please see Figure 1 As shown, this invention provides a machine vision-based method for managing plastic particle size data, including: Step 1: Obtain particle size and location data, divide the basic detection grid according to multiple sets of rows and columns, and form grid size data; form a detection area by continuous X rows and continuous Y columns of basic detection grid, move the detection area horizontally or vertically grid by grid and return to the starting detection area, and select the combination of rows and columns of the reference basic detection grid with the replacement relationship of horizontal and vertical grid bands that are connected. Specifically, images are acquired for plastic particles within the same batch and located in the same field of view. A size calibration plate is used to establish a conversion ratio between pixel distance and actual distance, and recalibration is performed when the image resolution or magnification changes. The upper left corner of the field of view is taken as the origin, and the horizontal and vertical coordinates increase from left to right and from top to bottom, respectively, with length expressed in mm and area expressed in mm².

[0016] In one embodiment, the method for acquiring and using the size calibration plate is as follows: Upon first execution of the current method and when the image resolution or magnification changes, a size calibration plate with known scribe line spacing is placed on the detection plane where the plastic particles are located. Size calibration images are acquired according to the current image resolution, magnification, and illumination parameters. The actual distance between two calibration points on the size calibration plate is read, and the pixel distance between the two calibration points in the size calibration image is calculated. The actual distance is divided by the pixel distance to form a conversion ratio between the pixel distance and the actual distance, in mm / pixel. After removing the size calibration plate, detection images of the plastic particles are acquired at the same image resolution and magnification. Subsequent particle contour area, particle size data, detection field size, and basic detection grid size are all converted to actual values ​​according to this conversion ratio.

[0017] In one embodiment, the illumination parameters are calculated for all historical calibration images included in the same historical calibration record. The actual output values ​​of the light source and the actual exposure times at the time of image acquisition are read separately. The absolute difference between each actual output value of the light source and the set output value is calculated, and the maximum absolute difference is taken as the allowable deviation of the light source output. Similarly, the absolute difference between each actual exposure time and the set exposure time value is calculated, and the maximum absolute difference is taken as the allowable deviation of the exposure time.

[0018] The allowable range for light source output is formed by subtracting and adding the allowable deviation of light source output from the setpoint. Similarly, the allowable range for exposure time is formed by subtracting and adding the allowable deviation of exposure time from the setpoint. When acquiring the current detection image, the actual values ​​of light source output and exposure time are read. Only when both the actual light source output and exposure time are within the allowable range are the background grayscale range, lower limit of closed contour area, minimum size of basic detection grid, upper limit of particle capacity, and candidate configuration list from the corresponding historical calibration record are used. If any actual value exceeds the corresponding allowable range, a record of acquisition parameter mismatch is generated, and the current detection batch is terminated.

[0019] The system reads historical calibration images whose plastic particle specifications, image resolution, imaging magnification, and illumination parameters all match the current batch. If no images are read, a record of missing historical calibration data is created, and the current batch is terminated. Illumination parameters include light source output parameters and exposure time, with the acquired configuration settings as the nominal values. The allowable range is defined by the maximum absolute deviation between the nominal value ± the historical actual value and the nominal value. The system reads the minimum and maximum grayscale values ​​of particle-free areas to form the background grayscale range. It also reads the area of ​​complete particle contours without truncation, occlusion, or segmentation, using the minimum value to form the lower limit of the closed contour area.

[0020] In one embodiment, the historical calibration images are detection images pre-acquired and retained for the corresponding plastic particle size and acquisition configuration prior to the current detection batch. The plastic particle size identifier written with the batch data for the current detection batch is read; the acquisition configuration includes image resolution, imaging magnification, light source output settings, and exposure time settings.

[0021] When generating historical calibration images, plastic particles of the corresponding specifications are selected to cover the detection field of view without contact or overlap between particles. These particles are then laid on the detection plane. After calibrating the pixel distance and actual distance, images are acquired according to the corresponding acquisition configuration. Each acquired image is examined. When an image contains an area without particle coverage, and at least one particle-connected region that does not intersect with the image boundary, does not connect with other particle-connected regions, and has a continuous closed outer boundary, the image is identified as a historical calibration image.

[0022] For each historical calibration image corresponding to the same plastic particle size, image resolution, imaging magnification, light source output setting, and exposure time setting, a historical calibration record is created, and a unique historical calibration record identifier is generated for each image. The historical calibration record identifier, plastic particle size identifier, image identifier, image resolution, imaging magnification, light source output setting, exposure time setting, actual light source output value at image acquisition, actual exposure time value, and the conversion ratio between pixel distance and actual distance are written into the historical calibration record.

[0023] The current testing batch reads historical calibration records where the plastic particle specification identifier, image resolution, imaging magnification, light source output setting, and exposure time setting are all identical, and reads the corresponding historical calibration image based on the historical calibration record identifier. If no corresponding historical calibration record is read, a historical calibration data missing record is generated, and the current testing batch ends.

[0024] The grayscale value of each pixel in the current detection image is read one by one. Pixels with grayscale values ​​lower than the lower limit of the background grayscale range or higher than the upper limit are identified as candidate particle pixels, and the remaining pixels are identified as background pixels. Candidate particle pixels are connected by eight neighbors. Connected regions whose actual projected area is less than the lower limit of the closed contour area are deleted. The outer boundaries of the remaining connected regions are identified as the closed contour of the plastic particle, forming a plastic particle identifier. The actual projected area of ​​the contour is divided by π, the square root is taken, and then multiplied by 2 to form the particle size data. The average horizontal and vertical coordinates of the pixels enclosed by the contour are calculated to form the centroid position of the contour. The particle basic data is written into the record, and the total number of plastic particles is counted. When the number is 0, an empty batch record is created, and the process ends.

[0025] A candidate configuration list is generated based on historical calibration images. The maximum lateral and vertical spans of historical effective particle contours are read to form the minimum lateral and vertical dimensions of the basic detection grid, respectively. Using these two minimum dimensions as the width and height of a rectangular window, the window is moved pixel by pixel in the historical calibration images, and the number of contour centroids within the window is counted. The maximum value is used to form the upper limit for the number of particles that can be accommodated. X represents the number of rows of the basic detection grid that are continuously covered by the detection area, and Y represents the number of columns of the basic detection grid that are continuously covered.

[0026] In one embodiment, the historical effective particle contour and historical parameters include: for each historical calibration image read, forming candidate connected regions using the same segmentation method as the current particle image with eight-neighbor connectivity. When a candidate connected region does not intersect with the boundary of the historical calibration image, does not contact other candidate connected regions, and its outer boundary is closed at both ends, the outer boundary of the candidate connected region is determined as the historical effective particle contour; candidate connected regions that do not meet any of these conditions do not participate in the formation of historical parameters. Read the grain-free areas from all historical calibration images, and calculate the grayscale values ​​of each pixel. Use the minimum and maximum grayscale values ​​to form the background grayscale range. Calculate the actual projected area of ​​the region enclosed by each historical effective particle contour, and use the minimum actual projected area to form the lower limit of the closed contour area. Calculate the maximum coordinate difference between the horizontal and vertical coordinates of each historical effective particle contour, forming the horizontal and vertical spans of the contour. Use the maximum horizontal and vertical spans of all historical effective particle contours to form the minimum horizontal and vertical dimensions of the basic detection grid, respectively. Read the number of horizontal and vertical pixels of the historical calibration image, and multiply them by the conversion ratio of pixel distance to actual distance to form the horizontal and vertical dimensions of the historical detection field of view. Using the minimum horizontal and vertical dimensions of the basic detection grid as the width and height of the rectangular window, the rectangular window moves horizontally and vertically pixel by pixel within each historical calibration image. The number of historical effective particle outline centroids within each window position is counted, and the maximum number in all window positions of all historical calibration images is used to form the upper limit of the number of particles that can be accommodated.

[0027] Divide the longitudinal and lateral dimensions of the historical detection field of view by the corresponding minimum dimensions and round down to form the upper limits of the number of rows and columns of the historical candidate grid. Candidate values ​​for X are formed sequentially from 2 to the upper limit of the number of rows minus 1, and candidate values ​​for Y are formed sequentially from 2 to the upper limit of the number of columns minus 1. These are combined with the upper limit of the particle capacity and the two minimum dimensions to form the configuration to be verified; if any value range is empty, no corresponding configuration is formed. Process the historical calibration images according to the following grid formation and filtering rules, and write at least two sets of grid row and column combinations into the candidate configuration list; form candidate configuration numbers according to the historical calibration record identifier, X, and Y from smallest to largest.

[0028] In one embodiment, the method of using historical calibration images in the candidate configuration list includes: for each configuration to be verified, performing basic detection grid row and column number combination generation, unique particle attribution, and grid particle number filtering on each historical calibration image in the same historical calibration record according to X, Y, particle capacity limit, basic detection grid horizontal minimum size and basic detection grid vertical minimum size in the configuration to be verified; If each historical calibration image retains at least two combinations of grid rows and columns, the configuration to be verified is written to the candidate configuration list, along with the corresponding historical calibration record identifier. If any historical calibration image retains fewer than two combinations of grid rows and columns, the configuration to be verified is not written to the candidate configuration list. Candidate configuration numbers are generated in ascending order of historical calibration record identifier, X, and Y.

[0029] The candidate configurations for the current batch are read sequentially by serial number. The total number of plastic granules is divided by the maximum granule capacity and rounded up to form the lower limit of the total number of basic detection grids. The longitudinal and transverse dimensions of the detection field of view are divided by the corresponding minimum dimensions and rounded down to form the upper limit of the number of candidate grid rows and columns. Grid rows and columns are combined within the corresponding upper limits, and combinations where the product of the number of rows and columns is less than the lower limit of the total number, the number of grid rows is not greater than X, or the number of grid columns is not greater than Y are deleted.

[0030] Divide the detection field of view equally according to the remaining combinations to form the basic detection grid boundaries, row arrangement order, and column arrangement order. Establish a unique particle affiliation based on the centroid position of the contour; internal boundaries follow the rule that the left and upper boundaries contain the particle, while the right and lower boundaries do not, with the rightmost and bottommost boundaries contained within their corresponding outermost basic detection grids. Count the number of grid particles and delete combinations where the number of grid particles exceeds the particle capacity limit. Calculate the absolute difference between the grid row / column ratio and the horizontal / vertical aspect ratio of the detection field of view, and arrange them in ascending order of absolute difference, row / column product, grid row count, and grid column count. Select the first two groups to form the first and second row / column number combinations; if fewer than two combinations are retained, delete the temporary record associated with the current candidate configuration number and read the next candidate configuration.

[0031] The summation of particle size data is used as the size aggregation method. For each basic detection grid in the two sets of row and column combinations, the assigned particle size data is aggregated to form grid size data. Empty grids are recorded as 0mm, and grid boundary records, particle assignment records, and grid size data records are generated.

[0032] For each combination of rows and columns, a detection area is formed by a continuous X-row, Y-column basic detection grid. The movable position is represented by the row and column arrangement of the basic detection grid at the top left corner of the detection area. The movable position at the top left corner is determined as the starting detection area. The detection area is moved back and forth horizontally and vertically, forming an initial movement sequence that traverses all movable positions. This initial movement sequence is then copied to form the current movement sequence.

[0033] The coverage grid sets corresponding to adjacent positions in the current movement sequence are compared sequentially. A change of 1 grid in the column arrangement order forms a horizontal coverage status change record, and a change of 1 grid in the row arrangement order forms a vertical coverage status change record; for the same basic detection grid in the same direction, only the first change position and type in the current movement sequence after the update are recorded.

[0034] The basic detection grid that has neither formed a coverage change record nor a coverage maintenance record in the horizontal or vertical direction is selected. All adjacent movable position pairs in the missing direction are read, and the position pairs where the coverage status of the grid differs in the two positions are identified as candidate change position pairs. When candidate change position pairs exist, all sequence positions of the two movable positions in the position pair in the current movement sequence are read. The smallest sequence position is identified as the candidate insertion sequence position and the candidate insertion position, and the other position is identified as the candidate adjacent position. The former is moved to the latter and then returned to form a candidate supplementary movement segment. When no candidate change position pairs exist, the basic detection grid identifier, missing direction, all adjacent position pairs, and the result of maintaining coverage or maintaining non-coverage are written into the coverage maintenance record.

[0035] For each candidate supplementary moving segment, it is temporarily inserted after the candidate insertion sequence position to form a temporary moving sequence; temporary horizontal and vertical coverage status change records are formed according to the temporary moving sequence, and the number of basic detection grids added in the corresponding direction relative to the current record is counted.

[0036] For each movable position in the current move sequence and the temporary move sequence, subtract 1 from the count of that movable position in the corresponding sequence, and record any result less than 0 as 0, to form the repetition count of that movable position in the corresponding sequence. Subtract the sum of the repetition counts of all movable positions in the temporary move sequence from the sum of the repetition counts of all movable positions in the current move sequence to form the number of repetitive movable positions in the candidate supplementary move segment. Then delete the temporary move sequence and the temporary record.

[0037] The candidate replacement segments are arranged in descending order of the number of basic detection grids for newly added coverage status changes. If the number of grids is the same, they are arranged in ascending order of the number of repeated movable positions. If they are still the same, they are arranged in ascending order of the candidate insertion sequence position, the row arrangement order of the candidate adjacent positions, and the column arrangement order. The candidate replacement segments that appear first in the list are then inserted into the current movement sequence. After insertion, the records are cleared and the two types of coverage status change records are re-formed based on the updated current movement sequence. Unselected candidate replacement segments are re-formed in the next round.

[0038] Repeat the process until each basic detection grid forms a coverage status change record or a coverage status maintenance record in both the horizontal and vertical directions. At least one missing direction record is added in each round; basic detection grids that have already formed records for that direction no longer participate in that direction's processing. Then, starting from the end position of the current movement sequence, return to the starting detection region grid by grid in the reverse order of the initial movement sequence, forming a detection region movement record.

[0039] For each combination of rows and columns, if a basic detection grid with at least two grid particles exists, it is retained; otherwise, the basic detection grid with the largest number of grid particles is retained. Median values ​​are arranged in ascending order: the median value is taken when the number of particles is odd, and the average of the two median values ​​is taken when the number is even. The median value for the retained grid particle count is then calculated. The absolute difference between the number of particles in each grid and this median value is used as the quantity deviation. Basic detection grids with quantity deviations not exceeding the median of all quantity deviations are retained, forming a set of grids with stable quantity.

[0040] For each base detection grid in the stable grid set, the average horizontal and vertical coordinates of the internal contour centroid position are calculated to form the particle position centroid; the distance from the centroid to the four grid boundaries is calculated, and the minimum value is used to form the centroid boundary distance; the straight-line distance from each contour centroid position to the particle position centroid is calculated, and the median value is used to form the particle position discrepancy. These are then sorted in ascending order of quantity deviation, descending order of centroid boundary distance, ascending order of particle position discrepancy, and ascending order of row and column arrangement, with the first item determined as the reference base detection grid.

[0041] Read all position pairs in the movable position set that have the same row order and differ by 1 in column order. Compare the basic detection grid sets covered by the two detection areas. Write X consecutive basic detection grids that exist only in one set and are located in the same column into the horizontal grid band record. Read all position pairs that have the same column order and differ by 1 in row order, and write Y consecutive basic detection grids in the same row into the vertical grid band record in the same way. The grid band record includes a unique identifier, the identifier of the basic detection grid it contains, the row or column it is in, and the starting row or column order. Records with the same content only retain the first formed item.

[0042] For two horizontal grid bands with the same column order and a starting row order difference of 1, if they share X-1 basic detection grids and each contains one differential basic detection grid not included in the other grid band, a unique horizontal grid band replacement relationship record is formed, and two horizontal grid band identifiers, a shared basic detection grid identifier, and two differential basic detection grid identifiers are written. For two vertical grid bands with the same row order and a starting column order difference of 1, a vertical grid band replacement relationship record is formed in the same way. The current step does not determine the order of the differential basic detection grids, the first grid band, the second grid band, or the replacement direction.

[0043] Read the row and column arrangement order of the reference base detection grid. Write all horizontal grid bands in the same column into the set of horizontal grid bands to be inspected. Initialize the horizontal grid bands containing the reference base detection grid according to their identifiers from smallest to largest, writing them into the set of horizontally connected grid bands and the horizontal connection order record. The initialization item does not record the identifier of the previous grid band or the identifier of the relationship record. Replace the relationship record identifiers of the horizontal grid bands to be established from smallest to largest, repeatedly reading relationships where one end is connected and the other end is not. Write the other end into the set of horizontally connected grid bands, and write the identifier of the previous grid band, the identifier of the relationship record, and the initial connection order into the horizontal connection order record; do not modify when reaching the same location repeatedly. When all horizontal grid bands to be inspected are written into the set, a horizontally connected record is formed.

[0044] Write all vertical grid bands that are the same in the same row into the set to be checked, and form the vertically connected set, the vertical connection order record, and the vertical connected record in the same way. When both the horizontal and vertical connected records are formed, the combination of the current row and column numbers satisfies the connectivity condition.

[0045] If only one set of row and column combinations satisfies the connectivity condition, the row and column combination that satisfies the connectivity condition is determined as the target row and column combination, and the other set is determined as the cross-validation row and column combination; if both sets of row and column combinations satisfy the connectivity condition, the row and column combination that was originally ranked first is determined as the target row and column combination, and the other set is determined as the cross-validation row and column combination.

[0046] When at least one combination of rows and columns satisfies the connectivity condition, the current batch configuration is determined and a current batch configuration identifier is formed. Reading of other candidate configurations is stopped. The historical calibration record identifier, candidate configuration sequence number, current batch configuration identifier, target row and column combination identifier, cross-check row and column combination identifier, and preset size summary method are written into the processing result record of step one. The grid boundary, particle affiliation, grid size data, detection area movement, reference base detection grid, horizontal grid band, vertical grid band, replacement relationship of grid band to be established, horizontal connection order, vertical connection order, and connectivity record corresponding to the target row and column combination are written into the processing result record of step one. At the same time, the grid boundary, particle affiliation, and grid size data corresponding to the cross-check row and column combination are written.

[0047] If neither of the two sets of row and column combinations satisfies the connectivity condition, delete the following records associated with the current candidate configuration number: grid boundary record, particle affiliation record, grid size data record, detection area movement record, coverage status change record, coverage status maintenance record, grid strip record, grid strip replacement relationship record to be established, connection order record, and connectivity record. Then, read the next candidate configuration. If all candidate configurations have been processed and no current batch configuration has been formed, a configuration mismatch record is generated, and the current detection batch ends.

[0048] The particle base data record and the mesh size data record are stored separately and each uses its own record identifier. Subsequent steps read back data from the particle base data record and the mesh size data record respectively, without regenerating or overwriting one record with the other; step three performs a consistency check on the corresponding size data in the two records.

[0049] Step 2: Extract two unidirectional grid bands and establish grid band replacement relationships; the two horizontal grid bands share X-1 basic detection grids, and the two vertical grid bands share Y-1 basic detection grids, and each contains one differential basic detection grid; Specifically, the target row and column number combination identifier is read from the processing result record of step one, and the corresponding grid boundary record, horizontal grid band record, vertical grid band record, horizontal grid band replacement relationship record, and vertical grid band replacement relationship record are read. This step does not change the basic detection grid boundary, grid band composition, particle affiliation relationship, grid size data, or reference basic detection grid formed in step one.

[0050] The location data, including lateral and longitudinal coordinates, is read from the particle basic data record. The increasing direction of the lateral coordinates is determined as the increasing direction of the grid column coordinates, and the increasing direction of the longitudinal coordinates is determined as the increasing direction of the grid row coordinates. The row and column order of each basic detection grid in the grid boundary record is read, and the row order is used as the grid row coordinates, and the column order as the grid column coordinates. The target row / column combination identifier, the basic detection grid identifier, the grid row coordinates, and the grid column coordinates are written into the basic detection grid coordinate record. Following the row order from top to bottom in the detection field of view, the grid row coordinate of the topmost basic detection grid is set to 1, and then incremented by 1 sequentially along the longitudinal direction. Following the column order from left to right in the detection field of view, the grid column coordinate of the leftmost basic detection grid is set to 1, and then incremented by 1 sequentially along the lateral direction. Both the grid row and column coordinates are dimensionless integers.

[0051] Read all horizontal and vertical records of grid replacement relationships to be established, and initialize the number of anomalies to 0. During the review process, only shared and differential basic detection grids are calculated; no formal grid replacement relationship records are generated.

[0052] According to the horizontal grid replacement relationship record identifiers in ascending order, read the two horizontal grid identifiers in each horizontal grid replacement relationship record, and read the basic detection grid identifiers contained in the two horizontal grids from the horizontal grid record respectively, forming a basic detection grid set corresponding to each horizontal grid identifier.

[0053] The basic detection grid identifier that exists in two basic detection grid sets simultaneously is identified as the shared basic detection grid identifier; the shared basic detection grid identifier is deleted from each basic detection grid set, and the remaining basic detection grid identifier is identified as the differential basic detection grid identifier of the corresponding horizontal grid band.

[0054] When the number of shared basic detection grids is X-1, and the number of differential basic detection grids corresponding to the two horizontal grid bands is 1, the number of verification anomalies remains unchanged; if any of the numbers is not met, the number of verification anomalies is increased by 1, and the target row and column number combination identifier, the current horizontal grid band replacement relationship record identifier, the two horizontal grid band identifiers, the actual shared basic detection grid identifiers and quantities, and the actual differential basic detection grid identifiers and quantities corresponding to each horizontal grid band are immediately written into the grid band replacement relationship verification anomaly record.

[0055] According to the vertical grid replacement relationship record identifiers in ascending order, read the two vertical grid identifiers in each vertical grid replacement relationship record, and read the basic detection grid identifiers contained in the two vertical grids from the vertical grid record respectively, forming a basic detection grid set corresponding to each vertical grid identifier.

[0056] The basic detection grid identifier that exists in two basic detection grid sets simultaneously is identified as the shared basic detection grid identifier; the shared basic detection grid identifier is deleted from each basic detection grid set, and the remaining basic detection grid identifier is identified as the differential basic detection grid identifier of the corresponding vertical grid band.

[0057] When the number of shared basic detection grids is Y-1, and the number of differential basic detection grids corresponding to the two vertical grid bands is 1, the number of verification anomalies remains unchanged; if any number is not met, the number of verification anomalies is increased by 1, and the target row and column number combination identifier, the current vertical grid band replacement relationship record identifier, the two vertical grid band identifiers, the actual shared basic detection grid identifier and quantity, and the actual differential basic detection grid identifier and quantity corresponding to each vertical grid band are immediately written into the grid band replacement relationship verification anomaly record.

[0058] After reviewing all records of mesh replacement relationships to be established, compare the number of reviewed anomalies with 0. If the number of reviewed anomalies is greater than 0, end the current step, do not generate mesh replacement relationship records or mesh replacement direction records, and the current inspection batch will not proceed to subsequent steps.

[0059] When the number of verified anomalies is 0, the replacement relationship records of each grid band to be established are read again in ascending order of horizontal grid band replacement relationship record identifiers and vertical grid band replacement relationship record identifiers. The shared basic detection grid identifier and the differential basic detection grid identifier corresponding to each grid band are re-formed according to the aforementioned set intersection and set deletion methods.

[0060] A unique grid strip replacement relationship identifier is formed according to the reading order. When the current reading object is a horizontal grid strip replacement relationship record to be established, the relationship type is determined to be a horizontal grid strip replacement relationship; when the current reading object is a vertical grid strip replacement relationship record to be established, the relationship type is determined to be a vertical grid strip replacement relationship.

[0061] Write the grid band replacement relationship identifier, target row and column number combination identifier, relationship type, grid band replacement relationship record identifier to be established, two unidirectional grid band identifiers, and shared basic detection grid identifier into the grid band replacement relationship record; write each differential basic detection grid identifier and the unidirectional grid band identifier containing that differential basic detection grid into the grid band replacement relationship record in pairs.

[0062] For each grid replacement relationship record, read two differential basic detection grid identifiers and read the corresponding grid row coordinates and grid column coordinates from the basic detection grid coordinate record.

[0063] When the relationship type is a horizontal grid band replacement relationship, the two difference detection grids are arranged in ascending order of grid column coordinates; if the grid column coordinates are the same, they are arranged in ascending order of grid row coordinates. When the relationship type is a vertical grid band replacement relationship, the two difference detection grids are arranged in ascending order of grid row coordinates; if the grid row coordinates are the same, they are arranged in ascending order of grid column coordinates.

[0064] The difference detection grid that appears first in the sequence is designated as the first difference detection grid, and the difference detection grid that appears later in the sequence is designated as the second difference detection grid. Based on the paired data written in the grid band replacement relationship record, the co-directional grid band containing the first difference detection grid is designated as the first grid band, and the co-directional grid band containing the second difference detection grid is designated as the second grid band.

[0065] The direction from the first grid band to the second grid band is defined as the grid band replacement direction. In the horizontal grid band replacement relationship, the grid band replacement direction is the direction from the grid row coordinate of the first difference base detection grid to the grid row coordinate of the second difference base detection grid; in the vertical grid band replacement relationship, the grid band replacement direction is the direction from the grid column coordinate of the first difference base detection grid to the grid column coordinate of the second difference base detection grid.

[0066] Each grid band replacement relationship forms a grid band replacement direction record. The grid band replacement relationship identifier is used as the grid band replacement direction record identifier, and the relationship type, the first difference base detection grid identifier, the second difference base detection grid identifier, the first grid band identifier, the second grid band identifier, and the grid band replacement direction are written into the grid band replacement direction record.

[0067] In a specific set of implementation data, the position of the basic detection grid is represented by "(grid row coordinates, grid column coordinates)". The target row and column combination includes 4 rows and 5 columns of basic detection grids, X=2, Y=2. The horizontal grid band H1 includes (1,3) and (2,3), and the horizontal grid band H2 includes (2,3) and (3,3). The shared basic detection grid is (2,3), and the shared quantity is 1, which is equal to X-1. The differential basic detection grids are (1,3) and (3,3), and their grid column coordinates are both 3. According to the grid row coordinates arranged from small to large, (1,3) is determined as the first differential basic detection grid, and (3,3) is determined as the second differential basic detection grid. H1 and H2 are determined as the first grid band and the second grid band, respectively. The grid band replacement direction is the direction of increasing grid row coordinates.

[0068] The longitudinal grid band V1 includes (2,1) and (2,2), and the longitudinal grid band V2 includes (2,2) and (2,3). The shared basic detection grid is (2,2), and the number of shared grids is 1, which is equal to Y-1. The differential basic detection grids are (2,1) and (2,3). According to the grid column coordinates arranged from small to large, (2,1) is determined as the first differential basic detection grid, and (2,3) is determined as the second differential basic detection grid. The grid band replacement direction is determined as the direction of increasing grid column coordinates.

[0069] After completing the processing of all mesh band replacement relationships, this step generates a basic detection mesh coordinate record, a mesh band replacement relationship record, and a mesh band replacement direction record. Subsequent steps read the shared basic detection mesh, the first differential basic detection mesh, the second differential basic detection mesh, the first mesh band, the second mesh band, and the mesh band replacement direction according to the mesh band replacement relationship identifier, without changing the arrangement order and corresponding results generated in this step.

[0070] Step 3: Summarize the particle size data and grid size data to form the direct size value and reconstructed size value of the grid band, compare them to form the difference of the directional grid band, and form the grid band replacement difference from the difference of the same directional grid band; verify with reference to the basic detection grid, and set the data transfer difference that has passed the verification to zero; Specifically, before generating the grid size data in step one, the particle size data of the determined plastic particles will be summed to determine the preset size summary method, and the preset size summary method will be written into the processing result record of step one. This preset size summary method will be used when generating the grid size data in step one and when generating the direct size value and cross-check size data of the grid strip in this step, without rounding individual particle size data or summation results.

[0071] After the corresponding historical calibration records and candidate configuration lists are formed, and before processing the current detection batch, a range of allowable size data consistency is established. For each historical calibration image in the same historical calibration record, the generation of row and column number combinations, unique particle attribution, screening of two sets of row and column number combinations, and selection rules for the reference base detection grid are followed to form historical target row and column number combinations, historical cross-check row and column number combinations, historical reference base detection grid, and historical grid size data.

[0072] Read the grid boundaries of the historical reference base detection grid, and read the grid boundaries of each base detection grid in the historical cross-check row and column combination. Calculate the historical common coverage area according to the common coverage area calculation method specified in this step. Based on the centroid position of the historical plastic particles' outlines, uniquely write the identifiers of plastic particles falling into each historical common coverage area into the historical cross-check particle set. Summate the particle size data in the historical cross-check particle set to form the historical cross-check size data.

[0073] The historical reference grid verification difference is generated by subtracting the historical grid size data corresponding to the historical reference base detection grid from the historical cross-verification size data. All historical reference grid verification differences corresponding to the same historical calibration record, candidate configuration sequence number, target row and column combination, and cross-verification row and column combination are read. The largest absolute value is taken as the allowable value for size data consistency, and its negative and positive values ​​form the lower and upper limits of the allowable range for size data consistency.

[0074] The historical calibration record identifier, candidate configuration sequence number, target row and column combination, cross-check row and column combination, allowable value for dimensional data consistency, and allowable range for dimensional data consistency are written into the allowable range record for dimensional data consistency. If no historical reference grid verification difference is generated, a record for missing allowable range for dimensional data consistency is generated.

[0075] When the current batch of tests enters this step, it reads the historical calibration record identifier, candidate configuration sequence number, target row and column combination identifier, cross-check row and column combination identifier, and preset size summarization method from the processing result record in Step 1. Based on the row and column numbers of the target row and column combination and the cross-check row and column combination, it reads the uniquely matching size data consistency allowable range record. If no match is found, this step ends, and the current batch of tests does not proceed to subsequent steps.

[0076] Read the particle basic data record, the grid boundary record of the target row and column number combination, the grid size data record, as well as the grid band replacement relationship record and grid band replacement direction record formed in step two.

[0077] For each grid strip replacement relationship record, the basic detection grid identifiers contained in the first and second grid strips are read respectively. The location range enclosed by the boundary of each basic detection grid and conforming to the boundary attribution rule in step one is determined as the coverage range of the corresponding basic detection grid. The union of the coverage ranges of all basic detection grids contained in the same grid strip is determined as the grid strip coverage range.

[0078] The system reads back the plastic particle identifier, outline centroid position, and particle size data one by one from the particle base data record. When the outline centroid position is within the coverage area of ​​the current grid zone, the corresponding plastic particle identifier and particle size data are written to the particle set of the current grid zone. The same plastic particle identifier is written only once. The particle size data in the particle set of the current grid zone are summed to form the direct size value of the grid zone.

[0079] Based on the identifiers of the basic detection grids included in the current grid band, the currently stored grid size data of each basic detection grid is read back from the grid size data record, and summed to form the reconstructed size value. The direct size value of the grid band uses the particle basic data record as the data source, while the reconstructed size value uses the grid size data record as the data source. The two sets of data are read back independently from different records. This step is used to verify the data consistency between the two types of records, without assuming that the direct size value of the grid band and the reconstructed size value must be equal, nor does it overwrite the other record with the result of one calculation.

[0080] The directional grid zone difference is generated by subtracting the reconstructed dimension value from the direct dimension value of the grid zone. The grid zone replacement relationship identifier, grid zone identifier, direct dimension value, reconstructed dimension value, and directional grid zone difference value are then written into the directional grid zone difference record, all in mm. A directional grid zone difference of 0 mm indicates that the two types of records are consistent within the current grid zone; a difference of non-0 mm indicates that there are dimensional differences between the two types of records within the current grid zone.

[0081] According to the grid band replacement direction record, read the direction grid band difference between the first and second grid bands in the same grid band replacement relationship, subtract the direction grid band difference of the first grid band from the direction grid band difference of the second grid band to form the grid band replacement difference, and write it into the grid band replacement difference record.

[0082] After completing the replacement difference of all grid bands, read the reference base detection grid identifier, corresponding grid boundary and grid size data, and read the grid boundary of each base detection grid in the cross-verification row and column combination.

[0083] For each cross-checking baseline detection grid, a candidate common coverage area is formed by its left boundary maximum value, right boundary minimum value, upper boundary maximum value, and lower boundary minimum value with respect to the reference baseline detection grid. If the left boundary of the candidate common coverage area is smaller than the right boundary and the upper boundary is smaller than the lower boundary, the cross-checking baseline detection grid identifier and the four boundaries are written into the common coverage area record; otherwise, no corresponding record is formed.

[0084] Initialize the cross-check particle set to an empty set. Read the common coverage area records according to the row and column order of the cross-check basic detection grid, and compare the centroid position of the plastic particle outline with the boundary of the common coverage area one by one. If the outline centroid position is within the common coverage area and the corresponding plastic particle identifier has not yet been written to the cross-check particle set, write the plastic particle identifier and particle size data to the cross-check particle set; if it has already been written, do not write it again.

[0085] Read back the particle size data of each plastic particle in the cross-checked particle set from the particle basic data record, and perform summation according to the preset size summary method to form cross-checked size data; when the cross-checked particle set is empty, record the cross-checked size data as 0mm.

[0086] Based on the reference baseline detection grid identifier, the currently stored grid size data of the reference baseline detection grid is read back from the grid size data record corresponding to the target row and column combination. The reference grid verification difference is formed by subtracting the read-back reference baseline detection grid size data from the cross-verification size data. The cross-verification size data uses the particle baseline data record as the data source, and the reference baseline detection grid size data uses the grid size data record as the data source. This step is used to verify the consistency of the two types of records within the coverage area of ​​the reference baseline detection grid.

[0087] In the specific implementation data, the cross-check size data is 9.9 mm, and the reference base detection grid size data read back in the grid size data record is 9.8 mm, with a reference grid check difference of 0.1 mm. This difference indicates a data discrepancy of 0.1 mm between the two types of records, and does not indicate that different results were obtained by performing the same summation twice based on the same data.

[0088] When the reference grid verification difference is within the allowable range for dimensional data consistency, a verification pass record is generated, and the reference base inspection grid identifier, verification pass record identifier, and data transfer difference value of 0mm are written to the reference base inspection grid record. When the reference grid verification difference exceeds the allowable range for dimensional data consistency, a verification fail record is generated, and the cross-verification dimensional data, the corresponding grid dimensional data of the reference base inspection grid, and the reference grid verification difference are written to the record. No data transfer difference is generated, and the current inspection batch does not proceed to subsequent steps.

[0089] In a specific set of implementation data, the target row and column combination includes a 4-row, 5-column basic detection grid, with X=2 and Y=2. The horizontal grid band H1 includes the basic detection grids (1,3) and (2,3), and the horizontal grid band H2 includes the basic detection grids (2,3) and (3,3). The two share the basic detection grid (2,3) and form a grid band replacement relationship.

[0090] In a specific set of implementation data, the particle size data of each plastic particle within the coverage area of ​​H1 is read back from the particle basic data record and summed to form the direct size value of the grid band, which is 9.90 mm; the grid size data of the two basic detection grids contained in H1, which are 4.94 mm and 4.96 mm, are read back from the grid size data record and summed to form the reconstructed size value of 9.90 mm, with a directional grid band difference of 0 mm.

[0091] Following the same method, the direct size value of the mesh band H2, 10.18 mm, is formed from the particle base data record, and the reconstructed size value of H2, 10.18 mm, is also formed from the mesh size data record. The directional mesh band difference is 0 mm. The mesh band replacement difference from H1 to H2 is 0 mm minus 0 mm, which is 0 mm.

[0092] Referring to the basic detection grid boundaries of 20mm to 40mm horizontally and 20mm to 40mm vertically, the cross-check row and column combinations are divided at 30mm horizontally and 30mm vertically, forming four common coverage areas. Plastic particles with profile centroid positions of (25mm, 25mm) and (37mm, 34mm) fall into the corresponding common coverage areas, with particle sizes of 4.8mm and 5.1mm respectively, and a cross-check size of 9.9mm.

[0093] The reference grid size is 9.9mm, and the reference grid verification difference is 0mm. When the historical reference grid verification difference in the corresponding historical calibration records is 0mm, the allowable value for size data consistency is 0mm, and the allowable range for size data consistency is 0mm to 0mm. If the current reference grid verification difference is within the range, a verification pass record is formed, and the data transmission difference is set to 0mm.

[0094] Step 4: Starting from the reference base detection grid, form a horizontal difference response and a vertical difference response based on the grid band replacement difference along the horizontal and vertical grid band replacement relationship; when both types of difference responses are within the allowable range of size data consistency, or when the directions are consistent and the difference in the difference amount is within the range, form a grid difference fingerprint, and use this to review and correct the grid size data or particle attribution relationship; Specifically, the reference base detection grid, target row and column number combination, grid boundary, grid band replacement relationship, grid band replacement difference, allowable range of size data consistency and data transfer difference are read, and the row order and column order are formed according to the arrangement position of the base detection grid in the target row and column number combination.

[0095] Read X and Y from the current batch configuration, and read the grid row coordinates and grid column coordinates of the reference base detection grid and the candidate base detection grid. If the absolute value of the difference between the grid row coordinates of the candidate base detection grid and the reference base detection grid is divisible by X, and the absolute value of the difference between the grid column coordinates is divisible by Y, then two types of response connection orders are formed for that candidate base detection grid; if either coordinate difference does not meet the requirements, it is not used as a candidate base detection grid for the current response propagation.

[0096] When forming the lateral response connection order, first keep the grid row coordinates unchanged, and then increase or decrease the grid column coordinates by Y along the candidate basic detection grid direction each time until the column containing the candidate basic detection grid is reached; each move reads the vertical grid band replacement relationship between the two preceding and following basic detection grids as the first and second difference basic detection grids. Then, keep the grid column coordinates unchanged, and then increase or decrease the grid row coordinates by X along the candidate basic detection grid direction each time until the candidate basic detection grid is reached; each move reads the lateral grid band replacement relationship between the two preceding and following basic detection grids as the two difference basic detection grids.

[0097] When forming the vertical response connection order, first keep the grid column coordinates unchanged, and increase or decrease the grid row coordinates by X each time until the row of the candidate basic detection grid is reached, and read the corresponding horizontal grid band replacement relationship; then keep the grid row coordinates unchanged, and increase or decrease the grid column coordinates by Y each time until the candidate basic detection grid is reached, and read the corresponding vertical grid band replacement relationship.

[0098] For each coordinate movement, if only one grid replacement relationship between the two preceding and following basic detection grids is read, the grid replacement relationship identifier is written into the corresponding response connection order; if no grid replacement relationship is read or more than two grid replacement relationships are read, a record of failure of difference response path verification is generated.

[0099] In the minimum implementation data with X=2 and Y=2, the reference basic detection grid is (1,1), and the candidate basic detection grid is (3,3). The lateral response connection order is (1,1)→(1,3)→(3,3), and the vertical grid replacement relationship and the lateral grid replacement relationship are read sequentially; the vertical response connection order is (1,1)→(3,1)→(3,3), and the lateral grid replacement relationship and the vertical grid replacement relationship are read sequentially. When only one corresponding relationship is read, the relationship is written into the corresponding response connection order; when no relationship is read or more than two relationships are read, a difference response path verification failure record is formed, and the candidate basic detection grid identifier, response direction, current basic detection grid identifier, next basic detection grid identifier, matched grid replacement relationship identifier, and failure reason are written into the record, and the candidate basic detection grid is no longer processed.

[0100] When both types of response connections are complete, the initial response is the data transfer difference from the reference base detection grid. The grid band replacement differences are read item by item according to the connection order of the two types of responses. The values ​​are added when pointing from the first difference base detection grid to the second difference base detection grid, and subtracted when pointing in the opposite direction. After each calculation, the response direction, connection position, grid band replacement relationship identifier, current base detection grid identifier, next base detection grid identifier, and the difference response of the next base detection grid are written to the difference response record.

[0101] After all relationships in the connection order of the two types of responses have been calculated, the corresponding basic detection grid is determined as the basic detection grid to be judged, and the transverse difference response and longitudinal difference response formed by the connection order of the two types of responses and the end are written into the record of the basic detection grid to be judged. If any relationship lacks a grid band replacement difference or the addition / subtraction direction cannot be determined, a record of difference response path verification failure is formed, and it is uncertain whether it is the basic detection grid to be judged.

[0102] In this step, the mesh band substitution relationships used and written into the transverse response connection order when forming the transverse difference response are collectively referred to as the mesh band substitution relationships used in the transverse response; the mesh band substitution relationships used and written into the longitudinal response connection order when forming the longitudinal difference response are collectively referred to as the mesh band substitution relationships used in the longitudinal response. These designations are used to distinguish the response formation paths in which the relationships participate, and do not change the relationship type of the transverse or longitudinal mesh band substitution relationships written in step two.

[0103] Following the reverse order of the grid band replacement relationship identifiers in the lateral response connection sequence, the grid band replacement relationships used in the lateral response are read item by item from the base detection grid to be judged to the reference base detection grid; following the reverse order of the grid band replacement relationship identifiers in the longitudinal response connection sequence, the grid band replacement relationships used in the longitudinal response are read item by item. When the grid band replacement difference is first satisfied within the allowable range of dimensional data consistency, the differential base detection grid on the side closer to the reference base detection grid is not the reference base detection grid, and its corresponding directional difference response is within the stated range, a selected grid band replacement relationship for the corresponding direction is formed.

[0104] The number of grid band replacement relationships contained from the selected relationship to the end of the corresponding response connection sequence is determined as the interval number. When both the horizontal and vertical directions form a selected relationship, the interval number is the same, and the two adjacent side difference base detection grids are different, the difference response in the corresponding directions is used as the horizontal reference value and the vertical reference value, respectively; otherwise, the data transfer difference of the reference base detection grid is used.

[0105] The lateral relative difference and the longitudinal relative difference are formed by subtracting the corresponding reference value from the two types of difference responses, respectively. The direction is determined to be consistent when both relative differences are greater than the upper limit of the allowable range or both are less than the lower limit of the allowable range. The difference in magnitude is formed by subtracting the absolute value of the longitudinal difference response from the absolute value of the lateral difference response.

[0106] When both types of difference responses are within the allowable range of dimensional data consistency, or when the directions are consistent and the difference in the amount of difference is within the range, a unique grid difference fingerprint identifier is formed according to the row and column order of the basic detection grid to be judged. The grid difference fingerprint identifier, the basic detection grid to be judged, the horizontal response connection order, the vertical response connection order, the horizontal difference response, the vertical difference response, the horizontal reference value, the vertical reference value, the horizontal relative difference, the vertical relative difference, the direction judgment result, and the difference in the amount of difference are written into the grid difference fingerprint record. If the conditions are not met, a grid difference fingerprint verification failure record is formed, and the basic detection grid to be judged, the two types of difference responses, the two types of reference values, the two types of relative differences, the direction judgment result, and the difference in the amount of difference are written into the record.

[0107] Before performing particle attribution verification, the current particle attribution relationship and mesh size data are copied to form baseline particle attribution relationship and baseline mesh size data. All mesh difference fingerprints are calculated independently based on the same baseline data, and the actual data is not updated until all calculations are completed.

[0108] For each grid difference fingerprint, the location data, particle size data, and reference particle affiliation relationship of the plastic particles within the base detection grid to be judged and the base detection grid sharing its boundary or vertices are read. The base detection grid is re-determined based on the centroid position of the contour; if it cannot be uniquely determined, a record of failed position affiliation verification is generated, and the identifier of the base detection grid to be judged, the grid difference fingerprint identifier, the plastic particle identifier, the centroid position of the contour, the matching result, and the reason for failure are written, and the affiliation trial calculation of the current base detection grid to be judged is stopped.

[0109] When the redefined basic detection grid is inconsistent with the original basic detection grid in the reference particle attribution relationship, read the row and column positions of the original basic detection grid and the redefined basic detection grid.

[0110] When the column order changes, and one of the original or redefined basic detection grids becomes the basic detection grid to be judged, the corresponding plastic particle is written into the horizontal particle set to be verified. When the row order changes, and one of the original or redefined basic detection grids becomes the basic detection grid to be judged, the corresponding plastic particle is written into the vertical particle set to be verified. The identifier of the basic detection grid to be judged, the plastic particle identifier, the particle size data, the identifier of the original basic detection grid, and the identifier of the redefined basic detection grid are written respectively.

[0111] The baseline particle assignment relationships are copied to form horizontal and vertical trial particle assignment relationships. During the horizontal trial, only the horizontal particles to be verified are assigned to the newly determined basic detection grid; during the vertical trial, only the vertical particles to be verified are assigned to the newly determined basic detection grid; the remaining plastic particles retain the baseline particle assignment relationships.

[0112] The unadjusted grid size data of the basic detection grid to be judged is generated based on the baseline particle attribution relationship. The adjusted grid size data is generated laterally and vertically based on both horizontal and vertical particle attribution relationship calculations. The horizontal attribution change is calculated by subtracting the unadjusted grid size data from the adjusted grid size data, and the vertical attribution change is calculated by subtracting the unadjusted grid size data from the adjusted grid size data. When the corresponding particle set to be verified is empty, the adjusted grid size data equals the unadjusted grid size data, and the corresponding attribution change is 0 mm.

[0113] When both the lateral assignment change and the lateral relative difference are greater than 0 mm or both are less than 0 mm, the lateral direction is determined to be the same; when either value is equal to 0 mm or the two values ​​have different signs, the lateral direction is determined to be different. The longitudinal assignment change and the longitudinal relative difference are used to determine the longitudinal direction according to the same rules.

[0114] The difference in horizontal attribution is calculated by subtracting the absolute value of the horizontal relative difference from the absolute value of the horizontal attribution change; the difference in vertical attribution is calculated by subtracting the absolute value of the vertical relative difference from the absolute value of the vertical attribution change.

[0115] When the lateral direction is the same and the difference in lateral assignment is within the allowable range for dimensional data consistency, and the longitudinal direction is the same and the difference in longitudinal assignment is within the same range, a particle assignment correction record is formed; if both conditions are not met, no corresponding particle assignment correction record is formed and the baseline particle assignment relationship is retained.

[0116] After calculating the lateral and vertical attribute changes of the current basic detection grid to be judged, delete the lateral and vertical trial particle attribute relationships. When a record of failed location attribute verification is generated, delete the set of particles to be verified that has been formed but not yet completed for the current basic detection grid to be judged, the re-determined results, and the trial particle attribute relationships. The deleted data will not be included in the subsequent summary of particle attribute correction records.

[0117] When generating particle attribution correction records, the following information is written into the particle attribution correction records: grid difference fingerprint identifier, basic detection grid identifier to be judged, plastic particle identifier, benchmark attribution basic detection grid identifier, newly determined basic detection grid identifier, and the source type of the corresponding plastic particle belonging to the horizontal particle set to be verified, the vertical particle set to be verified, or both sets.

[0118] After all trial calculations are completed, the particle attribution correction records are summarized according to the plastic particle identification. When the redefined basic detection grid corresponding to the same plastic particle is the same, the corresponding particle attribution correction records are merged, and all source basic detection grid identifications are retained.

[0119] When the same plastic particle corresponds to two or more different redefined basic detection grids, a particle attribution conflict verification failure record is generated. The plastic particle identifier, the identifier of each redefined basic detection grid and the identifier of the basic detection grid to be judged from its source are written into the record. Then, all particle attribution correction records formed by the basic detection grids to be judged from each source are deleted. The deleted records do not participate in the formation of the current particle attribution relationship.

[0120] Based on the baseline particle attribution relationship, and according to the remaining particle attribution correction records, the basic detection grid for the corresponding plastic particle attribution is updated to a newly determined basic detection grid, thus forming the current particle attribution relationship.

[0121] The set of basic detection grids involved is formed by removing duplicates from the basic detection grids to be judged, the horizontal particles to be verified, and the vertical particles to be verified, as well as the base detection grids to be redefined and the base detection grids to be redefined in the remaining particle assignment correction records.

[0122] Based on the current particle affiliation and the preset size aggregation method, the particle size data belonging to each basic detection grid in the relevant basic detection grid set are aggregated to form the reconstructed grid size data. The corresponding baseline grid size data is then subtracted from the reconstructed grid size data to form the grid size update difference.

[0123] When the mesh size update difference is less than the lower limit of the allowable range for size data consistency or greater than the upper limit of the allowable range for size data consistency, the corresponding mesh size data is regenerated and updated; when the mesh size update difference is within the allowable range for size data consistency, the corresponding reference mesh size data is retained. The updated mesh size data or the retained reference mesh size data is determined as the current valid mesh size data for the corresponding basic detection mesh.

[0124] Step 5: Write the data that passed and failed the verification into the dimensional data set and the record to be reviewed, respectively; Specifically, the candidate basic detection grid identifiers in the records of failed difference response path verification are read, the basic detection grid identifiers to be judged in the grid difference fingerprint records are read, and the basic detection grid identifiers associated with the records of failed grid difference fingerprint verification, failed location attribution verification, and failed particle attribution conflict verification are read, and then processed item by item after deduplication.

[0125] When a record of a failed differential response path verification is generated, all records of failed differential response path verification are summarized according to the candidate basic detection grid identifier. The candidate basic detection grid identifier, the response direction corresponding to each record, the current basic detection grid identifier, the next basic detection grid identifier, the identifier of the matched grid band replacement relationship, and the reason for failure are written into a record to be reviewed.

[0126] When a record of failing the grid difference fingerprint verification is generated, the corresponding record is summarized according to the basic detection grid identifier to be judged, and the basic detection grid identifier to be judged, the horizontal difference response, the vertical difference response, the horizontal reference value, the vertical reference value, the horizontal relative difference, the vertical relative difference, the direction judgment result, and the difference in the difference amount are written into a record to be reviewed.

[0127] When a location attribution verification fails, the corresponding records are summarized according to the basic detection grid identifier to be judged, and the basic detection grid identifier to be judged, the grid difference fingerprint identifier, the plastic particle identifier, the centroid position of the contour, the matching result, and the reason for failure are written into a record to be reviewed.

[0128] When a record of particle attribution conflict verification fails, all source base detection grid identifiers to be determined are read from the record. For each source base detection grid to be determined, a record to be reviewed is generated and the corresponding grid difference fingerprint identifier, conflicting plastic particle identifier, each re-determined base detection grid identifier and its source base detection grid identifier are written.

[0129] For the basic detection grid to be judged that has not formed any verification failure records and has formed grid difference fingerprint and current valid grid size data, the plastic particles currently belonging to the basic detection grid to be judged are selected according to the current particle belonging relationship. The basic detection grid to be judged, the grid difference fingerprint, the plastic particle identifier of the selected plastic particles, the particle size data, the current particle belonging relationship and the corresponding current valid grid size data are written into a size data set record.

[0130] The same candidate basic detection grid or the basic detection grid to be judged is written into only one of the size data set or the record to be reviewed, based on the final processing result; when there are more than two records of the same type that have failed the verification, they are merged and written into the same record to be reviewed.

[0131] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A method for managing plastic particle size data based on machine vision, characterized in that, include: Step 1: Obtain particle size and location data, divide the basic detection grid according to multiple sets of rows and columns, and form grid size data; The detection area is formed by a continuous X-row, continuous Y-column basic detection grid. The detection area moves horizontally or vertically grid by grid and returns to the starting detection area. The combination of rows and columns of the reference basic detection grid is selected, and the replacement relationship of the horizontal and vertical grids are connected. Step 2: Extract two unidirectional grid bands and establish grid band replacement relationships; the two horizontal grid bands share X-1 basic detection grids, and the two vertical grid bands share Y-1 basic detection grids, and each contains one differential basic detection grid; Step 3: Summarize the particle size data and grid size data to form the direct size value and reconstructed size value of the grid band, compare them to form the difference of the directional grid band, and form the grid band replacement difference from the difference of the same directional grid band; verify with reference to the basic detection grid, and set the data transfer difference that has passed the verification to zero; Step 4: Starting from the reference base detection grid, form a horizontal difference response and a vertical difference response based on the grid band replacement difference along the horizontal and vertical grid band replacement relationship; when both types of difference responses are within the allowable range of size data consistency, or when the directions are consistent and the difference in the difference amount is within the range, form a grid difference fingerprint, and use this to review and correct the grid size data or particle attribution relationship; Step 5: Write the data that passed and failed the verification into the size data set and the record to be reviewed, respectively.

2. The method for managing plastic particle size data based on machine vision according to claim 1, characterized in that, The method for generating multiple sets of row and column numbers and grid size data in step one includes: Read the horizontal dimension of the detection field of view, the vertical dimension of the detection field of view, the total number of plastic particles, the upper limit of the number of particles that can be contained, and the minimum horizontal dimension and the minimum vertical dimension of the basic detection grid. The ratio of the total number of plastic granules to the upper limit of the granule capacity is rounded up to form the lower limit of the total number of basic detection grids. The ratio of the vertical dimension of the detection field to the minimum vertical dimension of the basic detection grid is rounded down to form the upper limit of the number of candidate grid rows. The ratio of the horizontal dimension of the detection field to the minimum horizontal dimension of the basic detection grid is rounded down to form the upper limit of the number of candidate grid columns. Within the upper limit of the number of candidate grid rows and the upper limit of the number of candidate grid columns, form combinations of candidate grid row and column numbers, and delete combinations whose product of row and column numbers is less than the lower limit of the total number of basic detection grids; The basic detection grid is divided according to the remaining combinations. The number of grid particles is counted based on the location data. Combinations in which the number of grid particles does not exceed the upper limit of particle capacity are retained. The grid particles are arranged in ascending order of the absolute difference between the ratio of the number of grid columns to the number of grid rows and the ratio of the horizontal dimension to the vertical dimension of the detection field of view. If the absolute differences are the same, they are arranged in ascending order of the product of the number of rows and columns. The first two groups are selected as the number of rows and columns for multiple groups. The centroid position of each plastic particle is read from the location data. Each plastic particle is uniquely assigned to the corresponding basic detection grid based on the centroid position. The particle size data in each basic detection grid is summarized according to the preset size summary method to form the corresponding grid size data.

3. The method for managing plastic particle size data based on machine vision according to claim 1, characterized in that, Step one, the method of moving the detection area horizontally or vertically grid by grid and returning to the initial detection area, includes: A set of movable positions is formed based on the row and column boundaries of the basic detection grid and the coverage of the detection area. The set of movable positions includes at least two movable positions in both the horizontal and vertical directions. The detection area located at the corner of the movable position set is determined as the initial detection area. The detection area moves back and forth horizontally and advances vertically to form an initial movement sequence, and the initial movement sequence is used as the current movement sequence. Read adjacent movable positions in the current movement sequence in sequence. Based on the movement direction of the detection area, determine the basic detection grid that changes from uncovered to covered or from covered to uncovered. Write the corresponding basic detection grid identifier into the horizontal coverage status change record or the vertical coverage status change record respectively, and write the same identifier only once in the same record. Screen the basic detection grids that have not simultaneously written two types of coverage state change records, determine the movement direction corresponding to the missing records, and determine the candidate insertion positions that can cause the screened basic detection grids to change their coverage state when moving along the movement direction to the adjacent movable position from the current movement sequence. When a candidate insertion position exists, the device moves from the candidate insertion position to the corresponding adjacent movable position and returns to the candidate insertion position, forming a candidate supplementary moving segment; when no candidate insertion position exists, the identifier of the selected basic detection grid is written into the coverage status record of the corresponding moving direction. The candidate supplementary moving segments that have been formed are arranged in descending order of the number of basic detection grids with newly added coverage status change records. If the number is the same, they are arranged in ascending order of the number of repeated movable positions. The candidate supplementary moving segments that are arranged first are selected and inserted into the current moving sequence. Re-establish horizontal and vertical coverage status change records until the identifiers of each basic detection grid are written into the corresponding coverage status change records or coverage status maintenance records in the horizontal and vertical directions, respectively. Following the reverse order of the initial movement sequence, the detection area returns to the starting detection area grid by grid.

4. The method for managing plastic particle size data based on machine vision according to claim 1, characterized in that, Step one, referring to the selection method of the basic detection grid, includes: For each group of rows and columns corresponding to the basic detection grid, the number of grid particles in each basic detection grid is counted. When there is a basic detection grid with a number of grid particles of not less than two, the basic detection grid with a number of grid particles of not less than two is retained; when there is no basic detection grid with a number of grid particles of not less than two, the basic detection grid with the largest number of grid particles is retained; and the median value of the number of grid particles in each retained basic detection grid is formed. Calculate the number deviation of each retained basic detection grid from the median value, and retain the basic detection grids whose number deviation is not greater than the median value of all number deviations to form a set of number-stable grids; The centroid of the particle position is formed based on the position data of plastic particles in each basic detection grid in the stable grid set. The distance from the centroid of the particle position to each boundary of the corresponding basic detection grid is calculated, and the minimum value is taken as the centroid boundary distance. Calculate the distance between the position data of each plastic particle and the centroid of the corresponding particle position, and use the median value of the obtained distance as the particle position discretization; For each set of number of rows and columns corresponding to a stable set of grids, they are arranged in order of increasing quantity deviation, decreasing centroid boundary distance, and increasing particle position dispersion. When the arrangement results are the same, they are arranged in order of increasing row and column order in the corresponding combination of number of rows and columns. The basic detection grid that is arranged first is determined as the reference basic detection grid for the corresponding combination of number of rows and columns.

5. The method for managing plastic particle size data based on machine vision according to claim 1, characterized in that, The method for arranging the differential detection grid in step two includes: Read the horizontal and vertical position coordinates from the position data, determine the direction of increase of the horizontal position coordinates as the direction of increase of the grid column coordinates, determine the direction of increase of the vertical position coordinates as the direction of increase of the grid row coordinates, and form the grid column coordinates and grid row coordinates according to the arrangement order of each basic detection grid in the two increasing directions. Read the differential detection grids contained in each of the two co-directional grid bands, and obtain the grid row coordinates and grid column coordinates of the two differential detection grids; When two grid bands in the same direction are horizontal grid bands, the two differential base detection grids are arranged in ascending order of grid column coordinates. If the grid column coordinates are the same, they are arranged in ascending order of grid row coordinates. When two grid bands in the same direction are vertical grid bands, the two differential base detection grids are arranged in ascending order of grid row coordinates. If the grid row coordinates are the same, they are arranged in ascending order of grid column coordinates. The difference detection grid arranged at the beginning is defined as the first difference detection grid, the difference detection grid arranged at the end is defined as the second difference detection grid, the same-direction grid band containing the first difference detection grid is defined as the first grid band, and the same-direction grid band containing the second difference detection grid is defined as the second grid band. The direction from the first grid band to the second grid band is determined as the grid band replacement direction, and the first grid band, the second grid band, and the grid band replacement direction are written into the grid band replacement direction record.

6. The method for managing plastic particle size data based on machine vision according to claim 2, characterized in that, Step three, referring to the verification method of the basic detection grid, includes: Read the grid boundaries of the reference base detection grid, and read the grid boundaries of each base detection grid from another combination of rows and columns that is different from the combination of rows and columns to which the reference base detection grid belongs; Identify the basic detection grids that share a common coverage area with the reference basic detection grid, and form the common coverage area between each basic detection grid and the reference basic detection grid; Based on the location data, determine the plastic particles whose centroid positions fall within each common coverage area, write the determined plastic particles into the cross-check particle set, and write the same plastic particle only once. The particle size data in the cross-check particle set is summarized according to the preset size summarization method used when forming the grid size data, and the cross-check size data of the reference base detection grid is formed. Calculate the difference between the cross-verification size data and the corresponding grid size data of the reference base detection grid to form the reference grid verification difference; When the verification difference of the reference grid is within the allowable range of dimensional data consistency, a verification pass record is generated, and the data transfer difference of the reference base detection grid is set to zero.

7. The method for managing plastic particle size data based on machine vision according to claim 1, characterized in that, In step four, the determination of the consistency of direction between the lateral and longitudinal difference responses includes: For the basic detection grid to be judged, read the grid band replacement relationship used when forming the lateral and longitudinal difference responses, as well as the connection order from the reference basic detection grid to the basic detection grid to be judged; Read the horizontal and vertical mesh replacement relationships step by step from the base detection mesh to the reference base detection mesh. Select the mesh replacement relationship that first satisfies the condition that the mesh replacement difference is within the allowable range of dimensional data consistency, the difference base detection mesh on the side closer to the reference base detection mesh is not the reference base detection mesh, and the difference response in the corresponding direction is within the allowable range of dimensional data consistency. When both horizontal and vertical grid replacement relationships are selected, and the number of intervals between the two selected grid replacement relationships and the base detection grid to be judged is the same, and the corresponding differential base detection grids are different, the difference response in the corresponding direction of the two differential base detection grids is determined as the horizontal reference value and the vertical reference value, respectively; if this condition is not met, the data transfer difference of the reference base detection grid is determined as the horizontal reference value and the vertical reference value, respectively. Subtract the lateral reference value from the lateral difference response of the basic detection grid to be judged to form the lateral relative difference value; subtract the longitudinal reference value from the longitudinal difference response of the basic detection grid to be judged to form the longitudinal relative difference value. When both the lateral relative difference and the longitudinal relative difference are greater than the upper limit of the allowable range for dimensional data consistency, or both are less than the lower limit of the allowable range for dimensional data consistency, the lateral difference response and the longitudinal difference response are determined to be in the same direction.

8. The method for managing plastic particle size data based on machine vision according to claim 7, characterized in that, Step four, the method for correcting particle attribution and grid size data based on grid difference fingerprint verification, includes: Read the location data, particle size data, and particle affiliation of plastic particles within the basic detection grid to be judged and the basic detection grid that shares grid boundaries or grid vertices with it to form the grid difference fingerprint. Read the centroid position of the contour from the location data and form the row order position and column order position according to the row and column arrangement order of the basic detection grid. Based on the position of the centroid of the profile, the basic detection grid corresponding to each plastic particle is redefined, and plastic particles that are inconsistent with the original particle affiliation are screened. Plastic particles whose column order changes between the original base detection grid and the newly determined base detection grid, and whose one of them is the base detection grid to be judged, are identified as horizontal particles to be verified. Plastic particles whose row order changes, and whose one of them is the base detection grid to be judged, are identified as vertical particles to be verified. Under the condition that only the transverse particles to be verified and only the longitudinal particles to be verified are assigned to the newly determined basic detection grid, while the remaining plastic particles maintain their original particle assignment relationships, the grid size data before and after the adjustment of the basic detection grid to be judged are generated according to the method of grid size data formation, and the difference is calculated to form the transverse assignment change and the longitudinal assignment change. When the lateral assignment change and the lateral relative difference are in the same direction and the difference is within the allowable range of dimensional data consistency, and the longitudinal assignment change and the longitudinal relative difference are in the same direction and the difference is within the range, the particle assignment relationship of the lateral and longitudinal particles to be verified is corrected according to the position of the centroid of the contour; if the condition is not met, the original particle assignment relationship is retained. The grid size data of the underlying detection grid is reconstructed according to the current particle affiliation, and the corresponding grid size data is updated when the difference exceeds the allowable range for size data consistency.