Summary of the invention
The embodiment of the invention provides a kind of generation method and device of video scalability file, solve in the prior art supervisory system when detecting these identical or similar contents, do not have general Interchange Format, thereby cause being difficult in each supervisory system and the supervising device realize the problem of sharing of data.
The embodiment of the invention provides a kind of generation method of video scalability file, comprising:
When video file does not have corresponding scalable file, detect the motion fragment that comprises in the described video file, and generate each motion fragment that the motion fragment index is used for the positioning video file;
Detect the position of each moving target in every frame, and, generate the motion conditions that the moving target index is used to describe each moving target the corresponding target identification record of the positional information of same moving target in different frame;
Add described motion fragment index and moving target index to form described video file in the one text file scalable file.
Also provide a kind of generating apparatus of video scalability file according to the said method embodiment of the invention, comprising:
Motion fragment index generation module is used for detecting the motion fragment that comprises in the described video file when not having corresponding scalable file to video file, and generates each motion fragment that the motion fragment index is used for the positioning video file;
Moving target index generation module, be used for detecting the position of each moving target at every frame, and, generate the motion conditions that the moving target index is used to describe each moving target with the corresponding target identification record of the positional information of same moving target in different frame;
Scalable file generating module is used for adding described motion fragment index and moving target index to scalable file that the one text file forms described video file correspondence.
The device of the method that the embodiment of the invention provided of application generates the sharable scalable file of various supervisory systems, motion conditions according to object in the video file is divided into the fragment of doing more physical exercises with video file, and the feature of each moving object is described the index that generates correspondence.Make the user when checking video file, can navigate to the special area of the moving object or the moving object of desired seek in the shortest time according to different index.And described scalable file is applicable to all systems, thereby also realizes sharing of each supervisory system and supervising device data.
Embodiment
The embodiment of the invention provides a kind of generation method of video scalability file, this method comprises: when video file does not have corresponding scalable file, detect the motion fragment that comprises in the described video file, and generate each motion fragment that the motion fragment index is used for the positioning video file; Detect the position of each moving target in every frame, and, generate the motion conditions that the moving target index is used to describe each moving target the corresponding target identification record of the positional information of same moving target in different frame; Add described motion fragment index and moving target index to form described video file in the one text file scalable file.
In embodiments of the present invention, so-called scalable file refers to that the pick-up unit of difference in functionality can be according to existing low-level information in this scalable file (wherein, low-level information comprises and comprises several motion fragments in the video segment, how many moving targets are perhaps arranged) and self function treatment further fill the premium area (information that comprises special area, the relation of target and special area etc.) data, can be when resolving video file according to the different content of user's desired seek, utilize in the scalable file respective index to obtain relevant information.
As: in a surveillance video, need people's face of certain target be detected.Then people's face pick-up unit can utilize the target index in the file, the zone that the target that navigates to occurs, and the result further expanded in the special area index, determine the position that people's face occurs, and then realize that people's face detects.
As shown in Figure 1, the generation method of a kind of video scalability file of the embodiment of the invention specifically comprises step:
Step 101, detect video file whether corresponding scalable file is arranged, if do not have, then set up the text (being scalable file) of a blank, be used to store the index content of this video file correspondence, detect the motion fragment that comprises in the described video file, and generate each the motion fragment in the motion fragment index positioning video file;
As shown in Figure 4, the description content of every record of motion fragment index can comprise: the duration of the reference position of motion fragment and this motion fragment.
When comprising a plurality of incoherent motion fragment in the video file, locate some motion fragments for convenience, then described scalable file also comprises fragment video association index, the embodiment of the invention also comprises:
Step 102, determine the motion fragment that comprised in each video file, set up each motion fragment that fragment video association index is used for the positioning video file, and add this fragment video association index in the described scalable file (specifically can be structure shown in Figure 2).
Step 103 detects the position of each moving target in every frame, and with the corresponding target identification record of the positional information of same moving target in different frame, generates the motion conditions that the moving target index is used to describe each moving target;
In the present invention is in the example, and the time that is described as of index or the location of physical location can navigate to required content by this description in video.
After determining moving target, some special areas (as zones such as people's face, car plates) of further setting movement target also comprise the special area index in scalable file of the invention process for convenience:
Step 104 by feature detection and the tracking to moving target, generates the special area index, and this special area index is added in the described scalable file.
When needs are located in certain motion fragment certain moving target, then can in described scalable file, the target fragment association index be set, comprising:
Step 105 is determined the moving target that comprised in each motion fragment, sets up the target fragment association index, and this target fragment association index is added in the described scalable file.
The target fragment association index comprised the many to 1 corresponding relation of target-fragment, avoided like this that a plurality of targets all comprise the redundancy that segment indicates in the fragment.
In addition, when concrete the application, need search for certain special area of a certain moving target usually,, comprise so be necessary in described scalable file, to add the regional aim association index:
Step 106 is set up the regional aim association index, and this regional aim association index is added in the described scalable file.
Can only detect the special area (as: people's face, car plate etc.) that occurs in the video file, and detected special area and moving target are carried out the related regional aim association index of setting up.
In embodiments of the present invention, also will now the index that generates be carried out buffer memory, the scalable file of unifying again after all index content all generate that adds formation video file in the same text to.
The generation of above-mentioned index is not limited to the order of above-mentioned steps flow process, can arbitrarily change when concrete the application.And each index is relatively independent in described flexible file, and the position is free relatively.
As shown in Figure 3, the concrete structure of index can be set to comprise in the embodiment of the invention: the record number that index identifies, index comprised and the description content of every record.
As shown in Figure 5, the description content of every record comprises in the described moving target index: the initial position of the relative zero-time of moving target, exercise duration, moving target and each position of this moving target in this exercise duration.
In embodiments of the present invention, the moving target record comprises the relative zero-time of target, and this time is corresponding to the segment that comprises target.The initial position that target occurs first (describing) with boundary rectangle.Position is afterwards described with different records, and every record comprises the speed (displacement) with last record difference, size, time.The bar number of record is judged with duration length after can adding up according to the time that every record continues.If the difference time does not exist and represents that then each location records is uniform.Calculate the record number by the frame per second of duration and corresponding video.
As shown in Figure 6, according to said method, the embodiment of the invention also comprises a kind of generating apparatus of video scalability file, it is characterized in that, comprising:
Motion fragment index generation module 601 is used for detecting the motion fragment that comprises in the described video file when not having corresponding scalable file to video file, and generates each motion fragment that the motion fragment index is used for the positioning video file;
Moving target index generation module 602, be used for detecting the position of each moving target at every frame, and, generate the motion conditions that the moving target index is used to describe each moving target with the corresponding target identification record of the positional information of same moving target in different frame;
Scalable file generating module 603 is used for adding described motion fragment index and moving target index to scalable file that the one text file forms described video file.
For convenience of after determining moving target, some special areas (as zones such as people's face, human bodies) of further setting movement target, this device also comprises:
Special area index generation module 604 is used for by feature detection and tracking to moving target, generates the special area index, the special area that comprises in this special area index location and the description motion fragment;
When comprising a plurality of incoherent motion fragment in the video file, locate some motion fragments for convenience, this device also comprises:
Fragment video association index generation module 605 is used for the motion fragment that definite each video file is comprised, and sets up fragment video association index;
When needs were located in certain motion fragment certain moving target, this device also comprised:
Target fragment association index generation module 606 is used for the moving target that definite each motion fragment is comprised, and sets up the target fragment association index;
In addition, when concrete the application, need search for certain special area of a certain moving target usually, this device also comprises:
Based on the generation of above-mentioned special area index generation module 604, fragment video association index generation module 605, target fragment association index generation module 606 and regional aim association index module 607, described scalable file generating module 603 also is used for adding special area index, fragment video association index, target fragment association index and regional aim association index the scalable file of described video file correspondence to.
The generation of above-mentioned index is not limited to the order of above-mentioned steps flow process, can arbitrarily change when concrete the application.And each index is relatively independent in described flexible file, and the position is free relatively.
The device of the method that the embodiment of the invention provided of application generates the sharable scalable file of various supervisory systems, thereby realizes sharing of each supervisory system and supervising device data.
In addition, use method and apparatus provided by the invention and can navigate to the required content of user, reach the purpose of fast browsing video file according to index file.
Further, because scalable file according to the moving target of video file for the record foundation, so can navigate to the special area of certain target or certain moving target fast according to the scalable file of video file correspondence.
Method of the present invention is not limited to the embodiment described in the embodiment, and those skilled in the art's technical scheme according to the present invention draws other embodiment, belongs to technological innovation scope of the present invention equally.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.