An automatic counting method and system for air intake tubes

CN122820727BActive Publication Date: 2026-10-30SHAANXI RUNZE BROSE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202611316125.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-10-30
Estimated Expiration
2046-08-28

AI Technical Summary

Technical Problem

[0004]然而,在处理堆叠或遮挡图像时,基于像素连通性的判定逻辑表现出明显的局限性:受限于进气管的复杂三维弯曲轮廓,重叠工况下的投影会产生复杂的粘连区域,使得物理隔离的多个实例在图像层面退化为单一的大型连通域

Benefits of technology

[0021]在第二方面,本发明提供了一种用于进气管的自动计数系统,用于进气管的自动计数系统包括存储器和处理器,所述存储器存储有计算机程序指令,当所述计算机程序指令被所述处理器执行时实现本发明第一方面的一种用于进气管的自动计数方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122820727B_ABST
    Figure CN122820727B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image data processing, and more particularly to an automatic counting method and system for intake pipes, which comprises the following steps: obtaining a pretreated image and extracting a skeleton containing several skeleton nodes; obtaining local features in a neighborhood window for the skeleton nodes and counting distribution characteristics, and calculating geometric consistency; obtaining a radial width sequence of the skeleton nodes and calculating width consistency; identifying end points and intersection points to segment the skeleton into several skeleton segments, obtaining connection weights based on geometric consistency at the end points, width consistency and spatial distance between the end points; and merging the skeleton segments based on the connection weights to obtain a target skeleton and count the number. The present application can reduce the interference of topological mutations caused by pipe body overlap on recognition by fusing physical criteria of path smoothness and cross-sectional roundness, and improve the accuracy of intake pipe counting.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology, and in particular to an automatic counting method and system for air intake pipes. Background Technology

[0002] As a component of the automotive powertrain, the intake manifold guides air into the combustion chamber. In the industrialized production and warehousing management of automotive parts, automatic counting of intake manifolds is crucial for complete production data recording and digital logistics monitoring. Considering the complex three-dimensional curved structure of the intake manifold and its random distribution on the conveyor belt, adopting an automated counting scheme is of great significance for improving production line efficiency and ensuring real-time data traceability.

[0003] In the existing technology, the automatic counting of workpieces on industrial conveyor belts mostly adopts the technical solution disclosed in Chinese Patent No. CN106803259B: This patent relies on an industrial vision system to collect image signals, performs connected component analysis on the pre-processed binarized image, and clusters spatially adjacent pixel sets into independent workpiece individuals based on pixel attribution determination logic in Euclidean space. Finally, the number of independent connected components that are separated from each other in the image is used as the counting result of the workpieces.

[0004] However, pixel connectivity-based decision-making logic exhibits significant limitations when processing stacked or occluded images: constrained by the complex three-dimensional curved contour of the intake pipe, projections under overlapping conditions generate complex adhesion regions, causing physically isolated instances to degenerate into a single large connected domain at the image level. Since Euclidean space-based counting schemes primarily rely on pixel attribution, they struggle to deconstruct the interwoven central paths within adhesion regions. Considering that overlap leads to nonlinear expansion and distortion at the pipe projection edges, relying solely on pixel connectivity without analyzing the depth evolution of local structures fails to establish rigorous individual segmentation criteria at the morphological level. This increases the probability of target misclassification; therefore, when dealing with high-density transport conditions, it is necessary to address the failure of topology recognition and the blurring of individual boundaries caused by complex stacking. Summary of the Invention

[0005] To address the technical problem of individual counting failure caused by the central path interlacing and contour distortion resulting from the stacking and adhesion of multi-dimensional curved intake pipes, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides an automatic counting method for an intake manifold, the method comprising the steps of:

[0007] A preprocessed image of the intake pipe is acquired, and its skeleton is extracted, comprising several skeleton nodes. For each skeleton node, its local curvature and local tangent direction within a neighborhood window are obtained, and the curvature distribution characteristics and tangent direction distribution characteristics within the neighborhood window are statistically analyzed. Based on the degree of difference between the local curvature and curvature distribution characteristics, and the degree of consistency between the local tangent direction and tangent direction distribution characteristics, the geometric consistency of the skeleton node is calculated. The radial width sequence of the skeleton node along several sampling directions is acquired, and the width consistency of the skeleton node is calculated based on the statistical distribution characteristics of the radial width sequence. The endpoints and intersections of the skeleton are identified, and the skeleton is divided into several skeleton segments using the endpoints and intersections. Based on the geometric consistency, width consistency, and spatial distance between the endpoints of any two skeleton segments, the connection weight of the two skeleton segments is obtained. The several skeleton segments are merged based on the connection weight to obtain the target skeleton, and the number of the target skeleton is counted.

[0008] This invention first acquires a preprocessed image and extracts a skeleton containing several skeleton nodes. Geometric consistency is obtained by utilizing the difference between local curvature and local tangent direction within the neighborhood window and the statistical features of the neighborhood. Simultaneously, radial width sequences along several sampling directions are acquired to evaluate width consistency. By fusing physical criteria of path smoothness and cross-sectional roundness, interference from unnatural turns and abnormal edge expansion caused by overlapping pipe projections is reduced. After identifying endpoints and intersections, the skeleton is segmented into several skeleton segments. Connection weights are obtained based on the spatial distance and feature consistency between endpoints, and merging is performed. This multi-level topology deconstruction logic can accurately reassemble physically isolated but logically connected intake pipe individuals, obtaining the number of target skeletons. This enhances the counting stability of randomly distributed objects in industrial environments, providing an accurate basis for the supervision of intake pipe production data.

[0009] Preferably, calculating the geometric consistency of the skeleton node based on the degree of difference between the local curvature and curvature distribution features, and the degree of consistency between the local tangent direction and tangent direction distribution features, includes: calculating the absolute deviation of the local curvature of the skeleton node from the average curvature within its neighborhood window, and using the ratio of the absolute deviation to a preset curvature deviation threshold as the curvature deviation normalization value; calculating the absolute deviation of the local tangent direction of the skeleton node from the average tangent direction within its neighborhood window, and using the ratio of the absolute deviation to a preset direction deviation threshold as the direction deviation normalization value; and using the product of the complement of the curvature deviation normalization value and the complement of the direction deviation normalization value as the geometric consistency of the skeleton node.

[0010] This invention extracts the curvature and tangent direction of skeleton nodes, calculates their absolute deviation from the statistical average of their local neighborhoods, and performs normalization and complement mapping based on a preset threshold, transforming discrete absolute geometric parameters into dimensionless geometric consistency scores. This mechanism can accurately assess the physical reliability of the skeleton in the axial direction dimension, effectively reducing misjudgments caused by unnatural sharp corners or curvature abrupt changes at intake pipe overlaps that affect subsequent topological connections.

[0011] Preferably, the step of calculating the width consistency of the skeleton node based on the statistical distribution characteristics of the radial width sequence includes: calculating the sum of the absolute deviations of each radial width component in the radial width sequence of the skeleton node from the average radial width of the skeleton node within its neighborhood window, to obtain a total deviation; calculating the product of the total number of sampling directions and the average radial width, to obtain a normalized reference value; and using the complement of the ratio of the total deviation to the normalized reference value as the width consistency of the skeleton node.

[0012] This invention constructs a width consistency evaluation model based on the dimensional deviation ratio by calculating the sum of the absolute deviations between the width components in each radial sampling direction and the average radial width of the neighboring area. This model can evaluate the radial symmetry and stability of the intake pipe cross-section under normal two-dimensional projection, thereby effectively eliminating the interference caused by the non-uniform edge expansion resulting from the mutual obstruction of multiple intake pipes on the identification of the true shape of the pipe body.

[0013] Preferably, obtaining the radial width sequence of the skeleton node along several sampling directions includes: obtaining the normal direction of the skeleton node; setting several deflection angles based on the normal direction to obtain several sampling directions; extending to both sides along the several sampling directions to obtain two boundary intersections corresponding to the sampling directions on the preprocessed image; calculating the distance between the two boundary intersections corresponding to the several sampling directions to obtain the radial width sequence of the several sampling directions.

[0014] This invention uses the normal direction of the skeleton node as a reference to set the deflection angle to determine the sampling direction, extends to both sides to detect the boundary intersection of the preprocessed image and calculates the distance, thereby obtaining a complete radial width sequence, realizing all-round coverage of the intake pipe cross-section distribution signal, and improving the coverage density of local edge distortion detection.

[0015] Preferably, the step of obtaining the connection weight of the two skeleton segments based on the geometric consistency, width consistency, and spatial distance between the endpoints of any two skeleton segments includes: obtaining the ratio of the Euclidean distance between the corresponding endpoints of the two skeleton segments to a preset distance attenuation constant to obtain a distance attenuation ratio; calculating the product of the average values ​​of the geometric consistency of the two skeleton segments within their respective corresponding endpoint neighborhood windows to obtain a first average product; calculating the product of the average values ​​of the width consistency of the two skeleton segments within their respective corresponding endpoint neighborhood windows to obtain a second average product; and multiplying the complement of the distance attenuation ratio, the first average product, and the second average product to obtain the connection weight of the two skeleton segments.

[0016] This invention transforms the Euclidean distance between the endpoints of skeleton segments into a distance attenuation ratio, and multiplies and fuses this ratio with the mean of geometric consistency and the mean of width consistency in the endpoint neighborhood to construct a connection weight calculation model with multidimensional joint constraints. This method not only controls the maximum allowable physical gap in spatial association through distance constraints, but also establishes a rigorous cross-occlusion association threshold using high-confidence requirements of multiple physical features, reducing the probability of erroneous merging under complex fracture conditions.

[0017] Preferably, the step of extracting the skeleton of the preprocessed image includes: performing binarization processing on the preprocessed image to obtain a binarized image, the binarized image containing a foreground region and a background region; performing iterative thinning operations on the binarized image using a morphological thinning algorithm, peeling off pixels in the foreground region layer by layer until a single-pixel width of connected path is retained, thereby obtaining the skeleton.

[0018] Preferably, identifying the endpoints and intersections of the skeleton includes: counting the number of non-zero pixels of each skeleton node in a preset neighborhood within a preset detection window; when the number of non-zero pixels is 1, it is recorded as an endpoint; when the number of non-zero pixels is greater than or equal to 3, it is recorded as an intersection.

[0019] Preferably, the step of dividing the skeleton into several skeleton segments using the endpoints and intersections includes: removing or setting the pixels at the intersections to the background color, breaking the skeleton at the intersections to obtain a broken skeleton; and using a connected component labeling algorithm to extract independent connected regions in the broken skeleton to obtain several skeleton segments.

[0020] Preferably, the step of merging the plurality of skeleton segments based on connection weights to obtain a target skeleton includes: setting a connection threshold; merging the corresponding two skeleton segments when the connection weight between any two skeleton segments is greater than the connection threshold, until all skeleton segments that meet the conditions are merged to obtain an independent connected path; and recording the independent connected path as the target skeleton.

[0021] In a second aspect, the present invention provides an automatic counting system for an intake manifold, the automatic counting system for an intake manifold including a memory and a processor, the memory storing computer program instructions, which, when executed by the processor, implement an automatic counting method for an intake manifold according to the first aspect of the present invention.

[0022] By adopting the above technical solution, a computer program for an automatic counting method for an air intake pipe according to the first aspect of the present invention is generated and stored in a memory so that it can be loaded and executed by a processor, thereby creating a terminal device based on the memory and the processor for convenient use.

[0023] The beneficial effects of this invention are as follows: This invention uses a two-way criterion of geometric consistency and width consistency to assess reliability from two physical dimensions: the smoothness of the skeleton axis and the roundness of the pipe cross-section width. This reduces interference from abnormal expansion of the projection edges of overlapping areas or topological abrupt changes on individual identification. This invention utilizes multi-dimensional constraint association logic to obtain connection weights, integrating the Euclidean distance between pairs of points to be connected and multiple statistical average features within the neighborhood window. It logically merges the segmented skeleton segments to obtain the target skeleton, achieving accurate deconstruction of complex topological structures that are physically isolated but logically connected. This invention combines image topology analysis with industrial production counting scenarios. By counting the number of target skeletons, it achieves automatic counting and outputs results in real time using industrial communication protocols. This reduces the probability of misidentification caused by environmental clutter under random and scattered distribution conditions, improving the digitalization level of intake pipe logistics monitoring. Attached Figure Description

[0024] Figure 1 A flowchart of an automatic counting method for an intake pipe provided in an embodiment of the present invention; Figure 2 The image provided in this embodiment of the invention is the original image of the intake pipe. Figure 3 A schematic diagram illustrating the processing results of the method of the present invention provided in an embodiment of the present invention; Figure 4 This is a structural block diagram of an automatic counting system for an air intake pipe, provided as an embodiment of the present invention. Detailed Implementation

[0025] The first aspect of this invention provides an automatic counting method for an intake pipe, such as... Figure 1 As shown, the method includes steps S100-S400: Step S100: Obtain the preprocessed image of the intake pipe and extract the skeleton.

[0026] It should be noted that, in order to achieve accurate counting of the intake pipes, it is first necessary to acquire the original image of the intake pipes. Considering the complex lighting and background clutter in the production line environment, which can interfere with the edge features of the pipes, this invention preprocesses the original image to filter out stray background and highlight the contour features of the pipes. Simultaneously, considering that high-quality contour information is the foundation for subsequent topology reconstruction, this invention suppresses non-target noise in the image, providing a preprocessed image with smooth edges and a complete topological structure for subsequent steps, effectively reducing the probability of misidentification due to environmental clutter.

[0027] Specifically, an industrial camera deployed directly above the conveyor belt is used to acquire raw images of the air intake pipe in real time; the raw images are then preprocessed to obtain preprocessed images of the air intake pipe.

[0028] The preprocessing includes: converting the original image into a single-channel grayscale image using a color space conversion algorithm to reduce the complexity of subsequent calculations; and using a median filtering algorithm to smooth and denoise the grayscale image in spatial dimensions to obtain a denoised image, which is then used as the preprocessed image.

[0029] Furthermore, binarization is required before extracting the skeleton.

[0030] Specifically, a preset threshold is set based on the global grayscale distribution characteristics of the image, and a binarization operation is used to map the preprocessed image into a binarized image. In the binarized image, the air intake area is marked as the foreground area, and the background is marked as the background area. In addition, morphological opening operations can be used to remove isolated noise pixels in the background, thereby improving the clarity of the binarized image.

[0031] The preset threshold can be dynamically adjusted according to the ambient light intensity of the production line. As a preferred embodiment, the preset threshold value is set to an integer between 120 and 180. Preferably, the filter window size can be set to... Pixels. The choice of this parameter balances the physical scale of the intake pipe edge signal with the noise spectrum characteristics: if the window is too large, it will increase the probability of edge features at the pipe bends becoming diffused and causing geometric distortion; if the window is too small, the suppression effect on high-intensity reflection noise from the metal surface will be limited.

[0032] It should be noted that the intake pipe, in physical space, appears as a tubular entity with a fixed diameter and continuous extension. Its shape and orientation can be characterized by extracting its topological centerline, which is defined as the skeleton in this invention. To achieve topological simplification of the entity's shape while preserving key connectivity relationships, it is necessary to compress the planar regions in the binarized image into centerline segments with a single pixel width using image thinning techniques.

[0033] Specifically, extracting the skeleton of the preprocessed image includes: performing iterative thinning operations on the binarized image using a morphological thinning algorithm. This process, while maintaining image connectivity, peels away pixels from the foreground region layer by layer, i.e., eliminating edge thickness, until the foreground region converges to a connected path of single-pixel width, thereby obtaining the skeleton. To facilitate subsequent discretized geometric analysis, this invention defines each pixel constituting the skeleton as a skeleton node.

[0034] like Figure 2 As shown, this image is the original image of the intake pipe. Under actual production line conditions, due to the metallic properties of the intake pipe surface, the image contains high-intensity reflected glare and background clutter interference. Furthermore, multiple intake pipes are randomly stacked on the conveyor belt, forming complex physical overlaps and visual occlusion areas. This causes severe nonlinear distortion and visual adhesion of the pipe edge features in the projection plane, making it difficult to discern the true contours of each pipe instance and complicating subsequent accurate counting analysis.

[0035] Thus, the skeleton extraction based on the preprocessed image of the air intake pipe was completed, and a skeleton composed of several skeleton nodes was obtained.

[0036] Step S200: Calculate the geometric consistency of each skeleton node in the skeleton.

[0037] As a rigid, smoothly curved body, the intake pipe's corresponding skeleton curve should satisfy curvature smoothness and directional continuity in physical space. However, when multiple intake pipes overlap on the projection plane, the topology of the adhesion region changes drastically, causing unnatural turns in the extracted skeleton at the overlap points. This invention obtains the geometric deviation of each position on the skeleton from its neighborhood window to acquire the confidence level of the skeleton in the orientation dimension, thereby identifying geometric jump points caused by overlap and providing prior constraints in the line dimension for subsequent logical connections.

[0038] First, a neighborhood window is constructed, and the curvature and orientation features of each skeleton node are calculated. It should be noted that, to accurately reflect the consistency of curvature across skeleton nodes, it is not sufficient to rely solely on the geometric parameters of a single point. Instead, the average state within the neighborhood window needs to be obtained based on statistical principles as a reference benchmark to mitigate computational interference caused by discrete pixel sampling.

[0039] Specifically, this invention constructs a neighborhood window centered on any skeleton node, extracts the coordinate sequence of all skeleton nodes contained within the neighborhood window, performs quadratic polynomial fitting on the coordinate sequence using the least squares method to construct the local curve equation at that location, and calculates the local curvature value and tangent direction angle of the skeleton node based on the second derivative of the local curve equation at the current skeleton node. Furthermore, this invention simultaneously calculates the average curvature, standard deviation of curvature, and average tangent direction angle of all skeleton nodes within the neighborhood window.

[0040] In a preferred embodiment, the size of the neighborhood window can be set to... Pixels. The choice of this size is based on a balance between the physical characteristics of the air intake and statistical stability: considering that the local minimum bending radius of the air intake at the current imaging magnification is in the range of 15 to 30 pixels, The neighborhood window of a pixel can provide enough skeleton node samples to ensure the robustness of fitting operations and statistical extraction, and can also effectively suppress interference from distant irrelevant contours or background clutter introduced by an excessively large neighborhood window.

[0041] Then, the geometric consistency of each skeleton node is calculated. It should be noted that in the region where the intake pipe extends normally, the curvature change of the skeleton line is in a low steady-state range, and its tangential direction has a high degree of consistency. However, at the pseudo-topological connection caused by the mutual obstruction of two pipes, the skeleton will produce sharp corners or abrupt curvature fluctuations due to forced connectivity. Therefore, this invention transforms the absolute geometric features into a dimensionless confidence score by comparing the statistical distribution difference between the current skeleton node and the neighboring window, which is used to characterize the physical reliability of the skeleton node in the axial direction dimension.

[0042] Based on the above logic, the geometric consistency of any skeleton node satisfies the following relation: ; in, It is a skeleton node Geometric consistency; It is a skeleton node The curvature value; It is a neighborhood window The average curvature of all skeleton nodes within the structure; It is a skeleton node The angle of the tangent direction at that point; It is a neighborhood window The average tangent direction angle of all skeleton nodes within the structure; It is a preset curvature deviation threshold, used to characterize the maximum allowable curvature fluctuation range when the tube body is normally bent. The value of the curvature deviation threshold is based on the minimum bending radius of the intake pipe, and is preferably set as the reciprocal of the minimum bending radius. It is a preset first tiny value to prevent the denominator from being 0, and the preferred value range is... ; It is the absolute value symbol; It is a preset directional deviation threshold, used to characterize the maximum tolerable deflection angle of the skeleton orientation, preferably... or .

[0043] In this relation, Used to evaluate the smoothness of curvature, when the curvature of a skeleton node deviates little from the mean in its neighborhood window, the fraction value approaches 0, and this term approaches 1, indicating that the skeleton node is in a smoothly extending tube body region with high confidence; conversely, if it is at a distortion point caused by overlap, since the curvature deviation exceeds the statistical tolerance range of the neighborhood window, this term will decrease linearly. To assess directional consistency, the linear difference between the tangent angle of a skeleton node and the mainstream directional angle of its neighborhood window is used as a mapping benchmark. When the tangent direction of a skeleton node is consistent with the overall orientation of the neighborhood window, this result approaches 1; conversely, if the direction undergoes drastic oscillations or reversals, this result will significantly decrease, thereby effectively reducing the weight of skeleton nodes with abnormal orientations in subsequent topological connections.

[0044] The core of the geometric consistency constructed in this invention lies in utilizing the morphological stability of the intake pipe as a rigid entity to transform complex image topological features into assessable physical confidence. This relation considers the continuity characteristics of tubular targets in nature under two-dimensional projection: First, the relation introduces a mapping between the curvature deviation and a preset threshold, the logic of which is to establish a fault-tolerant mechanism based on physical scale. In the gently curved region of the intake pipe, although normal curvature changes exist, because this change is within... Within the defined steady-state range, geometric consistency remains at a high level. However, when entering the pseudo-topological region caused by overlapping pipes, the skeleton lines generate physically unrealizable sudden bends. These anomalous jumps significantly exceed the preset statistical tolerance range, triggering a linear reduction mechanism and causing a sharp drop in confidence. Secondly, this relationship constructs a multi-dimensional joint constraint judgment logic through the multiplicative fusion of the direction consistency term and the smoothness term. This follows the engineering verification principle: a reliable skeleton node must simultaneously satisfy the natural laws of local curvature stability and overall direction consistency. If any dimension deviates, such as a directional oscillation or a sudden increase in curvature, the final consistency score will rapidly approach zero. This effectively eliminates numerical fluctuations caused by environmental noise, discrete sampling, or minor glitches, ensuring the robustness and real-time performance of the algorithm when handling high-density overlapping conditions.

[0045] At this point, the geometric consistency of each skeleton node has been obtained.

[0046] Step S300: Calculate the width consistency of each skeleton node in the skeleton.

[0047] It should be noted that the cross-section of the intake pipe exhibits high radial symmetry under normal conditions. Physically, the projected width of a single intake pipe along its axial normal direction should remain relatively stable; however, when multiple intake pipes overlap in the projection plane, the edges of the adhesion area will expand outwards unevenly, resulting in impaired roundness of the cross-section. This invention introduces physical constraints from the volumetric feature dimension of the pipe morphology, providing an independent physical criterion for segmenting overlapping regions by identifying abnormal edge expansion in the preprocessed image caused by overlap.

[0048] First, radial width sampling is performed. It should be noted that, as a three-dimensional tube, the width characteristics of the two-dimensional projection of the intake pipe are affected by multiple factors such as viewing angle and deformation. It is difficult to fully capture the symmetry changes of the cross-section by relying on a single dimension measurement. It is necessary to obtain the complete spatial distribution signal through multi-dimensional radial detection.

[0049] Specifically, for any skeleton node on the skeleton Calculate the tangent direction at the skeleton node, and then obtain the normal direction perpendicular to the tangent. Using this normal direction as a reference, set several deflection angles within a preset angle range. For example, set the deflection angle range to... ,in, The value can be set to To cover the entire circumference, uniformly sample within the deflection angle range. From each angle, thus obtaining Each sampling direction is used; for each sampling direction, the search extends outwards from the current skeleton node until the edge boundary of the intake pipe in the binarized image is detected, thereby determining the two boundary intersection points corresponding to that sampling direction in the binarized image; the Euclidean distance between these two boundary intersection points is calculated and used as the radial width component under that sampling direction. This process is repeated for all sampling directions to obtain the result. A radial width sequence composed of sampling directions ,in ; It represents the total number of sampling directions for the radial width.

[0050] As a preferred implementation, the total number of sampling directions The value needs to be set according to the minimum diameter of the intake pipe to ensure the coverage density of radial detection. In this embodiment, The step size is set to 16, which means that the radial detection is performed in a step size of 22.5° for the whole cycle. The choice of this step size balances the computational cost and the accuracy of feature capture.

[0051] Then, width consistency is calculated. It should be noted that, due to the asymmetric nature of edge distortion caused by overlap in different sampling directions, the measured value sequence deviates from the ideal circular distribution. This invention utilizes the arithmetic deviation mapping principle to measure the geometric roundness of the cross section, achieving a linear mapping of apparent size distortion to obtain the characteristic deviation caused by overlap.

[0052] Based on the above logic, the width consistency of any skeleton node satisfies the following relationship: ; in, It is a skeleton node Consistency in width; It is a skeleton node The first in the radial width sequence One radial width component; It is a skeleton node In its neighborhood window The average value of the inner radial width; It is a preset second tiny value, used to prevent the denominator from being zero. The preferred value range is ; It represents the total number of sampling directions for the radial width; It is the absolute value symbol.

[0053] In this formula, the numerator calculates the sum of the absolute deviations of the width values ​​in each sampling direction from the local reference mean, characterizing the fluctuation intensity of the cross-sectional geometry; the denominator, as a normalization reference, represents the average physical scale within the neighborhood. The formula applies if and only if the widths of all sampling directions... All equal to the mean When the physical shape of the cross-section is completely symmetrical in a two-dimensional projection, the number of molecules is 0. for When overlap occurs, leading to non-uniform edge expansion, the degree to which the sampling sequence deviates from the mean reference system increases, the fractional value increases, and thus... It shows a trend of decreasing as the deviation increases.

[0054] The width consistency constructed in this invention is essentially based on the inherent radial symmetry and dimensional stability of the intake pipe cross-section in industrial production. Under normal physical production and transportation conditions, the cross-section of a single intake pipe tends to be circular or elliptical under ideal projection, and its radial width sequence probed outward along the central frame exhibits high stability. First, this relation utilizes multi-dimensional radial sampling to construct a volumetric feature detection mechanism for the pipe body. This corresponds to omnidirectional radial verification in physical space, capable of capturing local deformations that are difficult to detect with single-dimensional measurements. When the intake pipe is in an independent state, the sampling sequence closely matches the neighborhood mean sequence; when physical overlap occurs between pipe bodies, the edge of the overlapping area, accompanied by the overlap of multiple pipe walls, produces non-uniform outward expansion. The asymmetry exhibited by this expansion in different sampling directions causes the measured value sequence to deviate significantly from the ideal physical distribution law. Second, the relation adopts a standardized calculation method based on the arithmetic mean deviation ratio, the core of which lies in mapping complex cross-sectional distortions into a dimensionless stability evaluation. This logic adheres to the constraints of rigid entities in physical space, assessing the roundness of the intake pipe by measuring the deviation of the actual sampling sequence from an ideal mean reference system. Compared to directly using absolute dimensions for judgment, this effectively resists dimensional fluctuations caused by changes in imaging angle, light and shadow occlusion, or manufacturing tolerances, while avoiding computational redundancy caused by square root or exponential operations. Through this mapping based on natural laws, this invention can accurately identify abnormal edge expansion caused by overlap, thus providing an independent and reliable physical criterion for the segmentation and identification of overlapping areas.

[0055] At this point, the width consistency of each skeleton node has been achieved.

[0056] Step S400: Identify and merge skeleton segments to obtain counting results.

[0057] It should be noted that, for the problem of topological breakage or adhesion caused by overlapping intake pipes under high-density conveying conditions, relying solely on geometric proximity is insufficient to accurately determine instance attribution. This invention, through multi-dimensional constraint association logic, integrates the geometric orientation characteristics of the skeleton lines with the width consistency of the pipe body to accurately merge physically isolated but logically connected skeleton segments, thereby obtaining a counting result that truly reflects the number of individuals.

[0058] First, several independent skeleton segments are obtained. It should be noted that, due to the complex overlapping conditions, the original skeleton contains false branches and overlapping intersections. It is necessary to decompose the skeleton by identifying key topological nodes and transform it into feature segments with definite physical meaning in order to facilitate subsequent fine-grained logical associations.

[0059] Specifically, this invention traverses the skeleton, scans each skeleton node using a probe window, and counts the number of non-zero pixels in the 8-neighborhood of each skeleton node within the probe window. When the number of non-zero pixels is 1, the skeleton node is determined to be an endpoint; when the number of non-zero pixels is greater than or equal to 3, the skeleton node is determined to be an intersection. The specific operation involves removing the pixels at the intersection from the skeleton image, or setting the pixel value at the intersection to the background color, thus physically breaking the originally connected skeleton network. A connected component labeling algorithm is used to traverse the broken image, extracting all independent connected regions that are not connected to each other. Each connected region is then marked as an independent skeleton segment. The skeleton segment is presented as a single-pixel connected line segment, and each independent skeleton segment naturally contains two endpoints: either the original skeleton endpoint or a newly generated breakpoint after the intersection is removed.

[0060] In a preferred embodiment, the size of the detection window can be set to... Pixels. This size is chosen based on the topological characteristics of the single-pixel skeleton, ensuring physical accuracy in identifying endpoints and intersections.

[0061] Secondly, when calculating the feature matching parameters between each skeleton segment, it's important to note that skeleton breaks caused by overlap are spatially random, and the break locations are often accompanied by sampling noise. If only features from a single point are extracted as the association criterion, pixel-level jitter can easily lead to association failure. Therefore, it's necessary to find the closest physical endpoint pairs between skeleton segments and combine this with the statistically averaged features within the endpoint neighborhood to establish a robust foundation for cross-occlusion association.

[0062] Specifically, for any two skeleton segments and skeleton segment Extract skeleton segments respectively Skeletal segment The coordinates of the two endpoints are determined; by calculating all four possible Euclidean distance combinations between the endpoints of the two segments, the set of endpoints with the smallest distance is selected as the corresponding endpoint. A neighborhood window is then constructed centered on each of these corresponding endpoints. Calculate the neighborhood window Geometric consistency of all skeleton nodes within And perform an arithmetic average to obtain the skeleton segment. Skeletal segment The average geometric consistency within its corresponding endpoint neighborhood window , ; Calculate the neighborhood window The width of all skeleton nodes within is consistent. And perform an arithmetic average to obtain the skeleton segment. Skeletal segment The average width consistency within its corresponding endpoint neighborhood window , .

[0063] Then, the connection weights between each skeleton segment are calculated. It should be noted that the topological breaks caused by occlusion are represented as isolated segments that are not directly adjacent in the image space. This invention establishes candidate association pairs in the manifold space and calculates the similarity measure between non-adjacent skeleton segments to achieve logical connections across occlusion regions.

[0064] Specifically, by calculating the skeleton segment With skeleton segment Connection weights This is to assess the possibility that the two belong to the same intake manifold entity. Based on the above logic, the connection weights of any two skeleton segments satisfy the following relationship: ; in, It is a skeletal segment With skeleton segment The connection weights, with values ​​ranging from 0 to 1; It is a skeletal segment With skeleton segment The Euclidean distance between the corresponding endpoints; It is the distance decay constant, used to characterize the maximum physical gap that allows topological breaks to occur; , They are the skeleton segments Skeletal segment The average geometric consistency within its corresponding endpoint neighborhood window; , They are the skeleton segments Skeletal segment The average width consistency within the neighborhood window of its corresponding endpoint.

[0065] In this relation, For the distance constraint term, the skeleton segment was calculated. and The degree of proximity in spatial distribution decreases monotonically with increasing physical displacement. and The multi-dimensional fusion constraint logic is constructed such that the calculation result approaches 1 if and only if the geometric orientation and width stability of two skeleton segments are simultaneously at a high confidence level; if the physical features of any dimension are severely distorted at the overlapping position, the connection weight will be constrained and decrease rapidly. When that happens, set its corresponding connection weight to 0.

[0066] This invention achieves a deep reconstruction of the physical continuity of the intake pipe by constructing a connection weight evaluation criterion when processing the association of cross-obstruction skeleton segments. This relationship is not a simple numerical superposition, but follows a multi-dimensional physical property joint constraint law: First, the relationship multiplicatively couples spatial distance constraints with the consistency of local deformation features. This establishes a joint threshold based on physical logic. In a real intake pipe continuum, the two skeleton segments at the break point must simultaneously satisfy three natural properties: spatial proximity, continuous orientation, and stable cross-sectional shape. Through multiplication, if any dimension of the physical feature exhibits significant distortion, such as excessive distance or loss of cross-sectional roundness due to unnatural overlap, the final connection weight will be significantly suppressed. Second, this criterion effectively eliminates the interference of discrete pixel-level noise on the expression of physical laws by introducing the neighborhood statistical average as a feature input. This corresponds to the smoothing of measurement data in engineering practice, ensuring that the association logic is based on the macroscopic physical trend of the pipe body, rather than random sampling fluctuations. By using this mapping method based on natural laws, the present invention can accurately restore the topological structure of the target entity across visual occlusion areas, ensuring the objectivity of the counting results under high-density working conditions.

[0067] It should be noted that the distance attenuation constant The value needs to be set according to the physical dimensions of the intake pipe: for operating conditions with a large expected overlap area and a long break gap, it can be increased. To provide redundancy for long-range correlation, it can be set to 5 times the average projected diameter of the intake pipe; for operating conditions with low delivery density and limited breakpoints, it can be appropriately reduced. For example, it can be set to 1.5 times the average projected diameter of the intake pipe. In this embodiment, The optimal setting is three times the average projected diameter of the intake pipe. This setting balances the ability to capture real connections with the filtering effect on spurious connections. It should also be noted that... .

[0068] Finally, topology merging and counting are performed. It's important to note that in complex industrial vision environments, preprocessed images may contain background artifacts or non-target adhesion. Without thresholding the connection weights, erroneous topology reorganization can occur, leading to counting bias. By setting a hard connection threshold and performing coordinate sequence merging, we can ensure that only segments conforming to the physical laws of rigid bending bodies are reorganized into single target instances, thus guaranteeing the reliability of the counting results.

[0069] Specifically, set connection thresholds. A candidate pool is established, and for all skeleton segments to be processed, the connection weight between any two skeleton segments is calculated. When merging, the pair of skeleton segments and their corresponding connection weights are stored in the candidate pool and sorted from highest to lowest connection weight. During merging, the principle of prioritizing the pair with the highest connection weight is followed, selecting the skeleton segment pair with the highest connection weight first. For example, if the skeleton segment pair has the highest connection weight, the pair with the highest connection weight is selected first. With skeleton segment When the connection weight is at its maximum, it is determined that the two belong to the same intake pipe, and coordinate sequence splicing is performed: the skeleton segment is... Tail end point and skeleton segment The first endpoint or the nearest endpoint is connected to form a new connected path. After one merging, all other candidate connections involving the merged endpoints are immediately removed from the candidate pool to resolve conflicts when an endpoint simultaneously meets the threshold with multiple candidate segments. This merging process is iterative: the newly generated connected path is treated as a new object, and its geometric consistency and width consistency mean values ​​in the neighborhood of its endpoints are recalculated and updated. It continues to participate in the connection weight sorting and determination of the remaining skeleton segments until there are no more skeleton segment pairs that meet the threshold conditions in the candidate pool. At this point, all independent connected paths that are not connected to each other in the image are the final determined target skeletons. Finally, the total number of the target skeletons is counted, and this value is the automatic counting result of the air intake pipe. The connection threshold is preferably set between 0.5 and 0.8. When the surface reflection of the air intake pipe is severe or the overlap density is high, the connection threshold can be appropriately increased to 0.75 to prevent false merging; when the lighting is uniform and the background is clean, it can be appropriately reduced to 0.55 to improve the ability to capture small breaks.

[0070] It should be noted that, to ensure the closed-loop nature of the counting process and the real-time nature of the physical response, this invention outputs the automatic counting results to the production management system in real time via an industrial communication protocol and performs continuous verification. Simultaneously, the production management system controls the physical sorting mechanism at the end of the conveyor belt based on the received counting data.

[0071] like Figure 3 As shown in the figure, this diagram illustrates the processing result of the method of the present invention. (Comparison is needed for a clearer understanding of the process.) Figure 2 As can be seen from the original state, even in areas where the intake pipes severely overlap and their edges exhibit nonlinear distortion, this invention can still utilize multi-dimensional physical constraints of geometric and width consistency to cross visual breakpoints, deconstructing and recombining the adhered targets into continuous and independent target skeletons, i.e., the thin black connected lines in the figure. This invention maps the final target skeleton back to the original image space and visually delineates the visible pipe areas of each individual intake pipe based on the target skeleton, i.e., the outer contour lines in the figure. This effectively restores the physical continuity of the pipes, reduces the risk of counting failures caused by complex stacking, and thus provides a basis for the supervision of production data.

[0072] This completes the automatic intake manifold counting method.

[0073] The second aspect of this embodiment provides an automatic counting system for an intake pipe, such as... Figure 4 As shown, the automatic counting system for the intake manifold includes a memory and a processor. The memory stores computer program instructions, which, when executed by the processor, implement an automatic counting method for the intake manifold according to the first aspect of the present invention.

[0074] The automatic counting system for the intake manifold also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the setup and functions of which are known in the art and will not be described in detail here.

[0075] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as resistive random access memory (DRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (DRAM), high-bandwidth memory, hybrid memory cube, etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device.

[0076] The above are all preferred embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Therefore, all equivalent changes made in accordance with the structure, shape and principle of the present invention should be covered within the scope of protection of the present invention.

Claims

1. An automatic counting method for an intake pipe, characterized in that, include: Obtain a preprocessed image of the intake manifold, and extract the skeleton of the preprocessed image, which contains several skeleton nodes. For each skeleton node in the skeleton, its local curvature and local tangent direction within its neighborhood window are obtained, and the curvature distribution characteristics and tangent direction distribution characteristics within the neighborhood window are statistically analyzed. Based on the degree of difference between local curvature and curvature distribution characteristics, and the degree of consistency between local tangent direction and tangent direction distribution characteristics, the geometric consistency of the skeleton node is calculated, satisfying the following: , skeleton nodes Geometric consistency, skeleton nodes The curvature value, For neighborhood windows The average curvature of all skeleton nodes within the structure. skeleton nodes The angle of the tangent direction at that point. For neighborhood windows The average tangent direction angle of all skeleton nodes within the structure. The preset curvature deviation threshold, To preset the first tiny value, It is the absolute value symbol. The preset directional deviation threshold; Obtain the radial width sequence of the skeleton nodes along several sampling directions, and calculate the width consistency of the skeleton nodes based on the statistical distribution characteristics of the radial width sequence, satisfying: , skeleton nodes Width consistency skeleton nodes The first in the radial width sequence One radial width component, skeleton nodes In its neighborhood window The average value of the inner radial width, To preset the second tiny value, This represents the total number of sampling directions for the radial width. Identify the endpoints and intersections of the skeleton, and segment the skeleton into several skeleton segments using these endpoints and intersections. Based on the geometric consistency, width consistency, and spatial distance between the endpoints of any two skeleton segments, obtain the connection weight between the two skeleton segments, satisfying the following: , skeleton segment With skeleton segment The connection weights, skeleton segment With skeleton segment The Euclidean distance between the corresponding endpoints The distance attenuation constant is , They are skeleton segments. Skeletal segment The average geometric consistency within its corresponding endpoint neighborhood window. , They are skeleton segments. Skeletal segment The average width consistency within its corresponding endpoint neighborhood window; Several skeleton segments are merged based on connection weights to obtain the target skeleton, and the number of target skeletons is counted.

2. The automatic counting method for an intake pipe according to claim 1, characterized in that, Obtain the radial width sequence of the skeleton node along several sampling directions, including: Obtain the normal direction of the skeleton node, and set several deflection angles based on the normal direction to obtain several sampling directions; Extending to both sides along the aforementioned sampling directions, two boundary intersections of the corresponding sampling directions are obtained on the preprocessed image; Calculate the distance between the two boundary intersections corresponding to the several sampling directions to obtain the radial width sequence of the several sampling directions.

3. The automatic counting method for an intake pipe according to claim 1, characterized in that, The extraction of the skeleton from the preprocessed image includes: The preprocessed image is binarized to obtain a binarized image, which contains a foreground region and a background region; The binarized image is iteratively thinned using a morphological thinning algorithm, peeling away pixels in the foreground region layer by layer until a single-pixel width of connected path is retained, thus obtaining the skeleton.

4. The automatic counting method for an intake pipe according to claim 1, characterized in that, The endpoints and intersections of the identified skeleton include: Count the number of non-zero pixels of each skeleton node in the preset neighborhood within the preset detection window; When the number of non-zero pixels is 1, it is denoted as an endpoint; When the number of non-zero pixels is greater than or equal to 3, it is recorded as an intersection point.

5. The automatic counting method for an intake pipe according to claim 1, characterized in that, The process of dividing the skeleton into several skeleton segments using endpoints and intersections includes: Remove or set the pixels at the intersection points to the background color, and break the skeleton at the intersection points to obtain a broken skeleton; The connected component labeling algorithm is used to extract independent connected regions in the broken skeleton, resulting in several skeleton segments.

6. The automatic counting method for an intake pipe according to claim 1, characterized in that, The process of merging several skeleton segments based on connection weights to obtain the target skeleton includes: Set connection threshold; When the connection weight between any two skeleton segments is greater than the connection threshold, the corresponding two skeleton segments are merged until all skeleton segments that meet the conditions are merged to obtain an independent connected path. The independent connected paths are denoted as the target skeleton.

7. An automatic counting system for an air intake pipe, characterized in that, The automatic counting system for the intake pipe includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement an automatic counting method for the intake pipe according to any one of claims 1-6.

Citation Information

Patent Citations

  • An Automatic Visual Detection and Counting Method for Cigarette Sticks on a Conveyor Flow Platform

    CN106803259B

  • Neural network and point cloud spatial feature-based road center line determination method and system

    CN120808115A

  • Drain pipe defect detection method and system based on image processing

    CN121883499A