Method for detecting the position of the leaves of a multileaf collimator
By combining infrared cameras and machine vision feature extraction algorithms, the problems of high cost and high environmental requirements for multi-leaf grating blade position detection have been solved, achieving low-cost and high-precision blade position detection.
Patent Information
- Application Number
- CN202611225179.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-06
AI Technical Summary
Existing multi-leaf grating blade position detection methods suffer from high installation and maintenance costs, high environmental requirements, and affect blade movement accuracy, making it difficult to meet the needs of precise radiation.
By combining an infrared camera with a machine vision feature extraction algorithm, and through calibration and blade recognition steps, the position of multi-leaf grating blades can be accurately detected, avoiding the need for additional sensors, reducing costs and improving detection accuracy.
It achieves low-cost and stable multi-leaf grating blade position detection, improves the accuracy and reliability of detection results, and meets the requirements of high-precision position detection.
Smart Images

Figure CN123045203A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical device technology, and in particular to a method for detecting the position of multi-leaf grating blades. Background Technology
[0002] Multileaf gratings are core components of medical accelerator devices. By precisely adjusting the position of the leaf blades, they shape the radiation field to fit the tumor target area, making the radiation dose distribution highly conformal to the target area and significantly reducing the radiation dose to surrounding healthy tissues. Therefore, the accurate detection of the position of the multileaf grating leaves is crucial.
[0003] In existing technologies, the position of multi-leaf grating blades is mainly detected by two methods. One is the contact detection method, which uses contact sensors such as thin-film potentiometers and resistive film sensors. The displacement signal is acquired by relying on the physical contact between the sensor and the blade. This method is simple in structure and low in cost. The other is the non-contact detection method, which uses non-contact detection devices such as ruby imaging detection devices with CCD cameras, magnetic grating-based detection devices, or vision detection devices. Position feedback is achieved by relying on optical or magnetic signals.
[0004] However, traditional detection methods mainly have the following problems: (1) Contact sensors have a short service life and poor reliability due to physical wear, and their measurement accuracy is insufficient under small displacement conditions. (2) Due to long-term exposure to radiation fields, the chip built into the imaging detection device of the ruby and CCD camera is prone to failure, resulting in high maintenance costs. (3) Due to the limitations of its own characteristics, the detection device based on the magnetic grating can only be used in a non-magnetic environment; (4) The visual inspection device needs to be coated with reflective material on the blade surface. During the reciprocating motion of the blade, the reflective material on its surface is easily worn off, affecting the inspection stability. (5) Regardless of whether it is a contact detection method or a non-contact detection method, each leaf of the multi-leaf grating needs to be equipped with an independent sensor. The installation is complicated and costly, and it will also increase the inertial load of the leaf movement, interfering with the accuracy of the leaf movement control. Summary of the Invention
[0005] Therefore, it is necessary to provide a multi-leaf grating blade position detection method to address the problems of high installation and maintenance costs, high requirements for the operating environment, and impact on blade movement accuracy in existing detection devices and methods, which make it difficult to meet the requirements of precise radiation.
[0006] The technical solution adopted in this invention is as follows: A method for detecting the position of a multi-leaf grating blade includes the following steps: S1. Preparation: Prepare the infrared camera and fix it in place so that the infrared camera can cover the multi-leaf grating when it forms a radiation field. The multi-leaf grating includes several leaves, and the top end face of each leaf has a groove for marking points; S2. Calibration and correction: Calibrate the infrared camera, calculate the distortion coefficient, complete image distortion correction, obtain the center coordinates and pixel resolution, and save the distortion coefficients, center coordinates and pixel resolution for later use. S3. Leaf recognition: According to the set target coordinate parameters, each leaf is moved to the target position, and then real-time images are captured by an infrared camera; First, the archived distortion coefficients are used to correct the distortion of the real-shot image, and then the effective recognition area is selected based on the machine vision feature extraction algorithm. Based on the archived center coordinates and pixel resolution, combined with the thickness parameters corresponding to each blade, the target area containing the groove is segmented into sections within the effective recognition area. In each target area, the pixel coordinates of the corresponding groove are located. The pixel coordinates are then combined with the archived pixel resolution to perform physical coordinate conversion, so as to obtain the actual coordinate parameters corresponding to the actual position of each blade. The difference between each actual coordinate parameter and the corresponding target coordinate parameter is compared to determine whether the corresponding blade has positional deviation.
[0007] As a further improvement to the above technical solution: Each groove is 0.3 mm wide and 1 mm deep.
[0008] The infrared camera is arranged horizontally or vertically.
[0009] When the infrared camera is arranged horizontally, it is equipped with a reflector. The reflector is tilted at 45°. By adjusting the installation height and angle of the infrared camera, the optical axis of the infrared camera lens is aligned with the reflected light path of the reflector.
[0010] The multi-leaf grating includes a first leaf module and a second leaf module arranged sequentially from top to bottom in a vertical direction. The first leaf module includes two sets of first leaf assemblies arranged symmetrically at intervals along a first horizontal direction. Each set of first leaf assemblies includes several first leaves arranged at intervals along a second horizontal direction. The second leaf module includes two sets of second leaf assemblies arranged symmetrically at intervals along a first horizontal direction. Each set of second leaf assemblies includes several second leaves arranged at intervals along a second horizontal direction. The top end face of each first blade and the top end face of each second blade are provided with grooves, thereby forming marking points on each first blade and each second blade.
[0011] During calibration, a first calibration plate and a second calibration plate are set up at intervals from top to bottom along the vertical direction. Both the first calibration plate and the second calibration plate adopt a checkerboard calibration plate. The first calibration plate is used to simulate the spatial position of the first blade module, and the second calibration plate is used to simulate the spatial position of the second blade module.
[0012] The calibration of an infrared camera includes the following steps: Acquire the calibration board image corresponding to the first calibration board and the calibration board image corresponding to the second calibration board. Extract the coordinates of all corner points of the chessboard grid from the two calibration board images respectively, transform the origin of the coordinates to the center position of the image, and complete the basic coordinate normalization process. Based on the physical distance information between the first calibration board and the second calibration board and the size information of the single grid, the global distortion coefficient of the two-layer blade module is calculated, thereby performing distortion correction on the full-frame image. Extract the center coordinates of the first calibration board from the calibration board image corresponding to the first calibration board after calibration, and extract the center coordinates of the second calibration board from the calibration board image corresponding to the second calibration board after calibration; Based on the size information of the first calibration board, the pixel resolution corresponding to the first blade module is calculated, and based on the size information of the second calibration board, the pixel resolution corresponding to the second blade module is calculated. The two sets of distortion correction parameters, two sets of center coordinates, and two sets of pixel resolutions are classified and archived separately to complete the calibration.
[0013] After the infrared camera completes calibration, it triggers a verification step, moves all the blades to the preset standard verification position, performs a blade identification step, performs identification and comparison, and outputs the comparison result after completion.
[0014] When selecting effective recognition regions based on machine vision feature extraction algorithms, the following steps are included: The horizontal gradient operator is used to perform convolution operation on the real-shot image after distortion correction to enhance the edge features of each groove. Each groove is converted into a rectangular structuring element with a corresponding number of pixels according to the archived pixel resolution. Closing operation is applied to fill the discontinuous area at the edge of each rectangular structuring element to obtain the first image. An adaptive threshold segmentation algorithm is used to perform binarization separation of the foreground and background in the first image. An opening operation is used to remove interference to obtain a binary image. A connected component analysis algorithm is used to filter connected components in the binary image that meet the preset threshold and exclude regions with inconsistent areas, thereby obtaining the second image. Invalid gaps are set on both sides of the second image. Pixels in the area corresponding to the invalid gaps are uniformly set to zero, and only the pixel information in the middle area is retained to obtain the third image. The pixel information on the third image is used as the filtered valid recognition area.
[0015] The infrared camera is equipped with a supplementary light for illumination.
[0016] The beneficial effects of this invention are as follows: This invention features a compact and reasonable structure, and is easy to operate. It involves three steps: setup preparation, calibration, and blade identification. No additional sensors are required, and it has low requirements for the working environment, resulting in low installation and maintenance costs. It can achieve accurate, stable, and low-cost detection of the position of each blade of a multi-leaf grating, effectively improving the accuracy and reliability of the detection results and meeting the high-precision position detection requirements of multi-leaf grating blades.
[0017] The present invention also has the following advantages: (1) By setting a reflector, the image of the multi-leaf grating can be reflected into the lens of the infrared camera, thus achieving indirect observation and solving the spatial limitation problem that the infrared camera cannot directly aim at the leaf from above in the vertical direction.
[0018] (2) By setting up supplementary lights, supplementary light sources can be provided when the light is insufficient. After supplementary lighting, the blade is preprocessed by supplementary light image processing algorithm to obtain a final grayscale image with uniform brightness and clear local details, which facilitates the capture of blade groove marking points by a clear infrared camera, improves detection accuracy, avoids image blurring, and ensures stable and reliable position detection.
[0019] (3) In this invention, by setting up a groove feature enhancement process based on horizontal gradient combined with a closing operation, the edge features of the groove can be precisely enhanced, edge breakpoints can be filled, local noise interference can be eliminated, and the contour integrity and clarity of the groove can be improved.
[0020] (4) In this invention, by using an adaptive threshold segmentation algorithm combined with opening operation, the foreground and background of the groove can be accurately separated, irrelevant noise interference can be eliminated, and misidentified areas can be screened out, which greatly improves the accuracy and stability of groove recognition. Attached Figure Description
[0021] Figure 1 This is a schematic diagram of the structure of the present invention.
[0022] Figure 2 This is a schematic diagram of the structure of the first blade in this invention.
[0023] Figure 3 This is a schematic diagram of the structure of the second blade in this invention.
[0024] Figure 4 This is a flowchart illustrating the calibration process of the infrared camera in this invention.
[0025] Figure 5This is a flowchart of the blade identification step in this invention.
[0026] Figure 6 This is a schematic diagram of the structure of the first calibration plate in this invention.
[0027] Figure 7 This is a schematic diagram of the structure of the second calibration plate in this invention.
[0028] Figure 8 This is a real-world photograph of the first blade module captured by the infrared camera in this invention.
[0029] Figure 9 This is a real-world photograph of the second blade module captured by the infrared camera in this invention.
[0030] Figure 10 This is a schematic diagram of the first blade module after distortion correction, taken from a real photograph.
[0031] Figure 11 This is a schematic diagram of the final grayscale image in this invention.
[0032] Figure 12 This is a flowchart of the machine vision feature extraction algorithm in this invention.
[0033] Figure 13 This is a schematic diagram of the first image in this invention.
[0034] Figure 14 This is a schematic diagram of the second image in this invention.
[0035] Figure 15 This is a schematic diagram of the third image in this invention.
[0036] Figure 16 This is a schematic diagram of the markers on the right side in this invention.
[0037] Figure 17 This is a schematic diagram of the left-side marker in this invention.
[0038] The components include: 1. Infrared camera; 2. Fill light; 3. Reflector; 4. Support base; 5. First blade; 501. First connecting hole; 6. Second blade; 601. Second connecting hole; 7. Groove. Detailed Implementation
[0039] The specific embodiments of the present invention will now be described with reference to the accompanying drawings.
[0040] like Figures 1-17 As shown, the multi-leaf grating blade position detection method of this embodiment includes the following steps: S1. Preparation: Prepare infrared camera 1 and fix it in place so that the infrared camera 1 can cover the multi-leaf grating when it forms a radiation field; the multi-leaf grating includes several leaves, and the top end face of each leaf has a groove 7 for marking points.
[0041] In this embodiment, the infrared camera 1 is arranged horizontally or vertically; for example... Figure 1 As shown, when the infrared camera 1 is arranged horizontally, it is equipped with a reflector 3. The reflector 3 is tilted at 45°. By adjusting the installation height and angle of the infrared camera 1, the optical axis of the lens of the infrared camera 1 is aligned with the reflected light path of the reflector 3. By setting the reflector 3, the image of the multi-leaf grating can be reflected into the lens of the infrared camera 1, realizing indirect observation, thereby solving the spatial limitation problem that the infrared camera 1 cannot be directly aligned with the leaf from above in the vertical direction. The infrared camera 1 is supported by the support base 4 to adjust its installation angle and installation height.
[0042] The infrared camera 1 is equipped with an auxiliary light 2 for supplementary lighting, which can provide sufficient illumination, facilitate clear capture of leaf marking points by the infrared camera 1, improve detection accuracy, avoid image blurring, and ensure stable and reliable position detection. In addition, an industrial control computer is also configured, which communicates with the infrared camera 1 to receive and process the images captured by the infrared camera 1.
[0043] In this embodiment, the multi-leaf grating includes a first leaf module and a second leaf module arranged sequentially from top to bottom in a vertical direction. The first leaf module includes two sets of first leaf assemblies arranged symmetrically at intervals along a first horizontal direction. Each set of first leaf assemblies includes several first leaves 5 arranged at intervals along a second horizontal direction. The second leaf module includes two sets of second leaf assemblies arranged symmetrically at intervals along a first horizontal direction. Each set of second leaf assemblies includes several second leaves 6 arranged at intervals along a second horizontal direction. A groove 7 is provided on the top end face of each first leaf 5 and the top end face of each second leaf 6, thereby forming a marking point on each first leaf 5 and each second leaf 6. Specifically, a single first blade assembly includes seventeen first blades 5, and a single second blade assembly includes sixteen second blades 6, such as... Figure 2 As shown, a first connecting hole 501 is provided on the front end sidewall of the single first blade 5. The first connecting hole 501 connects to the output end of the corresponding first rotary drive motor, thereby driving the corresponding first blade 5 to rotate. The corresponding groove 7 is located near the tail end (away from the first connecting hole 501). Figure 3As shown, a second connecting hole 601 is provided on the front side wall of the single second blade 6. The second connecting hole 601 is connected to the output end of the corresponding second rotary drive motor, so that the second rotary drive motor drives the corresponding second blade 6 to rotate. The corresponding groove 7 is provided near the tail end (away from the direction of the second connecting hole 601). Each groove 7 has a width of 0.3 mm and a depth of 1 mm, providing reliable identification features for the corresponding blade.
[0044] S2. Calibration and correction: Calibrate infrared camera 1, calculate distortion coefficients, complete image distortion correction, obtain center coordinates and pixel resolution, and archive the distortion coefficients, center coordinates and pixel resolution for later use.
[0045] To ensure the accuracy of images acquired by infrared camera 1, it needs to be calibrated and corrected before use. Since the multi-leaf grating in this embodiment includes two sets of leaf modules arranged from top to bottom, two calibration plates are required to correspond to the two sets of leaf modules respectively. Therefore, during calibration and correction, if... Figures 6-7 As shown, a first calibration plate and a second calibration plate are set at intervals from top to bottom along the vertical direction. Both the first and second calibration plates adopt a checkerboard pattern. The first calibration plate simulates the spatial position of the first blade module, and the second calibration plate simulates the spatial position of the second blade module. In order to ensure that the calibration plates can accurately simulate the spatial position of the corresponding blade modules, the first calibration plate must be at the same height as the first blade module, and the second calibration plate must be at the same height as the second blade module. During the calibration process, the first and second calibration plates must be fixed to prevent loosening or tilting during use, thereby avoiding the introduction of additional errors.
[0046] like Figure 4 As shown, the calibration of infrared camera 1 includes the following steps: S2.1. Acquire the calibration board image corresponding to the first calibration board, acquire the calibration board image corresponding to the second calibration board. When the infrared camera 1 acquires the calibration board image, both the first blade module and the second blade module need to be turned on. S2.2. Extract the coordinates of all corner points (i.e., the corner points at the top left, top right, bottom right, and bottom left positions) of the checkerboard grid from the two calibration board images respectively, and transform the origin of the coordinates to the center of the image to complete the basic coordinate normalization process; specifically, according to the image center and the size of a single grid on the calibration board (1 grid = 3mm), calculate the coordinates of the four corner points at the top left, top right, bottom right, and bottom left respectively, thereby converting the four corner points into coordinates centered on the image center; S2.3. Based on the physical distance information between the first calibration plate and the second calibration plate and the size information of a single checkerboard grid (1 grid = 3mm), the global distortion coefficient of the two-layer blade module is calculated, thereby performing distortion correction on the full-frame image. S2.4. Extract the center coordinates of the first calibration plate from the calibration plate image corresponding to the first calibration plate after correction, and extract the center coordinates of the second calibration plate from the calibration plate image corresponding to the second calibration plate after correction; Based on the size information of the first calibration board, the pixel resolution corresponding to the first blade module is calculated, and based on the size information of the second calibration board, the pixel resolution corresponding to the second blade module is calculated. S2.5. Classify and archive the two sets of distortion correction parameters, the two sets of center coordinates, and the two sets of pixel resolutions respectively to complete the calibration, and then remove the calibration plate; if the position of infrared camera 1 is moved later, the calibration steps need to be repeated to avoid errors.
[0047] After infrared camera 1 completes calibration, it triggers the verification step, moves all blades to the preset standard verification position, performs a blade identification step, performs identification and comparison, and outputs the comparison result after completion.
[0048] S3. Leaf identification, such as Figure 5 As shown, each blade is moved to the target position according to the set target coordinate parameters, and then real-time images are captured by infrared camera 1; as shown Figure 8 As shown, this is a real-world image of the first blade module captured by infrared camera 1. Figure 9 The image shown is a real-world image of the second blade module captured by infrared camera 1.
[0049] First, the archived distortion coefficients are used to correct the distortion of the actual captured image. Then, a machine vision feature extraction algorithm is used to select the effective recognition region. The image of the first blade module after distortion correction is shown below. Figure 10 As shown, according to Figure 10 In the first leaf module, the left leaf component is darker than the right leaf component, which may affect the recognition of the left leaf. Therefore, before the infrared camera 1 captures the actual image, a supplementary light 2 needs to be set for overall illumination. After the supplementary light 2 illuminates the multi-leaf grating, the infrared camera 1 captures a clear actual image. After distortion correction, this image is further processed by the supplementary lighting image processing algorithm. The processed image is as follows: Figure 11 As shown; the processing procedure based on the supplementary lighting image processing algorithm is as follows: First, the input image is converted to a grayscale image and then normalized. Then, by calculating the column average brightness and smoothing it with Gaussian, and using 90% of the global average brightness as the threshold, we search from the left and right sides toward the center to locate the occlusion boundary whose brightness is lower than the threshold (if not detected, the image edge is taken by default). Subsequently, based on the degree of brightness loss of each column relative to the global average brightness, corresponding column direction gain coefficients are generated. Compensation maps are constructed column by column only in the left and right occlusion areas. The compensation maps are then Gaussian smoothed to avoid abrupt boundary changes. The original real-shot image is multiplied element by element with the corresponding compensation map to obtain a preliminary brightness-enhanced image. Then, a large-size mean filter (approximately 20% of the short side of the image and adjusted to an odd number) is used to estimate the remaining large-scale illumination residuals in the initial brightness enhancement image. The large-scale illumination residuals are removed by pixel-by-pixel division, thereby further homogenizing the brightness and obtaining a brightness-uniformed image. Finally, the brightness-uniformed image is linearly normalized to the [0,1] range and converted to an 8-bit integer. Then, the CLAHE (Contrast-Limited Adaptive Histogram Equalization) algorithm is applied to enhance local contrast, ultimately outputting a grayscale image with uniform brightness and significantly reduced lateral occlusion. Figure 11 .
[0050] like Figure 12 As shown, when selecting effective recognition regions based on machine vision feature extraction algorithms, the following steps are included: The distortion-corrected real-world image is convolved using the horizontal gradient operator to enhance the edge features of each groove 7. Based on the archived pixel resolution, each groove 7 is converted into a rectangular structuring element (with a size of [0.9mm, 0.9mm]) corresponding to the number of pixels. A closing operation is then applied to fill the discontinuous areas at the edges of each rectangular structuring element, thus obtaining the first image, as shown below. Figure 13 As shown; through this step, the edge features of the groove 7 can be precisely enhanced, edge breaks can be filled, local noise interference can be eliminated, and the outline integrity and clarity of the groove 7 can be improved. An adaptive thresholding segmentation algorithm is used to binarize and separate the foreground and background of the first image. Opening operations are used to remove interference, resulting in a binary image from which high grayscale values are extracted. A connected component analysis algorithm is then used to filter connected components in the binary image that meet a preset threshold (the preset threshold is an area greater than 200 pixels), excluding regions with inconsistent areas, thus obtaining the second image. Figure 14 As shown; this step can accurately separate the foreground and background of the groove 7, eliminate irrelevant noise interference, and screen out misidentified areas with inconsistent areas, thus greatly improving the accuracy and stability of groove 7 recognition. Invalid spacing is set on both sides of the second image, and the pixels in the corresponding areas of the invalid spacing are uniformly set to zero, retaining only the pixel information of the middle area, thus obtaining the third image, as shown below. Figure 15As shown, the pixel information on the third image is used as the filtered valid recognition area. Since the recognition process uses the groove 7 as the marker point, it is necessary to ensure that the marker point of each blade extends completely out of the image and can be seen. Therefore, it is necessary to limit the range on both sides. In this embodiment, for the image of the first blade module, the left side spacing is set to 3.5mm and the right side spacing is set to 2.5mm. For the image of the second blade module, the left side spacing is set to 16.5mm and the right side spacing is set to 9mm.
[0051] Based on the archived center coordinates and pixel resolution, combined with the thickness parameters corresponding to each blade, the target area containing the groove 7 is segmented in the effective identification area. Having obtained the center coordinates in the calibration step, the approximate location of the first target area is calculated based on the center coordinates. In this embodiment, half of the fixed distance in the vertical direction of the first blade module is 18mm, and half of the fixed distance in the vertical direction of the second blade module is 22mm. Based on the pixel resolution, the aforementioned physical information can be converted into pixel distance, and the starting y3 coordinate of the target area is calculated based on the center coordinate y1 and this distance. In this embodiment, both the first and second blade modules include blades of two thicknesses. The thickness of the thick blade in the first blade module is 2.35mm, and the thickness of the thin blade is 1.94mm. The thickness of the thick blade in the second blade module is 2.94mm, and the thickness of the thin blade is 2.54mm.
[0052] Specifically, taking the first blade module as an example, when using the multi-row sliding window method to segment the target area containing the groove 7 within the effective recognition area, the following steps are included: First, calculate the starting position y2 based on the center coordinate y1 and the fixed distance mentioned above, x=1, and convert the physical size of the first thin blade (thickness of 1.94mm) in the first blade module into pixel size; Based on the starting positions x and y2 and the physical dimensions of the blade, the first target area is obtained by cropping. Then, the two largest inscribed rectangles in the target area are found and their areas are calculated. Since the first target area may not be complete, the above process is repeated 4 times with a step size of 5 pixels. After the loop, the centroid of the largest inscribed rectangle is calculated. The ordinate of the centroid is used as the accurate starting position y3. The target area can be cropped according to y3 and the blade thickness. Then, based on the thickness parameters of each blade, a multi-row sliding window is used to sequentially extract the target area specific to each blade. Since the first blade module includes two sets of symmetrical first blade assemblies, therefore, as... Figure 16There may be two inscribed rectangles in the target area, so it is necessary to determine the left and right sides. When there are two inscribed rectangles in the target area, the right inscribed rectangle is determined as the marker point, i.e., the right marker point. When there is one inscribed rectangle in the target area, the inscribed rectangle is determined as the marker point, i.e., the left marker point. The determination result is stored. Based on the above steps, the target area is captured and the left and right sides are marked and determined sequentially for the seventeen pairs of blades in the first blade module and the sixteen pairs of blades in the second blade module until all blades are identified.
[0053] In each target area, locate the pixel coordinates of the corresponding groove 7 (i.e., the right or left mark point after the left and right mark determination is completed). Combine the pixel coordinates with the archived pixel resolution to perform physical coordinate conversion to obtain the actual coordinate parameters corresponding to the actual position of each blade. Compare the difference between each actual coordinate parameter and the corresponding target coordinate parameter to determine whether the corresponding blade has positional deviation.
[0054] The above description is an explanation of the present invention and not a limitation thereof. The scope of the present invention is defined by the claims. Within the scope of protection of the present invention, any form of modification may be made.
Claims
1. A method for detecting the position of multi-leaf grating blades, characterized in that: Includes the following steps: S1. Preparation: Prepare the infrared camera (1), fix the infrared camera (1) in place so that the infrared camera (1) can cover the multi-leaf grating when it forms a radiation field; The multi-leaf grating includes several leaves, and the top end face of each leaf has a groove (7) for marking points. S2. Calibration and correction: Calibrate the infrared camera (1), calculate the distortion coefficient, complete the image distortion correction, obtain the center coordinates and pixel resolution, and save the distortion coefficients, center coordinates and pixel resolution for later use. S3. Leaf identification: According to the set target coordinate parameters, each leaf is moved to the target position, and then real-shot images are collected by infrared camera (1); First, the archived distortion coefficients are used to correct the distortion of the real-shot image, and then the effective recognition area is selected based on the machine vision feature extraction algorithm. Based on the center coordinates and pixel resolution of the archive, and combined with the thickness parameters corresponding to each blade, the target area containing the groove (7) is segmented in the effective recognition area. In each target area, locate the pixel coordinates of the corresponding groove (7), combine the pixel coordinates with the archived pixel resolution to perform physical coordinate conversion, obtain the actual coordinate parameters corresponding to the actual position of each blade, compare the difference between each actual coordinate parameter and the corresponding target coordinate parameter, and thus determine whether the corresponding blade has position deviation.
2. The method for detecting the position of multi-leaf grating blades as described in claim 1, characterized in that: The width of a single groove (7) is 0.3 mm and the depth is 1 mm.
3. The method for detecting the position of multi-leaf grating blades as described in claim 1, characterized in that: The infrared camera (1) is arranged in a horizontal direction or in a vertical direction.
4. The method for detecting the position of multi-leaf grating blades as described in claim 3, characterized in that: When the infrared camera (1) is arranged in a horizontal direction, it is equipped with a reflector (3). The reflector (3) is set at an angle of 45°. By adjusting the installation height and installation angle of the infrared camera (1), the optical axis of the lens of the infrared camera (1) is aligned with the reflected light path of the reflector (3).
5. The method for detecting the position of multi-leaf grating blades as described in claim 1, characterized in that: The multi-leaf grating includes a first leaf module and a second leaf module arranged sequentially from top to bottom in the vertical direction. The first leaf module includes two sets of first leaf assemblies arranged symmetrically at intervals along the first horizontal direction. Each set of first leaf assemblies includes several first leaves (5) arranged at intervals along the second horizontal direction. The second leaf module includes two sets of second leaf assemblies arranged symmetrically at intervals along the first horizontal direction. Each set of second leaf assemblies includes several second leaves (6) arranged at intervals along the second horizontal direction. A groove (7) is provided on the top end face of each first blade (5) and the top end face of each second blade (6), thereby forming a marking point on each first blade (5) and each second blade (6).
6. The method for detecting the position of multi-leaf grating blades as described in claim 5, characterized in that: During calibration, a first calibration plate and a second calibration plate are set up at intervals from top to bottom along the vertical direction. Both the first calibration plate and the second calibration plate adopt a checkerboard calibration plate. The first calibration plate is used to simulate the spatial position of the first blade module, and the second calibration plate is used to simulate the spatial position of the second blade module.
7. The method for detecting the position of multi-leaf grating blades as described in claim 6, characterized in that: The calibration of the infrared camera (1) includes the following steps: Acquire the calibration board image corresponding to the first calibration board and the calibration board image corresponding to the second calibration board. Extract the coordinates of all corner points of the chessboard grid from the two calibration board images respectively, transform the origin of the coordinates to the center position of the image, and complete the basic coordinate normalization process. Based on the physical distance information between the first calibration board and the second calibration board and the size information of the single grid, the global distortion coefficient of the two-layer blade module is calculated, thereby performing distortion correction on the full-frame image. Extract the center coordinates of the first calibration board from the calibration board image corresponding to the first calibration board after calibration, and extract the center coordinates of the second calibration board from the calibration board image corresponding to the second calibration board after calibration; Based on the size information of the first calibration board, the pixel resolution corresponding to the first blade module is calculated, and based on the size information of the second calibration board, the pixel resolution corresponding to the second blade module is calculated. The two sets of distortion correction parameters, two sets of center coordinates, and two sets of pixel resolutions are classified and archived separately to complete the calibration.
8. The method for detecting the position of multi-leaf grating blades as described in claim 7, characterized in that: After the infrared camera (1) completes calibration, it triggers a verification step, moves all the blades to the preset standard verification position, performs a blade identification step, performs identification and comparison, and outputs the comparison result after completion.
9. The method for detecting the position of multi-leaf grating blades as described in claim 1, characterized in that: When selecting effective recognition regions based on machine vision feature extraction algorithms, the following steps are included: Based on the horizontal gradient operator, the real-shot image after distortion correction is convolved to enhance the edge features of each groove (7). According to the archived pixel resolution, each groove (7) is converted into a rectangular structural element with the corresponding number of pixels. The closing operation is applied to fill the discontinuous area at the edge of each rectangular structural element to obtain the first image. An adaptive threshold segmentation algorithm is used to perform binarization separation of the foreground and background in the first image. An opening operation is used to remove interference to obtain a binary image. A connected component analysis algorithm is used to filter connected components in the binary image that meet the preset threshold and exclude regions with inconsistent areas, thereby obtaining the second image. Invalid gaps are set on both sides of the second image. Pixels in the area corresponding to the invalid gaps are uniformly set to zero, and only the pixel information in the middle area is retained to obtain the third image. The pixel information on the third image is used as the filtered valid recognition area.
10. The method for detecting the position of multi-leaf grating blades as described in claim 1, characterized in that: The infrared camera (1) is equipped with a supplementary light (2) for supplementary lighting.
