A method and system for quickly detecting the rise and fall time of electric barriers for toll collection
The high-speed camera collects the electric railing image frames and uses the image frame state recognition model and the ConvLSTM model to calculate the motion speed, which solves the problem of large error in the calculation of the lifting and landing time of the electric railing in the traditional detection method, achieving fast and accurate detection and reducing costs.
Patent Information
- Application Number
- CN202510251960.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-03-05
AI Technical Summary
The traditional electric railing time detection method has problems such as large errors, high labor and time costs.
A high-speed camera is used to collect the image frame set of electric railings, and the railing open and closed state is identified through the image frame state recognition model. The motion speed is calculated in combination with the ConvLSTM model, and the speed change trend is judged to quickly detect and measure the accurate time.
It realizes rapid and accurate detection of the lifting and landing time of electric railings, reduces labor and time costs, and improves the degree of automation of inspections.
Smart Images

Figure CN119758696B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric barrier detection, and in particular to a method and system for quickly detecting the rise and fall time of an electric barrier for charging. Background Art
[0002] During the opening and closing process of electric barriers, it is usually necessary to accurately measure the opening and closing time to ensure the operating efficiency of the toll station and the health monitoring of the barrier equipment. At present, the traditional detection methods are divided into the stopwatch method and the video frame reading method. When the stopwatch method is used for detection, the judgment of the rise / fall time of the barrier is too subjective, and the stopwatch action is difficult to synchronize with the rise / fall of the barrier, so the time measurement error is generally large; when the video frame reading method is used for detection, it is necessary to record the video of the movement process of the electric barrier on site, copy the video to the computer, and use the playback software to read and display it frame by frame. Several detection personnel subjectively determine the rise / fall image frame of the barrier, and calculate the rise / fall time of the barrier according to the image frame time interval. This method has high manpower and time costs and low automation. Summary of the invention
[0003] The purpose of the present invention is to provide a method and system for quickly detecting the rise and fall time of an electric barrier for toll collection, which utilizes an image frame state recognition model to identify and classify the opening and closing state of the electric barrier, and then quickly detects and measures the accurate time based on the speed change trend of the continuous barrier opening and closing state, so as to solve the technical problems of large errors in measuring the rise and fall time of the electric barrier and high manpower and time costs in traditional detection methods.
[0004] In order to solve the above technical problems, the present invention adopts the following solutions:
[0005] A method for quickly detecting the rise and fall time of an electric barrier for charging, the method comprising the following steps:
[0006] S1, collecting image frames of the electric railing according to sampling time intervals by a high-speed camera;
[0007] S2, inputting the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened;
[0008] S3, sequentially find the partial continuous states from the first frame partially open to fully open or the first frame partially open to fully closed from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and sequentially connect the motion speeds to form a speed change set;
[0009] S4. Determine whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state. If so, calculate the railing opening and closing time according to the sampling time interval and the speed change set.
[0010] Furthermore, in S2, the process of inputting the image frame set into the image frame state recognition model to obtain the continuous state of the corresponding image frame set is:
[0011] S21, determining a characteristic region of interest by using a special marker preset on the electric railing, and performing image preprocessing on each image frame according to the characteristic region of interest to obtain a preprocessed image frame set;
[0012] S22, extracting features from the preprocessed image frame set through mobileNet to obtain spatial features of the feature region of interest;
[0013] S23, performing a convolution operation on the image frame set according to the ConvLSTM model, sequentially advancing the spatial features of the current image frame through the convolution operation, and then combining the historical image data through the gating mechanism to determine the opening and closing state of the railing of the current image frame;
[0014] S24, connecting the railing opening and closing states of each image frame in the image frame set to form a corresponding continuous state.
[0015] Furthermore, the historical image data refers to image data obtained by annotating the opening and closing states of the electric railings in advance on historical images of the electric railings collected by a high-speed camera.
[0016] Furthermore, the image preprocessing includes preprocessing cropping and histogram equalization.
[0017] Furthermore, in S3, the process of calculating the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous state is:
[0018] The latent space of each image frame corresponding to the partial continuous state is obtained through the ConvLSTM model, the cosine similarity of the latent space of two adjacent image frames is calculated, and the cosine similarity between the current image frame and the previous image frame is obtained in turn. The motion speed of the current image frame is calculated through the cosine similarity;
[0019] The calculation formula is: v = 1- cos(h(t-1),h(t)), where h(t) represents the latent space of the current image frame and h(t-1) represents the latent space of the previous image frame.
[0020] Furthermore, the step S4 includes the following steps:
[0021] S41, obtaining a speed change set corresponding to a part of the continuous state, judging whether the change trend of the movement speed is consistent with the opening and closing state of the barrier according to the continuous movement speeds in the speed change set, and then going to step S42;
[0022] S42, taking the first frame partially opened or the first frame fully opened in the partially continuous state as the time starting point, calculating the time from the first frame partially opened to fully opened or the first frame partially opened to fully closed according to the sampling time interval, and taking the time as the opening and closing time of the railing.
[0023] Further, in S41, the process of judging whether the changing trend of the motion speed is consistent with the opening and closing state of the barrier is as follows:
[0024] Calculate the difference between two adjacent motion speeds in the speed change set in sequence;
[0025] According to the comparison between the difference between two adjacent motion speeds and the threshold, the change trend between the two adjacent motion speeds is obtained, and the change trend is divided into acceleration, uniform speed and deceleration;
[0026] A corresponding change trend chain is formed according to the change trend between two adjacent movement speeds. When the change trend chain is acceleration-constant speed-deceleration, it is determined that the change trend of the movement speed is consistent with the opening and closing state of the railing.
[0027] Furthermore, the process of comparing the difference between two adjacent motion speeds with the threshold is as follows:
[0028] If the current speed is less than the next speed, determine whether the difference between the two exceeds a threshold value. If so, determine that the change trend between the current speed and the next speed is acceleration. If not, determine that the change trend between the current speed and the next speed is uniform.
[0029] If the current movement speed is greater than the next movement speed, determine whether the difference between the two exceeds a threshold. If so, determine that the change trend between the current movement speed and the next movement speed is deceleration; if not, determine that the change trend between the current movement speed and the next movement speed is uniform.
[0030] A rapid detection system for the rise and fall time of an electric barrier for toll collection, using the rapid detection method for the rise and fall time of an electric barrier for toll collection, comprising:
[0031] Image frame acquisition module: collects image frame sets of electric railings at sampling time intervals through a high-speed camera;
[0032] Image frame state recognition module: input the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened;
[0033] Image frame motion speed calculation module: find the partial continuous states from the first frame partially open to fully open or from the first frame partially open to fully closed in sequence from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and connect the motion speeds in sequence to form a speed change set;
[0034] Railing opening and closing time detection module: determines whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state. If so, the railing opening and closing time is calculated based on the sampling time interval and the speed change set.
[0035] Beneficial effects of the present invention:
[0036] The present invention provides a method and system for quickly detecting the rise and fall time of an electric barrier for charging. A high-speed camera is used to collect continuous image frames of the electric barrier, and the collected continuous image frames are input into an image frame state recognition model so that the model can recognize and classify the opening and closing states of the electric barrier in the continuous image frames. The opening and closing states of the electric barrier in the continuous image frames are cut to obtain the opening and closing segments of the barrier to be detected, and then the cosine similarity calculation is performed on two adjacent image frames in the opening and closing segments of the barrier to be detected in turn. The corresponding speed change trend is obtained according to the cosine similarity calculation, and the opening and closing segments of the barrier to be detected are quickly detected according to the speed change trend and the accurate time is measured to solve the technical problems of large error in the measurement of the rise and fall time of the electric barrier and high manpower and time costs in the traditional detection method. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 The figure is a flow chart of a method for quickly detecting the rise and fall time of an electric barrier for toll collection in Embodiment 1 of the present invention.
[0038] Figure 2 Schematic diagram of the model architecture of the image frame state recognition model in Example 1 of the present invention.
[0039] Figure 3 Schematic diagram of the structure of the ConvLSTM model in Example 1 of the present invention. DETAILED DESCRIPTION
[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The following description of at least one exemplary embodiment is actually only illustrative and is by no means intended to limit the present invention and its application or use. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0041] The relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0042] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0043] Additionally, descriptions of well-known structures, functions, and configurations may be omitted for clarity and conciseness.One of ordinary skill in the art will recognize that various changes and modifications may be made to the examples described herein without departing from the spirit and scope of the present disclosure.
[0044] Technologies, methods, and apparatus known to ordinary technicians in the relevant field may not be discussed in detail, but where appropriate, such technologies, methods, and apparatus should be considered part of the authorization specification.
[0045] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limiting. Therefore, other examples of the exemplary embodiments may have different values.
[0046] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments:
[0047] Example 1
[0048] In this embodiment, a method for quickly detecting the rise and fall time of a toll-collecting electric barrier is proposed. Figure 1 As shown, the method comprises the following steps:
[0049] S1, collecting image frames of the electric railing according to sampling time intervals by a high-speed camera;
[0050] S2, inputting the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened;
[0051] S3, sequentially find the partial continuous states from the first frame partially open to fully open or the first frame partially open to fully closed from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and sequentially connect the motion speeds to form a speed change set;
[0052] S4. Determine whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state. If so, calculate the railing opening and closing time according to the sampling time interval and the speed change set.
[0053] Specifically, a high-speed camera is set on the electric railing. The high-speed camera has a fast acquisition speed, a sampling frequency of ≥120 frames, and a single frame time interval of 8ms. The high-speed camera can accurately acquire a clear continuous image frame set, and the continuous image frame set includes multiple image frames sorted in time sequence.
[0054] In one embodiment, in S2, the process of inputting the image frame set into the image frame state recognition model to obtain the continuous state of the corresponding image frame set is:
[0055] S21, determining a characteristic region of interest by using a special marker preset on the electric railing, and performing image preprocessing on each image frame according to the characteristic region of interest to obtain a preprocessed image frame set;
[0056] S22, extracting features from the preprocessed image frame set through mobileNet to obtain spatial features of the feature region of interest;
[0057] S23, performing a convolution operation on the image frame set according to the ConvLSTM model, sequentially advancing the spatial features of the current image frame through the convolution operation, and then combining the historical image data through the gating mechanism to determine the railing opening and closing state of the current image frame; wherein the historical image data refers to image data in which the railing opening and closing state is annotated in advance for the historical images of the electric railing collected by the high-speed camera;
[0058] S24, connecting the railing opening and closing state of each image frame in the image frame set to form a corresponding continuous state.
[0059] Among them, special markers are adsorbed on the electric railings and mechanically fixed to ensure their stability. The special markers use templates with shapes, colors, contrasts, and structural complexity that are quite different from those in the toll station detection environment. They can adapt to railings of different shapes, materials, backgrounds, and patterns. Special markers are used to obtain more stable features and detection areas, and then the image frame state recognition model is used to identify and analyze the dynamic behaviors of continuous image frames in the image frame set. Specifically, the special markers can be specific logos, blocks of alternating colors, triangles, five-pointed stars, arcs, ellipses, and other shapes. In addition, the special markers can be fixed to the electric railings by magnets or by pasting, bundling, snapping, etc.
[0060] In one embodiment, in S3, the process of calculating the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous state is:
[0061] The latent space of each image frame corresponding to the partial continuous state is obtained through the ConvLSTM model, the cosine similarity of the latent space of two adjacent image frames is calculated, and the cosine similarity between the current image frame and the previous image frame is obtained in turn. The motion speed of the current image frame is calculated through the cosine similarity;
[0062] The calculation formula is: v = 1- cos(h(t-1),h(t)), where h(t) represents the latent space of the current image frame and h(t-1) represents the latent space of the previous image frame.
[0063] Specifically, in this embodiment, a method is proposed in which a high-speed camera is used to collect a video or a continuous image frame set of the electric barrier rising and falling process, and the image frame set is input into an image frame state recognition model to obtain a continuous state consisting of the opening and closing states of the barrier of continuous image frames. The model architecture diagram of the image frame state recognition model is shown in FIG. Figure 2 As shown, it includes image preprocessing, feature extraction, ConvLSTM model, state classification, etc. The process is as follows:
[0064] The original image Image t is obtained by image preprocessing img_crop(t), img_crop(t), t=1,2,…,n, and then feature extraction is performed through mobileNet to obtain spatial features x(t). The spatial features x(t) are used as the input of the ConvLSTM model. The dynamic behaviors of consecutive image frames in the image frame set are recognized and analyzed by the ConvLSTM model to obtain the output latent space h(t). A state classification CL is added after the latent space h(t), wherein the state classification CL includes a fully connected layer FC and a softmax activation function. The opening and closing state of the railing can be obtained through the state classification CL, and the opening and closing state of the railing includes fully closed, partially open, and fully open.
[0065] Among them, at the beginning, the input c0 and h0 of the ConvLSTM model are initialized to zero tensors of size H*W*C. In practical applications, H=W=16 and C=1 can be taken.
[0066] The image preprocessing process is specifically as follows: according to the size of the special marker and the electric railing part, the characteristic region of interest, i.e., the motion region of the railing and the special marker region, is determined, and each image frame is preprocessed, cropped, and histogram equalized according to the characteristic region of interest, etc., to ensure the consistency of the input data. The electric railing part is the part of the electric railing above the special marker size that can be selected during processing, in order to enrich the features of the region of interest.
[0067] The feature extraction process is specifically as follows: after image preprocessing, feature extraction is performed on the feature region of interest through mobileNet to obtain deep features of the feature region of interest, obtain spatial features x(t), and reduce the size of the spatial features x(t) to reduce the amount of calculation in the ConvLSTM model.
[0068] The structure diagram of the ConvLSTM model is as follows Figure 3 As shown in the figure, C(t-1) is the memory unit; C(t) is the memory unit updated at the current moment; h(t-1) is the hidden state at the previous moment, that is, the latent space of the previous image frame; (t) is the hidden state after update, that is, the latent space of the previous image frame; t is the current input, that is, the current image frame; Wh and Wx are the transfer matrix of the latent space and the transfer matrix of the image respectively; BN is batch normalization; b is bias; Wpeep is the conversion matrix; σ is sigmoid; f(t), i(t), and o(t) are the forget gate, input gate, and output gate respectively.
[0069] Specifically, the conv layer in the ConvLSTM model can obtain spatial features including railing edge information, railing surface texture information, changes in the shape of the railing or railing surface pattern, etc.; at the same time, the LSTM mechanism can be used to obtain spatial features including the moving speed, acceleration, and position change of the electric railing during the rise and fall process. Therefore, the ConvLSTM model is used to process and analyze the spatial feature information and temporal feature information of each image frame in the image frame to improve the overall judgment accuracy; and the ConvLSTM model will extract the spatial features of the current frame of the image through the convolution operation Wx, and then judge the opening and closing state of the railing through the LSTM gating mechanism combined with the historical image data.
[0070] Among them, when training the model, only the ConvLSTM model and the state classification CL need to be trained, and mobileNet uses the weights that have been trained in the public dataset ImageNet. During training, historical images of electric railings collected in advance by high-speed cameras are used, and all historical images are labeled according to the opening and closing status of the railings to construct a training set and complete the model training.
[0071] The state classification process is specifically as follows: for the latent space h(t) output by the ConvLSTM model, a fully connected layer and Softmax are used to classify the states of fully closed, partially open, and fully open.
[0072] Based on the above-mentioned image frame state recognition model, the collected image frame set is input into the image frame state recognition model to obtain a continuous state composed of the opening and closing states of the railings in continuous image frames. Furthermore, the railing opening and closing segments to be detected are obtained according to the part from partially open to fully open in the first frame or from partially open to fully closed in the continuous state, and accurate time calculation is performed on the railing opening and closing segments to be detected.
[0073] Since the speed curve of the electric barrier during the rise and fall process is usually accelerated to a certain speed first, and then decelerated when approaching the end point, it can be divided into the acceleration stage, the uniform speed stage, and the deceleration stage. In addition, the latent space h(t) output by the ConvLSTM model corresponding to different time points during the rise and fall of the electric barrier will also change accordingly. The greater the change of adjacent time points, the greater the change of adjacent latent space h(t).
[0074] Therefore, in this embodiment, the cosine similarity of the latent space h(t) of two adjacent image frames is calculated to determine the speed change of the electric railing during the rise and fall of the electric railing. Specifically, when the cosine similarity of the latent space h(t) of two adjacent image frames is 1, it means that there is no change between the two adjacent image frames, that is, the electric railing is in a stationary state and does not move; when the cosine similarity of the latent space h(t) of two adjacent image frames is lower, it means that the change between the two adjacent image frames is greater, that is, the movement speed of the electric railing is faster; based on the above, the calculation formula for the movement speed can be obtained: v =1- cos(h(t-1),h(t)).
[0075] In one embodiment, step S4 includes the following steps:
[0076] S41, obtaining a speed change set corresponding to a part of the continuous state, judging whether the change trend of the movement speed is consistent with the opening and closing state of the barrier according to the continuous movement speeds in the speed change set, and then going to step S42;
[0077] S42, taking the first frame partially opened or the first frame fully opened in the partially continuous state as the time starting point, calculating the time from the first frame partially opened to fully opened or the first frame partially opened to fully closed according to the sampling time interval, and taking the time as the opening and closing time of the railing.
[0078] In one embodiment, in S41, the process of determining whether the change trend of the motion speed is consistent with the opening and closing state of the barrier is:
[0079] Calculate the difference between two adjacent motion speeds in the speed change set in sequence;
[0080] According to the comparison between the difference between two adjacent motion speeds and the threshold, the change trend between the two adjacent motion speeds is obtained, and the change trend is divided into acceleration, uniform speed and deceleration;
[0081] A corresponding change trend chain is formed according to the change trend between two adjacent movement speeds. When the change trend chain is acceleration-constant speed-deceleration, it is determined that the change trend of the movement speed is consistent with the opening and closing state of the railing.
[0082] In one embodiment, the process of comparing the difference between two adjacent motion speeds with a threshold is as follows:
[0083] If the current speed is less than the next speed, determine whether the difference between the two exceeds a threshold value. If so, determine that the change trend between the current speed and the next speed is acceleration. If not, determine that the change trend between the current speed and the next speed is uniform.
[0084] If the current movement speed is greater than the next movement speed, determine whether the difference between the two exceeds a threshold. If so, determine that the change trend between the current movement speed and the next movement speed is deceleration; if not, determine that the change trend between the current movement speed and the next movement speed is uniform.
[0085] In one embodiment, during the opening process of the electric barrier, three image frames in the continuous states of fully closed, partially open, and partially open can be taken to accurately calculate the opening time of the electric barrier. Assuming that the time sequence number of fully closed is n, and the sampling time interval is 0.08s, the time sequence of the three image frames is n*t, (n+1)*t, (n+2)*t, and the corresponding motion speeds of the three image frames are estimated to be v(n), v(n+1), and v(n+2). The corresponding precise time starting point is: n*t +(v(n+2)-v(n+1)) / v(n+1)*t; Similarly, the closing time of the electric railing can be accurately calculated by taking three image frames with continuous states of partially open, partially open, and fully open. Assuming that the time sequence number of fully open is m, the time sequence of the three image frames is (m-2)*t, (m-1)*t, and m*t. The corresponding motion speeds of the three image frames are estimated to be: v(m-2), v(m-1), and v(m). The corresponding end point of the precise time is: (m-1)*t +(v(m-2)-v(m-1)) / v(m-1)*t. The precise opening and closing time is obtained by using the precise time starting point and end point. In addition, the same method can be used to calculate the precise time during the closing process of the electric railing.
[0086] In summary, in this embodiment, a method for quickly detecting the rise and fall time of an electric barrier for toll collection is proposed. A high-speed camera is used to collect a video or a continuous image frame set of the rise and fall process of the electric barrier, and the image frame set is input into an image frame state recognition model. Image feature extraction is performed through mobilenet. The dynamic behavior of each image frame in the image frame set is identified and analyzed through a ConvLSTM model to obtain an accurate opening and closing state of the barrier, so as to achieve high-precision time measurement. In addition, based on the image frame state recognition model, it is proposed to use the cosine similarity between two adjacent image frames to estimate the movement speed of the electric barrier at this moment, and the electric barrier is accurately detected according to its movement law of acceleration, uniform speed, and deceleration to obtain a more accurate rise and fall time. The method can be adapted to the detection of various toll stations, and is suitable for the detection accuracy of the rise and fall time of electric barriers of various levels in the national standard (F grade (less than 1.4s), O grade (1.4s-4s), S grade).
[0087] Example 2
[0088] A rapid detection system for the rise and fall time of an electric barrier for toll collection, using the rapid detection method for the rise and fall time of an electric barrier for toll collection, comprising:
[0089] Image frame acquisition module: collects image frame sets of electric railings at sampling time intervals through a high-speed camera;
[0090] Image frame state recognition module: input the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened;
[0091] Image frame motion speed calculation module: find the partial continuous states from the first frame partially open to fully open or from the first frame partially open to fully closed in sequence from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and connect the motion speeds in sequence to form a speed change set;
[0092] Railing opening and closing time detection module: determines whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state. If so, the railing opening and closing time is calculated based on the sampling time interval and the speed change set.
[0093] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. According to the technical essence of the present invention, within the spirit and principles of the present invention, any simple modification, equivalent replacement and improvement made to the above embodiment still falls within the protection scope of the technical solution of the present invention.
Claims
1. A method for quickly detecting the rise and fall time of an electric barrier for toll collection, characterized in that: The method comprises the following steps: S1, collecting image frames of the electric railing according to sampling time intervals by a high-speed camera; S2, inputting the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened; S3, sequentially find the partial continuous states from the first frame partially open to fully open or the first frame partially open to fully closed from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and sequentially connect the motion speeds to form a speed change set; The process of calculating the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous state is as follows: the latent space of each image frame corresponding to the partial continuous state is obtained by the ConvLSTM model, the cosine similarity of the latent space of two adjacent image frames is calculated, and the cosine similarity between the current image frame and the previous image frame is obtained in turn. The motion speed of the current image frame is calculated by the cosine similarity, that is, v = 1- cos(h(t-1),h(t)), where h(t) represents the latent space of the current image frame and h(t-1) represents the latent space of the previous image frame; S4, judging whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state, if so, calculating the railing opening and closing time according to the sampling time interval and the speed change set; The S4 includes the following steps: S41, obtaining a speed change set corresponding to a part of the continuous state, judging whether the change trend of the movement speed is consistent with the opening and closing state of the barrier according to the continuous movement speeds in the speed change set, and then going to step S42; In S41, the process of judging whether the change trend of the motion speed is in accordance with the opening and closing state of the railing is as follows: sequentially calculating the difference between two adjacent motion speeds in the speed change set; obtaining the change trend between the two adjacent motion speeds according to the comparison between the difference between the two adjacent motion speeds and the threshold, and the change trend is divided into acceleration, uniform speed and deceleration; forming a corresponding change trend chain according to the change trend between the two adjacent motion speeds, and when the change trend chain is acceleration-uniform speed-deceleration, it is judged that the change trend of the motion speed is in accordance with the opening and closing state of the railing; S42, taking the first frame partially opened or the first frame fully opened in the partially continuous state as the time starting point, calculating the time from the first frame partially opened to fully opened or the first frame partially opened to fully closed according to the sampling time interval, and taking the time as the opening and closing time of the railing.
2. A method for quickly detecting the rise and fall time of an electric barrier for toll collection according to claim 1, characterized in that: In S2, the process of inputting the image frame set into the image frame state recognition model to obtain the continuous state of the corresponding image frame set is: S21, determining a characteristic region of interest by using a special marker preset on the electric railing, and performing image preprocessing on each image frame according to the characteristic region of interest to obtain a preprocessed image frame set; S22, extracting features from the preprocessed image frame set through mobileNet to obtain spatial features of the feature region of interest; S23, performing a convolution operation on the image frame set according to the ConvLSTM model, sequentially advancing the spatial features of the current image frame through the convolution operation, and then combining the historical image data through the gating mechanism to determine the opening and closing state of the railing of the current image frame; S24, connecting the railing opening and closing states of each image frame in the image frame set to form a corresponding continuous state.
3. A method for quickly detecting the rise and fall time of an electric barrier for toll collection according to claim 2, characterized in that: The historical image data refers to image data obtained by annotating the opening and closing states of the electric railings in advance on historical images of the electric railings collected by a high-speed camera.
4. A method for quickly detecting the rise and fall time of an electric barrier for toll collection according to claim 2, characterized in that: The image preprocessing includes preprocessing cropping and histogram equalization.
5. A method for quickly detecting the rise and fall time of an electric barrier for toll collection according to claim 1, characterized in that: The process of comparing the difference between two adjacent motion speeds with the threshold is as follows: If the current speed is less than the next speed, determine whether the difference between the two exceeds a threshold value. If so, determine that the change trend between the current speed and the next speed is acceleration. If not, determine that the change trend between the current speed and the next speed is uniform. If the current movement speed is greater than the next movement speed, determine whether the difference between the two exceeds a threshold. If so, determine that the change trend between the current movement speed and the next movement speed is deceleration; if not, determine that the change trend between the current movement speed and the next movement speed is uniform.
6. A rapid detection system for the rise and fall time of electric barriers for toll collection, characterized in that: A method for quickly detecting the rise and fall time of an electric barrier for charging as described in any one of claims 1 to 5 is applied, comprising: Image frame acquisition module: collects image frame sets of electric railings at sampling time intervals through a high-speed camera; Image frame state recognition module: input the image frame set into the image frame state recognition model to obtain a continuous state consisting of the railing opening and closing states of the continuous image frames, wherein the railing opening and closing states include fully closed, partially opened, and fully opened; Image frame motion speed calculation module: find the partial continuous states from the first frame partially open to fully open or from the first frame partially open to fully closed in sequence from the continuous states, calculate the motion speed of each image frame by the cosine similarity of two adjacent image frames corresponding to the partial continuous states, and connect the motion speeds in sequence to form a speed change set; Railing opening and closing time detection module: determines whether the speed change set corresponding to the partial continuous state conforms to the railing opening and closing state. If so, the railing opening and closing time is calculated based on the sampling time interval and the speed change set.
Citation Information
Patent Citations
Ultrasonic flow meter and time difference measuring method thereof
CN103323063A
Determination method and device for re-detecting ground
CN108399641A