CPC card reading method, device and equipment and storage medium
The camera determines the position of the CPC card and moves the card to the recognition area with the highest confidence level, which solves the problem of low success rate of CPC card reading and improves vehicle traffic efficiency.
Patent Information
- Application Number
- CN202411656663.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-09-13
- Filing Date
- 2024-11-19
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-11-19
AI Technical Summary
When the CPC card is read in the card-to-call machine, the card falls due to the randomness of the driver's parking position, resulting in a low reading success rate and affecting the vehicle's traffic efficiency.
Obtain video data through the camera, determine whether there is a CPC card on the antenna board, and calculate the world coordinates of the card, and move the card according to the recognition area with the highest confidence to improve the reading success rate.
It improves the reading success rate and efficiency of CPC cards, ensures vehicle traffic efficiency, and avoids internal and external factors of the card-counter.
Smart Images

Figure CN119323835A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to information technology, and in particular to a CPC card reading method, device, equipment and storage medium. Background Art
[0002] The highway composite pass card is also called the CPC card. By reading the CPC card, it can identify the vehicle's entry and exit information at the toll station, accurately record the vehicle's actual driving path, and provide an important basis for inter-provincial toll billing and settlement.
[0003] CPC cards are issued to drivers at the entrance of highway toll stations. Drivers stop at the exit of toll stations and insert CPC cards into the card-dispensing machine. The card-dispensing machine is equipped with an antenna board for reading CPC cards. After reading the vehicle's entry, exit, route and other information, the toll is calculated and the CPC card is then recycled.
[0004] Since the parking position of the driver is usually a certain distance away from the card dispenser, the driver's card insertion is somewhat random. In order to prevent the CPC card from falling, the antenna plate is usually set very large. However, the edge area of the large antenna plate has a low reading success rate. Once the CPC card falls on the edge area of the antenna plate, the data in the CPC card cannot be read or read incorrectly, which in turn affects the traffic efficiency of the vehicle. Summary of the invention
[0005] The present invention provides a CPC card reading method, device, equipment and storage medium to improve the CPC card reading success rate and reading efficiency and improve vehicle traffic efficiency.
[0006] In a first aspect, the present invention provides a CPC card reading method, comprising:
[0007] Acquiring video data collected by a camera, wherein the camera is arranged above the antenna board and is used to photograph an area including the antenna board;
[0008] Determining whether a CPC card currently exists on the antenna board based on the video data;
[0009] When a CPC card is currently present on the antenna board, the timing starts, and if data in the CPC card is not read within a first preset time period, the world coordinates of the CPC card are calculated from the video data;
[0010] Calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate and reading efficiency of the recognition area in reading the CPC card;
[0011] Controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and moving the CPC card into the target identification area to read the data in the CPC card;
[0012] Updating the confidence level of the identification area read from the CPC card;
[0013] The confidences of the recognition areas of the antenna board are reordered, the target recognition area with the highest confidence is re-determined, and the step of obtaining the video data collected by the camera is returned to be executed.
[0014] Optionally, judging whether a CPC card is currently on the antenna board based on the video data includes:
[0015] Extracting a current frame image and a previous frame image before the current frame image from the video data;
[0016] Preprocessing the current frame image and the previous frame image respectively to obtain a preprocessed image of the current frame image and a preprocessed image of the previous frame image, wherein the preprocessing includes image correction, image enhancement and grayscale conversion;
[0017] Extracting image features from the preprocessed image of the current frame image and the preprocessed image of the previous frame image respectively to obtain image features of the current frame image and image features of the previous frame image;
[0018] Calculating the similarity between the image features of the current frame image and the image features of the previous frame image;
[0019] Comparing the similarity with a preset similarity threshold;
[0020] If the similarity is greater than or equal to the similarity threshold, it is determined that there is currently no CPC card on the antenna board;
[0021] If the similarity is less than the similarity threshold, it is determined that a CPC card currently exists on the antenna board.
[0022] Optionally, calculating the world coordinates of the CPC card from the video data includes:
[0023] Determine the pixel coordinates of the first reference point on the CPC card from the current frame image;
[0024] Based on the internal parameters and the external parameters of the camera, the pixel coordinates of the pixel coordinates of the first reference point are converted into world coordinates.
[0025] Optionally, calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card includes:
[0026] The difference between the world coordinates of the first reference point and the world coordinates of the second reference point in the target recognition area is calculated to obtain an offset distance of the CPC card relative to the target recognition area on the world coordinate axis.
[0027] Optionally, the confidence of the identification area read from the CPC card is updated, and the updating formula is as follows:
[0028]
[0029] in, is the updated confidence of the i-th identification area after the data in the CPC card is successfully read for the jth time, is the ranking of the historical average card reading time of the i-th recognition area after the j-th reading, N is the total number of recognition areas, is the number of historical card reading timeouts after the jth reading of the i-th identification area, T is the total number of historical card readings after the jth reading of the i-th identification area, It is the ranking of the shortest historical card reading time of the i-th recognition area after the j-th reading.
[0030] Optionally, the CPC card reading method further includes:
[0031] When it is determined that there is no CPC card on the antenna board, a prompt signal for re-inserting the card is sent to the driver through the prompt device;
[0032] If the data in the CPC card is read within the first preset time period, the payment information is sent to the driver through the prompt device, the identification area and reading time of the CPC card are recorded, and the step of updating the confidence of the identification area read from the CPC card is returned.
[0033] Optionally, the CPC card reading method further includes:
[0034] After controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area, if the data in the CPC card is not read within the second preset time period, the identification area currently ranked second in confidence on the antenna board is used as the target identification area, and the process returns to executing the step of controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area.
[0035] In a second aspect, the present invention further provides a CPC card reading device, comprising:
[0036] A video data acquisition module, used to acquire video data collected by a camera, wherein the camera is arranged above the antenna board and is used to shoot an area including the antenna board;
[0037] A card existence determination module, used for determining whether a CPC card is currently on the antenna board based on the video data;
[0038] A world coordinate calculation module, configured to start timing when a CPC card is currently present on the antenna board, and to calculate the world coordinates of the CPC card from the video data if data in the CPC card is not read within a first preset time period;
[0039] A moving distance calculation module, used for calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, wherein the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate and reading efficiency of the recognition area in reading the CPC card;
[0040] A movement control module, used for controlling a card movement mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and to move the CPC card into the target identification area to read data in the CPC card;
[0041] A confidence updating module, used for updating the confidence of the identification area read from the CPC card;
[0042] The confidence ranking module is used to re-rank the confidences of the recognition areas of the antenna board, re-determine the target recognition area with the highest confidence, and return to execute the step of acquiring the video data collected by the camera.
[0043] In a third aspect, the present invention further provides an electronic device, comprising:
[0044] one or more processors;
[0045] A storage device for storing one or more programs;
[0046] When the one or more programs are executed by the one or more processors, the one or more processors implement the CPC card reading method provided in the first aspect of the present invention.
[0047] In a fourth aspect, the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the CPC card reading method provided in the first aspect of the present invention.
[0048] The CPC card reading method provided by the present invention comprises: obtaining video data collected by a camera, wherein the camera is arranged above an antenna board and is used to shoot an area including the antenna board, judging whether a CPC card is currently on the antenna board based on the video data, and starting timing when a CPC card is currently on the antenna board; if data in the CPC card is not read within a first preset time period, calculating the world coordinates of the CPC card from the video data, and calculating the distance between the CPC card and a target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, wherein the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate of the recognition area in being able to read the CPC card Power and reading efficiency, control the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area, move the CPC card into the target identification area to read the data in the CPC card, update the confidence of the identification area read to the CPC card, re-sort the confidence of the identification area of the antenna board, re-determine the target identification area with the highest confidence, and return to execute the step of obtaining the video data collected by the camera to avoid the influence of internal and external factors of the card dispenser, ensure that each time the card is read, the CPC card can be read by the identification area with the highest confidence, improve the reading success rate and reading efficiency of the CPC card, and thus improve the traffic efficiency of vehicles.
[0049] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0051] Figure 1 A flowchart of a CPC card reading method provided by an embodiment of the present invention;
[0052] Figure 2 A partial structural schematic diagram of a card slot machine provided by an embodiment of the present invention;
[0053] Figure 3 for Figure 2 Schematic diagram of the structure of the moving mechanism;
[0054] Figure 4 A schematic diagram of the structure of a CPC card reading device provided by an embodiment of the present invention;
[0055] Figure 5A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.
[0056] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0058] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0059] Figure 1 The flowchart of a CPC card reading method provided by an embodiment of the present invention is applicable to quickly identifying the CPC card inserted into the card machine by the driver. The method can be executed by the CPC card reading device improved by the embodiment of the present invention. The device can be implemented by software and / or hardware, and is usually configured in an electronic device, such as Figure 1 As shown, the CPC card reading method specifically includes the following steps:
[0060] S101. Obtain video data collected by a camera, where the camera is disposed above the antenna board and is used to photograph an area including the antenna board.
[0061] In an embodiment of the present invention, the card ejector includes an antenna board, a movable mechanism, a camera and a card receiving box. Exemplarily, the antenna board is horizontally arranged, and the camera is arranged above the antenna board for photographing an area including the antenna board. The movable mechanism can be controlled to move to move the CPC card inserted into the card ejector to a specific area. The card receiving box is arranged below the antenna board. After successfully reading the data in the CPC card, the movable mechanism is controlled to move to push the CPC card into the card receiving box.
[0062] Figure 2 A partial structural diagram of a card slotting machine provided by an embodiment of the present invention, Figure 3 for Figure 2 The structural diagram of the mobile mechanism is shown in FIG. Figure 2 and Figure 3 As shown, the card dispenser includes an antenna plate (not shown in the figure), a moving mechanism, a camera 1 and a card receiving box 5, wherein the moving mechanism includes a transmission belt 4 arranged above the antenna plate, baffles 10 arranged at opposite ends of the transmission belt 4 and a push plate 9 arranged at the other end of the transmission belt 5, the transmission belt 4 can be driven along the first axis X in the figure, the two baffles 10 can move relatively along the second axis Y in the figure, and the push plate 9 can move along the first axis X in the figure, wherein the first axis X and the second axis Y are perpendicular in the horizontal plane. Exemplarily, the end of the baffle 10 is connected to a slider 8, the slider 8 is arranged on a slide rail 7, the slide rail 7 is arranged along the second axis Y, and the slider 8 can be driven by a motor to move along the slide rail 7, so that the two baffles 10 move relatively along the second axis Y. The transmission belt 4 and the baffle 10 cooperate to move the CPC card dropped on the transmission belt 4 to a specific area. After successfully reading the data in the CPC card, the push plate 9 is controlled to move and push the CPC card on the transmission belt 4 into the card receiving box 5. Exemplarily, the card-throwing machine further includes a guide housing 3, an antenna plate and a moving mechanism are arranged at the bottom of the guide housing 3, and the side wall of the guide housing 3 has a certain inclination angle, which plays a guiding role and collects the CPC cards thrown by the driver onto the transmission belt 4. The card-throwing machine further includes a card-throwing wall 6, which is arranged along the second axis Y and is perpendicular to the horizontal plane. When the driver throws the card into the card-throwing machine with a large force, the CPC card hits the card-throwing wall 6 and rebounds onto the transmission belt 4 in the guide housing 3. The camera 1 is arranged at the top of the card-throwing wall 6, and is used to shoot the internal area of the guide housing 3. Exemplarily, the card-throwing machine further includes a fill light 2, which is used to fill light for shooting.
[0063] In the embodiment of the present invention, for the purpose of operation of the card slot machine, video data collected by the camera is acquired in real time.
[0064] S102: Determine whether there is a CPC card currently on the antenna board based on the video data.
[0065] In the embodiment of the present invention, a target recognition algorithm may be used to determine whether a CPC card is currently on the antenna board in the video data, or the change of consecutive frames in the video data may be used to determine whether a CPC card is currently on the antenna board, which is not limited in the embodiment of the present invention. If a CPC card is currently on the antenna board, step S103 is executed; if a CPC card is not currently on the antenna board, step S109 is executed.
[0066] Exemplarily, in some embodiments of the present invention, in order to improve recognition efficiency, the change of consecutive frames in the video data is used to determine whether there is a CPC card on the antenna board. Exemplarily, judging whether there is a CPC card on the antenna board based on the video data includes the following sub-steps:
[0067] S1021. Extract the current frame image and the previous frame image before the current frame image from the video data.
[0068] In the embodiment of the present invention, the current frame image and the previous frame image before the current frame image are extracted from the video data. Exemplarily, the image frame described in the embodiment of the present invention can be a common image frame or a key frame, which is not limited in the embodiment of the present invention. The key frame refers to the frame where the key action in the motion change of the object in the video data is located.
[0069] S1022 , preprocessing the current frame image and the previous frame image respectively to obtain a preprocessed image of the current frame image and a preprocessed image of the previous frame image, wherein the preprocessing includes image correction, image enhancement and grayscale conversion.
[0070] In the embodiment of the present invention, the current frame image and the previous frame image are preprocessed respectively to obtain the preprocessed image of the current frame image and the preprocessed image of the previous frame image. Among them, the preprocessing includes image correction, image enhancement and grayscale. Image correction refers to the restoration processing of the distorted image, which usually includes geometric correction and grayscale correction. Geometric correction fits the unknown coefficients in the mapping relationship through some known reference points, that is, the corresponding relationship between the coordinates of certain pixels of the undistorted image and the corresponding pixels of the distorted image, and serves as the basis for restoring other pixels. Grayscale correction mainly targets the uneven distribution of grayscale levels in the image, such as uneven exposure, and makes the grayscale distribution of the entire image more uniform by adjusting the grayscale level point by point to different degrees. Image enhancement refers to purposefully emphasizing the overall or local characteristics of the image, making the originally unclear image clear or emphasizing certain interesting features, expanding the differences between the features of different objects in the image, suppressing uninteresting features, so as to improve the image quality, enrich the amount of information, strengthen the image interpretation and recognition effect, and meet the needs of certain special analysis. Grayscale is the process of converting a color image into a grayscale image, wherein the color information of each pixel is converted into a single grayscale value. Of course, in other embodiments of the present invention, the preprocessing process may also include other processing processes, such as filtering, denoising, contrast enhancement, etc., which are not limited in the embodiments of the present invention.
[0071] S1023 , extracting image features from the preprocessed image of the current frame image and the preprocessed image of the previous frame image respectively, to obtain image features of the current frame image and image features of the previous frame image.
[0072] In an embodiment of the present invention, image features are extracted from the preprocessed image of the current frame image and the preprocessed image of the previous frame image, respectively, to obtain image features of the current frame image and image features of the previous frame image. Exemplarily, feature extraction is performed on the preprocessed image of the current frame image and the preprocessed image of the previous frame image using a feature extraction algorithm to obtain image features of the current frame image and image features of the previous frame image. Exemplarily, in an embodiment of the present invention, since the CPC card has obvious edge features, edge detection algorithms such as the Sobel operator and the Canny algorithm can be used to extract edge features of the preprocessed image as image features.
[0073] S1024: Calculate the similarity between the image features of the current frame image and the image features of the previous frame image.
[0074] In the embodiment of the present invention, the similarity between the image features of the current frame image and the image features of the previous frame image is calculated. Exemplarily, the similarity described in the present invention may be cosine similarity.
[0075] S1025: Compare the similarity with a preset similarity threshold.
[0076] The similarity between the image features of the current frame image and the image features of the previous frame image is compared with a preset similarity threshold to compare the magnitude relationship between the two.
[0077] S1026: If the similarity is greater than or equal to the similarity threshold, it is determined that there is no CPC card on the antenna board.
[0078] If the similarity is greater than or equal to the similarity threshold, it means that the difference between the current frame image and the previous frame image is very small, and it can be considered that there is no CPC card on the antenna board.
[0079] S1027: If the similarity is less than the similarity threshold, it is determined that a CPC card currently exists on the antenna board.
[0080] If the similarity is less than the similarity threshold, it means that the current frame image is significantly different from the previous frame image, and it can be considered that a CPC card currently exists on the antenna board.
[0081] S103: Determine whether the data in the CPC card can be read within the first preset time period.
[0082] In the embodiment of the present invention, the timing starts when it is determined that a CPC card is currently present on the antenna board, and it is determined whether the data in the CPC card can be read within a first preset time period.
[0083] If the data in the CPC card is not read within the first preset time period, step S104 is executed; if the data in the CPC card is read within the first preset time period, step S110 is executed.
[0084] S104, calculating the world coordinates of the CPC card from the video data.
[0085] If the data in the CPC card is not read within the first preset time period, it can be considered that the CPC card fell in a bad position (for example, at the edge of the antenna board) and the CPC card needs to be moved. Therefore, the world coordinates of the CPC card need to be calculated from the video data to provide a basis for the movement.
[0086] Exemplarily, in some embodiments of the present invention, the pixel coordinates of the first reference point on the CPC card are first determined from the current frame image. Exemplarily, the first reference point may be the center point of the CPC card. Then, based on the internal and external parameters of the camera, the pixel coordinates of the pixel coordinates of the first reference point are converted to world coordinates. Specifically, the conversion relationship of the pixel coordinates of the pixel coordinates of the first reference point is as follows:
[0087]
[0088] Among them, s is the scale factor, (u,v) is the pixel coordinate of the reference point, K is the internal parameter matrix of the camera, [R,t] is the external parameter matrix of the camera, and (X,Y,Z) is the world coordinate of the reference point.
[0089] S105 , calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card.
[0090] In an embodiment of the present invention, the antenna board is divided into multiple identification areas, and a confidence level is set for each identification area. The confidence level is used to characterize the success rate and reading efficiency of the identification area in reading the CPC card. The higher the confidence level, the higher the success rate and reading efficiency of the CPC card. In an embodiment of the present invention, the distance between the CPC card and the target identification area with the highest current confidence level on the antenna board is calculated based on the world coordinates of the CPC card, so that the CPC card can be moved to the target identification area for data reading in subsequent steps. It should be noted that the confidence level of the identification area is not fixed, but is updated according to the previous identification result. Please refer to the following text for a detailed introduction.
[0091] Exemplarily, in some embodiments of the present invention, the difference between the world coordinates of the first reference point and the world coordinates of the second reference point in the target identification area is calculated to obtain the offset distance of the CPC card relative to the target identification area on the world coordinate axis. Exemplarily, the second reference point may be the center point of the target identification area. By calculating the difference between the world coordinates of the first reference point and the world coordinates of the second reference point in the target identification area, the offset distance of the CPC card relative to the target identification area in the first axis X direction and the offset distance in the second axis Y direction can be obtained.
[0092] S106, controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and moving the CPC card into the target identification area to read the data in the CPC card.
[0093] After obtaining the distance between the CPC card and the target identification area, the card moving mechanism is controlled to move the CPC card according to the distance between the CPC card and the target identification area, and the CPC card is moved into the target identification area to read the data in the CPC card. Since the confidence of the target identification area is the highest, the higher the reading success rate and reading efficiency of the CPC card in the target identification area, the higher the reading success rate and reading efficiency of the CPC card can be, thereby improving the traffic efficiency of the vehicle.
[0094] S107: Update the confidence level of the recognition area read from the CPC card.
[0095] In an embodiment of the present invention, the confidence of the identification area (i.e., the target identification area) read from the CPC card is updated. Exemplarily, in an embodiment of the present invention, when the data in the CPC card is successfully read, the card reading time of this card reading is recorded, and the confidence of the target identification area is updated based on the card reading time.
[0096] Exemplarily, in some embodiments of the present invention, the confidence update formula is as follows:
[0097]
[0098] in, is the updated confidence of the i-th recognition area after the data in the CPC card is successfully read for the jth time, is the ranking of the historical average card reading time of the i-th recognition area after the j-th reading, N is the total number of recognition areas, is the number of historical card reading timeouts after the jth reading of the i-th identification area, T is the total number of historical card readings after the jth reading of the i-th identification area, is the ranking of the shortest card reading time in history for the i-th identification area after the j-th reading. The ranking of the historical average card reading time refers to the ranking of the historical average card reading time of a recognition area among all recognition areas. The ranking of the historical shortest card reading time refers to the ranking of the historical shortest card reading time of a recognition area among all recognition areas.
[0099] S108. Reorder the confidences of the recognition areas of the antenna board and re-determine the target recognition area with the highest confidence.
[0100] During the operation of the antenna board, due to the influence of internal current and external environmental factors, the recognition area with the highest confidence may not be fixed, but may be affected and change. In an embodiment of the present invention, after updating the confidence of the target recognition area, the confidence of the recognition area of the antenna board is reordered, the target recognition area with the highest confidence is re-determined, and the step of obtaining the video data collected by the camera is returned to start the next round of card reading tasks, ensuring that the CPC card can be read by the recognition area with the highest confidence each time the card is read, thereby improving the reading success rate and reading efficiency of the CPC card, and thus improving the traffic efficiency of the vehicle. For example, if the target recognition area is read for a long time, then according to the above formula, the confidence will be reduced, while the confidence of other recognition areas remains unchanged, then the confidence ranking of the target recognition area may be reduced. Similarly, if the target recognition area is read for a short time, then according to the above formula, the confidence will increase, while the confidence of other recognition areas remains unchanged, then the confidence ranking of the target recognition area may remain unchanged. In short, the confidence of the recognition area of the antenna board is re-ordered, and the target recognition area with the highest confidence is re-determined to ensure that the CPC card can be read by the recognition area with the highest confidence each time the card is read, thereby improving the reading success rate and reading efficiency of the CPC card, thereby improving the vehicle traffic efficiency.
[0101] S109: Send a prompt signal to the driver to re-insert the card through the prompt device.
[0102] In the above step S102, if it is determined that there is no CPC card on the antenna board, it means that the driver may have inserted the wrong card. A prompt signal for re-inserting the card is sent to the driver through the prompt device, prompting the driver to take the card and re-insert the card. Exemplarily, the prompt device may include a display and a speaker, which is not limited to the embodiments of the present invention.
[0103] S110, sending payment information to the driver through the prompt device, recording the recognition area and reading time of the CPC card, and returning to execute the step of updating the confidence of the recognition area read from the CPC card.
[0104] In the above step S103, if the data in the CPC card is read within the first preset time, the payment information is sent to the driver through the prompt device to guide the driver to pay. At the same time, the identification area where the data is read can be recorded, and the reading time can be recorded, and the step of updating the confidence of the identification area read from the CPC card can be returned. Specifically, the confidence update formula is as above, and the embodiment of the present invention is not repeated here.
[0105] Due to the influence of the internal current and external environment of the card ejector, there may be a special situation where the CPC card cannot be read even if it is moved to the target area with the highest confidence. In this case, after controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area, if the data in the CPC card is not read within the second preset time period, the identification area with the second highest confidence on the antenna board is used as the target identification area, and the process returns to execute the step of controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area, and repeats the above card moving and reading process until the data in the CPC card is successfully read.
[0106] The CPC card reading method provided by the embodiment of the present invention includes: obtaining video data collected by a camera, the camera is arranged above the antenna board and is used to shoot an area including the antenna board, judging whether a CPC card is currently present on the antenna board based on the video data, and starting timing when a CPC card is currently present on the antenna board; if the data in the CPC card is not read within a first preset time period, calculating the world coordinates of the CPC card from the video data, and calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize whether the recognition area can read the CPC card. The success rate and reading efficiency of the CPC card are improved, the card moving mechanism is controlled to move the CPC card according to the distance between the CPC card and the target recognition area, the CPC card is moved into the target recognition area to read the data in the CPC card, the confidence of the recognition area read from the CPC card is updated, the confidence of the recognition area of the antenna board is re-sorted, the target recognition area with the highest confidence is re-determined, and the step of obtaining the video data collected by the camera is returned to avoid the influence of internal and external factors of the card dispenser, and ensure that each time the card is read, the CPC card can be read by the recognition area with the highest confidence, thereby improving the reading success rate and reading efficiency of the CPC card, thereby improving the traffic efficiency of the vehicle.
[0107] The embodiment of the present invention further provides a CPC card reading device, Figure 4 A structural diagram of a CPC card reading device provided by an embodiment of the present invention is shown in FIG. Figure 4 As shown, the CPC card reading device includes:
[0108] A video data acquisition module 101, used to acquire video data collected by a camera, wherein the camera is arranged above the antenna board and is used to shoot an area including the antenna board;
[0109] A card existence determination module 102, configured to determine whether a CPC card is currently on the antenna board based on the video data;
[0110] A world coordinate calculation module 103, configured to start timing when a CPC card is currently present on the antenna board, and to calculate the world coordinates of the CPC card from the video data if no data in the CPC card is read within a first preset time period;
[0111] A moving distance calculation module 104, used for calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, wherein the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate and reading efficiency of the recognition area in reading the CPC card;
[0112] A movement control module 105, used to control the card movement mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and move the CPC card into the target identification area to read the data in the CPC card;
[0113] A confidence updating module 106, used to update the confidence of the identification area read from the CPC card;
[0114] The confidence ranking module 107 is used to re-rank the confidences of the recognition areas of the antenna board, re-determine the target recognition area with the highest confidence, and return to execute the step of acquiring the video data collected by the camera.
[0115] In some embodiments of the present invention, the card presence determination module 102 includes:
[0116] An image frame extraction submodule, used to extract a current frame image and a previous frame image before the current frame image from the video data;
[0117] A preprocessing submodule, used to preprocess the current frame image and the previous frame image respectively to obtain a preprocessed image of the current frame image and a preprocessed image of the previous frame image, wherein the preprocessing includes image correction, image enhancement and grayscale conversion;
[0118] A feature extraction submodule, used to extract image features from the preprocessed image of the current frame image and the preprocessed image of the previous frame image, respectively, to obtain image features of the current frame image and image features of the previous frame image;
[0119] A similarity calculation submodule, used to calculate the similarity between the image features of the current frame image and the image features of the previous frame image;
[0120] A comparison submodule, used for comparing the similarity with a preset similarity threshold;
[0121] A first determination submodule, configured to determine that there is no CPC card currently on the antenna board if the similarity is greater than or equal to the similarity threshold;
[0122] The second determination submodule is configured to determine that a CPC card currently exists on the antenna board if the similarity is less than the similarity threshold.
[0123] In some embodiments of the present invention, the world coordinate calculation module 103 includes:
[0124] A pixel coordinate determination submodule, used to determine the pixel coordinates of the first reference point on the CPC card from the current frame image;
[0125] The coordinate conversion submodule is used to convert the pixel coordinates of the pixel coordinates of the first reference point into world coordinates based on the internal parameters and external parameters of the camera.
[0126] In some embodiments of the present invention, the moving distance calculation module 104 includes:
[0127] The distance calculation submodule is used to calculate the difference between the world coordinates of the first reference point and the world coordinates of the second reference point in the target recognition area to obtain the offset distance of the CPC card relative to the target recognition area on the world coordinate axis.
[0128] In some embodiments of the present invention, the updating formula of the confidence updating module 106 is as follows:
[0129]
[0130] in, is the updated confidence of the i-th identification area after the data in the CPC card is successfully read for the jth time, is the ranking of the historical average card reading time of the i-th recognition area after the j-th reading, N is the total number of recognition areas, is the number of historical card reading timeouts after the jth reading of the i-th identification area, T is the total number of historical card readings after the jth reading of the i-th identification area, It is the ranking of the shortest historical card reading time of the i-th recognition area after the j-th reading.
[0131] In some embodiments of the present invention, the CPC card reading device further comprises:
[0132] A prompt module, for sending a prompt signal to the driver to re-insert the card through a prompt device when it is determined that there is no CPC card on the antenna board;
[0133] The record update module is used to send payment information to the driver through a prompt device if the data in the CPC card is read within a first preset time, record the identification area and reading time of the CPC card, and return to execute the step of updating the confidence of the identification area read from the CPC card.
[0134] In some embodiments of the present invention, the CPC card reading device further comprises:
[0135] The return execution module is used to control the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area. After the CPC card is moved to the target identification area, if the data in the CPC card is not read within a second preset time period, the identification area with the second highest confidence on the antenna board is used as the target identification area, and return to execute the step of controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and moving the CPC card into the target identification area.
[0136] The CPC card reading device can execute the CPC card reading method provided in the embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the CPC card reading method.
[0137] Figure 5 A schematic diagram of the structure of an electronic device provided for an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0138] like Figure 5As shown, the electronic device includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0139] A number of components in the electronic device are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0140] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a CPC card reading method.
[0141] In some embodiments, the CPC card reading method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the CPC card reading method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the CPC card reading method in any other appropriate manner (e.g., by means of firmware).
[0142] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0143] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0144] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0145] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0146] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0147] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0148] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the CPC card reading method provided in any embodiment of the present application.
[0149] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0150] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0151] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A CPC card reading method, characterized in that: include: Acquiring video data collected by a camera, wherein the camera is arranged above the antenna board and is used to photograph an area including the antenna board; Determining whether a CPC card currently exists on the antenna board based on the video data; When a CPC card is currently present on the antenna board, the timing starts, and if data in the CPC card is not read within a first preset time period, the world coordinates of the CPC card are calculated from the video data; Calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate and reading efficiency of the recognition area in reading the CPC card; Controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and moving the CPC card into the target identification area to read the data in the CPC card; Updating the confidence level of the identification area read from the CPC card; The confidences of the recognition areas of the antenna board are reordered, the target recognition area with the highest confidence is re-determined, and the step of obtaining the video data collected by the camera is returned to be executed.
2. The CPC card reading method according to claim 1, characterized in that: Determining whether a CPC card is currently on the antenna board based on the video data includes: Extracting a current frame image and a previous frame image before the current frame image from the video data; Preprocessing the current frame image and the previous frame image respectively to obtain a preprocessed image of the current frame image and a preprocessed image of the previous frame image, wherein the preprocessing includes image correction, image enhancement and grayscale conversion; Extracting image features from the preprocessed image of the current frame image and the preprocessed image of the previous frame image respectively to obtain image features of the current frame image and image features of the previous frame image; Calculating the similarity between the image features of the current frame image and the image features of the previous frame image; Comparing the similarity with a preset similarity threshold; If the similarity is greater than or equal to the similarity threshold, it is determined that there is currently no CPC card on the antenna board; If the similarity is less than the similarity threshold, it is determined that a CPC card currently exists on the antenna board.
3. The CPC card reading method according to claim 1, characterized in that: Calculating the world coordinates of the CPC card from the video data includes: Determine the pixel coordinates of the first reference point on the CPC card from the current frame image; Based on the internal parameters and the external parameters of the camera, the pixel coordinates of the pixel coordinates of the first reference point are converted into world coordinates.
4. The CPC card reading method according to claim 3, characterized in that: Calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card includes: The difference between the world coordinates of the first reference point and the world coordinates of the second reference point in the target recognition area is calculated to obtain an offset distance of the CPC card relative to the target recognition area on the world coordinate axis.
5. The CPC card reading method according to any one of claims 1 to 4, characterized in that: The confidence level of the identification area read from the CPC card is updated, and the update formula is as follows: in, is the updated confidence of the i-th identification area after the data in the CPC card is successfully read for the jth time, is the ranking of the historical average card reading time of the i-th recognition area after the j-th reading, N is the total number of recognition areas, is the number of historical card reading timeouts after the jth reading of the i-th identification area, T is the total number of historical card readings after the jth reading of the i-th identification area, It is the ranking of the shortest historical card reading time of the i-th recognition area after the j-th reading.
6. The CPC card reading method according to any one of claims 1 to 4, characterized in that: Also includes: When it is determined that there is no CPC card on the antenna board, a prompt signal for re-inserting the card is sent to the driver through the prompt device; If the data in the CPC card is read within the first preset time period, the payment information is sent to the driver through the prompt device, the identification area and reading time of the CPC card are recorded, and the step of updating the confidence of the identification area read from the CPC card is returned.
7. The CPC card reading method according to any one of claims 1 to 4, characterized in that: Also includes: After controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area, if the data in the CPC card is not read within the second preset time period, the identification area currently ranked second in confidence on the antenna board is used as the target identification area, and the process returns to executing the step of controlling the card moving mechanism to move the CPC card according to the distance between the CPC card and the target identification area and moving the CPC card into the target identification area.
8. A CPC card reading device, characterized in that: include: A video data acquisition module, used to acquire video data collected by a camera, wherein the camera is arranged above the antenna board and is used to shoot an area including the antenna board; A card existence determination module, used for determining whether a CPC card is currently on the antenna board based on the video data; A world coordinate calculation module, configured to start timing when a CPC card is currently present on the antenna board, and to calculate the world coordinates of the CPC card from the video data if data in the CPC card is not read within a first preset time period; A moving distance calculation module, used for calculating the distance between the CPC card and the target recognition area with the highest current confidence on the antenna board based on the world coordinates of the CPC card, wherein the antenna board is divided into a plurality of recognition areas, and the confidence is used to characterize the success rate and reading efficiency of the recognition area in reading the CPC card; A movement control module, used for controlling a card movement mechanism to move the CPC card according to the distance between the CPC card and the target identification area, and to move the CPC card into the target identification area to read data in the CPC card; A confidence updating module, used for updating the confidence of the identification area read from the CPC card; The confidence ranking module is used to re-rank the confidences of the recognition areas of the antenna board, re-determine the target recognition area with the highest confidence, and return to execute the step of acquiring the video data collected by the camera.
9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the CPC card reading method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the CPC card reading method as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Card-pushing mechanism for card sending machine
CN102194258A
Radio frequency identification reader card reading method and device and computer readable storage medium
CN109614832A
Expressway pass card throwing and sorting device and card throwing type self-service payment machine
CN115497181A
Highway toll robot and method
CN116311567A
Card receiver and charging system
CN116432678A