Bus coin automatic counting method and device

By using video motion detection and target detection models to identify currency features, the problem of traditional bus coin counters being unable to identify currency value and distinguish between genuine and counterfeit currency has been solved. This has enabled high-precision automatic counting and monitoring, reduced missed detections and undercounting, and lowered operating costs.

CN121789342APending Publication Date: 2026-04-03XIAN TRANSPORTATION INFORMATION INVESTMENT & OPERATION CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional bus coin counters cannot identify coin value or distinguish between genuine and counterfeit currency, and driver supervision is often inadequate, resulting in a lack of effective oversight of the counting process, especially during peak passenger flow or in poor lighting conditions, where there are obvious blind spots in supervision.

Method used

Video motion detection technology is used to monitor image changes, and a target detection model is used to identify currency features, including authenticity and denomination. Occlusion detection is used to improve recognition accuracy and achieve automatic counting.

Benefits of technology

It significantly improves the accuracy of currency recognition and counting, reduces missed detections and undercounts, lowers operating costs, and reduces the workload of drivers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121789342A_ABST
    Figure CN121789342A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of traffic management, and discloses a bus coin automatic counting method and device, and the method comprises the following steps: collecting a coin video, selecting a reference background image from the coin video, continuously monitoring the image change based on the reference background base image through a video movement detection technology, and carrying out the coin time monitoring. After the coin inserting event is monitored, a key frame image in the coin inserting video is acquired, currency feature information is identified based on the key frame image by adopting a target detection model, and the currency feature information at least comprises authenticity information and a corresponding currency face value; according to the invention, for the currency whose currency authenticity information is normal, the input currency is automatically accumulated during continuous currency insertion events, the currency input by a passenger is automatically identified and counted, and local warning is carried out when counterfeit currency is identified, so that the problem that visual supervision of an existing traditional mechanical counter and a driver is insufficient is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic management technology, specifically to an automatic coin-operated counting method and device for public transportation. Background Technology

[0002] Public buses are the most common form of public transportation, greatly facilitating people's travel. Traditional bus coin counting mainly relies on mechanical counters inside the coin box combined with driver visual supervision. The mechanical counter can only count the number of times coins pass through the flip plate; it cannot identify coin values ​​or banknotes, let alone distinguish between genuine and counterfeit currency. Driver supervision relies entirely on personal experience and attention, which is prone to oversights during peak hours or at night when lighting is poor. This results in a lack of effective technical means to accurately identify and record the amount of coins deposited, creating significant regulatory blind spots. Summary of the Invention

[0003] The purpose of this invention is to provide an automatic coin-operated counting method and apparatus for public transportation, so as to solve the technical problems mentioned in the prior art.

[0004] An automatic coin-operated counting method for public transportation includes the following steps: Step 1: Collect coin-insertion video, select a reference background image from the coin-insertion video, and continuously monitor image changes based on the reference background image using video motion detection technology to monitor coin-insertion time; Step 2: After detecting a coin insertion event, acquire keyframe images from the coin insertion video, and use an object detection model to identify currency feature information based on the keyframe images. The currency feature information includes at least authenticity information and the corresponding currency denomination. Step 3: For currencies whose authenticity information is normal, record it as a single coin insertion event; and display the identified currency denomination locally. If consecutive coin insertion events are detected within a fixed time window, and the frequency of these events is less than a preset frequency, then these consecutive coin insertion events are recorded as single-person coin insertion events. The sum of the coin values ​​of all single coin insertion events within a single-person coin insertion event is then accumulated and added together to update the local display information.

[0005] Furthermore, step 2 also includes: using an object detection model to identify currency occlusion information based on keyframe images, determining whether to perform occlusion detection based on the currency occlusion information, and obtaining currency authenticity information and corresponding currency denominations based on the occlusion detection results.

[0006] Furthermore, an object detection model is used to identify currency occlusion information based on keyframe images, and the determination of whether to perform occlusion detection is based on the currency occlusion information, including: Acquire at least two adjacent keyframe images and calculate the occlusion rate of the two keyframe images. If the occlusion rate is greater than the preset threshold, there may be obstacles to the recognition of currency feature information. Occlusion detection is performed based on key frame images. , , m is The number of elements in the middle. Let be the set of bounding boxes detected by the object detection model in the (k-1)th frame image. Let K be the set of bounding boxes obtained by the object detection model in the k-th frame image. , A set of geometric features Let be the area of ​​the i-th detection box in the (k-1)-th frame. Let be the area of ​​the j-th detection box in the k-th frame.

[0007] Furthermore, occlusion detection includes: Based on keyframe images, identify whether different types of currency exist and determine whether currency feature information has been occluded to obtain occlusion judgment results; Based on the occlusion judgment result, the occlusion domain data of the keyframe image is obtained, the occlusion domain data is compared with the set occlusion threshold, and the updated occlusion judgment result is output based on the comparison result. Whether to perform supplementary currency value calculation is determined based on the updated occlusion judgment results.

[0008] Furthermore, based on keyframe images, the system identifies the presence of different types of currency and determines whether currency feature information has been occluded. Specifically: According to the binary comparison function The calculation results generate the first detection matrix A, and based on... Whether it equals 0 determines whether currency feature information has been obscured; The binary comparison function , ,in, for The corresponding set of currency denominations, for The corresponding set of currency denominations, , A collection of semantic attributes For the currency type in the nth frame of the (k-1)th frame of the image, Let A be the currency type of the m-th bounding box in the k-th frame of the image; the first detection matrix A = ( ),matrix Let be the permutation matrix of the first detection matrix A.

[0009] Furthermore, based on the occlusion judgment result, occlusion domain data of the keyframe image is obtained, the occlusion domain data is compared with the set occlusion threshold, and an updated occlusion judgment result is output based on the comparison result, including: Based on the occlusion domain data, a second detection matrix is ​​obtained based on the overlapping region function and the similarity function. Each row of data in the second detection matrix is ​​compared with the set occlusion threshold. If the minimum value of the row is greater than the occlusion threshold, the position represented by the row is occluded, which is the occluded position. Map the obscured locations to a set of currency denominations to obtain the obscured currency denominations.

[0010] Furthermore, overlapping region functions , , ,in, It is the area of ​​the nth detection box in the (k-1)th frame. It is the area of ​​the m-th detection box in the k-th frame; Similarity function in, For the frame and The intersection and union ratio, for and The ratio of the Euclidean distance of the center point to the diagonal length of its smallest outermost matrix. This is a correction value; By analyzing the overlapping region function and similarity function The calculated values ​​are weighted and averaged to obtain Thus, the second detection matrix is ​​obtained. Where m and n are sets With sets The number of elements; The calculation process is as follows .

[0011] Furthermore, Obtaining the occluded currency value also includes: calculating a currency value detection box based on the first detection matrix A, and finding the corresponding currency value Val based on the currency value detection box; and when there are differences, the occlusion value calculated by the second detection matrix is ​​used first. The calculation process for the first detection matrix A is as follows: The sum of each column of the first detection matrix is ​​calculated. For example, the i-th column, which is less than -1, corresponds to the currency denomination detection box. The currency denomination corresponding to the corresponding detection box is found, which is the obscured currency denomination Val. Then, it is determined whether the obscured currency is in the detection box. If the currency is not detected, then the statistical currency denomination Val needs to be added to the statistical currency to improve accuracy.

[0012] Furthermore, the constraints for the supplementary calculations are as follows: ,in For the frame and The intersection and union ratio,

[0013] If the constraints are met, the obscured currency value will not be recalculated; if the constraints are not met, the obscured currency value will be recalculated.

[0014] This invention first acquires a stable image as a reference background map and continuously detects changes in the image. Then, it uses a target detection model to identify the face value and authenticity of the currency. It also accumulates and adds up the face values ​​of currency inserted by passengers in consecutive coin insertion events, thereby automatically identifying and counting the currency inserted by passengers. This solves the problem of insufficient visual supervision from existing traditional mechanical counters and drivers.

[0015] This invention, by judging whether currency is obscured during currency identification and detecting obscuration of suspected obscured currencies, can effectively identify currencies missed due to obscuration, significantly improve overall statistical accuracy, and reduce or avoid the problem of undercounting caused by mutual obscuration of currencies.

[0016] After entering the occlusion detection stage, this invention first performs a binary comparison of currency types, and then performs geometric feature detection. This not only allows for multiple screenings to distinguish between true and false occlusions, but also uses geometric feature detection to determine the occlusion location, achieving high-precision occlusion detection and positioning in complex coin-operated scenarios. Finally, combined with supplementary calculation constraint verification, the accuracy of occlusion counting is ensured, thereby achieving mutual verification and compensation to avoid the limitations of a single method.

[0017] An automatic coin-operated counting device for public transportation includes an intelligent counting terminal using the above-mentioned technical method. The intelligent counting terminal is installed on the coin box, and the coin box is also equipped with a camera, a display and an alarm. The camera, the display and the alarm are all connected to the intelligent counting terminal, and the intelligent counting terminal is connected to the back-end. The intelligent counting terminal uses the above counting method to count currency.

[0018] This invention, through the analysis of inserted coins, can automatically accumulate and identify counterfeit coins for each person's coin insertion, and then display the amount of each coin insertion and issue a counterfeit coin warning locally, greatly reducing the workload of drivers and lowering operating costs. Attached Figure Description

[0019] Figure 1 A schematic diagram of an automatic coin-operated counting device for public transportation. Figure 2 Flowchart of the automatic coin counting method for public transportation; In the picture: 1. Coin box; 2. Camera; 3. Display; 4. Alarm; 5. Smart counting terminal. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Reference Figure 2 As shown, the present invention provides an automatic coin counting method for public transportation, comprising the following steps: Step 1: Collect coin-insertion video, select a reference background image from the coin-insertion video, and continuously monitor image changes based on the reference background image using video motion detection technology to monitor coin-insertion events; Specifically, the system continuously monitors the coin insertion point using a camera, collects the coin insertion video required for image recognition, and extracts a stable frame as a reference background image. Then, video motion detection technology is used to detect significant changes in the image in real time. When motion detection is triggered, it indicates that coins have been inserted.

[0022] Step 2: After detecting a coin insertion event, keyframe images from the coin insertion video are acquired, and a target detection model is used to identify currency feature information based on the keyframe images. The currency feature information includes at least currency authenticity information and the corresponding currency denomination. The target detection model is then used to identify currency occlusion information based on the keyframe images. Based on the currency occlusion information, it is determined whether to perform occlusion detection. Based on the occlusion detection results, currency authenticity information and the corresponding currency denomination are obtained. In this application, currency authenticity mainly distinguishes between game tokens and coins. Based on the above, before using the object detection model for recognition, the following steps are also included: training the object detection model. Specifically, a large number of images are collected through a high-definition camera and saved as samples. The samples are then used to train the model using YOLOv8 / YOLOv11. Then, the embedded platform tools convert the model into an OM that can run on the ARM Linux system, ensuring that the error between the OM's running result and the training model's result is within 1%. This is used to greatly reduce the model size, reduce the computational load and power consumption, and meet the resource constraints of the embedded environment while ensuring the model's accuracy.

[0023] The target detection model is used to identify currency occlusion information based on keyframe images. The determination of whether to perform occlusion detection based on currency occlusion information includes: acquiring at least two adjacent keyframe images, calculating the occlusion rate of the two keyframe images, and if the occlusion rate is greater than a preset threshold, there may be obstacles to the recognition of currency feature information. Occlusion detection is then performed based on the keyframe images. Specifically, by applying a target detection model to the (k-1)th frame image for currency identification, the set of detected bounding boxes is obtained as follows: The corresponding set of currency values ​​is The object detection model is used to identify currency in the k-th frame image, and the set of detected bounding boxes is obtained as follows: The corresponding set of currency values ​​is ,in, , For the geometric feature set corresponding to the currency detection results, for each element in the set, its definition is at least based on the coordinate representation of its bounding box, so as to be used to directly or indirectly calculate the required geometric attributes, such as area, center point coordinates, intersection area with other boxes, and intersection-union ratio. , For each element in the set, the target detection model identifies and outputs at least the currency category, currency denomination, and currency authenticity information. The occlusion rate is calculated using an occlusion rate function. Then, occlusion detection is performed, and the recognition difficulties caused by overlapping and occlusion are specifically handled through occlusion detection, reducing or avoiding the problem of missed counting caused by mutual occlusion of currency, thereby significantly improving the overall statistical accuracy.

[0024] The occlusion rate function is: m is The number of elements in the middle, where, Let be the area of ​​the i-th detection box in the (k-1)-th frame. Let be the area of ​​the j-th detection box in the k-th frame; Occlusion detection includes: Based on keyframe images, the system identifies the presence of different types of currency and determines whether currency feature information has been occluded, thus obtaining the occlusion judgment result. Specifically, according to the binary comparison function , ,in, For the currency type in the nth frame of the (k-1)th frame of the image, Let the matrix represent the currency type of the m-th frame in the k-th frame image. Let A be the permutation matrix of the first detection matrix A; according to the binary comparison function The calculation results generate the first detection matrix A, and based on... Whether it equals 0 determines whether currency feature information has been occluded; where, the first detection matrix A = ( For example, a 2x2 matrix A is If the types of currency being obscured are different, then Conversely A matrix A is constructed to increase the probability of judgment and improve reliability. For example, a 50-cent coin and a 50-cent banknote belong to different categories, i.e., different types of currency. In a binary comparison function, this is considered "not equal," and the corresponding value of the binary comparison function is -1. When one coin covers another, in the frame where the coin was first covered, if they are different currencies, then the generated matrix A yields... Conversely Then through Whether the value is 0 can be used to determine whether occlusion has occurred; Based on the occlusion judgment result, the occlusion domain data of the keyframe image is obtained. The occlusion domain data is compared with the set occlusion threshold. Based on the comparison result, the updated occlusion judgment result is output. That is, based on the occlusion domain data, the second detection matrix is ​​obtained based on the overlapping region function and the similarity function. The data of each row in the second detection matrix is ​​compared with the set occlusion threshold. If the minimum value of the row is greater than the occlusion threshold, the position represented by the row is occluded, which is the occlusion position. Specifically, this is achieved by calculating the overlapping region function. and similarity function Then, for the overlapping region function and similarity function The calculated values ​​are weighted and averaged to obtain the second detection matrix. Then, the minimum value of each row in the second detection matrix is ​​compared. If the minimum value of any row is greater than the occlusion threshold, it indicates that the area is occluded. The overlapping region function is then used to determine the minimum value. , , ,in, It is the area of ​​the nth detection box in the (k-1)th frame. It is the area of ​​the m-th detection box in the k-th frame; Similarity function in, for and The intersection and union ratio, for and The ratio of the Euclidean distance of the center point to the diagonal length of its smallest outermost matrix. This is a correction value; The calculation process is as follows

[0025] The second detection matrix is Where m and n are sets With sets The number of elements; Based on the above approach, a comprehensive inter-frame relationship metric is first constructed using overlapping region functions and a comprehensive similarity function. Then, through row minimum value analysis and threshold comparison, the location of actual occlusion is filtered out from a large number of selection boxes. This method combines geometric features (overlapping region, center distance, area ratio) with currency type logic judgment, which not only plays a role in further filtering and effectively distinguishes between real occlusion and normal currency movement, significantly reducing the false detection rate, but also provides accurate location basis for subsequent supplementary counting of occluded currency, achieving high-precision occlusion detection and positioning in complex coin-operated scenarios.

[0026] The occlusion location is mapped to the set of currency denominations to obtain the occluded currency denominations, and based on the updated occlusion judgment results, it is determined whether to perform supplementary calculations on the currency denominations. Specifically, the process involves locating the occluded currency denomination based on its position and obtaining a judgment result. This result is then verified using an object detection model. If verification passes, the denomination is recounted; otherwise, it is not. Verification is necessary because both consecutive frames require object detection for identification. Sometimes, severe occlusion can still be detected by YOLOv8, reducing the probability of detection compared to unoccluded frames. Even if occlusion exists and its location can be found, it may still be detected. For these cases, recounting is unnecessary. Therefore, it's necessary to determine if the occluded denomination has already been detected in the new frame. If detected, recounting is unnecessary; if not detected, recounting is required to avoid missed or excessive counts and improve accuracy. The judgment also verifies if it's the same banknote. If it is, the object detection model will detect the same label. Furthermore, it's assumed that the banknote hasn't moved significantly between the two frames, leading to the following constraints: , , in for and The intersection-union ratio; if the above conditions are not met, it needs to be added, and the occluded value is added; otherwise, it is not added; where the label is at least one element in the semantic attribute set, the occluded currency denomination is found based on the occlusion position, specifically, firstly, the sum of each column of the first detection matrix A is calculated, if the sum of column i is less than -1, then column i is mapped to the detection box, and then the occluded currency denomination Val can be obtained by finding the currency denomination corresponding to the detection box, which is denoted as the first currency denomination Val, and at the same time, the second detection matrix If the occlusion location is found, such as in row i, and the minimum value is greater than the occlusion threshold, it means that every value in this row is greater than the occlusion threshold. Therefore, the detection box corresponding to row i is the occluded box. Then, the corresponding currency value is found in the currency set, which is the occluded currency value Val, denoted as the second currency value Val. Then, in subsequent judgments, it can be determined whether the occluded currency is in the set. If the obscured currency is detected, and if not, the obscured currency value Val needs to be added to the statistical currency to improve accuracy. By using two matrices to calculate the obscured currency value simultaneously, the obscured values ​​calculated by the two matrices can be cross-validated to improve accuracy. When there are differences, the obscured value calculated by the second detection matrix is ​​given priority to improve accuracy. Based on the above approach, by first performing a binary comparison of currency types and then using geometric feature detection, it is possible to not only distinguish between true and false occlusions through multiple screenings, but also to determine the occlusion position using geometric feature detection. When subsequently calculating the coin value, two detection matrices are used for mutual verification, improving the accuracy of occlusion judgment and coin value calculation. This mutual verification in both occlusion judgment and coin value calculation avoids the limitations of a single method and further enhances accuracy in complex and varied real-world coin-operated environments. Furthermore, to prevent duplicate counting, background filtering is used to prevent duplicate counting of remaining coins. Specifically, when a coin gets stuck and cannot be dislodged, its position and value are recorded. During counting, the total number of detected coins is reduced by the value of the stuck coin.

[0027] Step 3: For currencies whose authenticity information is normal, record it as a single coin insertion event; and display the identified currency denomination locally. If a new coin insertion event is detected within a preset time window following the previous coin insertion event, the consecutive coin insertion events are recorded as a single coin insertion event, and the sum of the currency values ​​of all single coin insertion events within the single coin insertion event is accumulated and the local display information is updated. Based on the above: In determining the authenticity of currency, YOLOv8 is used for detection first, followed by YOLOv11 for classification. When game tokens are detected and classified, an alarm is used to alert the driver. The alarm can be canceled manually by the driver, or it can be automatically deactivated after a timeout, thus reminding the driver.

[0028] Based on the above: The preset time window can be set such that if no new coin insertion event is detected for 3 consecutive seconds (the specific parameter can be fine-tuned based on actual experience), then the single-person coin insertion event is considered to have ended. That is, if a passenger inserts one yuan and then inserts another yuan within 3 seconds, the previous one yuan will be added to the current one yuan, and the local display value will be updated to two yuan. The 3 consecutive seconds are counted from the completion of the previous coin insertion event. If the consecutive time is exceeded, the single-person coin insertion event is considered to have ended. After the single-person coin insertion event ends, all images and videos used for identifying single coin insertion events are uploaded to the intelligent counting platform and the third-party platform, and the locally displayed data is cleared. At the same time, the intelligent counting platform pushes the data to the driver's mobile phone. If the driver believes that the count is unreasonable, he can appeal through the mobile phone interface and report the corrected value to the platform. After the platform supervisors verify the data, they will respond to the appeal and store the review results in the database platform, which is conducive to the driver correcting the data in a timely manner.

[0029] Reference Figure 1 This application also provides an automatic coin-operated counting device for public transportation, including an intelligent counting terminal 5 using the above-mentioned counting method, which analyzes images to recognize and count coins. The intelligent counting terminal 5 is installed on a coin box 1, which is also equipped with a camera 2, a display 3, and an alarm 4, all of which are communicatively connected to the intelligent counting terminal 5. The coin box 1 is used for accepting and storing coins; the camera 2 is used to acquire coin-operated video and detect coin-operated dynamics in real time; the display 3 is an LED counting display device used to display counting information; and the alarm 4 is a buzzer. The alarm device is used to issue a warning when counterfeit money is detected. The intelligent counting terminal 5 communicates with the backend, which includes an intelligent counting pan-tilt unit, a driver's mobile phone, and a third-party platform. The intelligent counting pan-tilt unit is used to receive, store, and process counting data, evidence images, and videos from the intelligent counting terminal 5, and provides data management and analysis functions. Then, it pushes the summarized counting data to the third-party platform, which may include a bus dispatch system or a financial management system. The driver's mobile phone is used to receive the pushed single-person coin insertion counting information and evidence data, and provides the driver with an interactive interface for counting verification and appeal correction.

Claims

1. An automatic coin-operated counting method for public transportation, characterized in that, Includes the following steps: Step 1: Collect coin-insertion video, select a reference background image from the coin-insertion video, and continuously monitor image changes based on the reference background image using video motion detection technology to monitor coin-insertion events; Step 2: After detecting a coin insertion event, acquire key frame images from the coin insertion video, and use a target detection model to identify currency feature information based on the key frame images. The currency feature information includes at least currency authenticity information and the corresponding currency denomination. Step 3: For currencies whose authenticity information is normal, record it as a single coin insertion event; And display the identified currency denomination locally; If a new coin insertion event is detected within a preset time window following the previous coin insertion event, the consecutive coin insertion events are recorded as a single-person coin insertion event, and the sum of the currency values ​​of all single coin insertion events within the single-person coin insertion event is accumulated and added up to update the local display information.

2. The automatic coin-operated counting method for public transportation according to claim 1, characterized in that, Step 2 further includes: using the target detection model to identify currency occlusion information based on the keyframe image, determining whether to perform occlusion detection based on the currency occlusion information, and obtaining currency authenticity information and corresponding currency value based on the occlusion detection result.

3. The automatic coin-operated counting method for public transportation according to claim 2, characterized in that, The target detection model is used to identify currency occlusion information based on the keyframe image, and the determination of whether to perform occlusion detection is based on the currency occlusion information includes: Acquire at least two adjacent keyframe images and calculate the occlusion rate of the two keyframe images. If the occlusion rate is greater than a preset threshold, there may be obstacles to the recognition of currency feature information. Occlusion detection is performed based on the key frame image. , , m is The number of elements in the middle. Let K be the set of bounding boxes detected by the object detection model in the (k-1)th frame image. Let K be the set of bounding boxes obtained by the object detection model based on the k-th frame image. , A set of geometric features Let be the area of ​​the i-th detection box in the (k-1)-th frame. Let be the area of ​​the j-th detection box in the k-th frame.

4. The automatic coin-operated counting method for public transportation according to claim 3, characterized in that, The occlusion detection includes: Based on the keyframe image, the presence of different types of currency is identified, and it is determined whether the currency feature information has been occluded, thus obtaining the occlusion judgment result. Based on the occlusion judgment result, the occlusion domain data of the keyframe image is obtained, the occlusion domain data is compared with the set occlusion threshold, and an updated occlusion judgment result is output based on the comparison result. Based on the updated occlusion determination result, it is determined whether to perform supplementary calculation for the currency denomination Val.

5. The automatic coin-operated counting method for public transportation according to claim 4, characterized in that, Based on the keyframe image, the system identifies whether different types of currency exist and determines whether currency feature information has been occluded. Specifically: According to the binary comparison function The calculation results generate the first detection matrix A, and based on... Whether it equals 0 determines whether currency feature information has been obscured; The binary comparison function , ,in, for The corresponding set of currency denominations, for The corresponding set of currency denominations, , A collection of semantic attributes For the currency type in the nth frame of the (k-1)th frame of the image, Let m be the currency type in the m-th frame of the k-th image; First detection matrix A=( ),matrix Let be the permutation matrix of the first detection matrix A.

6. The automatic coin-operated counting method for public transportation according to claim 5, characterized in that, Based on the occlusion judgment result, occlusion domain data of the keyframe image is obtained, the occlusion domain data is compared with a set occlusion threshold, and an updated occlusion judgment result is output based on the comparison result, including: Based on the occlusion domain data, a second detection matrix is ​​obtained based on the overlapping region function and the similarity function. Each row of data in the second detection matrix is ​​compared with a set occlusion threshold. If the minimum value of the row is greater than the occlusion threshold, the position represented by the row is occluded, which is the occluded position. The obscured positions are mapped to a set of currency denominations to obtain the obscured currency denominations.

7. The automatic coin-operated counting method for public transportation according to claim 6, characterized in that, The overlapping region function , , ,in, It is the area of ​​the nth detection box in the (k-1)th frame. It is the area of ​​the m-th detection box in the k-th frame; The similarity function in, for and The intersection and union ratio, for and The ratio of the Euclidean distance of the center point to the diagonal length of its smallest outermost matrix. This is a correction value; By analyzing the overlapping region function and the similarity function The calculated values ​​are weighted and averaged to obtain Thus, the second detection matrix is ​​obtained. Where m and n are sets With sets The number of elements; The The calculation process is as follows .

8. The automatic coin-operated counting method for public transportation according to claim 7, characterized in that, Obtaining the occluded currency value also includes: calculating a currency value detection box based on the first detection matrix A, and finding the corresponding currency value Val based on the currency value detection box; and when there are differences, the occlusion value calculated by the second detection matrix is ​​used first. The calculation process for the first detection matrix A is as follows: The sum of each column of the first detection matrix is ​​calculated. For example, the i-th column, which is less than -1, corresponds to a currency denomination detection box. The currency denomination corresponding to the corresponding detection box is found, which is the obscured currency denomination Val. Then, it is determined whether the obscured currency is present in the detection box. If the currency is not detected, then the statistical currency denomination Val needs to be added to the statistical currency to improve accuracy.

9. The automatic coin-operated counting method for public transportation according to claim 4, characterized in that, The constraints for the supplementary calculation are: , , ,in for and The intersection and union ratio; If the constraints are met, the obscured currency denominations will not be recalculated. If the constraints are not met, the obscured currency value will be recalculated.

10. An automatic coin-operated counting device for public transportation, characterized in that, The intelligent counting terminal (5) using the above-mentioned technical methods is installed on the coin box (1). The coin box (1) is also equipped with a camera (2), a display (3) and an alarm (4). The camera (2), the display (3) and the alarm (4) are all connected to the intelligent counting terminal (5) in communication. The intelligent counting terminal is connected to the back end in communication. The intelligent counting terminal (5) uses the counting method described in any one of claims 1-9 to count currency.