Picture playback method, device, computer equipment, and storage medium
By preloading and storing pictures collected by multiple cameras in timestamps and storing them into the image pool, the video streaming problem caused by camera switching is solved, and the smooth tracking of the target object trajectory is achieved.
Patent Information
- Application Number
- CN201910516020.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-14
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2039-06-14
AI Technical Summary
In the prior art, the video stream switching is time-consuming in the target object tracking method based on multiple cameras, resulting in stuttering during the video stream switching and playback, affecting fluency.
By preloading more than one cameras according to the corresponding acquisition timestamp, the pictures are stored in the picture pool, and they are taken out and played in sequence according to the arrangement order in the picture pool, and combined with the marking of the coordinates of the target object, the tracking of the target object trajectory is achieved.
There is no need to switch video streams during the picture playback process, which improves the smoothness of the target tracking and ensures continuous tracking of the target track.
Smart Images

Figure CN112084367B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of multimedia technology, and in particular to a method, apparatus, computer device, and storage medium for playing pictures. Background Art
[0002] With the development of multimedia technology, the target object's trajectory can be tracked based on videos captured by multiple cameras and carrying the same target object. At present, the method of tracking the target object's trajectory based on multiple cameras is usually to play the video stream captured by the camera with the target object in the current field of view. When the target object enters the field of view of another camera, it is necessary to manually switch to the other camera to play the video stream captured by the other camera, thereby tracking the target object's trajectory. However, this method of tracking the target object's trajectory has the problem that the video stream switching is time-consuming, resulting in a freeze phenomenon during the video stream switching and playback process, which leads to an unsmooth tracking of the target object's trajectory. Summary of the Invention
[0003] Based on this, it is necessary to provide a picture playback method, device, computer equipment and storage medium that can improve the smoothness of target trajectory tracking in response to the above technical problems.
[0004] A method for playing pictures, comprising:
[0005] Preloading more than one picture according to corresponding acquisition timestamps; each picture includes at least a portion of the same target object;
[0006] Store the preloaded images into the image pool in sequence;
[0007] Take out the pictures in the order of arrangement in the picture pool;
[0008] Play the pictures taken from the picture pool in sequence.
[0009] In one embodiment, the method further comprises:
[0010] Get the corresponding target coordinates for each image;
[0011] Arrange the target object coordinates according to the acquisition timestamps of the corresponding images and store them in a coordinate pool;
[0012] When taking out the picture, the corresponding target object coordinates are taken out in sequence according to the arrangement order in the coordinate pool;
[0013] When playing the picture, the target object is marked in the played picture according to the target object coordinates.
[0014] In one embodiment, preloading more than one picture according to corresponding acquisition timestamps includes:
[0015] Obtain a picture address sequence; the picture address sequence includes picture addresses of more than one picture, and the picture addresses in the picture address sequence are arranged according to acquisition timestamps of corresponding pictures;
[0016] Traversing the picture addresses in the picture address sequence;
[0017] Preload the corresponding pictures according to the traversed picture addresses.
[0018] In one embodiment, the picture address sequence is generated by the following steps:
[0019] When the more than one pictures are captured by multiple cameras respectively, the picture addresses of the pictures from the same camera are sorted into picture address subsequences according to the capture timestamps; and then the picture address subsequences are sorted in time sequence to form a picture address sequence.
[0020] In one embodiment, the step of preloading more than one picture according to the corresponding acquisition timestamps is performed periodically according to a preset period.
[0021] In one embodiment, before extracting the images in sequence according to the arrangement order in the image pool, the method further includes:
[0022] Monitoring the image pool length of the image pool;
[0023] When the monitored picture pool length is greater than or equal to a preset threshold, the process jumps to the step of sequentially extracting pictures according to the arrangement order in the picture pool and continues to execute.
[0024] In one embodiment, the method further comprises:
[0025] Monitor the number of pictures with the played tag in the picture pool;
[0026] When the number of monitored images is greater than or equal to a preset number threshold, the image carrying the played tag is deleted from the image pool.
[0027] In one embodiment, the method further comprises:
[0028] Real-time detection of preset trigger operations;
[0029] When a preset trigger operation is detected, a corresponding picture playback control instruction is triggered according to the preset trigger operation;
[0030] The playing of the picture is controlled according to the picture playing instruction.
[0031] In one embodiment, the picture playback control instruction includes a pause playback instruction, a replay instruction, a full-screen playback instruction, an exit full-screen playback instruction, a screenshot instruction, an accelerated playback instruction, or a decelerated playback instruction.
[0032] A picture playing device, comprising:
[0033] A preloading module, configured to preload more than one image according to corresponding acquisition timestamps; each image includes at least a portion of the same target object;
[0034] The storage module is used to store preloaded images into the image pool in sequence;
[0035] An extracting module is used to extract pictures in sequence according to the arrangement order in the picture pool;
[0036] The playing module is used to play the pictures taken out from the picture pool in sequence.
[0037] In one of the embodiments, the apparatus further comprises an acquisition module;
[0038] The acquisition module is used to obtain the coordinates of the target object corresponding to each picture;
[0039] The storage module is further configured to store the target object coordinates into a coordinate pool according to the acquisition timestamps of the corresponding images;
[0040] The extraction module is further configured to extract the corresponding target object coordinates in sequence according to the arrangement order in the coordinate pool when extracting the image;
[0041] The playback module is further configured to mark the target object in the played picture according to the target object coordinates when playing the picture.
[0042] In one embodiment, the apparatus further comprises:
[0043] The monitoring module is used to monitor the image pool length of the image pool; when the monitored image pool length is greater than or equal to a preset threshold, the retrieval module is triggered to execute the step of sequentially retrieving images according to the arrangement order in the image pool.
[0044] A computer device includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the picture playing method described in each of the above embodiments when executing the computer program.
[0045] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the picture playing method described in each of the above embodiments.
[0046] The above-mentioned image playback method, apparatus, computer device, and storage medium preload images captured by more than one camera and containing at least a portion of the same target object according to the corresponding capture time and sequentially store them into an image pool, so as to achieve tracking of the target object's trajectory during the sequential playback of the images. When playing the images captured by the more than one camera, the corresponding images can be quickly retrieved and played sequentially according to the order in which the images are arranged in the image pool, without switching the video streams captured by different cameras. In other words, there is no time-consuming video stream switching caused by video stream switching during the image playback process, which can improve the smoothness of image playback and thus improve the smoothness of target object trajectory tracking based on more than one camera. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 This is a diagram showing an application scenario of a picture playing method in one embodiment;
[0048] Figure 2 1 is a flow chart of a method for playing pictures in one embodiment;
[0049] Figure 3 is a flowchart of a picture playing method in another embodiment;
[0050] Figure 4 This is a structural block diagram of a picture playback device in one embodiment;
[0051] Figure 5 is a structural block diagram of a picture playing device in another embodiment;
[0052] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] The picture playing method provided by this application can be applied to Figure 1In the application environment shown. The terminal 102 communicates with the server 104 through the network, and the camera 106 (including 106a, 106b...106n) communicates with the server 104 through the network. For more than one picture captured by more than one camera and containing at least a part of the same target object, the server 104 preloads them according to the corresponding acquisition timestamps and stores them in the picture pool in sequence. When playing the pictures, the corresponding pictures are taken out in sequence according to the arrangement order in the picture pool and played. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented as an independent server or a server cluster consisting of multiple servers.
[0055] In one embodiment, the terminal 102 can call a preconfigured image playback plug-in through a browser to implement the image playback methods provided in the following embodiments. The terminal 102 can also parse a web page file requested based on a preset URL through a browser, and execute the parsed JS code (Javascript, a scripting language) when the JS code is parsed in the web page file to implement the image playback methods provided in the following embodiments. The terminal 102 can also trigger the call of a preconfigured image playback plug-in to implement the image playback methods provided in the following embodiments when executing the parsed JS code.
[0056] In one embodiment, server 104 may be an independent server or server cluster integrating functions such as web content storage, image address storage, and image storage, or a server cluster consisting of web content storage servers, image address storage servers, and image storage servers.
[0057] In one embodiment, Figure 2 As shown, a picture playing method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:
[0058] S202 : Preload more than one picture according to corresponding acquisition timestamps; each picture includes at least a portion of the same target object.
[0059] The acquisition timestamp refers to the time the camera captured the image. Preloading refers to loading an image based on its address. Specifically, it refers to loading an image as an image object based on the address. An image object is a representation of an image and includes various attributes such as its dimensions, size, and pixels. The target object is the specific object or thing to be tracked, such as a person, animal, or vehicle.
[0060] Specifically, the terminal obtains the picture addresses and acquisition timestamps of pictures captured by more than one camera and including at least a portion of the same target object, and preloads the picture according to the picture address of the corresponding picture according to the acquisition timestamp of each picture.
[0061] In one embodiment, the terminal preloads more than one picture as a picture object according to the picture addresses of the corresponding pictures in a time sequence of respective acquisition timestamps of the pictures.
[0062] In one embodiment, when a preset trigger condition is detected, the terminal triggers the generation of an image acquisition request and sends it to the server, and receives the image addresses and acquisition timestamps of the images collected by more than one camera and including at least a portion of the same target object, which are queried and fed back by the server. The image acquisition request carries the target object identifier and the specified time period of the same target object, and may also carry the camera identifiers of more than one camera. Based on the target object identifier and the specified time period in the image acquisition request, the server queries for images that carry at least a portion of the corresponding target object and whose acquisition timestamps are within the specified time period. It may also filter images collected by the corresponding camera from the queried images based on the camera identifier specified in the image acquisition request, and feeds back the image addresses of the filtered images to the terminal.
[0063] The target object identifier is used to uniquely identify the target object. It can be a string of characters such as numbers, letters and symbols, or other data that can be used to uniquely identify the target object. Taking the target object as a person as an example, the target object identifier can be the target object's ID number, facial image and voiceprint data, etc. The specified time period is a time interval determined by a specified start time and end time, or it can be a time interval determined by a specified duration and a specified start time (or end time), such as a time interval with the current time as the end time and a specified duration of 1 second, that is, 1 second in the past. The preset trigger condition includes, for example, detecting a preset trigger operation triggered by the user, detecting that the current time is consistent with the preset trigger time, or reaching a preset duration since the last triggering of the image acquisition request.
[0064] In one embodiment, upon detecting a preset trigger condition, the terminal searches for matching images locally based on the target object identifier and the specified time period, and obtains the image address of the images. The terminal may also filter matching images from the queried images based on the camera identifier, and obtain the image address of the filtered images.
[0065] In one embodiment, similar to the above-mentioned picture preloading step, the terminal can obtain the picture addresses and acquisition timestamps of more than one pictures captured by a camera from the server or locally, and preload the corresponding pictures as picture objects according to the picture addresses in the sequence of the acquisition timestamps.
[0066] In one embodiment, the step of preloading the corresponding image as an image object according to the image address by the terminal includes: the terminal obtaining the corresponding image according to the image address through a browser, and creating the corresponding image object based on the obtained image. Specifically, the terminal calls a preconfigured image object creation function through the browser, and passes the image address as an input parameter to the image object creation function, so as to obtain the corresponding image object by running the image object creation function. The image object creation function can be understood as part of a plug-in or JS code.
[0067] In one embodiment, step S202 includes: obtaining a picture address sequence; the picture address sequence includes picture addresses of more than one picture, and the picture addresses in the picture address sequence are arranged according to the acquisition timestamps of the corresponding pictures; traversing the picture addresses in the picture address sequence; and preloading the corresponding pictures according to the traversed picture addresses.
[0068] The picture address sequence is a set of more than one picture addresses arranged according to the acquisition timestamps of the corresponding pictures.
[0069] Specifically, the terminal obtains a picture address sequence consisting of more than one picture addresses arranged according to the acquisition timestamps of the corresponding pictures, traverses the corresponding picture addresses according to the arrangement order in the picture address sequence, and preloads the corresponding pictures as picture objects according to the traversed picture addresses.
[0070] In one embodiment, the terminal obtains a sequence of image addresses from a server based on an image acquisition request. The images corresponding to the image addresses in the sequence of image addresses are captured by more than one camera, and each image includes at least a portion of the same target object. The terminal may also obtain the sequence of image addresses locally.
[0071] In one embodiment, the terminal obtains from a server or locally the picture addresses and acquisition timestamps of pictures that are captured by more than one camera and include at least a portion of the same target object, and sorts the corresponding picture addresses according to the acquisition timestamps of the pictures to obtain a picture address sequence.
[0072] In the above embodiment, a picture address sequence arranged according to the acquisition timestamp of the corresponding picture is obtained, so that the corresponding pictures can be preloaded according to the picture addresses in sequence according to the arrangement order in the picture address sequence, so that the corresponding pictures can be played in sequence according to the acquisition timestamp of the picture to achieve continuous tracking of the target object trajectory.
[0073] In one embodiment, a picture address sequence is generated by the following steps: when more than one picture is captured by multiple cameras respectively, the picture addresses of pictures from the same camera are sorted into picture address subsequences according to the capture timestamps; and then the picture address subsequences are sorted in time sequence to form a picture address sequence.
[0074] The picture address subsequence is a subset composed of the picture addresses of pictures captured by the same camera and containing at least a portion of the same target object, arranged according to the capture timestamps of the corresponding pictures.
[0075] Specifically, the terminal obtains from a server or local device the image addresses, acquisition timestamps, and camera identifiers of images captured by more than one camera and each including at least a portion of the same target object. The terminal then sorts the image addresses of the images corresponding to the camera identifiers according to the acquisition timestamps of the corresponding images to obtain a subsequence of image addresses corresponding to each camera identifier. The terminal then sorts the subsequences of image addresses corresponding to the camera identifiers in chronological order to obtain a sequence of image addresses consisting of the obtained image addresses. It is understood that the images were captured by the camera corresponding to the corresponding camera identifier.
[0076] In one embodiment, for the picture address subsequences corresponding to each camera identifier, the terminal determines the acquisition timestamp of the picture corresponding to the first picture address in each picture address subsequence, and sorts the corresponding picture address subsequences according to the timing of the determined acquisition timestamps to form a picture address sequence.
[0077] In the above embodiment, when the target object appears in the field of view of different cameras at the same time, the pictures captured by each camera and containing at least a portion of the target object are played in sequence according to the appearance sequence of the target object in the field of view of each camera, so as to ensure the smoothness of the target object trajectory tracking based on more than one camera.
[0078] S204: Store the preloaded images into the image pool in sequence.
[0079] The image pool is a storage space used to cache images, specifically a storage space used to cache image objects. The image pool can be understood as an empty collection of cacheable images.
[0080] Specifically, when the terminal preloads more than one picture according to the corresponding acquisition timestamps, the preloaded pictures are sequentially stored in the picture pool. That is, when the terminal preloads a corresponding picture according to the picture address, the corresponding picture is stored in the picture pool.
[0081] In one embodiment, when the terminal preloads each picture as a picture object according to the picture address of the corresponding picture according to the acquisition timestamp of the picture, the terminal stores the preloaded picture objects in the picture pool in sequence.
[0082] In one embodiment, during the trajectory tracking process for the target object, when the terminal detects a preset trigger condition for the first time, it triggers the creation of an image pool for caching images.
[0083] S206: Take out the pictures in sequence according to the arrangement order in the picture pool.
[0084] S208: Play the pictures taken out from the picture pool in sequence.
[0085] Specifically, when playing images, the terminal sequentially takes out corresponding images according to the arrangement order of the images in the image pool and plays the sequentially taken out images. That is, the terminal sequentially takes out and plays each image according to the arrangement order of the images in the image pool.
[0086] In one embodiment, the terminal sequentially retrieves image objects according to their arrangement order in the image pool, draws corresponding images based on the sequentially retrieved image objects, and plays the images. The terminal obtains a preconfigured canvas and draws corresponding images on the canvas based on the sequentially retrieved image objects to achieve image playback. The canvas can specifically be a canvas.
[0087] In one embodiment, when a preset playback condition is detected, the terminal retrieves and plays the pictures in the order in which they are arranged in the picture pool. The preset playback condition may be, for example, detecting a preset playback trigger operation by the user, or monitoring that the length of the picture pool reaches a preset threshold. The picture pool length refers to the number of pictures stored in the picture pool. The preset threshold can be customized or determined based on the number of preloaded pictures. It is understood that if the preset threshold is 1, the terminal triggers the playback process when it detects that there are pictures to be played in the picture pool.
[0088] In one embodiment, when the terminal retrieves and plays images in the order in which they are arranged in the image pool, it preloads and stores them in the image pool according to their acquisition timestamps, achieving the effect of concurrent preloading and playback. This allows for simultaneous loading and playback during the entire image playback process, excluding the initial / first batch of image preloading and waiting, thereby improving the smoothness of target trajectory tracking.
[0089] The above-mentioned image playback method preloads images captured by more than one camera and containing at least a portion of the same target object according to the corresponding capture time and sequentially stores them into an image pool, thereby achieving target object trajectory tracking during the sequential playback of the images. When playing the images captured by the more than one camera, the corresponding images can be quickly retrieved and played sequentially according to the order in which they are arranged in the image pool, without having to switch the video streams captured by different cameras. In other words, there is no time-consuming video stream switching caused by video stream switching during the image playback process, which can improve the smoothness of image playback and thus improve the smoothness of target object trajectory tracking based on more than one camera.
[0090] In one embodiment, the above-mentioned picture playback method also includes: obtaining the target object coordinates corresponding to each picture; arranging the target object coordinates according to the acquisition timestamp of the corresponding picture and storing them in a coordinate pool; when taking out the picture, taking out the corresponding target object coordinates in sequence according to the arrangement order in the coordinate pool; when playing the picture, marking the target object in the played picture according to the target object coordinates.
[0091] The target coordinates are the coordinates of the target or at least a portion of the target in the image, and are used to represent the position of the target in the corresponding image. It is understood that if the image includes at least a portion of the target, the target coordinates may refer to the coordinates of at least a portion of the target in the corresponding image. The target coordinates are a set of coordinates that include more than one pixel coordinate. Based on the target coordinates, the corresponding target or at least a portion of the target can be marked in the corresponding image.
[0092] Specifically, when the terminal preloads corresponding images according to the respective acquisition timestamps of more than one image, it obtains the target coordinates corresponding to each of the more than one image from the server or locally. For the more than one target coordinates obtained, the terminal stores them in the coordinate pool in sequence according to the acquisition timestamps of the corresponding images. When the terminal sequentially retrieves images according to the arrangement order in the image pool, it sequentially retrieves the corresponding target coordinates according to the arrangement order in the coordinate pool. When the terminal plays the images sequentially retrieved from the image pool, it marks the corresponding target in the corresponding image being played according to the sequentially retrieved target coordinates. It can be understood that the images in the image pool are arranged according to the corresponding acquisition timestamps, and the target coordinates in the coordinate pool are arranged according to the acquisition timestamps of the corresponding images. Therefore, the arrangement order of the images in the image pool corresponds to the sorting order of the corresponding target coordinates in the coordinate pool. The target coordinates retrieved by the terminal in sequence according to the arrangement order in the coordinate pool correspond to the images retrieved in sequence according to the arrangement order in the image pool. Therefore, when playing the retrieved images, the corresponding target can be marked in the played images based on the corresponding retrieved target coordinates.
[0093] In one embodiment, when obtaining the picture addresses of more than one picture, the terminal obtains the target coordinates of each of the more than one picture. The target coordinates are pre-determined by the server or the terminal based on the position of the target or at least a portion of the target in the picture.
[0094] In one embodiment, when the terminal obtains a picture address sequence including the picture addresses of more than one pictures, it obtains a target object coordinate sequence including the target object coordinates corresponding to each of the more than one pictures and arranged according to the acquisition timestamps of the corresponding pictures, and stores the target object coordinates in the coordinate pool in sequence according to the arrangement order in the target object coordinate sequence. The step of the terminal obtaining the target object coordinate sequence is similar to the step of obtaining the corresponding picture address sequence and is not repeated here. The arrangement order of each target object coordinate in the target object coordinate sequence is consistent with the sorting order of the picture address of the corresponding picture in the picture address sequence.
[0095] In one embodiment, the terminal traverses the target object coordinates in the target object coordinate sequence, and stores the traversed target object coordinates into the coordinate pool in sequence. It is understandable that the steps of the terminal traversing the picture addresses in the picture address sequence and storing the preloaded pictures based on the traversed picture addresses into the picture pool in sequence can be performed simultaneously with the steps of traversing the target object coordinates in the target object coordinate sequence and storing the traversed target object coordinates into the coordinate pool in sequence. It is understandable that since preloading the corresponding pictures based on the picture addresses takes time, the terminal can perform the above-mentioned traversal and storage operations on the picture addresses and target object coordinates respectively according to the arrangement order in the picture address sequence and the arrangement order in the target object coordinate sequence.
[0096] In one embodiment, when the terminal draws a corresponding picture based on the picture object extracted from the picture pool, it draws a corresponding mark in the drawn picture based on the target object coordinates correspondingly extracted from the coordinate pool to mark the corresponding target object in the picture. It is understandable that the terminal creates the corresponding coordinate pool when creating the picture pool.
[0097] In one embodiment, the target object coordinates include more than one coordinate that can be used to mark the corresponding target object or at least a part of the target object in the corresponding image. The target object coordinates are related to the identification shape used to mark the target object, that is, the target object coordinates include coordinates that can be used to determine the position of the identification shape in the image, such as a rectangle, a circle or other shape. Taking the identification shape as a rectangle as an example, the target object coordinates include the coordinates of the upper left corner pixel and the lower right corner pixel of the rectangle in the image. The terminal or server can determine the target object coordinates corresponding to each image based on the existing target detection algorithm, which will not be repeated here and will not be specifically limited.
[0098] In one embodiment, the target object coordinates may refer to the coordinates of a specified portion of the target object in the corresponding image, such as a face. Face detection and comparison can be used to determine the target object coordinates corresponding to the image. By marking the specified portion of the target object in the displayed image, the target object's trajectory can be tracked.
[0099] In the above embodiment, the picture and the target object coordinates corresponding to the picture are stored in the picture pool and the coordinate pool respectively according to the acquisition timestamp of the picture, so that when the picture is played, the picture and the corresponding target object coordinates can be taken out in sequence according to the arrangement order, and the corresponding target object can be marked according to the corresponding target object coordinates in the pictures played in sequence, which can not only improve the smoothness of the target object trajectory tracking, but also realize the effective tracking of the target object trajectory.
[0100] In one embodiment, step S202 is performed periodically according to a preset cycle.
[0101] The preset period is a pre-specified time length, such as 1 second. Specifically, the terminal periodically obtains the image addresses of images captured by more than one camera and containing at least a portion of the same target object from a server or local computer according to the preset period. For more than one image address obtained periodically, the terminal loads the corresponding images as image objects according to the acquisition timestamp of the corresponding images and stores them in the image pool according to each image address. This allows the terminal to retrieve the image objects in the order in which the image objects are arranged in the image pool during image playback, and draw and play the corresponding images based on the retrieved image objects.
[0102] In one embodiment, the terminal periodically obtains the image addresses and target coordinates of more than one image from a server or locally according to a preset period. The more than one image is captured by more than one camera within the current preset period and contains at least a portion of the same target. Taking the preset period of 1 second as an example, the more than one image is captured by more than one camera in the past 1 second and contains at least a portion of the same target. It is understood that the more than one image preloaded by the terminal periodically according to the preset period can be one or more images captured by a single camera.
[0103] In one embodiment, for images captured by the camera in real time, the terminal can periodically obtain the image addresses of the images captured in real time according to a preset period. For images captured by the camera in the past, the terminal can also obtain the image addresses of the images captured in the past.
[0104] In the above embodiment, the real-time collected pictures are preloaded regularly according to a preset period, and the corresponding pictures are played in sequence according to the preloaded order, so as to ensure the smoothness of tracking while achieving continuous tracking of the target object's trajectory.
[0105] In one embodiment, before step S206, the above-mentioned picture playing method further includes: monitoring the picture pool length of the picture pool; when the monitored picture pool length is greater than or equal to a preset threshold, jumping to the step of sequentially retrieving pictures according to the arrangement order in the picture pool and continuing execution.
[0106] The image pool length refers to the number of images stored in the image pool, specifically the number of images stored and waiting to be played. It can be understood that if image objects are stored in the image pool, the image pool length refers to the number of image objects stored in the image pool. The preset threshold is a pre-set threshold value that can be customized based on actual conditions, such as 50, or it can be determined based on the number of acquired image addresses.
[0107] Specifically, the terminal monitors the image pool length in real time and compares the monitored image pool length with a preset threshold. When the monitored image pool length is greater than or equal to the preset threshold, the terminal extracts the corresponding images in the order in which they are arranged in the image pool and plays the extracted images.
[0108] In one embodiment, when the length of the monitored image pool is greater than or equal to a preset threshold, the terminal sequentially extracts the corresponding images in the image pool according to the order in which the images are arranged, and sequentially extracts the corresponding target object coordinates in the coordinate pool according to the order in which the target object coordinates are arranged. The terminal then plays the images sequentially extracted from the image pool and marks the target objects in the played images according to the corresponding target object coordinates.
[0109] In one embodiment, when a terminal obtains the image addresses of more than one image, it counts the number of image addresses. When the counted number of image addresses is greater than or equal to a first threshold, the terminal obtains the image occupied space corresponding to any of the more than one images, queries a preconfigured image playback rate, and determines a preset threshold based on the image occupied space and the image playback rate. Image occupied space refers to the image size, such as 1MB, which affects the image preloading speed. The image playback rate refers to the number of images played per unit time. When the counted number of image addresses is less than the first threshold, the terminal determines the counted number of image addresses as the preset threshold. Thus, when the number of images to be played is greater than or equal to the first threshold, the terminal preloads the images in batches and begins playing the images sequentially when the number of preloaded images stored in the image pool is greater than or equal to the preset threshold. When the number of images to be played is less than the first threshold, indicating that the number of images to be played is small, the terminal begins playing the images sequentially after all images are preloaded and stored in the image pool.
[0110] In one embodiment, during the entire picture playback process currently being performed, the terminal performs the above-mentioned step of monitoring the picture pool length of the picture before taking out the picture from the picture pool and playing it for the first time, and when the monitored picture pool length is greater than or equal to the preset threshold, the picture is taken out and played in sequence according to the arrangement order in the picture pool. It can be understood that when the pictures are taken out and played in sequence according to the arrangement order in the picture pool, the terminal does not need to perform the above-mentioned step of monitoring the picture pool length. In addition to the waiting time for playback before the first playback of the picture, continuous playback of the picture can be achieved to ensure the smoothness of the target object trajectory tracking.
[0111] In one embodiment, for pictures that are regularly obtained according to a preset period and collected by the camera in real time, the preset threshold for comparison with the picture pool length can be set to 1. That is, when it is detected that there are stored pictures in the picture pool, the terminal will take out and play the pictures in sequence according to the arrangement order in the picture pool.
[0112] In the above embodiment, when it is detected that the length of the picture pool is greater than or equal to the preset threshold, the pictures are taken out and played in sequence according to the arrangement order in the picture pool to ensure the smoothness of the target object tracking during the picture playback process.
[0113] In one embodiment, the above-mentioned picture playing method further includes: monitoring the number of pictures carrying the played tag in the picture pool; when the monitored number is greater than or equal to a preset number threshold, deleting the pictures carrying the played tag from the picture pool.
[0114] The played tag is used to identify the corresponding picture as a played picture, and can be a character string consisting of at least one of numbers, letters, symbols, and other characters.
[0115] Specifically, the terminal monitors the picture pool in real time for pictures with the "played" tag, counts the number of pictures it detects, and compares the number with a preset threshold. If the number of pictures detected is greater than or equal to the preset threshold, the detected pictures with the "played" tag are deleted from the picture pool.
[0116] In one embodiment, when the number of monitored pictures is greater than or equal to a preset number threshold, the terminal deletes the monitored pictures carrying the played tag from the picture pool, and deletes the target object coordinates corresponding to the monitored pictures carrying the played tag from the coordinate pool.
[0117] In one embodiment, after taking out a picture from the picture pool and playing it in the above manner, the terminal marks the currently played picture in the picture pool with a played tag.
[0118] In one embodiment, different preset quantity thresholds can be pre-configured for pictures collected in real time and pictures collected historically. For example, the preset quantity threshold corresponding to pictures collected in real time can be set to 1 to achieve real-time deletion of pictures; the preset quantity threshold corresponding to pictures collected historically can be set to 10 to achieve batch deletion of pictures.
[0119] In the above embodiment, the played pictures are deleted in real time or in batches based on the preset number threshold and the played mark, so as to release the storage space occupied by the played pictures and reduce the pressure on the browser.
[0120] In one embodiment, the terminal monitors the total number of pictures stored in the picture pool in real time, and compares the monitored total number with the second quantity threshold. When the monitored total number is greater than or equal to the second quantity threshold, the terminal stops executing the step of preloading more than one picture according to the corresponding acquisition timestamp, that is, the terminal stops executing the preloading operation of the picture. When the monitored total number is less than the second quantity threshold, the terminal continues to execute the step of preloading more than one picture according to the corresponding acquisition timestamp. The terminal obtains the picture occupied space of any one of the more than one pictures, queries the preconfigured browser load value, and determines the second quantity threshold based on the picture occupied space and the browser load value. The picture occupied space can be directly extracted from the picture object stored in the picture pool. In this way, it can effectively avoid increasing the pressure on the browser.
[0121] In one embodiment, the above-mentioned picture playing method further includes: detecting a preset trigger operation in real time; when the preset trigger operation is detected, triggering a corresponding picture playing control instruction according to the preset trigger operation; and controlling the playing of the picture according to the picture playing instruction.
[0122] The preset trigger operation is a pre-set trigger operation, such as a touch operation, a cursor operation, a key operation, or a voice operation. The touch operation can be a touch click operation, a touch press operation, or a touch slide operation on a preset control, and the touch operation can be a single-point touch operation or a multi-point touch operation; the cursor operation can be an operation of controlling the cursor to click or to press; the key operation can be a virtual key operation or a physical key operation, etc. The image control instruction is an instruction for controlling the playback of an image, and can be a string of at least one of the characters selected from numbers, letters, and symbols.
[0123] Specifically, the terminal detects a preset trigger operation in real time and, upon detecting the preset trigger operation, generates a corresponding image playback control instruction based on the detected preset trigger operation. The terminal controls the playback of the image based on the generated image playback control instruction. It is understood that the terminal controls the playback of the image by calling a plug-in or JS code based on the image playback control instruction through the browser.
[0124] In the above embodiment, the playback of the image is controlled based on the detected preset trigger operation to meet different target object trajectory tracking requirements.
[0125] In one embodiment, the picture playback control instruction includes a pause playback instruction, a replay instruction, a full-screen playback instruction, an exit full-screen playback instruction, a screenshot instruction, an accelerated playback instruction, or a decelerated playback instruction.
[0126] The pause playback instruction is an instruction for instructing the terminal to pause the playback of the image, that is, to temporarily stop executing the step of taking the image from the image pool and playing it. The replay instruction is an instruction for instructing the terminal to replay the image that has been played. The replay instruction includes at least one of the image identifier to be replayed or the time period for determining the image to be replayed. The full-screen playback instruction is an instruction for instructing the terminal to play the image in full screen form. The exit full-screen playback instruction is an instruction for instructing the terminal to play the image in the form of exiting full screen. The terminal can achieve full-screen playback or exit full-screen playback of the image by adjusting the size of the canvas. Exiting full-screen playback means drawing and playing the image according to the preconfigured canvas size. The screenshot instruction is an instruction for instructing the terminal to capture the currently playing image and save it. The accelerated playback instruction or the decelerated playback instruction is an instruction for instructing the terminal to change (speed up or slow down) the image playback rate. The accelerated playback instruction or the decelerated playback instruction can carry the changed image playback rate.
[0127] In the above embodiments, a variety of functions for adjusting the image playback format are provided to meet diverse image playback requirements.
[0128] like Figure 3 As shown, in one embodiment, a method for playing pictures is provided, which specifically includes the following steps:
[0129] S302, obtaining a picture address sequence and a target coordinate sequence; the picture address sequence includes the picture addresses of more than one picture, and the picture addresses in the picture address sequence are arranged according to the acquisition timestamp of the corresponding picture; the more than one picture is acquired by more than one camera, and each picture includes at least a portion of the same target object; the target coordinate sequence includes the target coordinates corresponding to more than one picture, and the arrangement order of each target coordinate in the target coordinate sequence is consistent with the arrangement order of the picture address of the corresponding picture in the picture address sequence.
[0130] S304 , traversing the image addresses in the image address sequence and traversing the target object coordinates in the target object coordinate sequence.
[0131] S306: Preload the corresponding picture according to the traversed picture address.
[0132] S308: Store the preloaded images into the image pool in sequence, and store the traversed target object coordinates into the coordinate pool in sequence.
[0133] S310: Monitor the picture pool length of the picture pool.
[0134] S312: When the length of the monitored image pool is greater than or equal to a preset threshold, the images are sequentially retrieved according to the arrangement order in the image pool, and the corresponding target object coordinates are sequentially retrieved according to the arrangement order in the coordinate pool.
[0135] S314: Play pictures taken from the picture pool in sequence, and mark the target objects in the played pictures according to the corresponding target object coordinates.
[0136] S316: Monitor the number of pictures with the played tag in the picture pool.
[0137] S318, when the number of monitoring is greater than or equal to the preset number threshold, the picture carrying the played tag is deleted from the picture pool, and the target object coordinates corresponding to the picture are deleted from the coordinate pool.
[0138] In the above embodiment, a sequence of picture addresses and a corresponding target coordinate sequence are obtained, which are arranged according to the acquisition timestamps of the corresponding pictures from more than one picture addresses. The pictures corresponding to the more than one picture addresses are collected by more than one camera and all include at least a portion of the same target object. The corresponding pictures are preloaded according to the picture addresses in the order of arrangement in the picture address sequence and stored in the picture pool. The coordinates of each target object are stored in the coordinate pool in sequence according to the target coordinate sequence. When it is detected that the length of the picture pool is greater than or equal to a preset threshold, the pictures are sequentially taken out in the order of arrangement in the picture pool, the corresponding target coordinates are sequentially taken out in the order of arrangement in the coordinate pool, the pictures taken out in sequence are played, and the targets are marked in the played pictures according to the corresponding target coordinates, so as to improve the smoothness of target trajectory tracking based on multiple cameras. When it is detected that the number of played pictures in the picture pool is greater than or equal to the preset number threshold, the played pictures are deleted from the picture pool and the corresponding target coordinates are deleted from the coordinate pool to reduce the pressure on the browser, thereby further improving the smoothness of target trajectory tracking.
[0139] It should be understood that although Figure 2 、 Figure 3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2 、 Figure 3At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0140] In one embodiment, Figure 4 As shown, a picture playing device 400 is provided, comprising: a preloading module 402, a storing module 404, a retrieving module 406 and a playing module 408, wherein:
[0141] A preloading module 402 is configured to preload more than one image according to corresponding acquisition timestamps; each image includes at least a portion of the same target object;
[0142] The storage module 404 is used to store the preloaded pictures into the picture pool in sequence;
[0143] The fetching module 406 is used to fetch the pictures in sequence according to the arrangement order in the picture pool;
[0144] The playing module 408 is used to play the pictures taken from the picture pool in sequence.
[0145] In one embodiment, Figure 5 As shown, the picture playing device 400 further includes: an acquisition module 410;
[0146] An acquisition module 410 is used to obtain the coordinates of the target object corresponding to each image;
[0147] The storage module 404 is further used to store the target object coordinates into the coordinate pool according to the acquisition timestamp of the corresponding image;
[0148] The extraction module 406 is further used to extract the corresponding target object coordinates in the order of arrangement in the coordinate pool when extracting the image;
[0149] The playing module 408 is further configured to mark a target object in the played picture according to the coordinates of the target object when playing the picture.
[0150] In one embodiment, the preloading module 402 is further used to obtain a picture address sequence; the picture address sequence includes picture addresses of more than one picture, and the picture addresses in the picture address sequence are arranged according to the acquisition timestamps of the corresponding pictures; traverse the picture addresses in the picture address sequence; and preload the corresponding pictures according to the traversed picture addresses.
[0151] In one embodiment, the preloading module 402 is also used to, when more than one picture is captured by multiple cameras respectively, sort the picture addresses of the pictures from the same camera into picture address subsequences according to the capture timestamps; and then sort the picture address subsequences according to time sequence to form a picture address sequence.
[0152] In one embodiment, the preloading module 402 is further configured to periodically perform the step of preloading more than one picture according to corresponding acquisition timestamps according to a preset period.
[0153] In one embodiment, Figure 5 As shown, the picture playback device 400 further includes: a monitoring module 412;
[0154] The monitoring module 412 is configured to monitor the image pool length of the image pool; when the monitored image pool length is greater than or equal to a preset threshold, the fetching module 406 is triggered to execute the step of fetching images in sequence according to the arrangement order in the image pool.
[0155] In one embodiment, the monitoring module 412 is further configured to monitor the number of pictures carrying the played tag in the picture pool; when the monitored number is greater than or equal to a preset threshold, the pictures carrying the played tag are deleted from the picture pool.
[0156] In one embodiment, Figure 5 As shown, the picture playback device 400 further includes: a control module 414;
[0157] The control module 414 is used to detect the preset trigger operation in real time; when the preset trigger operation is detected, trigger the corresponding picture play control instruction according to the preset trigger operation; and control the play of the picture according to the picture play instruction.
[0158] In one embodiment, the picture playback control instruction includes a pause playback instruction, a replay instruction, a full-screen playback instruction, an exit full-screen playback instruction, a screenshot instruction, an accelerated playback instruction, or a decelerated playback instruction.
[0159] For the specific definition of the image playback device, please refer to the definition of the image playback method above, and will not be repeated here. Each module in the above-mentioned image playback device can be implemented in whole or in part by software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0160] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for playing pictures is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0161] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0162] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps of the picture playing method in each of the above embodiments when executing the computer program.
[0163] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the picture playing method in each of the above embodiments are implemented.
[0164] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0165] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for playing pictures, comprising: Preload more than one image according to the corresponding acquisition timestamp; Each image includes at least a portion of the same target object, and the more than one images are captured by more than one camera; Store the preloaded images into the image pool in sequence; Take out the pictures in the order of arrangement in the picture pool; Playing pictures taken from the picture pool in sequence; The method further comprises: Get the corresponding target coordinates for each image; Arrange the target object coordinates according to the acquisition timestamps of the corresponding images and store them in a coordinate pool; When taking out the picture, the corresponding target object coordinates are taken out in sequence according to the arrangement order in the coordinate pool; When playing the picture, the target object is marked in the played picture according to the target object coordinates.
2. The method according to claim 1, characterized in that The preloading of more than one picture according to corresponding acquisition timestamps includes: Obtain a picture address sequence; the picture address sequence includes picture addresses of more than one picture, and the picture addresses in the picture address sequence are arranged according to acquisition timestamps of corresponding pictures; Traversing the picture addresses in the picture address sequence; Preload the corresponding pictures according to the traversed picture addresses.
3. The method according to claim 2, characterized in that The image address sequence is generated by the following steps: When the more than one pictures are captured by multiple cameras respectively, the picture addresses of the pictures from the same camera are sorted into picture address subsequences according to the capture timestamps; and then the picture address subsequences are sorted in time sequence to form a picture address sequence.
4. The method according to claim 1, wherein The step of preloading more than one picture according to the corresponding acquisition timestamps is performed regularly according to a preset period.
5. The method according to claim 1, wherein Before sequentially extracting the images according to the arrangement order in the image pool, the method further includes: Monitoring the image pool length of the image pool; When the monitored picture pool length is greater than or equal to a preset threshold, the process jumps to the step of sequentially extracting pictures according to the arrangement order in the picture pool and continues to execute.
6. The method according to claim 1, wherein The method further comprises: Monitor the number of pictures with the played tag in the picture pool; When the number of monitored images is greater than or equal to a preset number threshold, the image carrying the played tag is deleted from the image pool.
7. The method according to claim 1, characterized in that The method further comprises: Real-time detection of preset trigger operations; When a preset trigger operation is detected, a corresponding picture playback control instruction is triggered according to the preset trigger operation; The playing of the picture is controlled according to the picture playing control instruction.
8. The method according to claim 7, characterized in that The picture playback control instructions include a pause playback instruction, a replay instruction, a full-screen playback instruction, an exit full-screen playback instruction, a screenshot instruction, an accelerated playback instruction, or a decelerated playback instruction.
9. A picture playing device, characterized in that: The device comprises: a preloading module, configured to preload more than one picture according to corresponding acquisition timestamps; each picture includes at least a portion of a same target object, and the more than one picture is acquired by more than one camera; The storage module is used to store preloaded images into the image pool in sequence; An extracting module is used to extract pictures in sequence according to the arrangement order in the picture pool; Play module, for playing the pictures taken out from the picture pool in sequence; The acquisition module is used to obtain the coordinates of the target object corresponding to each image; The storage module is further configured to store the target object coordinates into a coordinate pool according to the acquisition timestamps of the corresponding images; The extraction module is further configured to extract the corresponding target object coordinates in sequence according to the arrangement order in the coordinate pool when extracting the image; The playback module is further configured to mark the target object in the played picture according to the target object coordinates when playing the picture.
10. The device according to claim 9, characterized in that The device further comprises: The monitoring module is used to monitor the image pool length of the image pool; when the monitored image pool length is greater than or equal to a preset threshold, the retrieval module is triggered to execute the step of sequentially retrieving images according to the arrangement order in the image pool.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Traffic video monitoring management control system
CN106327875A
Image processing method and apparatus, and electronic device
CN108334806A