Method and device for visual counting of materials on a combination scale
By establishing a mapping between images and physical space in the combined scale, identifying occlusion risk areas and generating adaptive acquisition strategies, the problem of insufficient information and redundant data caused by occlusion in multi-channel discharge scenarios is solved, and high-precision material counting is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGODNG HIGH DREAM INTELLECTUALIZED MACHINERY CO LTD
- Filing Date
- 2026-03-06
- Publication Date
- 2026-06-02
AI Technical Summary
In multi-channel discharge scenarios of combined scales, existing visual counting methods suffer from insufficient information and redundant data due to occlusion, making it difficult to achieve optimal information acquisition. Furthermore, traditional weighted average or voting mechanisms cannot adaptively suppress the influence of abnormal channels, reducing the accuracy and reliability of the counting results.
By establishing a mapping between images and physical space through spatial morphology registration, identifying occlusion risk areas and generating adaptive acquisition strategies, performing material movement characteristic analysis and trajectory prediction, and combining multi-frame time sequence verification and channel reliability classification, weighted integration and dynamic correction of multi-channel data are achieved.
The sampling resource allocation was optimized, the information capture capability of key areas was improved, the accurate determination of material ownership under obstruction conditions was ensured, and the reliable fusion of multi-channel counting data and the accuracy of counting results were guaranteed through dynamic correction.
Smart Images

Figure CN122135298A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision and image processing technology, and in particular to a method and apparatus for visual counting of materials using a combination scale. Background Technology
[0002] In automated production lines, vision-based material counting technology has been widely used for product inspection and output statistics. Existing methods typically employ a fixed field-of-view coverage and uniform frame rate sampling strategy, implementing image acquisition with the same intensity across all locations within the monitored area.
[0003] In multi-channel discharge scenarios such as combined scales, occlusion frequently occurs at the channel boundaries due to the convergence of multiple material flows. Material movement in the central channel area, however, is relatively independent. A uniform sampling strategy results in insufficient information in high-risk areas and a large amount of redundant data in low-risk areas, making it difficult to achieve optimal information acquisition with limited resources. When a target disappears from the image sequence due to occlusion, existing tracking methods rely on the last visible position for attribution, failing to fully utilize historical motion information before occlusion, leading to decreased attribution accuracy. Regarding the integration of multi-channel counting results, traditional fixed-weighted averaging or voting mechanisms cannot adaptively suppress the influence of abnormal channels, causing local errors to spread to the overall counting results and reducing system reliability. Summary of the Invention
[0004] This invention discloses a combined scale material visual counting method and device, which aims to establish an accurate mapping between images and physical space through spatial morphology registration, identify occlusion risk areas caused by spatiotemporal overlap and generate an adaptive acquisition strategy, perform motion feature analysis and trajectory prediction on occluded sections to recover missing information, combine multi-frame temporal verification and channel reliability classification to achieve weighted integration of multi-channel data, and finally generate high-precision visual counting results through dynamic correction.
[0005] The first aspect of this invention proposes a visual counting method for materials using a combination scale, comprising the following steps: Collect image data of multi-channel discharge scenarios and the location distribution information of each discharge port, and construct a visual coverage mapping table by performing spatial morphological registration and recognition on the image data and the location distribution information of each discharge port. Based on the visual coverage mapping table, multi-channel spatiotemporal overlap analysis is performed to identify visual occlusion conflict areas, and differentiated image acquisition strategies are generated according to the degree of conflict between the visual occlusion conflict areas and the location distribution information of each discharge port. Based on the differentiated image acquisition strategy, visual detection and tracking of materials are performed to generate material movement trajectories. The occluded sections in the material movement trajectory are traced back to generate trajectory compensation markers. The target attribution markers are determined according to the trajectory compensation markers and the distribution information of each discharge port. Based on the target attribution markers, sub-channel visual counting parameters are generated. Based on the visual counting parameters of the sub-channels, visual counting is accumulated to generate a channel count value distribution. Multi-frame temporal cross-validation is performed on the channel count value distribution to identify counting deviations. Based on the counting deviations and the channel count value distribution, channel hierarchical weighted fusion is performed to generate a fused count sequence. Based on the fused counting sequence, temporal counting consistency detection is performed to generate dynamic correction parameters, and visual counting results are generated based on the dynamic correction parameters and the channel count value distribution.
[0006] A second aspect of the present invention provides a combined scale material visual counting device, comprising: The image acquisition module is used to acquire image data of the multi-channel discharge scene and the location distribution information of each discharge port, and to perform spatial morphological registration and recognition on the image data and the location distribution information of each discharge port to construct a visual coverage mapping table. The conflict analysis module is used to perform multi-channel spatiotemporal overlap analysis based on the visual coverage mapping table to identify visual occlusion conflict areas, and to generate differentiated image acquisition strategies according to the degree of conflict between the visual occlusion conflict areas and the location distribution information of each discharge port. The target tracking module is used to perform visual detection and tracking of materials based on the differentiated image acquisition strategy to generate material movement trajectories, perform reverse tracing of occluded sections in the material movement trajectory to generate trajectory compensation markers, determine target attribution markers based on the trajectory compensation markers and the distribution information of each discharge port, and generate sub-channel visual counting parameters based on the target attribution markers. The counting verification module is used to accumulate visual counts based on the sub-channel visual counting parameters to generate a channel count value distribution, perform multi-frame temporal cross-verification on the channel count value distribution to identify counting deviations, and perform channel-level weighted fusion based on the counting deviations and the channel count value distribution to generate a fused counting sequence. The result generation module is used to generate dynamic correction parameters based on the temporal counting consistency detection of the fused counting sequence, and generate visual counting results based on the dynamic correction parameters and the channel count value distribution.
[0007] The beneficial effects of this invention are reflected in the following points: 1. By constructing a visual coverage mapping table through spatial morphological registration of image data and discharge port position information, a precise mapping relationship between image pixel coordinates and physical spatial coordinates is established. Based on this, occlusion conflict areas caused by multi-channel spatiotemporal overlap are identified. Differentiated image acquisition strategies are generated according to the degree of conflict of each channel, realizing dense sampling of highly occluded channels and sparse sampling of low-occlusion channels. Under limited system bandwidth, the allocation of sampling resources is optimized, and the information capture capability of key areas is improved. 2. By performing target visibility continuity detection on occluded sections in the material movement trajectory to identify trajectory interruption points, the movement speed and trajectory curvature features before and after the interruption point are extracted for reliability weighting and continuity constraint correction, generating motion feature vectors and predicting trajectory segments during occlusion. The matching degree between the predicted trajectory segments and the actual recovery points is combined to generate trajectory compensation identifiers. Based on the corrected complete trajectory set, the endpoint coordinates and movement direction are extracted and jointly matched with the position information of each discharge port to determine the target affiliation, realizing accurate determination of the material affiliation channel under occlusion conditions. 3. By extracting multi-frame counting statistics from each channel count value and performing inter-channel consistency comparison to generate channel deviation distribution, multi-dimensional anomaly detection is performed on the deviation time series data and a comprehensive evaluation is conducted to generate channel stability index. Based on the stability index and deviation change trend, the channels are classified into reliability levels and classification weight coefficients are generated. A weighted fusion strategy is used to integrate the multi-channel count values. By detecting abnormal jumps in the fused count sequence through time series consistency detection, dynamic correction parameters are generated, thus realizing reliable fusion of multi-channel count data and ensuring the accuracy of counting results. Attached Figure Description
[0008] The accompanying drawings illustrate specific examples of the technical solutions described in this invention and, together with the detailed embodiments, form part of the specification, serving to explain the technical solutions, principles, and effects of this invention.
[0009] Figure 1 This is a flowchart illustrating a visual counting method for materials using a combined scale according to the present invention.
[0010] Figure 2 This is a schematic diagram of the layout of a multi-channel discharge visual acquisition device for a combined scale according to the present invention.
[0011] Figure 3 This is a structural block diagram of a combined scale material visual counting device according to the present invention.
[0012] Wherein: 1-Combined scale body; 2-Discharge channel; 3-Top-mounted industrial camera; 4-Ring light source; 5-Camera optical center projection center line; 6-Rectangular opening; 7-Field of view coverage; 8-Discharge radius range; 9-Coordinate system origin. Detailed Implementation
[0013] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0014] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0015] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0016] The technical solutions of the embodiments of this application will be described below.
[0017] like Figure 1 As shown, this embodiment of the invention provides a visual counting method for materials using a combination scale, including the following steps S110-S150: Step S110: Collect image data of the multi-channel discharge scene and the location distribution information of each discharge port, and perform spatial morphological registration and recognition on the image data and the location distribution information of each discharge port to construct a visual coverage mapping table.
[0018] Specifically, image data of multi-channel discharge scenarios and information on the location distribution of each discharge port are collected. For example... Figure 2 As shown in the top view on the left, the multi-channel discharge scenario includes eight independent discharge channels 2, which are evenly distributed in a ring. The central angle between adjacent channels is 45 degrees, and the discharge radius ranges from 150 to 280 millimeters. Figure 2As shown in the right-side side view, image data is acquired in real time by a top-mounted industrial camera 3. The camera is installed 650 mm above the discharge port, and its field of view 7 covers the entire discharge area. The image data resolution is 1920×1080 pixels, the acquisition frame rate is 60 frames / second, and the exposure time is 8 milliseconds. The pixel coordinate system of the image data has the upper left corner of the image as the origin, with the x-axis pointing horizontally to the right and the y-axis pointing vertically downwards. The coordinate unit is pixels, and the physical size of a pixel is approximately 0.28 mm / pixel. The location distribution information of each discharge port was obtained through mechanical structure measurement. The spatial coordinate system of each discharge port location distribution information is based on the center of the main body 1 of the combined scale as the origin, which is the origin 9 of the coordinate system. The three-dimensional coordinates and discharge direction vectors of the eight discharge channels 2 are recorded. The center of the first discharge channel 2 is located at (210, 0, -320) mm, and the discharge direction vector is (-1, 0, 0.2), indicating that the discharge channel 2 is roughly oriented towards the horizontal center and slightly inclined upwards. The center of the second discharge channel 2 is located at (148, 148, -320) mm, corresponding to a 45-degree azimuth angle. The opening size of each discharge channel 2 is a rectangular opening 6, with a width of 42 mm and a length of 80 mm. The normal vector of the opening plane is consistent with the discharge direction vector. During the image data acquisition process, the ambient lighting uses a ring light source 4, which is distributed in a ring around the center line 5 of the camera's optical center projection. The color temperature is 6500K, and the illuminance uniformity is greater than 90%, ensuring the brightness consistency of the image data in different discharge channel 2 areas.
[0019] A visual coverage mapping table is constructed by spatial morphological registration and recognition of image data and the spatial coordinates of each discharge port location. The registration goal is to establish the mapping relationship between the pixel coordinates of the image data and the spatial coordinates of each discharge port location. The mapping adopts a perspective projection model. The camera intrinsic parameter matrix includes a focal length fx=fy=1850 pixels, principal point coordinates (cx,cy)=(960,540) pixels, and radial distortion coefficients k1=-0.18 and k2=0.05. The rotation component of the extrinsic parameter matrix describes the camera attitude as roll angle 0 degrees, yaw angle 0 degrees, pitch angle 85 degrees, and translation component (0,0,650) millimeters. Perspective projection is performed on the boundaries of the rectangular openings 6 for each discharge port location distribution information. The three-dimensional coordinates of each discharge channel 2 are projected onto the image pixel coordinates. During the registration and recognition process, the boundaries of the rectangular openings 6 for each discharge port location distribution information are projected onto the image data. The center coordinates of the pixel region of the first discharge channel 2 after projection are (1120, 620) in the image data. Perspective projection results in a pixel size of approximately 0.84 times the physical size, with a region width of approximately 126 pixels and a length of approximately 238 pixels. The reprojection error of the spatial morphology registration result is verified. The average reprojection error is verified to be 0.85 pixels using a calibration board, which meets the sub-pixel level registration accuracy requirements. A visual coverage mapping table is constructed based on the spatial morphology registration and recognition results. The mapping table is stored in a 1920×1080 two-dimensional array with the same resolution as the image data. The array elements record the channel number to which the corresponding pixel belongs. Channel number 0 is reserved as the background identifier, and channel number 9 is reserved as the conflict area identifier. Initially, all pixels are marked as background channel 0. Pixels in the projection area of each discharge channel 2 are marked as channel numbers 1 to 8 in sequence. The overlapping area of channels is weighted by the reciprocal of the center distance of each discharge port. The visual coverage mapping table is constructed when the main body 1 of the combined scale is started. The construction takes about 180 milliseconds, and the time complexity of the table lookup is O(1).
[0020] Step S120: Based on the visual coverage mapping table, perform multi-channel spatiotemporal overlap analysis to identify visual occlusion conflict areas, and generate differentiated image acquisition strategies according to the degree of conflict between the visual occlusion conflict areas and the distribution information of each discharge port location.
[0021] In some embodiments, the step of performing multi-channel spatiotemporal overlap analysis and identifying visual occlusion conflict regions based on the visual coverage mapping table includes: extracting the material discharge time sequence of each channel according to the visual coverage mapping table to construct a material discharge time sequence feature set; performing time window overlap detection on the material discharge time sequence feature set to generate a synchronous material discharge period identifier; parsing the image spatial overlap region from the synchronous material discharge period identifier to generate a visual occlusion distribution; and evaluating the occlusion intensity of the synchronous material discharge period identifier based on the visual occlusion distribution to generate a visual occlusion conflict region.
[0022] A discharge timing feature set is constructed by extracting the discharge timing of each channel based on the visual coverage mapping table. The visual coverage mapping table provides spatial coverage area identifiers and channel numbers for 8 channels. The discharge trigger signal for the corresponding channel is read from the weighing controller using the channel number as an index. The weighing controller sends discharge trigger signals at 10-millisecond intervals, and the discharge timing of each channel is extracted from the trigger signal according to the channel number. The discharge timing feature set records the discharge start time, discharge duration, and discharge cycle for each channel. The record for channel 1 in the discharge timing feature set shows that this channel performed 6 discharges in the last second, with discharge start times of t=0, 170, 340, 510, 680, and 850 milliseconds, an average discharge duration of 145 milliseconds, and a discharge cycle of 170 milliseconds. This discharge rhythm originates from the batching optimization algorithm of the combined scale, which selects the optimal combination from 8 bins based on the target weight. Each batching cycle of approximately 170 milliseconds allows the system to maintain high discharge efficiency while ensuring accuracy. The discharge timing feature set also includes material falling velocity characteristics. The average falling time of the material from the discharge port to the bottom of the field of view is approximately 280 milliseconds, and the falling velocity is affected by gravity acceleration at approximately 1.2 m / s. The discharge timing feature set is stored in a time series data structure with a data update frequency of 10Hz and a sliding window length of 2 seconds. The window retains the timing information of the most recent 100 discharge events.
[0023] Time window overlap detection is performed on the discharge timing feature set to generate synchronous discharge period identifiers. Time window overlap detection determines whether the discharge time windows of any two channels intersect. The discharge window [0, 145] milliseconds of channel 1 and the discharge window [80, 225] milliseconds of channel 2 in the discharge timing feature set overlap by 80, 145 milliseconds, with an overlap duration of 65 milliseconds. This time overlap is very common in the actual operation of combined scales because the batching optimization algorithm often selects multiple hoppers to discharge simultaneously in pursuit of the optimal weight combination. For example, a target weight of 100 grams might consist of 52 grams from hopper 1 and 48 grams from hopper 2. The two hoppers opening almost simultaneously leads to overlapping discharge time windows. Time window overlap detection of the discharge timing feature set is implemented using an interval overlap algorithm. The algorithm first sorts the time windows of the discharge timing feature set according to their start time, and then sequentially determines whether adjacent windows intersect, generating synchronous discharge period identifiers. The synchronous discharge period identifier is recorded in the form of a two-dimensional matrix. The matrix dimension is 8×8, corresponding to the pairwise combinations of the 8 channels. The matrix element values are Boolean, with true values indicating that the corresponding channel pairs have overlapping time windows. There are 18 true value elements in the synchronous discharge period identifier, indicating that there are 18 pairs of channels that have overlapped within the current 2-second window. The channel pair with the highest overlap frequency is channel 1-2, with an 85% probability of overlap within 2 seconds. This indicates that channels 1-2 are frequently selected for combination in the batching algorithm. The synchronous discharge period identifier also records the start time and duration of the overlapping period. The average overlap duration of channel 1-2 is 58 milliseconds.
[0024] Visual occlusion distribution is generated by parsing the spatial overlap region of the image from the synchronous discharge time period identifier. The channel pairs corresponding to the ground truth elements of the synchronous discharge time period identifier are indexed according to their channel numbers to determine their respective spatial coverage areas in the image. The intersection of these spatial coverage areas is defined as the image spatial overlap region, which represents the spatial location where visual occlusion may occur. Visual occlusion occurs when two channels discharge simultaneously; the material falling first may obscure the material falling later, or the trajectories of the materials from the two channels may intersect during their descent, causing mutual occlusion. In the visual coverage mapping table, channel 1 covers approximately 32,000 pixels, and channel 2 covers approximately 31,000 pixels. The number of pixels in the image spatial overlap region between the two channels is approximately 4,200, accounting for 13.1% of the coverage area of channel 1. This proportion reflects the spatial proximity of channels 1 and 2. The center distance between the discharge outlets of the two channels is approximately 140 mm, and the trajectory diffusion during the material's descent causes the edge regions to overlap. The 18 pairs of overlapping channels identified by the synchronous discharge period markers yielded 18 overlapping regions in the visual coverage map, totaling approximately 24,000 pixels, accounting for 1.2% of the total image pixels. Visual occlusion distribution was represented as a grayscale image with the same dimensions as the visual coverage map (1920×1080). Pixel values ranged from 0 to 255, with 0 indicating no occlusion and 255 indicating maximum occlusion. The pixel values for visual occlusion distribution were calculated by multiplying the number of overlapping channel pairs in the synchronous discharge period markers associated with that pixel by a weighting coefficient of 32. Pixels involving 3 or more overlapping pairs accounted for approximately 5%. These pixels are located in the central area where multiple channels intersect. In real-world scenarios, this area often experiences simultaneous material drop from 3 or even 4 channels, causing severe visual occlusion and counting difficulties.
[0025] Based on the visual occlusion distribution, the occlusion intensity of the synchronous material discharge period markers is assessed to generate visual occlusion conflict areas. The occlusion intensity assessment quantifies the degree of occlusion for each overlapping channel pair in the visual occlusion distribution, and the assessment indicators include three dimensions: the number of overlapping pixels, the duration of overlap, and the average gray value of the occluded pixels. The number of overlapping pixels in channels 1 and 2 of the visual occlusion distribution is N_pixel=4200. The overlap duration recorded by the synchronous discharge period marker is T_overlap=58 milliseconds. The average grayscale value of the visual occlusion distribution in the overlapping area is I_avg=182. The formula for calculating the occlusion intensity index S is: S=w1·(N_pixel / N_total)+w2·(T_overlap / T_ref)+w3·(I_avg / 255), where N_total is the reference number of pixels (5000), T_ref is the reference overlap duration (100 milliseconds), and the weighting coefficients are w1=0.4, w2=0.3, and w3=0.3. The comprehensive evaluation yields an occlusion intensity index of approximately 0.72. The high occlusion intensity index reflects that channels 1 and 2 do indeed have a serious visual interference problem in actual scenarios. The occlusion intensity assessment calculated the occlusion intensity index for each of the 18 overlapping channels identified during the synchronous discharge period. Channel pairs with an index greater than 0.6 were defined as high-intensity occlusion. Six channel pairs were marked as high-intensity occlusion, including channels 1-2, 1-3, 2-3, 3-6, 5-6, and 6-7. These channel pairs share the common characteristic of adjacent discharge ports and similar discharge frequencies, resulting in a high probability of spatiotemporal overlap. The visual occlusion conflict region consists of the image spatial overlap area of the high-intensity occlusion channel pairs in the visual occlusion distribution. The total number of pixels in the visual occlusion conflict region is approximately 18,000, accounting for 75% of the total overlapping pixels in the visual occlusion distribution and 0.9% of the total image pixels. The visual occlusion conflict region is marked with an independent conflict channel number 9 in the visual coverage mapping table for easy subsequent differential processing.
[0026] In some embodiments, generating a differentiated image acquisition strategy based on the degree of conflict between the visual occlusion conflict area and the distribution information of each discharge port position includes: dividing the distribution information of each discharge port position into a high-occlusion channel group and a low-occlusion channel group according to the visual occlusion conflict area; generating differentiated frame rate parameters by adaptive frame rate allocation based on the occlusion degree of the high-occlusion channel group and the low-occlusion channel group; generating an acquisition timing table by exposure timing matching of the differentiated frame rate parameters; and generating a differentiated image acquisition strategy based on the acquisition timing table.
[0027] Based on the visual occlusion conflict areas, the distribution information of each outlet location was divided into a high-occlusion channel group and a low-occlusion channel group. The intersection of the projection area corresponding to each outlet location distribution information in the visual coverage mapping table and the visual occlusion conflict area was calculated. The percentage of the number of intersecting pixels to the total number of pixels in the projection area was defined as the conflict level. The intersection of the 18,000 pixels of the visual occlusion conflict area and the 32,000 pixels of the projection area of channel 1 of the outlet location distribution information yielded 4,200 pixels, with a conflict level of 13.1%. The statistical analysis of visual occlusion conflict areas shows that the conflict levels of the eight channels in the distribution information of each discharge port are 13.1%, 11.8%, 16.2%, 8.5%, 6.9%, 14.7%, 9.3%, and 7.8%, respectively, with an average conflict level of 11.0% and a standard deviation of 3.2%. This difference stems from the different physical layouts of the channels. The highest conflict level of 16.2% is for channel number 3 because it is located at the top center of the ring-shaped layout, surrounded by multiple adjacent channels, making it prone to multi-directional occlusion when materials fall. The threshold for classifying high-occlusion channels is set at 12%. Channels with a conflict level greater than 12% in the distribution information of each discharge port are classified into the high-occlusion channel group, including channels 1, 3, and 6, a total of three channels. The average conflict level of these three channels is 14.7%. Channels with a conflict rate of less than or equal to 12% in the distribution information of each discharge port are classified into the low-obstruction channel group, including channels 2, 4, 5, 7 and 8, a total of 5 channels. The average conflict rate of the low-obstruction channel group is 8.9%. The channels of the low-obstruction channel group are usually located on the periphery or side of the ring layout.
[0028] Differentiated frame rate parameters are generated through adaptive frame rate allocation based on the occlusion levels of the high-occlusion and low-occlusion channel groups. The principle of adaptive frame rate allocation is that the frame rate is proportional to the occlusion level. The high-occlusion channel group requires a higher acquisition frame rate to capture the motion details of the occluded materials, while the low-occlusion channel group can use a lower frame rate to save processing resources. When the top-mounted industrial camera 3 uses the region of interest mode, the single read time is approximately 4 milliseconds, and the maximum number of acquisitions of the region of interest within 1 second is approximately 250. Within this total acquisition capacity, the system allocates exposure time to each channel through time-division multiplexing to achieve channel-level differentiated effective frame rates. The average collision level of the high-occlusion channel group is 14.7%, and the average collision level of the low-occlusion channel group is 8.9%, with a collision level ratio of 1.65. Considering the trajectory continuity requirements, the frame rate allocation ratio is determined to be 3:1. The differentiated frame rate parameters are implemented using region-of-interest (ROI) time-division multiplexing. The target effective frame rate for the high-occlusion channel group is set to 50 frames per second (fps), and the target effective frame rate for the low-occlusion channel group is set to 15 fps. The high-occlusion channel group (3 channels) totals 150 fps, and the low-occlusion channel group (5 channels) totals 75 fps, for a total of 225 fps. This is lower than the maximum acquisition capability of 250 fps in the ROI mode, meeting the feasibility requirements for single-camera time-division multiplexing. The differentiated frame rate parameters also consider a material falling speed of 1.2 m / s. The 50 fps for the high-occlusion channel group corresponds to a frame interval of 20 milliseconds, and the material falling distance is approximately 24 mm. Combined with Kalman filtering for motion direction prediction compensation, the actual matching search range can be narrowed to a displacement within 15 milliseconds, meeting the trajectory continuity requirements. The frame rate allocation of the differentiated frame rate parameters ensures that the high-occlusion channel group obtains sufficient temporal resolution, while the low-occlusion channel group reduces the acquisition frequency while maintaining counting accuracy, achieving optimized allocation of system resources.
[0029] Exposure timing matching is performed on differentiated frame rate parameters to generate an acquisition timing table. The goal of exposure timing matching is to allocate exposure times to each channel on a unified time axis according to the frame rate requirements of the differentiated frame rate parameters. The acquisition timing table ensures that the effective frame rate of each channel is met through region-of-interest (ROI) time-division multiplexing. The differentiated frame rate parameters use 4 milliseconds as the basic time unit for a single ROI read, and the 1-second planning period contains approximately 250 time slots to cover the complete output cycle. The differentiated frame rate parameters require 50 exposures per second per channel in the high-occlusion channel group (3 channels, 150 time slots in total), and 15 exposures per channel in the low-occlusion channel group (5 channels, 75 time slots in total). A total of 225 exposure events are required within the 1-second period, occupying 900 milliseconds of time slots, with the remaining 100 milliseconds used as a scheduling buffer. The acquisition timing table records the time slot allocation results of 225 exposure events with a planning period of 1 second. The acquisition timing table employs a time-division multiplexing strategy to reasonably distribute the exposure times of each channel within 1 second. Only one channel's region of interest is acquired within the same time slot, and the exposure times of each channel do not conflict. The exposure timing matching algorithm for differentiated frame rate parameters adopts a greedy strategy, prioritizing the allocation of exposure times for high-occlusion channel groups. The acquisition timing table ensures that the exposure times of high-occlusion channel groups are evenly distributed, with an adjacent exposure interval of approximately 20 milliseconds, while the adjacent exposure interval for low-occlusion channel groups is approximately 67 milliseconds.
[0030] A differentiated image acquisition strategy is generated based on the acquisition time series table. This strategy converts the acquisition time series table into camera control commands, which include three core parameters: exposure time, exposure duration, and region of interest (ROI) coordinates. The projection area of each channel corresponding to a time slot in the acquisition time series table onto the visual overlay map is defined as the ROI. The ROI coordinates of channel 1 cover the channel's projection area and extend outwards by 20 pixels, resulting in an ROI size of approximately 280×160 pixels. This significantly reduces the data volume compared to the full image size of 1920×1080 pixels. Reading only the pixel data of this region reduces transmission time from 16 milliseconds for the full image to approximately 4 milliseconds. This ROI mechanism is crucial in high frame rate acquisition scenarios, as 50 frames per second requires a processing time of no more than 20 milliseconds per frame. The differentiated image acquisition strategy generates independent exposure parameters for each channel based on the time slots allocated in the acquisition timing table. Different channels are set with differentiated exposure times according to their position in the visual coverage map and the lighting conditions. The third channel in the high occlusion channel group is located at the edge of the light source, and its exposure time is extended to 10 milliseconds to compensate for insufficient illumination. The fourth channel in the low occlusion channel group is located at the center of the light source, and its exposure time is shortened to 6 milliseconds to avoid overexposure.
[0031] Step S130: Based on the differentiated image acquisition strategy, perform visual detection and tracking of materials to generate material movement trajectories. Perform reverse tracing of the occluded sections in the material movement trajectory to generate trajectory compensation markers. Determine the target attribution markers based on the trajectory compensation markers and the location distribution information of each discharge port. Generate sub-channel visual counting parameters based on the target attribution markers.
[0032] Material visual inspection and tracking are performed based on a differentiated image acquisition strategy to generate material motion trajectories. Camera control commands generated according to the differentiated image acquisition strategy trigger image acquisition sequentially according to the exposure times of each channel in the acquisition timing table. Each exposure only reads pixel data from the corresponding channel's region of interest (ROI). The ROI size for the high-occlusion channel group is approximately 280×160 pixels, and the exposure time is set differently for each channel (10 ms for channel 3, 6 ms for channel 4). The low-occlusion channel group also completes image acquisition according to the exposure times and parameters allocated in the acquisition timing table, ensuring that the image data for each channel is consistent with the frame rate requirements of the differentiated image acquisition strategy. Real-time material visual inspection is performed on the acquired ROI images from each channel. The detection algorithm uses a deep learning-based target detector, outputting the bounding box coordinates and detection confidence of the material. After non-maximum suppression processing, the centroid coordinates of each target are extracted as tracking input. The tracking algorithm employs a multi-target tracking framework, predicting the target's position in the next frame using Kalman filtering, and using the Hungarian algorithm to perform cost-optimal matching between the predicted position and the detection result, achieving cross-frame target association. Material movement trajectories are managed using trajectory IDs as indexes. Each material movement trajectory contains a sequence of centroid coordinates, a sequence of velocity vectors, and a sequence of visibility confidence. The visibility confidence is directly assigned by the output probability of the target detector. The sampling frequency of the material movement trajectory is consistent with the frame rate of the differentiated image acquisition strategy: 50 frames / second for the high occlusion channel and 15 frames / second for the low occlusion channel. The trajectory manager terminates and archives trajectories that do not match for more than 15 consecutive frames and automatically initializes new trajectories for newly appearing targets.
[0033] In some embodiments, the step of reverse tracing to generate trajectory compensation identifiers for occluded sections in the material movement trajectory includes: performing target visibility continuity detection to identify trajectory interruption points in the occluded sections of the material movement trajectory; extracting motion features from the trajectory segments before and after the trajectory interruption points to generate motion feature vectors; performing trajectory extension prediction based on the motion feature vectors to generate predicted trajectory segments; and generating trajectory compensation identifiers based on the matching degree between the predicted trajectory segments and the material movement trajectory.
[0034] To identify trajectory interruptions, target visibility continuity detection is performed on occluded sections of the material movement trajectory. The occlusion segment is determined by the continuous change in the visibility confidence sequence. A continuous frame segment with a visibility confidence score consistently below a threshold of 0.3 is defined as an occlusion segment. The confidence score ranges from 0 to 1. Within an occlusion segment, the material target is either invisible or only partially visible in the image, resulting in a significant decrease in the detector's output confidence score. Abrupt change points are searched at the boundaries of the occlusion segments to identify trajectory interruptions. The point where the confidence score drops sharply from greater than 0.7 to less than 0.3 is marked as the start boundary of the occlusion segment, and the point where the confidence score recovers from less than 0.3 to greater than 0.7 is marked as the end boundary. The frame preceding the start boundary and the frame following the end boundary of the occlusion segment are the trajectory interruption points. Trajectory breakpoints mark the moments when a material's trajectory transitions from a visible state to an obscured section and back to a visible state. Each breakpoint records its corresponding spatial coordinates and velocity vector. The frame segment between two breakpoints represents the obscured section requiring trajectory compensation. The accuracy of breakpoint identification directly impacts the quality of subsequent motion feature extraction; the positioning error of breakpoints must be controlled within one frame.
[0035] For example, the step of extracting motion features from the trajectory segments before and after the trajectory interruption point to generate a motion feature vector includes: extracting motion velocity and trajectory curvature forward and backward according to the trajectory interruption point respectively; performing a quantitative evaluation based on the continuity of the motion velocity and the trajectory curvature to generate a feature reliability score; extracting a reliability-weighted feature by weighting the motion velocity and the trajectory curvature based on the feature reliability score; and correcting the reliability-weighted feature by continuity constraints to generate a motion feature vector.
[0036] Motion velocity and trajectory curvature are extracted forward and backward from the trajectory interruption point, respectively. Trajectory segments are extracted by tracing back N frames from the trajectory interruption point towards both historical and future frames. The value of N is adaptively set according to the differentiated frame rate of each channel: N=5 frames for high occlusion channels corresponding to a 100ms time window, and N=2 frames for low occlusion channels corresponding to a 133ms time window. This time window can capture the stable characteristics of material motion while avoiding changes in motion state due to excessive time spans. Motion velocity is extracted for each trajectory segment, calculated using the positional difference between adjacent frames. The motion velocity sequence extracted from the trajectory segment before the trajectory interruption point contains four velocity vectors; a smaller velocity standard deviation indicates good motion stability. Trajectory curvature is extracted for each trajectory segment, calculated using the three-point method. Three consecutive frame coordinate points P1, P2, and P3 are selected, and the curvature is calculated using the formula... The curvature value k is calculated, where det represents the determinant and ||·|| represents the Euclidean norm of the vector. A larger curvature value indicates a sharper trajectory turn. The curvature of a material falling trajectory is usually smaller because gravity-dominated motion is generally linear. Acceleration is extracted for each trajectory segment, calculated by linearly fitting the slope of the velocity sequence. The average acceleration before and after the trajectory interruption point is extracted as a feature component. The velocity and curvature sequences of the trajectory segments before and after the interruption point are statistically summarized. The average velocity and average curvature of the trajectory segments before the interruption point, and the average velocity and average curvature of the trajectory segments after the interruption point together constitute the basic data for the reliability assessment of motion characteristics.
[0037] A feature reliability score is generated based on a quantitative evaluation of the continuity of motion speed and trajectory curvature. The continuity assessment judges whether the motion features before and after the trajectory interruption point transition smoothly. The evaluation indicators include two dimensions: motion speed difference and trajectory curvature difference. If the difference in motion features before and after occlusion is large, it indicates that the material may have collided or the trajectory may have been interfered with by other materials during the occlusion period. In this case, the reliability of the predicted trajectory will decrease. The motion speed difference is defined as the magnitude of the difference between the velocity of the last frame before the trajectory interruption point and the velocity of the first frame after the trajectory interruption point. The smaller the difference, the better the velocity continuity. The formula for calculating the difference is: Δv = ||v_before - v_after||, where v_before is the velocity of the 81st frame before the trajectory interruption point (12, -85) pixels / frame, and v_after is the velocity of the 108th frame after the trajectory interruption point (15, -92) pixels / frame. The motion speed difference Δv is 7.6 pixels / frame. The trajectory curvature difference is defined as the absolute value of the difference between the average curvature of the trajectory segments before and after the trajectory break point. The average curvature before the trajectory break point is 0.015, and the average curvature after the trajectory break point is 0.012. The trajectory curvature difference Δκ is 0.003 radians / pixel. The feature reliability score R is calculated by a normalized weighted combination of velocity difference and curvature difference. The scoring formula is: R=w_v·exp(-Δv / σ_v)+w_κ·exp(-Δκ / σ_κ), where w_v=0.6 and w_κ=0.4 are weighting coefficients, and σ_v=10 pixels / frame and σ_κ=0.01 radians / pixel are normalization parameters. The exponential function ensures that the smaller the difference, the higher the score. The feature reliability score of the material's motion trajectory is relatively high. The score range is 0 to 1. The higher the score, the better the continuity of motion features before and after the trajectory interruption point, and the higher the reliability. Trajectories with a score below 0.5 are judged as discontinuous motion and need to be handled with caution. Discontinuous motion means that the material may have bounced, collided, or had its trajectory severely interfered with during the occlusion period.
[0038] Reliability-weighted features are generated by weighting motion velocity and trajectory curvature based on feature reliability scores. The principle of weighting is to assign greater weight to features with higher reliability scores and less weight to features with lower reliability scores; the weighting coefficient is directly equal to the feature reliability score value. The motion velocity and trajectory curvature before the trajectory breakpoint are multiplied by the weighting coefficient corresponding to the feature reliability score. The weighted motion velocity and trajectory curvature retain the relative magnitude and motion trend of the original features, while adjusting the influence of each feature in subsequent trajectory prediction based on the feature reliability score. The dimensions of the reliability-weighted features are consistent with the original motion velocity and trajectory curvature features. Before and after the trajectory breakpoint, there are four dimensions: velocity x-component, velocity y-component, trajectory curvature, and acceleration. These are concatenated to form an 8-dimensional reliability-weighted feature vector, with the first four dimensions corresponding to the features before the trajectory breakpoint and the last four dimensions corresponding to the features after the trajectory breakpoint. The reliability-weighted features are stored in column vector form for easy matrix operations, and the numerical distribution of the reliability-weighted features reflects the difference in confidence between motion velocity and trajectory curvature after reliability weighting.
[0039] The reliability-weighted features are corrected for continuity constraints to generate motion feature vectors. In the scenario of simultaneous discharge from multiple channels in a combined scale, the motion state of materials before and after the obstruction zone may be slightly deviated due to collisions with materials in adjacent channels or airflow disturbances. For example, a material may fall steadily vertically at the leading edge of the obstruction zone, and upon regaining visibility after the obstruction ends, a slight contact with materials in adjacent channels causes a sudden increase in the horizontal velocity component. This sudden increase is reflected in the reliability-weighted features as a discontinuity in the velocity components before and after the trajectory interruption point. The continuity constraint correction processes the reliability-weighted features through a smoothing filter. A Gaussian kernel function is used to independently filter each dimension of the reliability-weighted features, and the kernel width is adaptively adjusted according to the feature reliability score. The lower the reliability score, the larger the kernel width to apply a stronger smoothing constraint. Taking the collision scenario mentioned above as an example, the sudden increase in horizontal velocity after the trajectory interruption point in the reliability-weighted features is smoothed to be close to the horizontal velocity before the trajectory interruption point after Gaussian filtering, eliminating the transient disturbances introduced by the collision. This allows the corrected motion feature vector to reflect the intrinsic motion mode of the material under undisturbed conditions. The motion feature vector maintains an 8-dimensional structure. The average velocity and average curvature before and after the trajectory interruption point in the vector are smoothed to make them more continuous. The enhanced continuity of the motion feature vector ensures that the trajectory predicted based on this feature will not have unreasonable jumps or turns due to transient disturbances.
[0040] The trajectory extension prediction is based on motion feature vectors to generate predicted trajectory segments. A Kalman filter model is used for trajectory extension prediction. The state vector contains four state variables: position and velocity. The average velocity and average acceleration in the motion feature vector serve as the observation inputs to the Kalman filter. The average acceleration is calculated by differencing the velocity sequence of the motion feature vector, specifically by linearly fitting the velocity sequence before the trajectory break point to obtain the acceleration component. The average velocity and average acceleration before the trajectory break point in the motion feature vector initialize the state vector of the Kalman filter. The prediction equation calculates the material position in each frame during the occlusion period based on a uniformly accelerated motion model. This prediction method is based on physical laws, assuming that the material is still mainly under the influence of gravity and undergoes uniformly accelerated motion during the occlusion period. The predicted trajectory segment extends 26 frames to 107 frames from the 81st frame before the trajectory break point, covering the entire occlusion area. The predicted coordinates of the 82nd, 95th, and 107th frames of the predicted trajectory segment sequentially provide the inferred position of the material during the occlusion period. The trajectory curvature feature in the motion feature vector is used to correct the direction of the predicted trajectory. A curvature value of 0.013 indicates that the trajectory curves slightly to the right. The x-coordinate component of the predicted trajectory segment gradually increases, while the y-coordinate component decreases according to gravitational acceleration. The confidence of the predicted trajectory segment is initialized using the feature reliability score of the motion feature vector. As the number of prediction frames increases, the confidence gradually decreases according to an exponential decay law, with a decay coefficient set to 0.98. This decay mechanism reflects that the uncertainty of the prediction increases over time, and the further away from the observation point, the less reliable the prediction becomes.
[0041] Trajectory compensation markers are generated based on the matching degree between the predicted trajectory segment and the material movement trajectory. The matching degree evaluation compares the endpoint of the predicted trajectory segment with the actual recovered point of the material movement trajectory after occlusion. The evaluation dimensions include three indicators: position error, velocity error, and direction error. These three indicators verify the accuracy of the predicted trajectory from different perspectives. The predicted coordinates, predicted velocity, and predicted direction vector of the predicted trajectory segment in frame 107 are compared with the actual coordinates, actual velocity, and actual direction vector of the material movement trajectory in frame 108 after occlusion. Position error is calculated using Euclidean distance; a smaller position error between the predicted and actual coordinates indicates accurate prediction. Velocity error is the magnitude of the velocity vector difference, and direction error is the cosine distance of the angle between the direction vectors. The matching degree score is calculated by a normalized weighted combination of the three error indicators, with weights of 0.5 for position, 0.3 for velocity, and 0.2 for direction. The smaller the error, the higher the score, indicating a higher matching degree score for the material movement trajectory (range 0 to 1). A high matching degree score indicates a good match between the predicted trajectory segment and the actual recovered trajectory, making it suitable for filling trajectory gaps during occlusion. The trajectory compensation identifier includes four fields: the start and end frame numbers of the occluded section, the coordinate sequence of the predicted trajectory segment, the confidence sequence, and the matching score. A matching score greater than 0.8 in the trajectory compensation identifier is considered as valid compensation. The trajectory compensation identifier records the occluded section from frame 82 to 107 of the material movement trajectory. The predicted trajectory segment contains 26 coordinate points, and information such as the average confidence and matching score is recorded completely.
[0042] In some embodiments, determining the target attribution identifier based on the trajectory compensation identifier and the location distribution information of each discharge port includes: correcting the material movement trajectory based on the trajectory compensation identifier to generate a complete trajectory set; extracting the trajectory endpoint coordinates and movement direction vectors based on the complete trajectory set to construct trajectory attribution features; performing joint matching of the trajectory attribution features and the location distribution information of each discharge port based on position distance and direction consistency to generate attribution confidence; and determining the target attribution identifier based on the attribution confidence.
[0043] A complete trajectory set is generated by correcting the material movement trajectory based on the trajectory compensation identifier. If the matching score of the trajectory compensation identifier is greater than the effective threshold of 0.8, the predicted trajectory segment is deemed usable for correction. The material movement trajectory correction fills the occluded sections of the original material movement trajectory with the predicted trajectory segments from the trajectory compensation identifier, forming trajectory data containing a complete frame sequence. This filling process resolves the trajectory discontinuity problem caused by occlusion. Frames 82 to 107 of the trajectory of material No. 15 were originally occluded and missing segments; after correction, they were filled with 26 coordinate points from the predicted trajectory segments provided by the trajectory compensation identifier. The complete trajectory set retains the non-occluded frames of the original trajectory (frames 1 to 81 and 108 to 150) and the predicted frames provided by the trajectory compensation identifier (frames 82 to 107). The complete trajectory set has a total of 150 frames, corresponding to a time span of 3000 milliseconds, covering the complete falling process of the material from the discharge port to the bottom of the field of view. The confidence sequence of the trajectory compensation identifier is synchronously filled into the complete trajectory set. The corrected confidence of frames 82 to 107 is the confidence value of the predicted trajectory segment, and the original confidence of non-occluded frames is maintained.
[0044] Trajectory attribution features are constructed by extracting the endpoint coordinates and motion direction vectors from complete trajectory sets. The endpoint coordinates of a complete trajectory set are defined as the centroid position of the last frame. The endpoint coordinates of the 15th complete trajectory set are the coordinates of the 150th frame, which are located at the bottom edge of the image, corresponding to the position where the material leaves the field of view. The y-value of the endpoint coordinates is close to the image height of 1080 pixels, indicating that the material has fallen to the bottom of the field of view. The motion direction vector of the complete trajectory set is calculated by fitting a straight line using the coordinates of the last N frames. N=10 frames correspond to a 200-millisecond time window. The least squares method is used for fitting. After determining the slope and intercept of the fitted line, the direction vector is defined as a unit vector along the direction of the fitted line. The motion direction vector of the 15th complete trajectory set is a normalized unit vector. The x-component of the vector represents the horizontal rightward motion component, and the y-component represents the vertical downward motion component. The direction angle indicates that the material mainly moves vertically downward, with a smaller horizontal component slightly offset to the right. This offset direction suggests that the material may have come from the discharge channel on the left. The trajectory attribution feature concatenates the endpoint coordinates and the direction vector of motion into a 4-dimensional feature vector. The first two dimensions are the x and y coordinates of the endpoint, and the last two dimensions are the x and y components of the direction vector. The compact dimensionality of the feature vector facilitates rapid matching and calculation. The endpoint coordinates and direction vector of the trajectory attribution feature together describe the final spatial position and movement trend of the material. These two features have complementary roles in attribution determination; the endpoint coordinates provide static position information, and the direction vector provides dynamic trend information.
[0045] A joint matching of positional distance and directional consistency is performed on the trajectory assignment features and the distribution information of each discharge port to generate assignment confidence. Positional distance matching calculates the Euclidean distance between the endpoint coordinates of the trajectory assignment features and the center coordinates of the eight discharge ports in the distribution information. The discharge port with the closest distance is selected as the candidate assignment channel. This matching strategy is based on the premise that the endpoint of the material's falling trajectory should be close to the projection position of its source channel. The projection position of the center coordinates of the first discharge port in the distribution information is relatively close to the endpoint coordinates of the trajectory assignment features, while the projection position of the center coordinates of the second discharge port is relatively far from the endpoint coordinates. Directional consistency matching calculates the cosine of the angle between the motion direction vector of the trajectory assignment features and the expected direction vectors pointed to by each discharge port in the distribution information. The closer the cosine value is to 1, the more consistent the directions. Directional consistency is determined based on the premise that the motion direction of the material falling from a certain discharge port should be basically consistent with the discharge direction of that discharge port. The cosine of the angle between the expected direction vector of outlet 1 and the direction vector of the trajectory attribution feature is close to 1. The cosine of the angle between the expected direction vector of outlet 2 and the trajectory attribution feature is smaller or even negative, indicating that the directions are opposite. The formula for calculating the attribution confidence is C_i=0.6×(1-d_i / d_max)+0.4×cos_i, where d_i is the Euclidean distance between the endpoint coordinates and the center of outlet i, d_max is the maximum reference distance, and cos_i is the cosine of the angle between the motion direction vector and the expected direction vector of outlet i. Outlet 1 has the highest attribution confidence, while outlet 2 has a very low attribution confidence. The highest attribution confidence of outlet 1 reflects that the material indeed comes from channel 1.
[0046] The target attribution identifier is determined based on the attribution confidence level. The outlet with the highest attribution confidence level is selected as the attribution channel for the material's movement trajectory. The comparison of attribution confidence levels uses a maximum value selection strategy; the outlet number corresponding to the maximum attribution confidence level among the eight outlets is the target attribution identifier. In the 15th complete trajectory set, the highest attribution confidence level is at outlet number 1, followed by outlet number 3. A larger difference between the highest and second-highest confidence levels indicates higher attribution discrimination and greater reliability. The target attribution identifier is determined as channel 1. The eight outlet channels are numbered from 1 to 8, with number 0 reserved to represent abnormal trajectories where attribution cannot be determined. Abnormal trajectories typically correspond to material oscillation at boundary positions, leading to unclear attribution or severe trajectory interference. The determination of target attribution identifiers also includes a confidence threshold check. If the highest attribution confidence value is lower than the threshold T_min=0.7, the trajectory is considered abnormal, and the target attribution identifier is marked as 0. This trajectory is not included in the count value of any channel. If the highest attribution confidence value of this material movement trajectory is greater than the threshold 0.7, it is considered a valid attribution. The target attribution identifier also records the attribution confidence value for quality assessment of the attribution determination. The output of the target attribution identifier determination result is a structure containing fields such as trajectory ID, attribution channel, attribution confidence, and determination status. The structure is serialized into JSON format for easy storage and transmission. The determination latency of the target attribution identifier is the time interval from the generation of the complete trajectory set to the output result. The average latency is small, mainly due to feature extraction, matching calculation, and data structuring. A latency of less than 30 milliseconds meets real-time requirements.
[0047] Visual counting parameters for each channel are generated based on the target attribution identifier. These parameters record two key indicators for each discharge channel: the material count value and the average attribution confidence score. The data structure for these parameters is an 8-dimensional array, with array indices 0 to 7 corresponding to discharge channels 1 to 8. The visual counting parameters for channel 1 are updated by accumulating the count value after the 15th target attribution identifier, while the average attribution confidence score is updated using a weighted moving average algorithm. Abnormal trajectories with a target attribution identifier of 0 are added to the global anomaly counter but are not counted in any channel's visual counting parameters. The global anomaly counter records the number of materials whose attribution cannot be clearly determined. The visual counting parameters for each channel are updated every 100 milliseconds, synchronized with the discharge cycle, ensuring real-time reflection of material flow changes in each channel. The sum of the count values from the eight channels plus the global anomaly count is approximately equal to the total number of material movement trajectories detected by the system; slight differences arise because some trajectories are still being tracked and their attribution has not yet been determined. The output format of the visual counting parameters for each channel is a JSON array, sent to the host computer via a network interface at a frequency of 10Hz, with a small single data packet size.
[0048] Step S140: Based on the visual counting parameters of each channel, visual counting is accumulated to generate a channel count value distribution. Multi-frame temporal cross-validation is performed on the channel count value distribution to identify counting deviations. Based on the counting deviations and the channel count value distribution, channel hierarchical weighted fusion is performed to generate a fused count sequence.
[0049] Specifically, a channel count distribution is generated by accumulating visual counts based on the channel-specific visual counting parameters. The channel-specific visual counting parameters record the real-time material counts and average attribution confidence of the eight discharge channels. The update frequency of the channel-specific visual counting parameters is 10Hz, receiving the latest count parameters output from step S130 every 0.1 seconds. The channel-specific visual counting parameters are obtained in real-time from the network interface of step S130 via a JSON array format, ensuring the timeliness and accuracy of the counting data. Visual count accumulation stores the count values of the channel-specific visual counting parameters in chronological order into a sliding window buffer. The buffer length is set to 5 seconds corresponding to 50 sampling points. The count value of channel 1 of the channel-specific visual counting parameters is 48 at t=0 seconds, updated to 49 at t=0.1 seconds, and updated to 50 at t=0.2 seconds. The monotonically increasing count value reflects the continuous passage of material. The channel count value distribution is stored in the form of an 8×50 two-dimensional matrix. The row index of the matrix corresponds to the eight channels, and the column index corresponds to the 50 time sampling points of the most recent 5 seconds. The matrix elements are the cumulative count values of that channel at that moment. The sliding window mechanism of the channel count distribution ensures that the counting history of the most recent 5 seconds is always retained. The window slides forward by one sampling point every 0.1 seconds, discarding the oldest sampling point and adding the latest count value of the sub-channel visual counting parameter. The average confidence level of the sub-channel visual counting parameter is synchronously recorded in the auxiliary data structure. The average confidence level of channel 1 is 0.92, used to evaluate the reliability of the count value of this channel. The current count values of each channel in the channel count distribution are [53, 48, 50, 49, 52, 47, 51, 50]. The sum of the count values of the 8 channels is 400, with an average of 50 materials per channel. The standard deviation is 2.1, reflecting the slight differences in the output of each channel.
[0050] In some embodiments, the step of performing multi-frame temporal cross-validation to identify counting deviations on the channel count value distribution includes: extracting multi-frame count statistics for each channel based on the channel count value distribution to construct counting statistical features; performing inter-channel count consistency comparison on the counting statistical features to generate a channel deviation distribution; performing temporal stability analysis based on the channel deviation distribution to generate a count confidence index; and determining a deviation threshold to identify counting deviations according to the count confidence index.
[0051] Based on the channel count distribution, multi-frame count statistics for each channel were extracted to construct counting statistical features. The channel count distribution records the material count values of eight discharge channels within a continuous time window in time series form. The time window length is set to 5 seconds, corresponding to 50 sampling points, and the sampling frequency is 10Hz. The count value sequence of channel 1 in the channel count distribution within the most recent 5 seconds is [48,49,50,50,51,51,52,52,53,53,...], with a sequence length of 50. The monotonically increasing sequence values reflect the continuous passage of material. The time series data recorded by the channel count distribution is used to extract multi-frame count statistics, which include four indicators: count increment, increment mean, increment standard deviation, and increment gradient. The count increment is defined as the difference in count values between adjacent sampling points. The count increment sequence of channel 1 in the channel count distribution is [1,1,0,1,0,1,0,1,0,1,0,...]. An increment value of 0 or 1 indicates that 0 or 1 material passed through in that sampling interval. The mean increment is obtained by calculating the arithmetic mean of the count increment sequence. The mean increment for channel 1 is 0.92 increments / sampling point, corresponding to a discharge frequency of 9.2 increments / second. The standard deviation of the increment reflects the volatility of the count increment. The standard deviation for channel 1 is 0.27, indicating a stable discharge frequency. The increment gradient is calculated using the slope of a linear regression of the count increment sequence. The increment gradient for channel 1 is 0.002 increments / sampling point. 2 A gradient close to 0 indicates that the discharge frequency has no obvious upward or downward trend. The counting statistical features concatenate the four statistics into a 4-dimensional feature vector, and the counting statistical features are extracted from the eight channels of the channel count value distribution to form an 8×4 feature matrix.
[0052] The counting statistical characteristics are compared for consistency across channels to generate a channel deviation distribution. This consistency comparison determines whether the count increment of each channel meets the theoretical expectation, which is determined based on the batching scheme of the combined scale. The scheme requires the discharge frequency ratio of the eight channels to be 1:1:1:1:1:1:1:1, meaning the discharge frequency of each channel should be basically consistent. The mean increment of the counting statistical characteristics reflects the actual discharge frequency of each channel. The mean increments of channels 1 to 8 recorded by the counting statistical characteristics are 0.92, 0.88, 0.95, 0.87, 0.90, 0.93, 0.89, and 0.91 per sampling point, respectively, with an average mean increment of 0.906 per sampling point for all eight channels. In the counting statistics, the difference between the mean of the increments of each channel and the average value is defined as the channel deviation. The deviation for channel 1 is 0.92 - 0.906 = 0.014, for channel 2 it is 0.88 - 0.906 = -0.026, and for channel 4 it is 0.87 - 0.906 = -0.036. The larger the absolute value of the deviation, the greater the difference between that channel and the overall average level. The channel deviation distribution records the deviation values of each channel in the form of 8-tuples, with the channel deviation distribution being [0.014, -0.026, 0.044, -0.036, -0.006, 0.024, -0.016, 0.004], and the deviation values range from -0.036 to 0.044. The channel deviation distribution also calculates the statistical characteristics of the deviation. The mean deviation is 0 (design value), the standard deviation of the deviation is 0.025, the maximum deviation is 0.044 corresponding to channel 3, and the minimum deviation is -0.036 corresponding to channel 4.
[0053] For example, the step of generating a count confidence index based on the time series stability analysis of the channel deviation distribution includes: extracting time series data of each channel deviation from the channel deviation distribution to construct a deviation fluctuation curve; performing multidimensional anomaly detection on the deviation fluctuation curve to generate an anomaly feature set, the anomaly feature set including fluctuation amplitude anomalies, frequency anomalies, and abrupt change anomalies; comprehensively evaluating the anomaly feature set to generate a channel stability index; and performing confidence mapping based on the channel stability index to generate a count confidence index.
[0054] Deviation fluctuation curves are constructed by extracting time-series deviation data from the channel deviation distribution. The historical records of the channel deviation distribution are stored in a sliding window format, with a window length of 30 seconds, a sampling frequency of 10Hz, and 300 historical deviation values within each window. The window slides forward one sampling point every 0.1 seconds. The time-series deviation data for each channel recorded in the channel deviation distribution are extracted from the historical records. The time-series deviation data for channel 1 is a numerical sequence of length 300, where the i-th element of the sequence is the deviation value at the i-th sampling time. The deviation fluctuation curves represent the time-series deviation data in a two-dimensional coordinate system, with the horizontal axis representing time t (range 0 to 30 seconds) and the vertical axis representing the deviation value δ (range -0.1 to 0.1). The deviation fluctuation curves are plotted as continuous curves using an interpolation algorithm, employing cubic splines to ensure curve smoothness. The deviation fluctuation curve for channel 1 shows periodic fluctuations around 0. This fluctuation originates from the batch discharging mechanism of the combined scale. Each batch of materials requires approximately 2 seconds of hopper opening and closing time. At the beginning of a batch, channel 1 may discharge before other channels, resulting in a momentary positive deviation. As other channels discharge in the middle of the batch, the relative deviation of channel 1 returns to around 0. This approximately 2-second periodic fluctuation reflects a normal discharging rhythm rather than a system malfunction. The peak-to-peak value of the fluctuation amplitude is approximately 0.08, corresponding to slight differences in the discharge timing between channels within each batch. The lack of a significant upward or downward trend in the curve indicates that the discharge frequency of channel 1 remains stable over a long period without drift. The statistical characteristics of the deviation fluctuation curve are calculated using curve integral. The absolute value of the area under the curve reflects the cumulative effect of the deviation. The area under the curve for channel 1 is 0.2. A smaller area indicates that the positive and negative deviations of this channel cancel each other out over a long period, and there is no persistent systematic deviation.
[0055] Multidimensional anomaly detection is performed on the deviation fluctuation curve to generate an anomaly feature set. The multidimensional anomaly detection executes three independent anomaly detection algorithms on the deviation fluctuation curve, each targeting a specific anomaly pattern. For fluctuation amplitude anomaly detection, a threshold T_amplitude = 0.1 is set for the absolute value of the deviation. The number of sampling points with an absolute deviation value greater than the threshold is counted. For channel 1, 0 sampling points trigger fluctuation amplitude anomalies, and for channel 4, 5 sampling points trigger fluctuation amplitude anomalies. These anomalies typically occur in scenarios where visual attribution is difficult when materials move across channel boundaries. For frequency anomaly detection, the frequency of deviation sign changes is calculated. The deviation sign sequence for channel 1 has 145 sign changes, while the expected number of changes is 150 ± 20. Since the actual number of changes is within the expected range, the frequency is considered normal. Normal frequency means that the deviation in this channel maintains a random fluctuation characteristic of alternating positive and negative signs, without continuous unidirectional drift. The mutation anomaly detection calculates the first derivative of the deviation fluctuation curve. Sampling points with an absolute derivative value greater than the threshold T_mutation = 0.5 per second are marked as mutation points. Channel 1 detected two mutation points. The actual scenario corresponding to these two mutation points is that multiple materials pass through this channel simultaneously within a short period of time, or this channel is temporarily blocked by materials falling from other channels. The anomaly feature set summarizes the detection results of three types of anomalies in the form of a structure. The anomaly feature set of channel 1 is {fluctuation amplitude anomaly: 0, frequency anomaly: false, mutation anomaly: 2}.
[0056] A comprehensive evaluation of the abnormal feature set is used to generate a channel stability index. The comprehensive evaluation quantifies the degree of abnormality in the abnormal feature set through a weighted deduction mechanism. The deduction rules are as follows: 0.1 points are deducted for each abnormal fluctuation amplitude, 0.2 points for each true frequency abnormality, and 0.05 points for each abrupt change. The deduction weights are set based on statistical analysis of the impact of different abnormality types on the final counting accuracy using extensive experimental data. The channel stability index is obtained by subtracting the total deduction from the initial score of 1. The abnormal feature set of channel 1 contains 0 abnormal fluctuation amplitudes, false frequency abnormalities, and 2 abrupt changes, with a deduction of 0.1 points and a channel stability index of 0.9. The abnormal feature set of channel 4 contains 5 abnormal fluctuation amplitudes, false frequency abnormalities, and 8 abrupt changes, with a deduction of 0.9 points and a channel stability index of 0.1. The low stability index reflects the problem of this channel in the actual scenario: channel 4 is located at the boundary between two adjacent channels. When material falls from the hopper, it often swings near the channel boundary, causing the visual attribution of the material to frequently switch between channel 4 and adjacent channels, resulting in counting instability. The channel stability index is a normalized measure of the reliability of channel counting. A higher index indicates smaller fluctuations in channel counting deviation, normal frequency, and no significant abrupt changes. The channel stability index reflects the counting stability and consistency of each channel over a long period of operation. The channel stability index sequence for the 8 channels is [0.9, 0.7, 0.95, 0.1, 0.8, 0.92, 0.75, 0.85]. The index for channel 4, 0.1, is significantly lower than the average level of 0.75.
[0057] A confidence level index for counts is generated by mapping confidence levels based on channel stability indices. The mapping function is a piecewise linear function with a slope inflection point at 0.5. When the channel stability index is below 0.5, the mapping slope is 1.5; when the channel stability index is above 0.5, the mapping slope is 0.325. The higher slope in the lower segment amplifies the confidence differences of low-stability channels, while the lower slope in the higher segment converges the confidence levels of high-stability channels to the range of 0.75 to 0.91. This design of two different slopes ensures that the confidence differences between low-stability and high-stability channels are effectively distinguished. For example, the channel stability index of 0.9 for channel 1 is mapped to a count confidence level of 0.88, and the channel stability index of 0.1 for channel 4 is mapped to a count confidence level of 0.15. The mapping results widen the confidence difference between high-stability and low-stability channels. The count confidence level ranges from 0 to 1; a higher index indicates a more reliable count result for that channel. Channels with an index below 0.3 are classified as low-confidence channels. The confidence index sequence for the 8 channels is [0.88, 0.82, 0.91, 0.15, 0.86, 0.90, 0.84, 0.87]. The confidence index of channel 4 is 0.15, which is lower than the threshold of 0.3, and is therefore classified as a low-confidence channel. The statistical characteristics of the confidence index include a mean of 0.78, a standard deviation of 0.24, a maximum value of 0.91 corresponding to channel 3, and a minimum value of 0.15 corresponding to channel 4.
[0058] Count bias is identified based on a bias threshold determined by the count confidence index. The bias threshold is set according to the numerical distribution of the count confidence index, with tiered thresholds. Channels with a count confidence index below the first threshold of 0.3 are directly identified as having count bias; channels with a count confidence index between the first threshold of 0.3 and the second threshold of 0.6 are identified as having slight count bias; and channels with a count confidence index above the second threshold of 0.6 are identified as having no count bias. The count confidence index sequence for the 8 channels is [0.88, 0.82, 0.91, 0.15, 0.86, 0.90, 0.84, 0.87]. Channel 4 has a count confidence index of 0.15, which is below the first threshold of 0.3, and is therefore identified as having count bias. The bias type is marked as "low confidence bias," and the reason for the bias is "excessive abnormal fluctuations leading to poor stability." This determination triggers a subsequent weight reduction mechanism to ensure that channels with count bias do not contaminate the fusion result. The confidence score for channel 3 is 0.91, which is higher than the second threshold of 0.6, indicating no counting bias. Although this channel has a relatively high bias value in the inter-channel comparison, the confidence score reflects that its bias fluctuation is stable and has no worsening trend, so it is still judged as a reliable channel. The identification results of counting bias are recorded as a Boolean array with a length of 8 corresponding to 8 channels. An array element of true indicates that the channel has counting bias, and false indicates that there is no counting bias. The current identification results are [false, false, false, true, false, false, false, false], with only channel 4 being identified as having counting bias.
[0059] In some embodiments, the step of generating a fused count sequence by channel hierarchical weighted fusion based on the count deviation and the channel count value distribution includes: extracting the deviation amplitude of each channel from the count deviation to construct a deviation amplitude sequence; performing time-series deviation change trend analysis on the deviation amplitude sequence to generate deviation gradient features; performing channel reliability hierarchical fusion based on the deviation gradient features to generate hierarchical weight coefficients; and performing weighted fusion of the channel count value distribution according to the hierarchical weight coefficients to generate a fused count sequence.
[0060] The deviation amplitude of each channel is extracted from the count deviation to construct a deviation amplitude sequence. The identification result of the count deviation marks the channels with deviations. The deviation amplitude is the absolute value of the deviation value in the channel deviation distribution, reflecting the degree of deviation of the channel from the average level. The deviation values of channels 1 to 8 are 0.014, -0.026, 0.044, -0.036, -0.006, 0.024, -0.016, and 0.004, respectively, with corresponding deviation amplitudes of 0.014, 0.026, 0.044, 0.036, 0.006, 0.024, 0.016, and 0.004. The deviation amplitude sequence records the deviation amplitude of each channel in the form of 8-tuples, with the sequence [0.014, 0.026, 0.044, 0.036, 0.006, 0.024, 0.016, 0.004], and the sequence value range is 0.004 to 0.044. The statistical characteristics of the deviation amplitude sequence include an average deviation amplitude of 0.021, a standard deviation of 0.013, a maximum deviation amplitude of 0.044 corresponding to channel 3, and a minimum deviation amplitude of 0.004 corresponding to channel 8. A Boolean array of count deviations is used in conjunction with the deviation amplitude sequence. The deviation amplitude of 0.036 for channels with deviations (channel 4) is used for weight adjustment, while the deviation amplitude of channels without deviations is only used as a reference and does not trigger weight adjustment. The deviation amplitude sequence is updated every 0.1 seconds as the channel deviation distribution is updated, maintaining synchronization with the channel count value distribution and ensuring that the deviation amplitude reflects the latest channel count status.
[0061] A time-series deviation trend analysis is performed on the deviation amplitude sequence to generate deviation gradient features. This analysis assesses the evolution direction of the deviation amplitude sequence over time, determining whether the deviation amplitude of each channel is increasing, decreasing, or stabilizing, thus providing early warning of channel performance deterioration. The historical data of the deviation amplitude sequence stores the deviation amplitude values for the most recent 10 seconds, with a sampling frequency of 10Hz and a historical sequence length of 100 sampling points. The deviation gradient is calculated using the slope of a linear regression of the historical deviation amplitude sequence. A positive slope indicates an increasing deviation amplitude, a negative slope indicates a decreasing deviation amplitude, and a slope close to 0 indicates a stable deviation amplitude. The deviation gradient for channel 1 is -0.0003 samples / point. This negative gradient indicates a slight decrease in the deviation amplitude of this channel, which may originate from the initial break-in process of the system. As the material flow gradually stabilizes, the improved coordination of the channels leads to a reduction in deviation. The deviation gradient for channel 4 is 0.0015 samples / sampling point. A positive gradient indicates that the deviation amplitude of this channel is continuously increasing. This upward trend reflects that the problem in this channel is worsening. Possible reasons include material accumulation on the inner wall of the discharge hopper of this channel, causing poor material flow, or dust contamination of the camera's field of view corresponding to this channel, leading to a decrease in visual inspection quality. The deviation gradient feature is recorded in the form of 8-tuples for each channel, with the gradient features being [-0.0003, 0.0005, 0.0001, 0.0015, -0.0002, 0.0003, -0.0001, 0.0000], and the gradient value range being -0.0003 to 0.0015. The deviation gradient feature represents the dynamic trend of channel count deviation. The larger the absolute value of the gradient, the faster the deviation changes, requiring a more aggressive weight adjustment strategy. The bias gradient of channel 4, 0.0015, is significantly larger than that of other channels, indicating that the bias problem of this channel is worsening. It is necessary to significantly reduce the weight or even eliminate the counting contribution of this channel to avoid its degraded counting data affecting the overall accuracy.
[0062] Channel reliability is graded based on deviation gradient characteristics, generating grading weight coefficients. Channel reliability is determined by the absolute value of the deviation gradient characteristic; a larger absolute value indicates a faster change in deviation. The grading standard divides the eight channels into three levels: high reliability, medium reliability, and low reliability. High reliability requires an absolute value of the deviation gradient characteristic less than 0.0005; channels 1, 3, 5, 6, 7, and 8 meet this condition and are classified as high reliability. Medium reliability requires an absolute value of the deviation gradient characteristic between 0.0005 and 0.001; channel 2, with a deviation gradient characteristic of 0.0005, is classified as medium reliability. Low reliability is defined for channels with an absolute value of the deviation gradient characteristic greater than 0.001; channel 4, with a deviation gradient characteristic of 0.0015, is classified as low reliability. The weighting coefficients are set according to the reliability level. The weighting coefficient for high reliability is 1.0, for medium reliability it is 0.6, and for low reliability it is 0.2. The weighting coefficients for the 8 channels are [1.0, 0.6, 1.0, 0.2, 1.0, 1.0, 1.0, 1.0]. The weighting coefficients are normalized, with a normalization factor of approximately 1.176. The normalized weighting coefficients are approximately [1.176, 0.706, 1.176, 0.235, 1.176, 1.176, 1.176, 1.176]. Normalization ensures that the total count after fusion is consistent with the original total count.
[0063] The channel count distribution is weighted and fused based on hierarchical weight coefficients to generate a fused count sequence. The weighted fusion employs a channel-level weight adjustment strategy, multiplying each channel count value in the channel count distribution by its corresponding hierarchical weight coefficient to generate a comprehensive fused count sequence. Taking a combined scale's actual operating scenario as an example, in a certain batching cycle, the eight channel count values are [53, 48, 50, 49, 52, 47, 51, 50]. Channel 4 is identified as a low-reliability channel due to difficulties in visual attribution, with a corresponding hierarchical weight coefficient of 0.235, significantly lower than the 1.176 of high-reliability channels. After weighted fusion, the original count value of channel 4 (49) is compressed to approximately 12, significantly weakening its contribution to the fusion result. Meanwhile, the count values of high-reliability channels 1, 3, 5, 6, 7, and 8 are amplified by approximately 18%, and these reliable channels dominate the fusion result. In real-world scenarios, channel 4 is located at the boundary between two adjacent channels. Material movement trajectories at this location frequently cross the channel boundary, causing material attribution to constantly switch between channel 4 and the adjacent channels 3 and 5, resulting in uncertainty in attribution determination. By reducing the weight of channel 4 and increasing the weight of adjacent reliable channels, the fused counting sequence can more accurately reflect the total number of materials actually passing through, avoiding double counting or undercounting caused by boundary ambiguity. The fused counting sequence is updated every 0.1 seconds based on the channel count value distribution and the hierarchical weight coefficients. The time-series format of the fused counting sequence records the fused count value at each moment, covering the fusion history of the most recent 5 seconds. The dynamic adjustment mechanism of the hierarchical weight coefficients allows the fused counting sequence to adaptively respond to changes in channel reliability. When the stability index of channel 4 recovers from 0.1 to 0.6 (e.g., through clearing accumulated material or cleaning the lens), the weight coefficient of this channel automatically increases from 0.235 to 0.6, gradually restoring its normal contribution to the fusion result. This dynamic mechanism ensures that the system maintains high counting accuracy and robustness under different operating conditions.
[0064] Step S150: Based on the fusion counting sequence, perform temporal counting consistency detection to generate dynamic correction parameters, and generate visual counting results based on the dynamic correction parameters and the channel count value distribution.
[0065] Specifically, dynamic correction parameters are generated based on the time-series counting consistency detection using the fused counting sequence. The time-series counting consistency detection evaluates the continuity and stability of the fused counting sequence over time, identifying anomalous jumps or trend shifts in the counting sequence. The fused counting sequence is recorded in time-series format as 50 sampling points over the most recent 5 seconds, with each sampling point corresponding to the fused count value of 8 channels. The time-series detection is performed independently on a channel-by-channel basis. The time-series counting consistency detection sets three types of checking rules: monotonicity check requires the counting sequence to be non-decreasing; incremental range check requires the difference between adjacent sampling points to be within the range of 0 to 3; and trend stability check requires the deviation of the linear regression slope of the counting sequence from the set discharge frequency to be less than 20%. The threshold 3 for the incremental range check is set based on physical constraints: the discharge cycle of the combined scale is 170 milliseconds, and the sampling interval is 100 milliseconds. Theoretically, there can be a maximum of one discharge within a sampling interval, and threshold 3 provides a margin for error. In the fusion counting sequence, channel 1 passed all three types of checks. Channel 4, at t=4.2 seconds, had a difference value of 5, exceeding the threshold of 3, and failed the incremental range check. This abnormal jump originated from multiple materials near channel 4 passing almost simultaneously. The visual detector made a trajectory association error in the blurred boundary area, misclassifying some materials from adjacent channels 3 and 5 as belonging to channel 4. Dynamic correction parameters are generated based on the consistency detection results. These parameters include three fields: correction type, correction magnitude, and correction time window. The dynamic correction parameter for channel 4 is "abnormal jump correction," with a correction magnitude of 2 obtained by subtracting the theoretical expected increment of 1 from the count increment of 5 and then multiplying by a conservative correction coefficient of 0.5. The correction time window is [4.1 seconds, 4.3 seconds]. Six out of the eight channels in the fusion counting sequence passed all checks, while two channels required correction. The dynamic correction parameters generated correction instructions for these two channels.
[0066] Visual counting results are generated based on dynamic correction parameters and channel count distribution. The visual counting results integrate the fused count values of the fused counting sequence and the correction instructions from the dynamic correction parameters, correcting any abnormal channel count values. The dynamic correction parameter correction operation is performed on the time series of the fused counting sequence; the correction operation for channel 4 reverts the fused count value at t=4.2 seconds from 15 to 13. The dynamic correction parameter correction process also triggers cross-validation of adjacent channels, checking whether the count increment of channels 3 or 5 is abnormally low. If insufficient compensatory increment is detected, it is marked as a suspected missed count requiring manual review. The channel count distribution provides the original count values of each channel as a reference benchmark; when the difference between the corrected fused counting sequence and the original channel count distribution exceeds 10%, it is marked as an abnormal count. The corrected fused count value for channel 4 is 13, while the original channel count distribution has a count value of 49, a difference of 73.5%. The visual count result for this channel is marked as "outlier count - requires review." This significant difference reflects the combined effect of the extremely low weight coefficient of 0.235 assigned to channel 4 in S140 and the outlier correction in S150. The visual count results are output in a structured data format, containing four fields: count value for each of the eight channels, correction flag, confidence level, and outlier flag. The visual count result for channel 1 is {count value: 66, correction: no, confidence level: 0.88, outlier: no}, and the visual count result for channel 4 is {count value: 13, correction: yes, confidence level: 0.15, outlier: yes}.
[0067] To implement the combined scale material visual counting method corresponding to the above method embodiments, and to achieve the corresponding functions and technical effects. See also Figure 3 , Figure 3 This application provides a structural block diagram of a combined scale material visual counting device 300, which includes: Image acquisition module 301 is used to acquire image data of multi-channel discharge scene and the location distribution information of each discharge port, and to perform spatial morphological registration and recognition on the image data and the location distribution information of each discharge port to construct a visual coverage mapping table. The conflict analysis module 302 is used to perform multi-channel spatiotemporal overlap analysis based on the visual coverage mapping table to identify visual occlusion conflict areas, and generate differentiated image acquisition strategies according to the degree of conflict between the visual occlusion conflict areas and the location distribution information of each discharge port. The target tracking module 303 is used to perform visual detection and tracking of materials according to the differentiated image acquisition strategy to generate material movement trajectory, perform reverse tracing of the occluded sections in the material movement trajectory to generate trajectory compensation marks, determine the target attribution mark according to the trajectory compensation mark and the distribution information of each discharge port, and generate sub-channel visual counting parameters based on the target attribution mark. The counting verification module 304 is used to generate a channel count value distribution by accumulating visual counts based on the sub-channel visual counting parameters, to identify counting deviations by performing multi-frame temporal cross-verification on the channel count value distribution, and to generate a fused count sequence by performing channel hierarchical weighted fusion based on the counting deviations and the channel count value distribution. The result generation module 305 is used to generate dynamic correction parameters based on the temporal counting consistency detection of the fused counting sequence, and generate visual counting results based on the dynamic correction parameters and the channel count value distribution.
[0068] The aforementioned combined scale material visual counting device 300 can implement the combined scale material visual counting method of the above method embodiments. The options in the above method embodiments are also applicable to this embodiment, and will not be detailed here. The remaining content of this application embodiment can be referred to the content of the above method embodiments, and will not be repeated in this embodiment.
[0069] The purpose of the above embodiments is to reproduce and derive the technical solution of the present invention by way of example, and to fully describe the technical solution, purpose and effect of the present invention. The purpose is to enable the public to have a more thorough and comprehensive understanding of the disclosure of the present invention, and not to limit the scope of protection of the present invention.
Claims
1. A visual counting method for materials using a combination scale, characterized in that, include: Collect image data of multi-channel discharge scenarios and the location distribution information of each discharge port, and construct a visual coverage mapping table by performing spatial morphological registration and recognition on the image data and the location distribution information of each discharge port. Based on the visual coverage mapping table, multi-channel spatiotemporal overlap analysis is performed to identify visual occlusion conflict areas, and differentiated image acquisition strategies are generated according to the degree of conflict between the visual occlusion conflict areas and the location distribution information of each discharge port. Based on the differentiated image acquisition strategy, visual detection and tracking of materials are performed to generate material movement trajectories. The occluded sections in the material movement trajectory are traced back to generate trajectory compensation markers. The target attribution markers are determined according to the trajectory compensation markers and the distribution information of each discharge port. Based on the target attribution markers, sub-channel visual counting parameters are generated. Based on the visual counting parameters of the sub-channels, visual counting is accumulated to generate a channel count value distribution. Multi-frame temporal cross-validation is performed on the channel count value distribution to identify counting deviations. Based on the counting deviations and the channel count value distribution, channel hierarchical weighted fusion is performed to generate a fused count sequence. Based on the fused counting sequence, temporal counting consistency detection is performed to generate dynamic correction parameters, and visual counting results are generated based on the dynamic correction parameters and the channel count value distribution.
2. The method according to claim 1, characterized in that, The step of performing multi-channel spatiotemporal overlap analysis and identifying visual occlusion conflict regions based on the visual coverage mapping table includes: Based on the visual coverage mapping table, the material discharge time sequence of each channel is extracted to construct a material discharge time sequence feature set; Perform time window overlap detection on the discharge timing feature set to generate synchronous discharge period identifiers; Visual occlusion distribution is generated by parsing the spatial overlap region of the image from the synchronous discharge time period identifier; Based on the visual occlusion distribution, the occlusion intensity of the synchronous material discharge period marker is evaluated to generate a visual occlusion conflict area.
3. The method according to claim 1, characterized in that, The method of generating a differentiated image acquisition strategy based on the degree of conflict between the visual occlusion conflict area and the location distribution information of each discharge port includes: Based on the visual occlusion conflict area, the location distribution information of each discharge port is divided into a high occlusion channel group and a low occlusion channel group; Based on the degree of occlusion of the high-occlusion channel group and the low-occlusion channel group, adaptive frame rate allocation is performed to generate differentiated frame rate parameters; Exposure timing matching is performed on the differentiated frame rate parameters to generate an acquisition timing table; A differentiated image acquisition strategy is generated based on the acquisition timing table.
4. The method according to claim 1, characterized in that, The step of reverse tracing to generate trajectory compensation markers for obstructed sections in the material's movement trajectory includes: The target visibility continuity detection is performed on the obstructed sections in the material movement trajectory to identify trajectory interruption points. Motion feature vectors are generated by extracting motion features from the trajectory segments before and after the trajectory interruption point. Based on the motion feature vectors, trajectory extension prediction is performed to generate predicted trajectory segments; A trajectory compensation identifier is generated based on the matching degree between the predicted trajectory segment and the material movement trajectory.
5. The method according to claim 1, characterized in that, The step of determining the target attribution identifier based on the trajectory compensation identifier and the distribution information of each discharge port includes: Based on the trajectory compensation identifier, the material movement trajectory is corrected to generate a complete trajectory set; Based on the complete trajectory set, the trajectory endpoint coordinates and motion direction vectors are extracted to construct trajectory attribution features; The trajectory attribution features are combined with the location distance and direction consistency information of each discharge port to generate attribution confidence. The target attribution identifier is determined based on the attribution confidence level.
6. The method according to claim 1, characterized in that, The step of performing multi-frame temporal cross-validation to identify counting deviations in the channel count distribution includes: Based on the distribution of channel count values, multi-frame count statistics for each channel are extracted to construct count statistics features; The channel deviation distribution is generated by comparing the channel count consistency of the statistical characteristics. Based on the channel deviation distribution, a time series stability analysis is performed to generate a count confidence index; The deviation threshold is determined and the counting deviation is identified according to the aforementioned counting confidence index.
7. The method according to claim 1, characterized in that, The step of generating a fused count sequence by performing channel-level weighted fusion based on the counting bias and the channel count value distribution includes: Extract the deviation amplitude of each channel from the count deviation to construct a deviation amplitude sequence; Perform time-series deviation change trend analysis on the deviation amplitude sequence to generate deviation gradient features; Based on the aforementioned deviation gradient characteristics, channel reliability is classified and a classification weight coefficient is generated. The channel count distribution is weighted and fused according to the hierarchical weight coefficient to generate a fused count sequence.
8. The method according to claim 4, characterized in that, The step of extracting motion features from the trajectory segments before and after the trajectory break point to generate motion feature vectors includes: Based on the trajectory breakpoint, extract the motion velocity and trajectory curvature forward and backward respectively; A feature reliability score is generated based on a quantitative evaluation of the continuity between the motion speed and the trajectory curvature. Based on the reliability score of the features, the motion speed and the trajectory curvature are weighted and extracted to generate reliability weighted features; The reliability weighted features are modified by continuous constraint to generate motion feature vectors.
9. The method according to claim 6, characterized in that, The generation of a count confidence index based on the time series stability analysis of the channel bias distribution includes: Extract the time-series data of each channel deviation from the channel deviation distribution to construct a deviation fluctuation curve; Multidimensional anomaly detection is performed on the deviation fluctuation curve to generate an anomaly feature set, which includes fluctuation amplitude anomaly, frequency anomaly and sudden change anomaly. The abnormal feature set is comprehensively evaluated to generate a channel stability index; Based on the channel stability index, a confidence level is generated by mapping the confidence level to a count confidence level.
10. A combined scale material visual counting device, characterized in that, include: The image acquisition module is used to acquire image data of the multi-channel discharge scene and the location distribution information of each discharge port, and to perform spatial morphological registration and recognition on the image data and the location distribution information of each discharge port to construct a visual coverage mapping table. The conflict analysis module is used to perform multi-channel spatiotemporal overlap analysis based on the visual coverage mapping table to identify visual occlusion conflict areas, and to generate differentiated image acquisition strategies according to the degree of conflict between the visual occlusion conflict areas and the location distribution information of each discharge port. The target tracking module is used to perform visual detection and tracking of materials based on the differentiated image acquisition strategy to generate material movement trajectories, perform reverse tracing of occluded sections in the material movement trajectory to generate trajectory compensation markers, determine target attribution markers based on the trajectory compensation markers and the distribution information of each discharge port, and generate sub-channel visual counting parameters based on the target attribution markers. The counting verification module is used to accumulate visual counts based on the sub-channel visual counting parameters to generate a channel count value distribution, perform multi-frame temporal cross-verification on the channel count value distribution to identify counting deviations, and perform channel-level weighted fusion based on the counting deviations and the channel count value distribution to generate a fused counting sequence. The result generation module is used to generate dynamic correction parameters based on the temporal counting consistency detection of the fused counting sequence, and generate visual counting results based on the dynamic correction parameters and the channel count value distribution.