Video playing method and device, terminal equipment and storage medium
By identifying the original video files in the video surveillance system, extracting and adding target license plate numbers, and generating target video files, the problem of inefficiency in traditional systems when quickly positioning and tracking vehicles is solved, real-time tracking and efficient review of specific vehicles is achieved.
Patent Information
- Application Number
- CN202411986532.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
Traditional video surveillance systems seem unscrupulous when quickly positioning a specific vehicle, tracking its driving trajectory, or intercepting vehicle images within a specific time period. Manually reviewing videos is time-consuming and labor-intensive and easy to miss key information, and cannot meet the efficiency and accuracy requirements of modern traffic management and safety monitoring.
By obtaining the original video file, vehicle identification and license plate recognition are used to identify all vehicles and license plate numbers. When a video generation instruction for the target license plate number is received, a video frame containing the target vehicle is extracted, and the target license plate number is added in the vehicle location area to generate the final target video frame, and finally form the target video file and play it.
It realizes rapid positioning and real-time tracking of specific vehicles, reducing the time and cost of manual review. The generated video file contains the target vehicle and its license plate number, which is convenient for subsequent viewing and review.
Smart Images

Figure CN119854572A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and in particular, relates to a video playback method, apparatus, terminal device and storage medium. Background Art
[0002] With the rapid development of intelligent transportation systems and video surveillance technology, the demand for vehicle management and traffic incident tracing is growing. Although traditional video surveillance systems can record a large amount of video data, they are often unable to meet the needs of quickly locating specific vehicles, tracking their driving trajectories, or capturing vehicle images within a specific time period. Manual video review is not only time-consuming and laborious, but also prone to missing key information, and cannot meet the efficiency and accuracy requirements of modern traffic management and safety monitoring. Summary of the invention
[0003] The embodiments of the present application provide a video playback method, apparatus, terminal device, and storage medium, which can solve the problem that related technologies are difficult to track in real time when viewing a specific vehicle.
[0004] In a first aspect, an embodiment of the present application provides a method for playing a video, the method comprising:
[0005] Obtain an original video file, which contains a vehicle;
[0006] Perform vehicle recognition and license plate recognition on the original video file to identify all vehicles in the original video file;
[0007] When the license plate number is recognized, determining the vehicle corresponding to the license plate number;
[0008] When receiving a video generation instruction for a target license plate number, determining a target vehicle according to the target license plate number;
[0009] Extract all initial target video frames containing the target vehicle from the original video file;
[0010] Add the target license plate number to the target vehicle position area in the initial target video frame to obtain the final target video frame;
[0011] A target video file is formed according to the final target video frame, and the target video file is played.
[0012] In a second aspect, an embodiment of the present application provides a video playback device, including:
[0013] An acquisition module is used to acquire an original video file, wherein the original video file contains a vehicle;
[0014] The recognition module is used to perform vehicle recognition and license plate recognition on the original video file, and recognize all vehicles in the original video file;
[0015] A first determination module is used to determine the vehicle corresponding to the license plate number when the license plate number is recognized;
[0016] A second determination module is used to determine the target vehicle according to the target license plate number when receiving a video generation instruction for the target license plate number;
[0017] An extraction module, used for extracting all initial target video frames containing the target vehicle from the original video file;
[0018] An adding module is used to add a target license plate number to a target vehicle position area in an initial target video frame to obtain a final target video frame;
[0019] The playing module is used to compose a target video file according to the final target video frame and play the target video file.
[0020] In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned video playback method when executing the computer program.
[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned video playback method are implemented.
[0022] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the terminal device to execute the above-mentioned video playback method.
[0023] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform vehicle identification and license plate identification on the original video file, identify all vehicles in the original video file, and when the license plate number is identified, determine the corresponding vehicle of the license plate number, and when a video generation instruction for the target license plate number is received, determine the target vehicle according to the target license plate number, extract all initial target video frames containing the target vehicle from the original video file, add the target license plate number to the target vehicle position area in the initial target video frame, obtain the final target video frame, compose the target video file according to the final target video frame, and play the target video file. The implementation method of the present application can quickly locate and extract video clips related to the target vehicle through automated processing, reduce the time and cost of manual review, and realize real-time tracking of specific vehicles. The user only needs to specify the target license plate number to quickly generate a video file containing the target vehicle and its license plate number, which is convenient for subsequent viewing and review. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0025] Figure 1 It is a schematic diagram of the implementation flow of a video playback method provided in an embodiment of the present application;
[0026] Figure 2 It is a structural schematic diagram of a video playback device provided in an embodiment of the present application;
[0027] Figure 3 It is a schematic diagram of the structure of the terminal device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.
[0029] It should be noted that the terms "include", "comprises" and "have" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, terminal, product or device that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices. In the claims, specification and drawings of the present application, relational terms such as "first" and "second" are merely used to distinguish one entity / operation / object from another entity / operation / object, and do not necessarily require or imply any such real-time relationship or order between these entities / operations / objects.
[0030] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0031] With the rapid development of intelligent transportation systems and video surveillance technology, the demand for vehicle management and traffic incident tracing is growing. Although traditional video surveillance systems can record a large amount of video data, they are often unable to meet the needs of quickly locating specific vehicles, tracking their driving trajectories, or capturing vehicle images within a specific time period. Manual video review is not only time-consuming and laborious, but also prone to missing key information, and cannot meet the efficiency and accuracy requirements of modern traffic management and safety monitoring.
[0032] In view of this, the implementation method of the present application can quickly locate and extract video clips related to the target vehicle through automated processing, reducing the time and cost of manual review and achieving real-time tracking of specific vehicles. Users only need to specify the target license plate number to quickly generate a video file containing the target vehicle and its license plate number, which is convenient for subsequent viewing and review.
[0033] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0034] Figure 1 A schematic diagram of the implementation process of a video playback method provided in an embodiment of the present application is shown. The method can be applied to a terminal device, specifically a smart phone, a tablet computer, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, etc.
[0035] Specifically, the video playback method may include the following steps S101 to S107.
[0036] Step S101, obtaining an original video file.
[0037] The original video file may be video data about the vehicle that is directly collected by a camera or other video recording device without any processing or editing, that is, the original video file contains the vehicle.
[0038] In an implementation manner of the present application, the terminal device may obtain the original video file through a file reading interface or a video stream receiving interface.
[0039] Step S102, performing vehicle recognition and license plate recognition on the original video file to identify all vehicles in the original video file.
[0040] In an implementation manner of the present application, the terminal device may use a deep learning model (such as YOLO, SSD, etc.) to process the video frames frame by frame to detect and identify the vehicles and license plate numbers that appear in each frame of the original video file.
[0041] Step S103, when the license plate number is recognized, determine the vehicle corresponding to the license plate number.
[0042] The license plate number is a sequence of characters used to uniquely identify the vehicle, usually consisting of letters and numbers.
[0043] In the implementation manner of the present application, the terminal device can associate the license plate number with the corresponding vehicle through the spatial position relationship between the vehicle and the license plate number, thereby determining the vehicle corresponding to the license plate number.
[0044] Step S104, when a video generation instruction for a target license plate number is received, a target vehicle is determined according to the target license plate number.
[0045] The target license plate number is a license plate number specified by the user and desired to be found and extracted from the original video file. The target vehicle corresponds to the target license plate number and is a vehicle specified by the user that requires special attention.
[0046] In the implementation manner of the present application, the terminal device can search for a vehicle matching the target license plate number in the database of identified vehicles and license plates, thereby locating the target vehicle that the user is concerned about according to the user's instructions.
[0047] Step S105, extracting all initial target video frames containing the target vehicle from the original video file.
[0048] The initial target video frames are all the video frames containing the target vehicle in the original video file.
[0049] In the implementation of the present application, the terminal device can traverse each frame of the original video file to check whether it contains the target vehicle, and extract it if it does. It can also obtain structured data of the target vehicle, and determine which video frames contain the target vehicle based on the structured data, thereby determining the initial target video frame.
[0050] Step S106, adding the target license plate number to the target vehicle position area in the initial target video frame to obtain a final target video frame.
[0051] The final target video frame is a video frame obtained by adding the target license plate number to the target vehicle position area of the initial target video frame.
[0052] In an embodiment of the present application, the terminal device can use image synthesis technology (such as image overlay, transparency adjustment, etc.) to add clear license plate number information in the target vehicle location area, thereby ensuring that in the target video file, regardless of whether the target vehicle is clear, its license plate number can be clearly displayed.
[0053] Step S107, forming a target video file according to the final target video frame, and playing the target video file.
[0054] In the implementation of the present application, the terminal device can combine all the final target video frames into a video file in order and play it using video playback software or library. By generating a video file containing only the target vehicle and its license plate number, it is convenient for users to view and review.
[0055] The implementation methods of this application can be applied to the following usage scenarios:
[0056] Traffic violation monitoring: Traffic police departments can use this method to quickly locate and extract videos of vehicles that violate traffic regulations. Parking lot management: Parking lot managers can use this method to quickly find and confirm vehicle information entering and leaving the parking lot, thereby improving management efficiency and safety.
[0057] Security incident tracing: When a traffic accident, theft or other security incident occurs, the police can use this method to quickly identify the suspect vehicle and provide key clues for solving the case.
[0058] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform vehicle identification and license plate identification on the original video file, identify all vehicles in the original video file, and when the license plate number is identified, determine the corresponding vehicle of the license plate number, and when a video generation instruction for the target license plate number is received, determine the target vehicle according to the target license plate number, extract all initial target video frames containing the target vehicle from the original video file, add the target license plate number to the target vehicle position area in the initial target video frame, obtain the final target video frame, compose the target video file according to the final target video frame, and play the target video file. The implementation method of the present application can quickly locate and extract video clips related to the target vehicle through automated processing, reduce the time and cost of manual review, and realize real-time tracking of specific vehicles. The user only needs to specify the target license plate number to quickly generate a video file containing the target vehicle and its license plate number, which is convenient for subsequent viewing and review.
[0059] In some specific implementations of the present application, the above-mentioned vehicle identification and license plate recognition are performed on the original video file to identify all vehicles in the original video file, which may specifically include steps S401 to S406.
[0060] Step S401, performing border detection on all video frames in the original video file, and detecting the vehicle border corresponding to the vehicle appearing in each video frame.
[0061] In the implementation mode of the present application, the terminal device may use a deep learning model (such as YOLO, SSD, etc.) for target detection. Specifically, the video file may be read frame by frame and input into the deep learning model for processing. The deep learning model may output the position and size of the vehicle in each frame, form a vehicle border, separate the vehicle from the complex background, and provide a basis for subsequent vehicle recognition and license plate recognition.
[0062] Step S402, determining the vehicles according to the vehicle borders, and numbering all the vehicles.
[0063] In the implementation of the present application, the terminal device can determine the vehicle in each frame based on the vehicle border output by the deep learning model. A counter or hash table can also be used to assign a unique number to each detected vehicle. This number remains unchanged during the video processing process and is used to track the position of the same vehicle in different frames, facilitating subsequent tracking and management of the vehicle.
[0064] Step S403, recording the first structured data of all vehicles in the original video file.
[0065] The first structured data is a data structure for recording vehicle-related information, and includes vehicle location, vehicle timestamp, and vehicle number.
[0066] In the implementation of the present application, the terminal device can create a data structure (such as a dictionary or a database table) to store relevant information about the vehicle. For each detected vehicle, its number, location (coordinates of the frame), timestamp (timestamp of the frame) and other information are recorded in the data structure, thereby providing data support for subsequent vehicle behavior analysis.
[0067] Step S404, locating the license plate area in the vehicle frame.
[0068] In the implementation of the present application, the terminal device can use image processing technology (such as color space conversion, morphological processing, etc.) to enhance the features of the license plate area within the vehicle frame, and use a license plate positioning algorithm (such as an analysis algorithm based on texture features) to locate the license plate area in the enhanced image, thereby providing accurate license plate location information for subsequent license plate character segmentation and recognition.
[0069] Step S405, performing character segmentation and recognition on the license plate area to obtain the license plate number.
[0070] In the implementation of the present application, the terminal device may first pre-process the license plate area, such as denoising, binarization, etc., to improve the accuracy of character segmentation. Then, a character segmentation algorithm (such as a segmentation algorithm based on vertical projection) is used to segment the characters on the license plate. Then, a character recognition algorithm (such as an OCR algorithm based on deep learning) is used to recognize the segmented characters and combine them into a license plate number.
[0071] Step S406, recording the second structured data of all license plate numbers in the original video file.
[0072] The second structured data is a data structure that records license plate related information, and the second structured data includes the license plate position, license plate timestamp, and license plate number.
[0073] In the implementation of the present application, the terminal device can create a data structure (such as a dictionary or a database table) to store the relevant information of the license plate. And for each recognized license plate, its position (coordinates of the license plate area), timestamp (timestamp of the frame), license plate number and other information are recorded in the data structure.
[0074] The implementation method of the present application can automatically extract detailed information of vehicles and license plates from original video files and record them in a structured manner, thereby greatly improving the efficiency and accuracy of video data processing, and providing strong technical support for the fields of intelligent transportation systems, vehicle monitoring, etc. At the same time, the implementation method of the present application also has good scalability and flexibility, and can adapt to the needs of different scenarios.
[0075] In some specific embodiments of the present application, when the license plate number is identified, determining the vehicle corresponding to the license plate number may specifically include steps S501 to S505.
[0076] Step S501, obtaining the license plate position of the license plate number in the corresponding video frame.
[0077] In an implementation manner of the present application, the terminal device may read the license plate position in the second structured data of the license plate number, and obtain the license plate position of the license plate number in the corresponding video frame.
[0078] Step S502, obtaining the vehicle positions of all vehicles in the corresponding video frame.
[0079] In an implementation manner of the present application, the terminal device may read the vehicle positions in the first structured data of all vehicles in the corresponding video frame, thereby obtaining the vehicle positions of all vehicles in the corresponding video frame.
[0080] Step S503, matching the license plate position with the vehicle position.
[0081] In the implementation of the present application, the terminal device can traverse all detected vehicle positions, calculate the relative distance or overlap between each vehicle position and the license plate position, and set a threshold value, when the relative distance is less than the threshold value or the overlap degree is greater than a certain ratio, the license plate position is considered to match the vehicle position.
[0082] Step S504, when the license plate position is matched to the vehicle position, the vehicle corresponding to the matched vehicle position is determined, corresponding to the license plate number.
[0083] In an implementation manner of the present application, once the license plate position is successfully matched with a vehicle position, the terminal device can determine that the vehicle is the vehicle corresponding to the license plate number and record the vehicle number.
[0084] Step S505, recording the correspondence between the license plate number and the matching vehicle, and adding the correspondence to the first structured data.
[0085] In an implementation manner of the present application, the terminal device may add the correspondence between the license plate number and the matching vehicle to the first structured data. Specifically, the license plate number may be used as a key and the vehicle number may be used as a value and added to the first structured data for subsequent use.
[0086] The implementation method of the present application ensures that the correspondence between the license plate number and the vehicle is accurate by accurately matching the license plate position with the vehicle position, and records the correspondence between the license plate number and the vehicle in a structured manner to facilitate subsequent data management and analysis.
[0087] In some specific implementations of the present application, the above-mentioned extraction of all initial target video frames containing the target vehicle from the original video file may specifically include steps S601 to S604.
[0088] Step S601, obtaining target first structured data corresponding to the target vehicle.
[0089] In an implementation manner of the present application, the terminal device may search for target first structured data matching the target vehicle from a database.
[0090] Step S602: extracting a first target video frame corresponding to the target vehicle from the original video file according to the target first structured data.
[0091] In an implementation manner of the present application, the terminal device may extract a video frame containing the target vehicle, ie, the first target video frame, from the original video file according to a timestamp or frame number recorded in the target first structured data.
[0092] Step S603: According to the first target video frame, vehicle tracking is performed on non-first target video frames in the original video file to obtain a vehicle tracking result.
[0093] In an embodiment of the present application, the terminal device can determine the initial position of the target vehicle in the extracted first target video frame. Then, a vehicle tracking algorithm (such as tracking based on feature matching, tracking based on detection, etc.) is used to continuously track the target vehicle in subsequent non-first target video frames. During the tracking process, the terminal device can continuously update the position information of the target vehicle and can make corrections based on contextual information (such as background changes, vehicle motion trajectory, etc.) to obtain a vehicle tracking result.
[0094] Step S604: determine a second target video frame according to the vehicle tracking result, and extract the second target video frame from the original video file.
[0095] In an embodiment of the present application, the terminal device can determine, based on the vehicle tracking results, which video frames other than the first target video frames contain target vehicles (even if they do not contain obvious target vehicle features, such as license plate numbers), and extract these video frames as second target video frames.
[0096] The implementation methods of the present application can significantly improve the speed and efficiency of video processing by reducing unnecessary calculations. And by combining the first target video frame and the second target video frame, more complete and accurate vehicle motion trajectory information can be obtained. For application scenarios that require real-time or near real-time processing (such as intelligent traffic monitoring, vehicle tracking, etc.), faster processing speeds and more accurate vehicle tracking results can be provided. Even when the characteristics of the target vehicle are not obvious (such as the license plate number is blocked), the target vehicle can be continuously tracked through the vehicle tracking algorithm, thereby significantly improving the user experience.
[0097] In some specific embodiments of the present application, the target license plate number is added to the target vehicle position area in the initial target video frame to obtain the final target video frame, which may specifically include steps S701 to S704.
[0098] Step S701, determine the target vehicle location area.
[0099] In an embodiment of the present application, the terminal device may use a vehicle detection or tracking algorithm to identify the bounding box of the target vehicle in the initial target video frame, and determine the location area of the target vehicle based on the coordinates of the bounding box.
[0100] Step S702, obtaining the target license plate number.
[0101] In an implementation manner of the present application, the terminal device may read a character string representation of the target license plate number from the first structured data of the target license plate number.
[0102] Step S703, generating a target license plate number image according to the target license plate number.
[0103] In an implementation manner of the present application, the terminal device can select appropriate parameters such as font, size, color, etc. according to a preset template, convert the character string of the target license plate number into an image format, and obtain the target license plate number image.
[0104] Step S704: superimpose the license plate image onto the target vehicle location area.
[0105] In the implementation of the present application, the terminal device can determine the position of the license plate image in the target vehicle location area (such as the license plate is usually located below the front of the vehicle or above the rear). Then use image overlay technology (such as transparency blending, image synthesis, etc.) to overlay the license plate image into the target vehicle location area, and adjust the background, lighting and other conditions of the license plate image and the target vehicle location area to obtain a natural overlay effect.
[0106] The implementation method of this application ensures the accurate correspondence between the target vehicle and the license plate number by accurately adding the license plate number image, providing richer data support for the fields of intelligent transportation systems and vehicle monitoring, and improving the overall performance of the system. For users who need to view or manage vehicle information in video frames, the video frame with the license plate number added will provide a more intuitive and convenient way to display information.
[0107] In some embodiments of the present application, when a video generation instruction for a target license plate number is received, before determining a target vehicle according to the target license plate number, the method may include steps S801 and S802.
[0108] Step S801, generating a corresponding license plate number button on the display interface according to the license plate number.
[0109] In the implementation mode of the present application, after identifying all the license plate numbers in the original video file, the terminal device can obtain all the license plate numbers and generate button elements according to the license plate numbers. Specifically, the license plate number button element can be generated at a specified position of the display interface using a graphical interface development tool (such as HTML, CSS, JavaScript, etc.), and the specific license plate number is used as the label or prompt information of the button. By generating a license plate number button, an intuitive and interactive interface element is provided to the user, allowing the user to trigger operations related to the license plate number by clicking the button.
[0110] Step S802: Establish a mapping relationship between the license plate number button and the corresponding video generation instruction.
[0111] In an implementation manner of the present application, the terminal device may define a series of video generation instructions according to the requirements of the application scenario, such as "generate a close-up video of the license plate number", "generate a video of the movement trajectory of the vehicle corresponding to the license plate number", etc.
[0112] Specifically, the terminal device can create a mapping table or data structure to associate the license plate number button with the corresponding video generation instruction. The mapping table can be a simple key-value pair set, where the key is the identifier of the license plate number button (such as the button ID) and the value is the corresponding video generation instruction. Then add a click event listener to the license plate number button. When the user clicks the button, the event listener is triggered, and the corresponding video generation instruction is found according to the mapping table and executed. By establishing a mapping relationship between the license plate number button and the video generation instruction, the function of users generating or processing videos by clicking buttons is realized, which improves the interactivity and ease of use of the system.
[0113] The implementation of the present application can provide users with an intuitive and easy-to-use interactive interface by generating a license plate number button and establishing a mapping relationship with a video generation instruction, so that users can easily trigger operations related to the license plate number, thereby improving the user experience. It is also possible to define a variety of video generation instructions according to different application scenarios and requirements, and associate them with different license plate number buttons through mapping relationships, thereby realizing flexible video generation and processing functions.
[0114] In some implementations of the present application, the target video file includes a dynamic virtual file, the target video file is composed according to the final target video frame, and the target video file is played, which may specifically include steps S901 to S903.
[0115] Step S901, obtaining target structured data of the final target video frame.
[0116] In an implementation manner of the present application, the terminal device may obtain target structured data of the final target video frame from a database.
[0117] Step S902: Create a virtual file object according to the target structured data.
[0118] In the implementation manner of the present application, the terminal device can create a virtual file object in the memory based on the acquired target structured data. The virtual file object will be used as a container of a dynamic virtual file to store and manage the final target video frame. By creating a virtual file object, the IO overhead of traditional file storage is avoided, and the efficiency and flexibility of video processing are improved.
[0119] Step S903, adding the final target video frame to the virtual file object, obtaining a dynamic virtual file, and playing the dynamic virtual file.
[0120] In the implementation manner of the present application, the terminal device can add the data of the final target video frame to the virtual file object frame by frame according to the requirements of the target structured data. Specifically, the final target video frame can be decoded, converted, and timestamp adjusted. After obtaining the dynamic virtual file, the dynamic virtual file is played through the player. By dynamically generating and managing video frames, a dynamic virtual file that can be played instantly is obtained, which improves the real-time and interactivity of video playback.
[0121] The implementation method of the present application avoids the IO bottleneck of traditional file storage and reading through dynamic virtual files, and improves the speed and efficiency of video processing. In addition, since dynamic virtual files do not exist physically, they do not need to occupy actual hard disk space, which helps save storage resources.
[0122] Figure 2The schematic diagram of the structure of a video playback device provided in an embodiment of the present application is shown. The video playback device 2 can be configured on a terminal device. Specifically, the video playback device 2 can include:
[0123] The acquisition module 201 is used to acquire an original video file, wherein the original video file contains a vehicle;
[0124] Identification module 202, used to perform vehicle identification and license plate recognition on the original video file, and identify all vehicles in the original video file;
[0125] A first determination module 203 is used to determine the vehicle corresponding to the license plate number when the license plate number is identified;
[0126] The second determination module 204 is used to determine the target vehicle according to the target license plate number when receiving a video generation instruction for the target license plate number;
[0127] An extraction module 205 is used to extract all initial target video frames containing the target vehicle from the original video file;
[0128] An adding module 206 is used to add a target license plate number to the target vehicle position area in the initial target video frame to obtain a final target video frame;
[0129] The playing module 207 is used to compose a target video file according to the final target video frame and play the target video file.
[0130] The beneficial effects of the embodiments of the present application compared with the prior art are as follows: the embodiments of the present application obtain the original video file, perform vehicle identification and license plate identification on the original video file, identify all vehicles in the original video file, and when the license plate number is identified, determine the corresponding vehicle of the license plate number, and when a video generation instruction for the target license plate number is received, determine the target vehicle according to the target license plate number, extract all initial target video frames containing the target vehicle from the original video file, add the target license plate number to the target vehicle position area in the initial target video frame, obtain the final target video frame, compose the target video file according to the final target video frame, and play the target video file. The implementation method of the present application can quickly locate and extract video clips related to the target vehicle through automated processing, reduce the time and cost of manual review, and realize real-time tracking of specific vehicles. The user only needs to specify the target license plate number to quickly generate a video file containing the target vehicle and its license plate number, which is convenient for subsequent viewing and review.
[0131] In some implementations of the present application, the identification module 202 is further used to:
[0132] Perform border detection on all video frames in the original video file, and detect the vehicle border corresponding to the vehicle appearing in each video frame;
[0133] Identify vehicles based on their borders and number all vehicles;
[0134] Recording the first structured data of all vehicles in the original video file, the first structured data including the vehicle position, vehicle timestamp, and vehicle number;
[0135] Locate the license plate area within the vehicle bounding box;
[0136] Perform character segmentation and recognition on the license plate area to obtain the license plate number;
[0137] The second structured data of all license plate numbers in the original video file is recorded, and the second structured data includes the license plate position, the license plate timestamp, and the license plate number.
[0138] In some implementations of the present application, the first determining module 203 is further configured to:
[0139] Get the license plate position of the license plate number in the corresponding video frame;
[0140] Get the vehicle positions of all vehicles in the corresponding video frame;
[0141] Matching license plate location with vehicle location;
[0142] When the license plate position is matched to the vehicle position, the vehicle corresponding to the matched vehicle position is determined, corresponding to the license plate number;
[0143] The correspondence between the license plate number and the matching vehicle is recorded, and the correspondence is added to the first structured data.
[0144] In some embodiments of the present application, the extraction module 205 is further used to:
[0145] Acquire target first structured data corresponding to the target vehicle;
[0146] Extracting a first target video frame corresponding to the target vehicle from the original video file according to the target first structured data;
[0147] According to the first target video frame, a vehicle is tracked on a non-first target video frame in the original video file to obtain a vehicle tracking result;
[0148] A second target video frame is determined according to the vehicle tracking result, and the second target video frame is extracted from the original video file.
[0149] In some implementations of the present application, the adding module 206 is further used to:
[0150] Determine the target vehicle location area;
[0151] Get the target license plate number:
[0152] Generate a target license plate number image based on the target license plate number:
[0153] Overlay the license plate image onto the target vehicle location area.
[0154] In some implementations of the present application, the video playback device 2 further includes a generation module for:
[0155] Generate a corresponding license plate number button on the display interface according to the license plate number;
[0156] Establish a mapping relationship between the license plate number button and the corresponding video generation instruction.
[0157] In some implementations of the present application, the target video file includes a dynamic virtual file, and the playback module 207 is further used to:
[0158] Obtain target structured data of the final target video frame;
[0159] Create a virtual file object based on the target structured data;
[0160] The final target video frame is added to the virtual file object to obtain a dynamic virtual file, and the dynamic virtual file is played.
[0161] like Figure 3 , which is a schematic diagram of a terminal device provided in an embodiment of the present application. The terminal device 3 may include: a processor 301, a memory 302, and a computer program 303 stored in the memory 302 and executable on the processor 301, such as a video playback program. When the processor 301 executes the computer program 303, the steps in the above-mentioned video playback method embodiments are implemented.
[0162] The computer program may be divided into one or more modules / units, one or more modules / units are stored in the memory 302 and executed by the processor 301 to complete the present application. One or more modules / units may be a series of computer program instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program in the terminal device.
[0163] The terminal device may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of a terminal device and does not constitute a limitation of the terminal device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal device may also include input and output devices, network access devices, buses, etc.
[0164] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0165] The memory 302 may be an internal storage unit of the terminal device, such as a hard disk or memory of the terminal device. The memory 302 may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal device. Further, the memory 302 may also include both an internal storage unit of the terminal device and an external storage device. The memory 302 is used to store computer programs and other programs and data required by the terminal device. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0166] It should be noted that, for the convenience and brevity of description, the structure of the above-mentioned terminal device can also refer to the specific description of the structure in the method embodiment, which will not be repeated here.
[0167] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0168] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned video playback method can be implemented.
[0169] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned video playback method when executing the computer program product.
[0170] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0171] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0172] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0174] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0175] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0176] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A video playback method, characterized in that: The method comprises: Acquire an original video file, wherein the original video file contains a vehicle; Performing vehicle identification and license plate recognition on the original video file to identify all vehicles in the original video file; When the license plate number is identified, determining the vehicle corresponding to the license plate number; When receiving a video generation instruction for a target license plate number, determining a target vehicle according to the target license plate number; Extracting all initial target video frames containing the target vehicle from the original video file; Add the target license plate number to the target vehicle position area in the initial target video frame to obtain a final target video frame; A target video file is formed according to the final target video frame, and the target video file is played.
2. The video playback method according to claim 1, characterized in that: The performing vehicle identification and license plate recognition on the original video file to identify all vehicles in the original video file includes: Performing border detection on all video frames in the original video file to detect a vehicle border corresponding to a vehicle appearing in each video frame; Determine the vehicle according to the vehicle border, and number all the vehicles; Recording first structured data of all the vehicles in the original video file, wherein the first structured data includes vehicle position, vehicle timestamp, and vehicle number; Locating a license plate region within the vehicle border; Performing character segmentation and recognition on the license plate area to obtain the license plate number; Record the second structured data of all the license plate numbers in the original video file, where the second structured data includes the license plate position, license plate timestamp, and license plate number.
3. The video playback method according to claim 2, characterized in that: When the license plate number is identified, determining the vehicle corresponding to the license plate number includes: Obtaining the license plate position of the license plate number in the corresponding video frame; Obtaining vehicle positions of all the vehicles in the corresponding video frame; matching the license plate position with the vehicle position; When the license plate position is matched to the vehicle position, determining the vehicle corresponding to the matched vehicle position corresponds to the license plate number; The correspondence between the license plate number and the matching vehicle is recorded, and the correspondence is added to the first structured data.
4. The video playback method according to claim 3, characterized in that: The step of extracting all initial target video frames containing the target vehicle from the original video file comprises: Acquire target first structured data corresponding to the target vehicle; Extracting a first target video frame corresponding to the target vehicle from the original video file according to the target first structured data; According to the first target video frame, performing vehicle tracking on non-first target video frames in the original video file to obtain a vehicle tracking result; A second target video frame is determined according to the vehicle tracking result, and the second target video frame is extracted from the original video file.
5. The video playback method according to claim 2, characterized in that: The step of adding the target license plate number to the target vehicle position area in the initial target video frame to obtain a final target video frame includes: Determining the target vehicle location area; Get the target license plate number: Generate a target license plate number image according to the target license plate number: The license plate number image is superimposed on the target vehicle position area.
6. The video playback method according to claim 2, characterized in that: When receiving a video generation instruction for a target license plate number, before determining a target vehicle according to the target license plate number, the method further includes: Generating a corresponding license plate number button on the display interface according to the license plate number; A mapping relationship is established between the license plate number button and the corresponding video generation instruction.
7. The video playback method according to claim 2, characterized in that: The target video file includes a dynamic virtual file, and the target video file is formed according to the final target video frame, and the target video file is played, including: Acquire target structured data of the final target video frame; Creating a virtual file object according to the target structured data; The final target video frame is added to the virtual file object to obtain the dynamic virtual file, and the dynamic virtual file is played.
8. A video playback device, characterized in that: include: An acquisition module, used for acquiring an original video file, wherein the original video file contains a vehicle; An identification module, used to perform vehicle identification and license plate recognition on the original video file, and identify all vehicles in the original video file; A first determination module is used to determine the vehicle corresponding to the license plate number when the license plate number is identified; A second determination module is used to determine a target vehicle according to the target license plate number when receiving a video generation instruction for the target license plate number; An extraction module, used for extracting all initial target video frames containing the target vehicle from the original video file; An adding module, used for adding the target license plate number to the target vehicle position area in the initial target video frame to obtain a final target video frame; The playing module is used to form a target video file according to the final target video frame and play the target video file.
9. A terminal device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the video playback method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the video playback method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Vehicle video characteristic extraction system and vehicle video characteristic extraction method based on video structure description
CN102982311A
License plate information and vehicle feature fusion vehicle trajectory tracking method
CN111666860A
Vehicle license plate recognition method and device
CN112115939A
Method and device for matching license plate information, equipment and storage medium
CN116912531A
Roadway Control System and Vehicle Identification Method Using the Same
KR101686225B1