An image processing-based chain box automatic pouring detection and positioning method
Patent Information
- Application Number
- CN202610598008.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-30
- Publication Date
- 2026-08-18
AI Technical Summary
但由于链式浇筑模板箱缩放的浇筑区域,链式浇筑模板箱边缘与背景颜色相似,易存在模糊,存在阴影遮挡或者光照不均匀情况,导致直线边缘等检测识别误差大
[0009] 1. The automatic chain box casting detection and positioning method disclosed in this invention based on image processing adopts a multiple straight line verification detection method to accurately realize automatic extraction of image edge features. It can accurately identify image edge features under complex backgrounds, and uses greedy clustering and binarization mask to assist in detection and positioning, effectively filtering out interference problems caused by complex backgrounds, and can effectively improve the detection accuracy under complex backgrounds.
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to an automatic chain box pouring detection and positioning method based on image processing, belonging to the fields of computer vision and computer control. Background Technology
[0002] In concrete pouring operations, chain-type pouring formwork boxes are an important piece of equipment, often simply called chain boxes. Their main function is to control the pouring area and the thickness of the pouring layer. They are typically constructed of steel, providing high strength and corrosion resistance. For dam pouring and tailings slurry pouring operations, where the poured material is often in a fluid state, pre-set chain-type pouring formwork boxes are frequently used to enhance pouring accuracy, improve efficiency, and achieve precise pouring layer thickness requirements. The chain-type formwork box is placed in the designated pouring area, and the concrete is precisely poured to the target location using a pump truck.
[0003] Existing chain-type casting formwork boxes rely heavily on manual inspection or simple sensors. These methods are slow, inefficient, and unsuitable for complex environments. Therefore, computer vision technology can effectively automate the detection and positioning of chain-type casting formwork boxes. Computer vision inspection mainly includes traditional image processing methods and deep learning-based detection methods. Chain-type casting formwork box detection can be achieved by combining deep neural networks. This method offers high accuracy under suitable datasets and fixed environments, but it requires significant computing power, is highly dependent on the dataset, and necessitates extensive data annotation for training, resulting in long training times and hindering rapid deployment in complex and volatile environments. Compared to deep learning methods, traditional computer vision detection methods, such as edge detection and morphological processing, are simpler and more convenient. However, due to the scaled casting area of the chain-type casting formwork box, the edges of the formwork box are often similar in color to the background, leading to blurring, shadow occlusion, or uneven lighting, resulting in large errors in the detection and recognition of straight edges. Existing traditional algorithms rely solely on single-line detection, which cannot accurately detect the intersection of rectangle edges, resulting in low recognition rates. Summary of the Invention
[0004] To address the aforementioned issues, the present invention aims to provide an automatic chain casting template box detection and positioning method based on image processing. This method establishes a joint working mechanism for chain casting template box detection and positioning through adaptive image processing combined with geometric feature extraction and analysis, effectively improving the accuracy and stability of the detection algorithm. Based on an adaptive threshold adjustment for edge clarity and a dynamic feature filtering model for line segments, the robustness of chain casting template box detection is improved under conditions such as changes in illumination and the presence of shadows. Furthermore, the present invention combines intersection point clustering stability judgment conditions and a secondary geometric repositioning algorithm to establish a chain casting template box re-detection and positioning mechanism, which can automatically recover detection when temporary loss occurs due to factors such as partial occlusion of chain casting template boxes, ensuring the accuracy and continuity of the detection system.
[0005] The objective of this invention is achieved through the following technical solution.
[0006] The automatic casting detection and positioning method for chain boxes based on image processing disclosed in this invention includes the following steps: Step 1: Acquire images of the desired region of interest. Establish a geodetic coordinate system to determine the specific location of the chain-cast formwork box. Mark and record the pixel coordinates and geodetic coordinates of any point at the four corners of the acquired image and the image center. Calibrate using linear interpolation, denoted as standard points D1=(X1,Y1), d1=(x1,y1), and standard points D2=(X2,Y2), d2=(x2,y2).
[0007] Step 2: Read the image from Step 1 and perform adaptive image preprocessing. First, convert it to grayscale image I. {gray}(x,y) I is obtained using an adaptive histogram. clahe(x,y) , to I clahe(x,y) Gaussian filtering is performed to obtain I blur(x,y) , to I blur(x,y) The edge map E is obtained using the Canny operator. (x,y) The line segment L is obtained by performing Hough transform on the edge map. i ; Step 3: The set of line segments in Step 2 is L = {L1, L2, …, L} i , …, L n}, where L i Let L represent the i-th line segment. Perform length equalization on the set of line segments to obtain the set of line segments of equal length. new ={L new1 , L new2 , …, L newi , …,L newn}, where L newi This represents the i-th line segment, and its color is changed to green.
[0008] Use a binary mask to remove the background and the set of line segments L, specifically for line segments of equal length L. new Perform secondary Canny edge detection and Hough transform to detect line segments, and extract the set L of line segments of equal length. new Image information. Preset line segment quantity threshold I len And perform quantity verification; if it exceeds the preset threshold I... len Repeat step three again. If the value is less than the threshold range, output the final set of line segments I = {I1, I2, ..., I...} i , …, I n}; Step 4: For each pair of line segments in the set I from Step 3, calculate the intersection points. Calculate the intersection point parameters t and s to determine if they are parallel or collinear. If they are not parallel or collinear, calculate the intersection point. The set of intersection points is (x int ,y int )={(x1,y1),(x2,y2), …, (x i ,y i ), (x n ,y n )}, where (x i ,y i Let (x) be the i-th point. For the set of all intersection points (x... int ,y int Clusters are constructed using a greedy algorithm, and the Euclidean distance between intersections is calculated, with a preset distance threshold D. cluster Clustering point determination is performed based on a distance threshold, and the center point of each cluster is calculated as the representative point. A second threshold D based on distance is then applied for deduplication. uniq Determine if the distance to all points is less than a threshold; discard any points that are less than a threshold. Extract the average point set d. (x,y) ={d1, d2, …, d i , …,d n}; Step 5: Calculate the average Euclidean distance between pairs of points. d Preset distance threshold D min and D max Threshold angle α min and α max Connection count threshold C max Connect points within a threshold range, and simultaneously mark the points that are connected and limit the number of connections C. max Change the color of the connecting line segments to blue. The set of connecting line segments is U = {U1, U2, …, U…}. i , …, U n}. Extract the blue line segment region using a mask and perform contour extraction. For each contour, perform polygon approximation. Calculate the lengths L of the four sides of the approximated quadrilateral polygon. sAnd calculate the included angle between adjacent angles. Preset length error k s Angle threshold [α] min_rect, α max_rect When the difference between the side lengths is within the length error range, and the angles of all four corners are within the angle threshold, it is determined to be a target quadrilateral polygon. Step Six: For the four points identified as the target quadrilateral polygon in Step Five, extract two pairs of diagonals from the four endpoints and calculate the pixel coordinates P of their intersection point. center ={P1, P2, …, P i , …, P n Save them sequentially. Extract the linear interpolation results from step one, and calculate the geodetic coordinates of the intersection point by reverse calculation of the linear interpolation, thus realizing the fully automated process of positioning the chain-type casting formwork box. Beneficial effects
[0009] 1. The automatic chain box casting detection and positioning method disclosed in this invention based on image processing adopts a multiple straight line verification detection method to accurately realize automatic extraction of image edge features. It can accurately identify image edge features under complex backgrounds, and uses greedy clustering and binarization mask to assist in detection and positioning, effectively filtering out interference problems caused by complex backgrounds, and can effectively improve the detection accuracy under complex backgrounds.
[0010] 2. The automatic chain box casting detection and positioning method disclosed in this invention, based on image processing, establishes a joint working mechanism for chain casting template box detection and positioning by adaptive image processing combined with geometric feature extraction and analysis, which effectively improves the accuracy and stability of the detection algorithm; based on the edge sharpness adaptive threshold adjustment and line segment dynamic feature screening model, it can improve the robustness of chain casting template box detection under conditions such as changes in lighting and the presence of shadow occlusion. Attached Figure Description
[0011] Figure 1 This is a flowchart of the automatic chain box casting detection and positioning method based on image processing disclosed in this invention (a flowchart of an automatic chain box casting detection and positioning method based on image processing is as follows). Figure 1 (as shown) Figure 2 This is a diagram showing the intersection points of line segments of equal length; Figure 3 This is a greedy cluster average point plot, with green line segments representing the detection of equal-length line segments; Figure 4 This is a processing effect diagram of the present invention. The green dot at the center of the chain casting template box in the diagram is the final corner point. The detection effect diagram is as follows. Figure 4 As shown, the green dots are the pixel coordinates to be calculated; the red dots are the intersections of line segments of equal length; and the blue dots are the average points of the greedy clustering algorithm. Detailed Implementation
[0012] To clearly illustrate the technical solution proposed in this invention, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the described examples are intended only to facilitate understanding of the invention and are not intended to limit it in any way.
[0013] like Figure 1 As shown, this implementation describes an automatic casting detection and positioning method for chain boxes based on image processing. The specific implementation steps are as follows: Step 1: Acquire images of the desired region of interest. Establish a geodetic coordinate system to determine the specific location of the chain-cast formwork box. Mark and record the pixel coordinates and geodetic coordinates of any point at the four corners of the acquired image and the image center. Calibrate using linear interpolation, denoted as standard points D1=(X1,Y1), d1=(x1,y1), and standard points D2=(X2,Y2), d2=(x2,y2).
[0014] Specifically, images are acquired based on the area where the chain-type casting formwork box to be poured is located. The ground coordinate system where the pump truck is located is defined as the geodetic coordinate system, with the pump truck as the center point, and the coordinate system is represented as D. i ={(X i ,Y i In the image acquisition process, i represents any point in the geodetic coordinate system. The ground position of any point at one of the four corners (top left, bottom left, top right, bottom right) of the image needs to be marked as standard point D1, where D1 = (X1, Y1). Simultaneously, the pump truck head is vertically downwards, and the position of the pump head on the ground is the center point of the acquired image. This mapped point is marked as standard point D2, where D2 = (X2, Y2). These standard points are stored in both geodetic coordinate systems. The pixel coordinates of standard points are extracted from the image acquired in step one, with the pixel coordinate system having the top-left corner of the image as the origin. Standard points D 1 The corresponding pixel coordinates are one of the four corner pixel coordinates of the image: d1=(x1,y1), and the pixel coordinates corresponding to the standard point D2 are the pixel coordinates of the center point of the image: d2=(x2,y2). Extract the standard points D1 and D2 stored in step one, and perform linear interpolation on the x and y coordinates of this set of standard points respectively.
[0015]
[0016] In addition, in this embodiment, detection can also be performed on a pre-defined region of interest.
[0017] Step 2: Read the image of the chain casting formwork box from Step 1 and perform adaptive image preprocessing on it. The input is converted to a grayscale image. {gray}(x,y) I is obtained using an adaptive histogram. clahe(x,y) , to Iclahe(x,y) Gaussian filtering is performed to obtain I blur(x,y) , to I blur(x,y) The edge map E is obtained using the Canny operator. (x,y) ; In this embodiment, the grayscale image is first processed and output according to equation (3), and the CLAHE function is used for image equalization. The tileGridSizee is set to (8*8) for local contrast enhancement, reducing the impact of small image detail noise on image detection.
[0018]
[0019] Among them, CDF local `tlip` is the cumulative distribution function for the local window, `L` is the grayscale value, `Clip` is the function to limit contrast to prevent over-enhancement, and `tileGridSizee` is the size of the local contrast enhancement block.
[0020] For the equalized image I clahe(x,y) Gaussian filtering is performed to reduce noise and highlight edge features. In this example, the background noise is high, so the kernel is set to (7, 7), and the output I... blur(x,y) .
[0021]
[0022] Where k is the convolution kernel, The standard deviation is denoted as .
[0023] Next, the image I after Gaussian filtering... blur(x,y) Edge detection is performed using the Canny operator. Edge features are extracted using Canny edge detection to enhance linearity. In this example, a low threshold of 80 and a high threshold of 365 are set. While ensuring complete detection of the edges of the chain-cast formwork box, background noise is reduced, and the output edge map E is obtained. (x,y) .
[0024]
[0025]
[0026] in, S x and S y It uses the Sobel kernel.
[0027] Next, the edge map obtained through adaptive preprocessing is... E(x,y) Perform Hough transform to detect geometric features of lines and extract the set of detected line segments L={L1, L2, …, L i , …, L n}
[0028]
[0029] in, , A point in polar coordinate space; x , y Use Cartesian coordinates.
[0030] Step 3, for the set of line segments L Perform equal length processing on line segments, where L i Let L represent the i-th line segment. A line segment is represented as L. i =(x i ,y i ), where x i y i These are the two endpoints of the line segment. First, calculate the inclination angle α between each line segment according to equation (13), and preset the expected length L of the line segment. new Keeping the original direction of the line segment, calculate the coordinates of the two endpoints of the line segment after the equal length processing according to equations (14) to (17). The equal length line segment is represented as L. newi .
[0031]
[0032] Next, for the set L of line segments of equal length new ={L new1 , L new2 , …, L newi , …, L newn}, perform HSV color conversion (H∈[35,85]), converting the color of equal-length line segments to green, used to mark equal-length line segments, where L newi This represents the i-th line segment. A binary mask is used to remove the image background (including noise, background, and the set of line segments L), retaining only the set of line segments L of equal length in the image. new Then, Canny edge detection and Hough transform are performed again on the masked image to detect straight line features, and the number of equal-length line segments is extracted from the reprocessed image. A preset threshold for the number of line segments, I, is used. len Quantity verification is performed based on a threshold to improve detection robustness. If the number exceeds a preset threshold I... len Repeat step 3 again. If the value is less than the threshold range, output the final set of line segments I = {I1, I2, …, I}. i , …, I n}, where I i It is represented as the i-th line segment.
[0033] Step 4: Extract the line segments from the line segment set I in Step 3, calculate the intersection points between each line segment, and use I as the line segment name.i =(x i ,y i The intersection point is determined by formula (18). The parameters Δ, t, and s are calculated based on this formula. If Δ = 0, it indicates that the two line segments are parallel or collinear, and there is no unique intersection point. If Δ ≠ 0, then t and s are calculated, and the coordinates of the intersection point are calculated using formula (21). The set of intersection points is S = {(x...} int1 ,y int1 ),(x int2 ,y int2 ), …, (x inti ,y inti ), (x intn ,y intn )}.
[0034]
[0035] Where (x) inti ,y inti (i) represents the i-th point.
[0036] Next, a cluster is constructed for all intersection points using a greedy approach. First, the Euclidean distance between each intersection point is calculated according to equation (22). For example, intersection point (x int2 ,y int2 ) and (x int1 ,y int1 The Euclidean distance is:
[0037] Next, preset distance threshold D cluster Define a set of intersection point clusters, and initialize the set of intersection point clusters to empty. For each point... Perform clustering point determination based on a distance threshold. Starting from the first point, calculate the Euclidean distance to its surrounding points; if the distance is less than the threshold D... cluster If a point is found to be a cluster, it is added to that cluster; otherwise, a new cluster is created. This process continues until all points have been identified. The center point of each cluster is then calculated as a representative point according to equation (23).
[0038]
[0039] Then, a distance-based deduplication threshold is applied, with a preset threshold D. uniq The chain casting formwork boxes are placed one after another in sequence. Therefore, the difference between the corner points of each chain casting formwork box will not exceed 1.5 times the length of the chain casting formwork box. Therefore, before adding the center point of each cluster to the final set, it is determined whether the distance between the cluster center point and an existing point is less than the threshold D. uniq If there is no value less than the threshold D uniq Discard if it is added to the final set S. fin ={(x fnt1 ,yfnt1 ), (x fnt2 ,y fnt2 ),…, (x fnti ,y fnti ), (x fntn ,y fntn )}.
[0040] Step 5: In this example, first calculate the average point S from step 4. fin The Euclidean distance d between them, with a preset threshold D min =60 and D max =125, only retain those conforming to D min <d<D max Points within a certain range are selected as a group of candidate connection points to prevent over-connection. Next, the angle α between three adjacent points in this group of candidate connection points is calculated, and a threshold angle α is set. min =80° and α max =105°, if it satisfies α min <α<α max Connect two points and mark the point as connected. The quadrilateral has 45 sides, and a preset threshold C is set for the number of connections. max =4 is used to limit the number of times each point is connected; after a point is connected four times, it will not be connected again. The connecting line segments in the image are set to blue, and the set of connecting line segments is U={U1, U2, …, U…}. i , …, U n}
[0041] The image is then subjected to another HSV transformation to extract the blue line segment regions. A binary mask is generated to conceal the background, retaining only the blue line segments and improving the robustness of the quadrilateral approximation. Contour extraction is performed on the image edges, and quadrilateral approximation is performed on each contour. The lengths L of the four sides of the approximate quadrilateral are calculated. s And calculate the included angle α between adjacent angles. i Preset length error k s Angle threshold [α] min_rect, α max_rect When the difference between the side lengths of the quadrilateral is within the length error range k, s Within, all four angles are within α. min_rect <α i t <α max_rect It is determined to be a target quadrilateral polygon; Step 6: Extract the four corner points of the target quadrilateral polygon identified in Step 5, calculate the two pairs of diagonals of the quadrilateral and calculate the pixel coordinates P of their intersection point. center ={P1, P2, …, P i , …, P n}, where pi=(x centeri , y centeri ).
[0042]
[0043] Extract the linear interpolation results from step 1, and calculate the coordinates of the intersection of the diagonals of the quadrilateral in the geodetic coordinate system by reverse calculation of the linear difference according to equations (24) and (25), so as to realize the position positioning of the chain casting template box in the fully automatic process.
[0044] This embodiment tested the system by combining it with a camera on the pump truck head, which enabled stable detection and positioning of the chain-type casting formwork box.
[0045] In summary, the above are merely preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An automatic detection and positioning method for chain boxes based on image processing, characterized in that: Includes the following steps: Step 1: Acquire images of the desired region of interest. Establish a geodetic coordinate system to determine the specific location of the chain-cast formwork box. Mark and record the pixel coordinates and geodetic coordinates of any point at the four corners of the acquired image and the image center. Calibrate using linear interpolation, denoted as standard points D1=(X1,Y1), d1=(x1,y1), and standard points D2=(X2,Y2), d2=(x2,y2).
2. Step Two: Read the image from Step One and perform adaptive image preprocessing. First, convert it to grayscale image I. {gray}(x,y) I is obtained using an adaptive histogram. clahe(x,y) , to I clahe(x,y) Gaussian filtering is performed to obtain I blur(x,y) , to I blur(x,y) The edge map E is obtained using the Canny operator. (x,y) The line segment L is obtained by performing Hough transform on the edge map. i ; Step 3: The set of line segments in Step 2 is L = {L1, L2, …, L} i , …, L n },in, L i Let L represent the i-th line segment. Perform length equalization on the set of line segments to obtain the set of line segments of equal length. new ={L new1 , L new2 , …, L newi , …, L newn }, where L newi This represents the i-th line segment, and its color is changed to green.
3. Use a binary mask to remove the background and the set of line segments L, specifically for line segments L of equal length. new Perform secondary Canny edge detection and Hough transform to detect line segments, and extract the set L of line segments of equal length. new Image information. Preset line segment quantity threshold I len And perform quantity verification; if it exceeds the preset threshold I... len Repeat step three again. If the value is less than the threshold range, output the final set of line segments I = {I1, I2, ..., I...} i , …, I n }; Step 4: For each pair of line segments in the set I from Step 3, calculate the intersection points. Calculate the intersection point parameters t and s to determine if they are parallel or collinear. If they are not parallel or collinear, calculate the intersection point. The set of intersection points is (x int ,y int )={(x1,y1),(x2,y2), …, (x i ,y i ), (x n ,y n )},in, (x i ,y i Let (x) be the i-th point. For the set of all intersection points (x... int ,y int Clusters are constructed using a greedy algorithm, and the Euclidean distance between intersections is calculated, with a preset distance threshold D. cluster Clustering point determination is performed based on a distance threshold, and the center point of each cluster is calculated as the representative point. A second threshold D based on distance is then applied for deduplication. uniq Determine if the distance to all points is less than a threshold; discard any points that are less than a threshold. Extract the average point set d. (x,y) ={d1, d2, …, d i , …,d n }; Step 5: Calculate the average Euclidean distance between pairs of points. d Preset distance threshold D min and D max Threshold angle α min and α max Connection count threshold C max Connect points within a threshold range, and simultaneously mark the points that are connected and limit the number of connections C. max Change the color of the connecting line segments to blue. The set of connecting line segments is U = {U1, U2, …, U…}. i , …, U n }. Extract the blue line segment region using a mask and perform contour extraction. For each contour, perform polygon approximation. Calculate the lengths L of the four sides of the approximated quadrilateral polygon. s And calculate the included angle between adjacent angles. Preset length error k s Angle threshold [α] min_rect, α max_rect When the difference between the side lengths is within the length error range, and the angles of all four corners are within the angle threshold, it is determined to be a target quadrilateral polygon. Step Six: For the four points identified as the target quadrilateral polygon in Step Five, extract two pairs of diagonals from the four endpoints and calculate the pixel coordinates P of their intersection point. center ={P1, P2, …, P i , …, P n Save them sequentially. Extract the linear interpolation results from step one, and calculate the geodetic coordinates of the intersection point by reverse calculation of the linear interpolation, thus realizing the fully automated process of positioning the chain-type casting formwork box.