Detection methods, apparatus, card recycling equipment and storage media for card recycling
By using an image acquisition device to compare the card recycling status with a background frame, the problem of low card recycling detection efficiency and high false negative rate is solved, achieving efficient and accurate card recognition and simplified operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GRG INTELLIGENT TECH SOLUTION CO LTD
- Filing Date
- 2023-12-04
- Publication Date
- 2026-06-30
AI Technical Summary
Existing technologies have low card recycling detection efficiency and high false negative rate, making it difficult to accurately identify the time, direction, and posture of card insertion.
The system uses an image acquisition device to capture video frames inside the card receiving box and compares them with prior background frames. Card retrieval is detected by the frame difference image, including mean filtering, binarization and noise reduction processing to extract card feature information, and recognition is performed by combining card feature conditions.
It improves the detection efficiency of card recycling, reduces the false negative rate, simplifies user operations, and reduces vehicle waiting time.
Smart Images

Figure CN117764928B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of computer technology, and in particular relates to a detection method, apparatus, card recycling equipment and storage medium for card recycling. Background Technology
[0002] Card (such as access cards) recycling primarily uses a card-drop method, where users insert their cards into a card reader at the bottom of the box, which then identifies and reads the information from the card to complete the recycling. However, the card detection area inside the card reader is relatively large, and factors such as the card's insertion time, direction, and position within the box cannot be estimated, leading to significant detection difficulties, low efficiency, and a high rate of missed detections. Summary of the Invention
[0003] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a card recycling detection method, apparatus, card recycling equipment, and storage medium, which can improve the detection efficiency of card recycling and reduce the false negative rate.
[0004] In a first aspect, this application provides a method for detecting card recycling, applied to a card recycling device, the card recycling device including a card receiving box and an image acquisition device disposed toward the card receiving box, the method comprising:
[0005] With the card receiving box fully open, the image acquisition device acquires the i-th video frame inside the card receiving box, where i ≥ 1;
[0006] The i-th video frame is compared with the prior background frame of the card receiving box to obtain the i-th frame difference image;
[0007] Based on the i-th frame difference image, detect whether the card has been returned to the card receiving box. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box, until it is determined that the card has been returned to the card receiving box.
[0008] According to the card recycling detection method of this application, by setting up an image acquisition device, when a card needs to be put into the card receiving box, the image acquisition device acquires video frames inside the card receiving box, determines the frame difference image between the video frame and the prior background frame of the card receiving box, so as to detect the card recycled to the card receiving box in a timely manner based on the frame difference image, thereby improving the detection efficiency of card recycling and reducing the false negative rate.
[0009] According to one embodiment of this application, the method further includes:
[0010] If it is determined from the i-th frame difference image that the card is recycled to the card receiving box, then the card area in the i-th video frame is marked and saved, and the recycling time is recorded.
[0011] According to one embodiment of this application, the method further includes:
[0012] If it is determined from the first frame difference image that the card has not been returned to the card receiving box, then the prior background frame is updated to the first video frame.
[0013] According to one embodiment of this application, detecting whether the card is recycled to the card receiving box based on the i-th frame difference image includes:
[0014] Count the number of target pixels in the i-th frame difference image, where the grayscale of the color component of the target pixel is greater than the target grayscale, i>1;
[0015] Detect whether the number of target pixels meets the target condition;
[0016] If yes, then based on the i-th frame difference image, detect whether the card has been returned to the card receiving box; otherwise, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box.
[0017] According to one embodiment of this application, the target condition includes that the number of target pixels in at least one of the frame difference images from the i-th frame difference image to the m-th frame difference image is greater than the target number, and the fluctuation range of the number of target pixels in the i-th frame difference image to the m-th frame difference image does not exceed the target range, i > m > 1.
[0018] According to one embodiment of this application, detecting whether the card is recycled to the card receiving box based on the i-th frame difference image includes:
[0019] Extract the first feature information from the i-th frame difference image;
[0020] Extract the second feature information from the i-th video frame;
[0021] Detect whether the first feature information and the second feature information satisfy the card feature conditions;
[0022] If so, then the card is confirmed to be returned to the card receiving box;
[0023] Otherwise, it is determined that the card has not been returned to the card receiving box.
[0024] According to one embodiment of this application, extracting the first feature information from the i-th frame difference image includes:
[0025] The i-th frame difference image is subjected to mean filtering;
[0026] Binarize the i-th frame difference image after filtering;
[0027] Denoising is performed on the i-th frame difference image after binarization.
[0028] Extract the first feature information from the i-th frame difference image after noise reduction.
[0029] According to one embodiment of this application, the first feature information includes the number and area of connected regions in the i-th frame difference image after noise reduction processing, as well as the length and width of the minimum bounding rectangle of the largest connected region. The second feature information includes the color information and region variance of the region in the i-th video frame that is the same as the largest connected region.
[0030] According to one embodiment of this application, the image acquisition device is turned on when the card receiving box is fully opened, and the first video frame acquired in the card receiving box is the nth video frame acquired by the image acquisition device, where n is greater than 1 and less than one-third of the number of frames acquired per second by the image acquisition device.
[0031] According to one embodiment of this application, the card recycling device further includes a card reader disposed at the bottom of the card collection box;
[0032] The method further includes:
[0033] When the card is determined to be returned to the card receiving box, the card reader is controlled to read the information in the card.
[0034] Secondly, this application provides a card recycling detection device, applied to a card recycling equipment, the card recycling equipment including a card receiving box for recycling cards and an image acquisition device disposed toward the card receiving box, the device comprising:
[0035] The acquisition module is used to acquire the i-th video frame inside the card receiving box, i≥1, through the image acquisition device when the card receiving box is fully open;
[0036] The comparison module is used to compare the i-th video frame with the prior background frame of the card receiving box to obtain the i-th frame difference image;
[0037] The detection module is used to detect whether the card has been returned to the card receiving box based on the i-th frame difference image. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box, until it is determined that the card has been returned to the card receiving box.
[0038] According to the card recycling detection device of this application, by setting up an image acquisition device, when a card needs to be put into the card receiving box, the image acquisition device acquires video frames in the card receiving box, determines the frame difference image between the video frame and the prior background frame of the card receiving box, so as to detect the card to be recycled into the card receiving box in a timely manner based on the frame difference image, thereby improving the detection efficiency of card recycling and reducing the false negative rate.
[0039] Thirdly, this application provides a card recycling device, comprising:
[0040] Card box;
[0041] The image acquisition device is positioned facing the card receiving box;
[0042] A controller, connected to the image acquisition unit, is used to implement the card recycling detection method as described in the first aspect above.
[0043] Fourthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the card recycling detection method as described in the first aspect above.
[0044] The above-described one or more technical solutions in the embodiments of this application have at least one of the following technical effects:
[0045] By setting up an image acquisition device, when a card needs to be inserted into the card receiving box, the image acquisition device can acquire video frames inside the card receiving box and determine the frame difference image between the video frame and the prior background frame of the card receiving box. Based on the frame difference image, the card to be returned to the card receiving box can be detected in time, thereby improving the detection efficiency of card return and reducing the false negative rate.
[0046] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description
[0047] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0048] Figure 1 This is a schematic diagram of the card recycling device provided in the embodiments of this application;
[0049] Figure 2 This is a flowchart illustrating the card recycling detection method provided in the embodiments of this application;
[0050] Figure 3 This is a schematic diagram of the card recycling detection device provided in the embodiments of this application;
[0051] Figure 4This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0052] Figure 5 This is a hardware schematic diagram of the electronic device provided in the embodiments of this application. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0054] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0055] The detection method, apparatus, card recycling equipment, and storage medium for card recycling provided in this application will be described in detail below with reference to the accompanying drawings and through specific embodiments and application scenarios.
[0056] The card recycling detection method can be applied to the terminal, and can be executed by the hardware or software in the terminal.
[0057] The card recycling detection method provided in this application can be applied to card recycling equipment. For example... Figure 1 As shown, the card recycling device may include a card receiving box 1 and an image acquisition device 2. The card receiving box 1 is used for users to insert cards, and the image acquisition device 2 is set facing the card receiving box 1 to capture video frames inside the card receiving box 1.
[0058] like Figure 2 As shown, the detection method for card recycling includes steps 110, 120, and 130.
[0059] Step 110: With the card receiving box fully open, acquire the i-th video frame inside the card receiving box using an image acquisition device, where i ≥ 1.
[0060] The card can be a toll card, such as a CPC card, which is a highway composite toll card or a toll road network communication card. CPC cards can identify vehicle entry and exit information at toll stations, and can also accurately record the actual driving route of vehicles by setting up a route recognition system at highway network interchanges, enabling segmented tolling and unified payment.
[0061] The card reader can be a flip-top type, which can be opened or closed. Normally, the card reader is closed. When a card needs to be inserted, the card reader is opened for the user to insert the card.
[0062] For example, card collection devices are installed at highway exit checkpoints. When a vehicle needs to exit the highway, the system detects that the vehicle has arrived at the exit checkpoint and controls the card collection box to open at a constant speed, recording the time T0 when the box is fully open. After the box opens, the user (i.e., the driver) can insert their card into it for collection. Compared to related technologies where the user inserts the card into the collection device, this embodiment simplifies the user's operation by having the card inserted into the collection box, improving card collection efficiency and reducing vehicle waiting time.
[0063] In some embodiments, the image acquisition device is off when the card receiving box is closed. When the card receiving box is fully open, i.e., at time T0, the image acquisition device is turned on to capture real-time images of the internal area of the card receiving box, thereby acquiring video frames from within the card receiving box in real time. These video frames are color video frames.
[0064] In some embodiments, the first video frame acquired from the card receiving box is the nth video frame acquired by the image acquisition device, where n is greater than 1 and less than one-third of the number of frames acquired per second by the image acquisition device. In other words, video frames from the card receiving box are acquired starting from the nth video frame acquired by the image acquisition device to reduce the problem of video frame overexposure caused by sudden strong light after the image acquisition device is turned on.
[0065] In some embodiments, such as Figure 1 As shown, the card recycling device also includes a first light-emitting device 3, which is located on both sides of the image acquisition unit 2. The first light-emitting device 3 is used to provide supplementary lighting to the internal area of the card collection box 1 to improve the shooting effect of the image acquisition unit 2. When the card collection box 1 is fully open, i.e., at time T0, the first light-emitting device 3 can be activated simultaneously with the image acquisition unit 2. The first light-emitting device 3 can be a white LED array.
[0066] Step 120: Compare the i-th video frame with the prior background frame of the card receiving box to obtain the i-th frame difference image.
[0067] The prior background frame is an image frame inside the card receiving box when it is fully open and empty. This prior background frame can be pre-stored. Since the prior background frame is an image frame of the card receiving box in a fully open state, the i-th video frame inside the card receiving box is obtained when it is fully open and compared with the prior background frame. This ensures that the i-th video frame shows the same state of the card receiving box as the prior background frame, improving the comparison effect between the i-th video frame and the prior background frame.
[0068] After acquiring the i-th video frame from the card receiver, the i-th video frame is compared with the pre-stored prior background frame to obtain the i-th frame difference image, i.e.:
[0069] Frame_Sub i (x,y)=abs|Frame i -Frame Back |
[0070] Among them, Frame_Sub i (x, y) represents the i-th frame difference image, where x and y represent the width and height of the i-th frame difference image, respectively. i For the i-th video frame, Frame Back This is the prior background frame.
[0071] Step 130: Based on the i-th frame difference image, detect whether the card has been returned to the card receiving box. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box until it is determined that the card has been returned to the card receiving box.
[0072] Analyze the i-th frame difference image to detect whether the card has been returned to the card receiving box. If yes, the detection can be stopped. If no, let i = i + 1 and return to step 110 to continue detecting whether the card has been returned to the card receiving box until it is determined that the card has been returned to the card receiving box.
[0073] In some embodiments, step 130, detecting whether the card is returned to the card receiving box based on the i-th frame difference image, includes:
[0074] Extract the first feature information from the i-th frame difference image;
[0075] Extract the second feature information from the i-th video frame;
[0076] Detect whether the first feature information and the second feature information satisfy the card feature conditions;
[0077] If so, then the card has been returned to the card collection box;
[0078] Otherwise, it indicates that the card was not returned to the card collection box.
[0079] In this process, the i-th frame difference image can be processed first, and then the first feature information can be extracted from the i-th frame difference image.
[0080] In some embodiments, extracting first feature information from the i-th frame difference image includes:
[0081] Perform mean filtering on the i-th frame difference image;
[0082] Binarize the i-th frame difference image after filtering;
[0083] Denoising is performed on the i-th frame difference image after binarization.
[0084] Extract the first feature information from the i-th frame difference image after noise reduction.
[0085] After obtaining the i-th frame difference image, mean filtering can be applied to it to reduce noise and remove minor noise interference caused by changes in external lighting. The mean filtering formula is as follows:
[0086] Sub_Mean i (x,y)=Frame_Sub i (x,y)*Mean(3,3).
[0087] Among them, Sub_Mean i (x,y) represents the i-th frame difference image after filtering, and Mean(3,3) indicates that the mean filter kernel size is 3*3.
[0088] Then, the filtered i-th frame difference image is binarized based on the image color component extraction. The binarization formula is as follows:
[0089]
[0090] Among them, Bin i (x,y) represents the i-th frame difference image after binarization, GrayB i (x,y), GrayG i (x,y) and GrayR i (x, y) represent the grayscale values of the blue, green, and red components of the i-th frame difference image after filtering, respectively. b T g and T r T represents the grayscale thresholds for the blue component, green component, and red component, respectively. b T g and T rAll are adjustable thresholds, and T b T g and T r The data were obtained based on statistical analysis of the grayscale data of the blue component, green component, and red component in the actual image.
[0091] Then, denoising is performed on the i-th frame difference image after binarization to further remove small noise interference in the image. The denoising formula can be expressed as morphological opening operation:
[0092] Sub_Open i (x,y)=dilate(erode(Bin i (x,y),element(3,3))).
[0093] Among them, Sub_Open i (x,y) represents the i-th frame difference image after noise reduction, and element(3,3) represents a rectangular structuring element of size 3*3.
[0094] After performing mean filtering, binarization, and noise reduction on the i-th frame difference image, first feature information can be extracted from the processed i-th frame difference image. The first feature information may include the number and area of connected regions in the denoised i-th frame difference image, as well as the length and width of the minimum bounding rectangle of the largest connected region. Additionally, second feature information is extracted from the i-th video frame. The second feature information includes the color information and region variance of the region in the i-th video frame that is identical to the largest connected region. The first and second feature information may also include other information, which is not specifically limited here.
[0095] It should be noted that the frame difference image is the difference image between the acquired video frame and the prior background frame. When the acquired video frame contains a card, the frame difference image is the card image. A connected component is a region with the same pixel value that is adjacent, extracted after binarizing the frame difference image. Since the card may contain various patterns, the frame difference image may contain multiple connected components. The largest connected component may be the area covered by the card. The minimum bounding rectangle of the largest connected component is the rectangle with the smallest area that contains the largest connected component. The region containing the minimum bounding rectangle of the largest connected component may be the card region.
[0096] In some embodiments, card feature conditions may include: the number of connected regions in the denoised i-th frame difference image being less than a number threshold; the area of the largest connected region being greater than a first area threshold; the areas of other connected regions being less than a second area threshold; the first area threshold being greater than the second area threshold; the length and width of the minimum bounding rectangle of the largest connected region being within the target length and width range; the color information of the target region in the i-th video frame (i.e., the region that is the same as the largest connected region in the denoised i-th frame difference image) being within the target color information range; and the regional variance of the target region being within the target variance range. The first area threshold, the second area threshold, the target length and width range, the target color information range, and the target variance range can be preset according to the card's size, color, and surface pattern. It should be noted that the color inside the card holder is different from the color of the card.
[0097] This embodiment can set card feature conditions based on information such as the size, color, and surface pattern of the card to be detected, so as to identify the card to be detected and distinguish it from other objects (including non-card objects and other types of cards), so as to accurately identify the card to be detected and issue an alert for the input behavior of other objects.
[0098] It should be noted that this embodiment can also set card feature conditions based on information such as card thickness, surface flatness, and chip position, as long as the card to be detected can be identified and distinguished from other objects, no specific limitation is made here.
[0099] If the first feature information and the second feature information meet the card feature conditions, determine that the card is returned to the card receiving box; if the first feature information or the second feature information does not meet the card feature conditions, determine that the card is not returned to the card receiving box, let i = i + 1, and return to step 110 until it is determined that the card is returned to the card receiving box.
[0100] In some embodiments, if the first feature information and the second feature information do not meet the card feature conditions, it is also possible to detect whether the first feature information and the second feature information meet the foreign object feature conditions. If so, it indicates that the user has put a foreign object (non-card) into the card receiving box, confirming that there is a foreign object in the card receiving box, and the foreign object information can be output.
[0101] In some embodiments, if the first feature information and the second feature information do not meet the card feature conditions, it can also be detected whether the first feature information and the second feature information meet the no-object feature conditions. If so, it indicates that the user has not put an object into the card receiving box, and it is determined that there is no object in the card receiving box.
[0102] In some embodiments, the card recycling detection method further includes:
[0103] If the card is determined to be recycled to the card receiving box based on the i-th frame difference image, then the card area in the i-th video frame is marked and saved, and the recycling time is recorded.
[0104] In this context, the card region in the i-th video frame is the same as the largest connected region in the denoised i-th frame difference image. That is, the card region in the i-th video frame can be determined based on the largest connected region in the denoised i-th frame difference image. The card region in the i-th video frame is marked, and the marked i-th video frame is saved. Furthermore, the acquisition time of the i-th video frame is saved as the card retrieval time. The image file of the marked i-th video frame can be named after the card retrieval time.
[0105] This embodiment records the card recycling time with maximum accuracy down to the second, so as to detect the user's behavior of putting the card into the card collection box in a timely manner, thereby improving the detection efficiency of card recycling and reducing the missed detection rate.
[0106] In some embodiments, i=1, the first video frame of the receiving box is acquired, and the first video frame is compared with the prior background frame to obtain the first frame difference image. Then, the first frame difference image is subjected to mean filtering, binarization, and noise reduction. First feature information is extracted from the processed first frame difference image. The first feature information may include the number and area of connected regions in the noise-reduced first frame difference image, as well as the length and width of the minimum bounding rectangle of the largest connected region.
[0107] The system checks whether the first feature information satisfies the first card feature condition, specifically whether the number of connected regions is less than a number threshold, whether the area of the largest connected region is less than a first area threshold, whether the areas of other connected regions are less than a second area threshold, and whether the length and width of the minimum bounding rectangle of the largest connected region are within the target length and width range. If yes, the first feature information is determined to satisfy the first card feature condition; otherwise, the first feature information is determined not to satisfy the first card feature condition, and the system returns to step 110 to continue acquiring the second video frame.
[0108] If the first feature information satisfies the first card feature condition, the second feature information can be extracted from the first video frame. The second feature information includes the color information and region variance of the target region in the first video frame (i.e., the region that is the same as the largest connected region in the first frame difference image after noise reduction).
[0109] The system checks whether the second feature information satisfies the second card feature condition, specifically whether the color information of the target region is within the target color information range and whether the regional variance of the target region is within the target variance range. If yes, the system determines that the second feature information satisfies the second card feature condition; otherwise, it determines that the second feature information does not satisfy the second card feature condition and returns to step 110 to continue acquiring the second video frame.
[0110] If it is determined that the first feature information satisfies the first card feature condition and the second feature information satisfies the second card feature condition, it indicates that the card has been recycled to the card receiving box before the first video frame is acquired. The first video frame is the video frame acquired when the card receiving box is fully open. Therefore, it indicates that the user put the card into the card receiving box before the card receiving box is fully open. The card area in the first video frame is marked and saved, and the recycling time is recorded.
[0111] In some embodiments, the card recycling detection method further includes:
[0112] If it is determined from the first frame difference image that the card has not been returned to the card receiving box, then the prior background frame is updated to the first video frame.
[0113] After the first video frame, the prior background frame compared with the i-th (i>1) video frame is the first video frame, so as to ensure that the i-th (i>1) video frame and the prior background frame have the same acquisition environment (such as lighting) to improve the contrast effect and thus improve the image processing effect.
[0114] In some embodiments, i > 1, step 130, which involves detecting whether the card is returned to the card receiving box based on the i-th frame difference image, includes:
[0115] Count the number of target pixels in the i-th frame difference image, where the grayscale of the color component of the target pixel is greater than the target grayscale.
[0116] Detect whether the number of target pixels meets the pixel count condition;
[0117] If yes, then based on the i-th frame difference image, detect whether the card has been returned to the card receiving box; otherwise, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box.
[0118] The grayscale of the color component compared with the target grayscale is determined based on the color of the card. For example, if the card is blue, the grayscale of the color component compared with the target grayscale is the blue component grayscale. Iterate through x*y pixels in the i-th frame difference image, determining whether the grayscale of the color component of each pixel is greater than the target grayscale K. Count the number N of target pixels in the i-th frame difference image whose grayscale of the color component is greater than the target grayscale K. i .
[0119] The number of target pixels in multiple consecutive frame difference images is used to determine whether the target condition is met. The target condition may include the number of target pixels in at least one of the frame difference images from the i-th to the im-th frame difference image being greater than the target number N. min Furthermore, the fluctuation range of the number of target pixels in the i-th frame difference image to the im-th frame difference image does not exceed the target range, i > m > 1. Where m is a pre-set threshold.
[0120] If the number of target pixels in at least one of the frame difference images from the i-th frame difference image to the im-th frame difference image is greater than the number of targets N. min If the number of target pixels fluctuates, it indicates that the card may be being delivered to the card receiving box. If the fluctuation range of the number of target pixels in the i-th frame difference image to the im-th frame difference image does not exceed the target range, it indicates that the number of target pixels is stabilizing, and the card may have been delivered to the card receiving box.
[0121] If the number of target pixels in the (m+1) consecutive frame difference images does not meet the target condition, then let i = i+1 and return to step 110. If the number of target pixels in the (m+1) consecutive frame difference images meets the target condition, it indicates that a card is suspected to appear in the i-th video frame.
[0122] The i-th frame difference image is subjected to mean filtering, binarization, and noise reduction. First feature information is extracted from the processed i-th frame difference image. This first feature information may include the number and area of connected regions in the denoised i-th frame difference image, as well as the length and width of the minimum bounding rectangle of the largest connected region.
[0123] The system checks whether the first feature information satisfies the first card feature condition, specifically whether the number of connected regions is less than a number threshold, whether the area of the largest connected region is less than a first area threshold, whether the areas of other connected regions are less than a second area threshold, and whether the length and width of the minimum bounding rectangle of the largest connected region are within the target length and width range. If yes, the system determines that the first feature information satisfies the first card feature condition; otherwise, it determines that the first feature information does not satisfy the first card feature condition, sets i = i + 1, and returns to step 110.
[0124] If the first feature information satisfies the first card feature condition, the second feature information can be extracted from the i-th video frame. The second feature information includes the color information and region variance of the target region in the first video frame (i.e., the region that is the same as the largest connected region in the i-th frame difference image after noise reduction).
[0125] Detect whether the second feature information satisfies the second card feature condition, that is, whether the color information of the target area is within the target color information range, and whether the regional variance of the target area is within the target variance range. If yes, determine that the second feature information satisfies the second card feature condition; otherwise, determine that the second feature information does not satisfy the second card feature condition, let i = i + 1, and return to step 110.
[0126] If it is determined that the first feature information satisfies the first card feature condition and the second feature information satisfies the second card feature condition, it indicates that the card has been returned to the card receiving box. The card area in the i-th video frame is marked and saved, and the return time is recorded.
[0127] In some embodiments, such as Figure 1 As shown, the card recycling device may also include a card reader 4 located below the card collection box 1. The card recycling detection method also includes:
[0128] When the card is confirmed to be returned to the card receiving box, the card reader is controlled to read the information in the card.
[0129] When the card is confirmed to be returned to the card receiving box, the reader can be promptly provided with a confirmation signal of card return, which helps the reader to read the information in the card in a timely manner.
[0130] In some embodiments, such as Figure 1 As shown, the card recycling device may also include an internal recycling box 7, which is connected to the card receiving box 1. After the card reader 4 reads the information from the card, it controls the card receiving box 1 to close, records the time point T1, and sends the card in the card receiving box 1 into the internal recycling box 7 to complete the card recycling. At time T1, the image acquisition by the image acquisition device 2 can be terminated.
[0131] When the card recycling device is set up at the highway entrance checkpoint, and the card is a toll card, the system detects that the vehicle has left the highway and records the time point T2. At time T2, the image acquisition device 2 is turned off, and the first light-emitting device 3 and other devices are also turned off.
[0132] It should be noted that the recorded times (such as the card collection time, card reading time, and vehicle exit time) can be saved as historical data for easy reference later.
[0133] The card recycling detection method provided in this application embodiment uses an image acquisition device to acquire video frames inside the card receiving box when a card needs to be placed in the receiving box. The frame difference image between the video frame and the prior background frame of the receiving box is determined, so that the card to be recycled into the receiving box can be detected in time based on the frame difference image, thereby improving the detection efficiency of card recycling and reducing the false negative rate.
[0134] The card recycling detection method provided in this application can be executed by a card recycling detection device. This application uses a card recycling detection device executing the card recycling detection method as an example to illustrate the card recycling detection device provided in this application.
[0135] This application also provides a card recycling detection device, which can be applied to card recycling equipment. For example... Figure 1 As shown, the card recycling device may include a card receiving box 1 and an image acquisition device 2. The card receiving box 1 is used for users to insert cards, and the image acquisition device 2 is set facing the card receiving box 1 to capture video frames inside the card receiving box 1.
[0136] like Figure 3 As shown, the card recycling detection device includes: an acquisition module 310, a comparison module 320, and a detection module 330.
[0137] The acquisition module 310 is used to acquire the i-th video frame inside the card receiving box, i≥1, through the image acquisition device when the card receiving box is fully open;
[0138] The comparison module 320 is used to compare the i-th video frame with the prior background frame of the card receiving box to obtain the i-th frame difference image;
[0139] The detection module 330 is used to detect whether the card has been returned to the card receiving box based on the i-th frame difference image. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box, until it is determined that the card has been returned to the card receiving box.
[0140] According to the card recycling detection device of this application, by setting up an image acquisition device, when a card needs to be put into the card receiving box, the image acquisition device acquires video frames in the card receiving box, determines the frame difference image between the video frame and the prior background frame of the card receiving box, so as to detect the card to be recycled into the card receiving box in a timely manner based on the frame difference image, thereby improving the detection efficiency of card recycling and reducing the false negative rate.
[0141] In some embodiments, the apparatus further includes a marking module, the marking module being used for:
[0142] If it is determined from the i-th frame difference image that the card is recycled to the card receiving box, then the card area in the i-th video frame is marked and saved, and the recycling time is recorded.
[0143] In some embodiments, the apparatus further includes an update module, the update module being configured to:
[0144] If it is determined from the first frame difference image that the card has not been returned to the card receiving box, then the prior background frame is updated to the first video frame.
[0145] In some embodiments, the detection module 330 is further configured to:
[0146] Count the number of target pixels in the i-th frame difference image, where the grayscale of the color component of the target pixel is greater than the target grayscale, i>1;
[0147] Detect whether the number of target pixels meets the target condition;
[0148] If yes, then based on the i-th frame difference image, detect whether the card has been returned to the card receiving box; otherwise, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box.
[0149] In some embodiments, the target condition includes that the number of target pixels in at least one of the frame difference images from the i-th frame difference image to the m-th frame difference image is greater than the target number, and the fluctuation range of the number of target pixels in the i-th frame difference image to the m-th frame difference image does not exceed the target range, i > m > 1.
[0150] In some embodiments, the detection module 330 is further configured to:
[0151] Extract the first feature information from the i-th frame difference image;
[0152] Extract the second feature information from the i-th video frame;
[0153] Detect whether the first feature information and the second feature information satisfy the card feature conditions;
[0154] If so, then the card is confirmed to be returned to the card receiving box;
[0155] Otherwise, it is determined that the card has not been returned to the card receiving box.
[0156] In some embodiments, the detection module 330 is further configured to:
[0157] The i-th frame difference image is subjected to mean filtering;
[0158] Binarize the i-th frame difference image after filtering;
[0159] Denoising is performed on the i-th frame difference image after binarization.
[0160] Extract the first feature information from the i-th frame difference image after noise reduction.
[0161] In some embodiments, the first feature information includes the number and area of connected regions in the i-th frame difference image after noise reduction, as well as the length and width of the minimum bounding rectangle of the largest connected region, and the second feature information includes the color information and region variance of the region in the i-th video frame that is the same as the largest connected region.
[0162] In some embodiments, the image acquisition device is activated when the card receiving box is fully opened, and the first video frame acquired from the card receiving box is the nth video frame acquired by the image acquisition device, where n is greater than 1 and less than one-third of the number of frames acquired per second by the image acquisition device.
[0163] In some embodiments, the card recycling device further includes a card reader located at the bottom of the card collection box;
[0164] The device further includes a control module, which is used for:
[0165] When the card is determined to be returned to the card receiving box, the card reader is controlled to read the information in the card.
[0166] The card recycling detection device in this application embodiment can be an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal.
[0167] The card recycling detection device in this application embodiment can be a device with an operating system. This operating system can be a Microsoft (Windows) operating system, an Android operating system, an iOS operating system, or other possible operating systems; this application embodiment does not specifically limit it.
[0168] The card recycling detection device provided in this application embodiment can realize all the processes of the card recycling detection method embodiment described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0169] This application also provides a card recycling device.
[0170] like Figure 1 As shown, the card recycling device includes a card receiving box 1, an image acquisition unit 2, and a controller 5. The card receiving box 1 is used for users to insert cards. The image acquisition unit 2 is positioned facing the card receiving box 1 and is used to capture video frames within the card receiving box 1. The controller 5 is located inside the card recycling device and is connected to the image acquisition unit 2. It is used to implement the various processes of the card recycling detection method embodiment described above and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0171] In some embodiments, the card receiving box 1 is a tipping-type card receiving box. The card recycling device may also include a card receiving box driver (not shown in the figure), and the controller 5 is connected to the card receiving box 1 through the card receiving box driver. The card receiving box driver is used to drive the card receiving box 1 to open or close.
[0172] For example, when a vehicle is detected to have arrived, the controller 5 controls the card reader driver to open the card reader 1 so that the user can insert the card into the card reader 1 for recycling; when a vehicle is detected to have left, the controller 5 controls the card reader driver to close the card reader 1.
[0173] In some embodiments, the image acquisition device 2 is located inside the card recycling device and above the card receiving box 1, at a distance of approximately 25 cm. The image acquisition device 2 captures images of the internal area of the card receiving box 1 from inside the card recycling device at a pitch angle of approximately 70° to the horizontal.
[0174] In some embodiments, the image acquisition device 2 can be an RGB camera. This RGB camera can be a USB camera with a maximum resolution of 320*240, allowing it to connect to the controller 5 inside the card recycling device via a USB data cable. The controller 5 can be an industrial computer, specifically a Topstar i5-7500U running CentOS 7.9 Linux distribution.
[0175] For example, when the controller 5 controls the card receiving box driver to fully open the card receiving box 1, the controller 5 also controls the image acquisition device 2 to turn on, so that the image acquisition device 2 can acquire video frames inside the card receiving box 1; when the controller 5 controls the card receiving box driver to close the card receiving box 1, the controller 5 also controls the image acquisition device 2 to turn off, so that the image acquisition device 2 stops acquiring video frames inside the card receiving box 1.
[0176] It should be noted that the image acquisition unit 2 and the controller 5 can also be other types of devices, which are not specifically limited here.
[0177] In some embodiments, such as Figure 1 As shown, the card recycling device may also include a card reader 4, which is located at the bottom of the card receiving box 1 and is connected to the controller 5. The card reader 4 is used to read information from the cards. The card reader 4 can be an antenna board card reader.
[0178] For example, when it is determined that the card has been returned to the card receiving box 1, the card reader 4 reads the information in the card.
[0179] In some embodiments, such as Figure 1As shown, the card recycling device may further include a first light-emitting device 3, which is located on both sides of the image acquisition unit 2, and the controller 5 is connected to the first light-emitting device 3. The first light-emitting device 3 is used to provide supplementary lighting to the internal area of the card collection box 1 in low-light environments to improve the shooting effect of the image acquisition unit 2. The controller 5 is also used to control the opening or closing of the first light-emitting device 3.
[0180] For example, when the controller 5 controls the image acquisition device 2 to be turned on, the controller 5 also controls the first light-emitting device 3 to be turned on, so that the first light-emitting device 3 provides supplementary lighting to the internal area of the card receiving box 1; when the controller controls the image acquisition device 2 to be turned off, the controller 5 also controls the first light-emitting device 3 to be turned off.
[0181] In some embodiments, the distance between the first light-emitting device 3 and the image acquisition device 2 can be approximately 5 centimeters. The installation height and angle of the first light-emitting device 3 and the image acquisition device 2 are consistent. The first light-emitting device 3 can be a white LED array.
[0182] In some embodiments, such as Figure 1 As shown, the card recycling device may also include a second light-emitting device (not shown in the figure), which is located on one side of the card receiving box 1, and the controller 5 is connected to the second light-emitting device. The second light-emitting device is used to indicate the card insertion area (i.e., the location of the card receiving box 1) to the user. The second light-emitting device can be a green LED array, and the controller 5 is also used to control the second light-emitting device to turn on or off.
[0183] For example, when a vehicle arrives at the card recycling device, the controller 5 controls the second light-emitting device to turn on so that the second light-emitting device indicates the location of the card receiving box 1; when the vehicle leaves the card recycling device, the controller 5 controls the card receiving box driver to drive the card receiving box 1 to close.
[0184] In some embodiments, the card recycling device may further include a display screen 6, which is connected to the controller 5. The display screen 6 may be located above the card collection box 1 and is used to display relevant information, such as vehicle passage information or vehicle payment information. After the card reader 4 reads the information from the card, the controller 5 determines the relevant information based on the information in the card and displays the relevant information on the display screen 6.
[0185] In some embodiments, the card recycling device may further include an internal recycling bin 7 for storing cards. After the card reader 4 reads the information from the card, the controller 5 sends the card into the internal recycling bin 7 for storage via the card receiving bin driver.
[0186] This embodiment uses an image acquisition device to capture video frames from the card receiving box when a card needs to be inserted. By utilizing the prior knowledge that the background of the card receiving box is relatively stable, the device detects card features in the video frames, thereby promptly identifying cards to be returned to the receiving box. This improves the detection efficiency of card return and reduces the false negative rate, providing front-end information confirmation for the card reader to read the card, facilitating the reader's wide-range card reading. It can also detect and alert the reader to foreign objects (non-cards) or multiple cards inserted into the receiving box.
[0187] like Figure 4 As shown, this application embodiment also provides an electronic device 500, including a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the program is executed by the processor 501, it implements the various processes of the card recycling detection method embodiment described above and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0188] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0189] Figure 5 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of this application.
[0190] The electronic device 600 includes, but is not limited to, components such as: radio frequency unit 601, network module 602, audio output unit 603, input unit 604, sensor 605, display unit 606, user input unit 607, interface unit 608, memory 609, and processor 610.
[0191] Those skilled in the art will understand that the electronic device 600 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 610 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 5 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.
[0192] The input unit 604 is used to acquire the i-th video frame inside the card receiving box when the card receiving box is fully open, where i ≥ 1.
[0193] The processor 610 is configured to compare the i-th video frame with the prior background frame of the card receiving box to obtain the i-th frame difference image; based on the i-th frame difference image, detect whether the card has been returned to the card receiving box; if it is determined based on the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box, until it is determined that the card has been returned to the card receiving box.
[0194] According to the electronic device provided in the embodiments of this application, by setting up an image acquisition device, when a card needs to be put into the card receiving box, the image acquisition device acquires video frames in the card receiving box, determines the frame difference image between the video frame and the prior background frame of the card receiving box, so as to promptly detect the card returned to the card receiving box based on the frame difference image, thereby improving the detection efficiency of card return and reducing the false negative rate.
[0195] In some embodiments, the processor 610 is further configured to mark and save the card area in the i-th video frame and record the recycling time if it is determined from the i-th frame difference image that the card has been recycled to the card receiving box.
[0196] In some embodiments, the processor 610 is further configured to update the prior background frame to the first video frame if it is determined from the first frame difference image that the card has not been returned to the card receiving box.
[0197] In some embodiments, the processor 610 is further configured to count the number of target pixels in the i-th frame difference image, wherein the grayscale of the color component of the target pixel is greater than the target grayscale, i > 1; detect whether the number of target pixels meets the target condition; if so, detect whether the card is recycled to the card receiving box according to the i-th frame difference image; otherwise, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box.
[0198] In some embodiments, the target condition includes that the number of target pixels in at least one of the frame difference images from the i-th frame difference image to the m-th frame difference image is greater than the target number, and the fluctuation range of the number of target pixels in the i-th frame difference image to the m-th frame difference image does not exceed the target range, i > m > 1.
[0199] In some embodiments, the processor 610 is further configured to extract first feature information from the i-th frame difference image; extract second feature information from the i-th video frame; detect whether the first feature information and the second feature information satisfy the card feature condition; if so, determine that the card is recycled to the card receiving box; otherwise, determine that the card is not recycled to the card receiving box.
[0200] In some embodiments, the processor 610 is further configured to perform mean filtering on the i-th frame difference image; perform binarization on the filtered i-th frame difference image; perform noise reduction on the binarized i-th frame difference image; and extract first feature information from the noise-reduced i-th frame difference image.
[0201] In some embodiments, the first feature information includes the number and area of connected regions in the i-th frame difference image after noise reduction, as well as the length and width of the minimum bounding rectangle of the largest connected region, and the second feature information includes the color information and region variance of the region in the i-th video frame that is the same as the largest connected region.
[0202] In some embodiments, the image acquisition device is activated when the card receiving box is fully opened, and the first video frame acquired from the card receiving box is the nth video frame acquired by the image acquisition device, where n is greater than 1 and less than one-third of the number of frames acquired per second by the image acquisition device.
[0203] In some embodiments, the processor 610 is further configured to control the card reader to read information from the card when it is determined that the card has been returned to the card receiving box.
[0204] It should be understood that, in this embodiment, the input unit 604 may include a graphics processing unit (GPU) 6041, which processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 606 may include a display panel 6061, which may be configured as a liquid crystal display, organic light-emitting diode, or the like. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also called a touchscreen. The touch panel 6071 may include a touch detection device and a touch controller. Other input devices 6072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0205] The memory 609 can be used to store software programs and various data. The memory 609 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 609 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 609 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0206] Processor 610 may include one or more processing units; processor 610 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the aforementioned modem processor may also not be integrated into processor 610.
[0207] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the card recycling detection method embodiment described above and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0208] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0209] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described card recycling detection method.
[0210] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0211] This application embodiment also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is used to run programs or instructions to implement the various processes of the above-described card recycling detection method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0212] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0213] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0214] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0215] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0216] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0217] Although embodiments of this application have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of this application, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for detecting card recycling, characterized in that, Applied to a card recycling device, the card recycling device including a card receiving box and an image acquisition device disposed toward the card receiving box, the method includes: With the card receiving box fully open, the image acquisition device acquires the i-th video frame inside the card receiving box, where i ≥ 1; The i-th video frame is compared with the prior background frame of the card receiving box to obtain the i-th frame difference image; Based on the i-th frame difference image, detect whether the card has been returned to the card receiving box. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box, until it is determined that the card has been returned to the card receiving box. The step of detecting whether the card is returned to the card receiving box based on the i-th frame difference image includes: Extract the first feature information from the i-th frame difference image; Extract the second feature information from the i-th video frame; Detect whether the first feature information and the second feature information satisfy the card feature conditions; If so, then the card is confirmed to be returned to the card receiving box; Otherwise, it is determined that the card has not been returned to the card receiving box; The first feature information includes the number and area of connected regions in the i-th frame difference image after noise reduction, as well as the length and width of the minimum bounding rectangle of the largest connected region. The second feature information includes the color information and region variance of the region in the i-th video frame that is the same as the largest connected region.
2. The detection method for card recycling according to claim 1, characterized in that, The method further includes: If it is determined from the i-th frame difference image that the card is recycled to the card receiving box, then the card area in the i-th video frame is marked and saved, and the recycling time is recorded.
3. The detection method for card recycling according to claim 1, characterized in that, The method further includes: If it is determined from the first frame difference image that the card has not been returned to the card receiving box, then the prior background frame is updated to the first video frame.
4. The detection method for card recycling according to claim 1, characterized in that, The step of detecting whether the card is returned to the card receiving box based on the i-th frame difference image includes: Count the number of target pixels in the i-th frame difference image, where the grayscale of the color component of the target pixel is greater than the target grayscale, i>1; Detect whether the number of target pixels meets the target condition; If yes, then based on the i-th frame difference image, detect whether the card has been returned to the card receiving box; otherwise, let i = i + 1, and return to the step of obtaining the i-th video frame in the card receiving box.
5. The detection method for card recycling according to claim 4, characterized in that, The target conditions include that the number of target pixels in at least one of the frame difference images from the i-th frame difference image to the m-th frame difference image is greater than the target number, and the fluctuation range of the number of target pixels in the i-th frame difference image to the m-th frame difference image does not exceed the target range, i>m>1.
6. The detection method for card recycling according to claim 1, characterized in that, Extracting the first feature information from the i-th frame difference image includes: The i-th frame difference image is subjected to mean filtering; Binarize the i-th frame difference image after filtering; Denoising is performed on the i-th frame difference image after binarization. Extract the first feature information from the i-th frame difference image after noise reduction.
7. The detection method for card recycling according to claim 1, characterized in that, The image acquisition device is activated when the card receiving box is fully opened. The first video frame acquired from the card receiving box is the nth video frame acquired by the image acquisition device, where n is greater than 1 and less than one-third of the number of frames acquired per second by the image acquisition device.
8. The detection method for card recycling according to claim 1, characterized in that, The card recycling device also includes a card reader located at the bottom of the card collection box; The method further includes: When the card is determined to be returned to the card receiving box, the card reader is controlled to read the information in the card.
9. A card recycling detection device, characterized in that, An apparatus for use in card recycling equipment, the card recycling equipment including a card receiving box for recycling cards and an image acquisition device disposed toward the card receiving box, the apparatus comprising: The acquisition module is used to acquire the i-th video frame inside the card receiving box, i≥1, through the image acquisition device when the card receiving box is fully open; The comparison module is used to compare the i-th video frame with the prior background frame of the card receiving box to obtain the i-th frame difference image; The detection module is used to detect whether the card has been returned to the card receiving box based on the i-th frame difference image. If it is determined from the i-th frame difference image that the card has not been returned to the card receiving box, then let i = i + 1 and return to the step of obtaining the i-th video frame in the card receiving box until it is determined that the card has been returned to the card receiving box. The step of detecting whether the card is returned to the card receiving box based on the i-th frame difference image includes: Extract the first feature information from the i-th frame difference image; Extract the second feature information from the i-th video frame; Detect whether the first feature information and the second feature information satisfy the card feature conditions; If so, then the card is confirmed to be returned to the card receiving box; Otherwise, it is determined that the card has not been returned to the card receiving box; The first feature information includes the number and area of connected regions in the i-th frame difference image after noise reduction, as well as the length and width of the minimum bounding rectangle of the largest connected region. The second feature information includes the color information and region variance of the region in the i-th video frame that is the same as the largest connected region.
10. A card recycling device, characterized in that, include: Card box; The image acquisition device is positioned facing the card receiving box; A controller, connected to the image acquisition unit, is used to implement the card recycling detection method as described in any one of claims 1-8.
11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the card recycling detection method as described in any one of claims 1-8.