Summary of the invention
In view of this, a kind of method for video coding and video encoding/decoding method are provided among the present invention on the one hand, a kind of video coding apparatus and video decoder are provided on the other hand,, make things convenient for later analysis and retrieval so that make intelligent video analysis result and unified transmission of vedio data or storage.
Method for video coding provided by the present invention comprises:
Gather video image, and described video image is carried out intelligent video analysis, obtain the intelligent video analysis intellectual analysis information of correspondence as a result;
Described video image is encoded,, the grammer of corresponding intellectual analysis information is embedded in the coding unit head grammer of current synchronization video image of encoding, obtained embedding the video data encoder of intellectual analysis information according to synchronous embedding rule.
Preferably, described coding unit head grammer comprises: image head grammer or slice header syntax.
Preferably, the grammer of described corresponding intellectual analysis information comprises: N intellectual analysis information unit, N are the integer more than or equal to 1.
Preferably, the grammer of described corresponding intellectual analysis information further comprises: the intellectual analysis Information sign is set to described N intellectual analysis information unit is set when effective at described intellectual analysis Information sign.
Preferably, described each intellectual analysis information unit comprises: the information parameter element that is used to represent the information category element of intellectual analysis information unit classification and is used to represent this classification information key parameter.
Preferably, this method further comprises: with described intellectual analysis information unit category division is two or more levels, described each information category element is represented with N bit, high position in the described N bit is used to represent high-level classification, and the low level in the described N bit is used to represent the classification of low level.
Preferably, described intellectual analysis information unit category division is two levels, and described high-level classification comprises: event category and/or target classification.
Preferably, the classification of described low level comprises: the invasion of corresponding event category, more line, drive in the wrong direction, leave over, lose, pace up and down, trail, assemble, suddenly speed change, cross, spray, block, fire, smog, explode, spill, low speed, hypervelocity, any 1 or combination in any in colliding, blocking up; And/or, any 1 or combination in any in the setting position in other moving target of corresponding target class, people's face, human body, the human body, car plate, all types of automobile, steamer, the animal.
Video encoding/decoding method provided by the present invention comprises:
Video data encoder is decoded, and the grammer according to corresponding intellectual analysis information in the encoding video pictures unit header grammer of decoding obtains the intellectual analysis information synchronous with described video image.
Preferably, the grammer of described corresponding intellectual analysis information comprises: the intellectual analysis Information sign is set;
Be set to N intellectual analysis information unit is set when effective at described intellectual analysis Information sign, N is the integer more than or equal to 1.
Preferably, described according to the grammer of corresponding intellectual analysis information in the encoding video pictures unit header grammer of decoding, obtain comprising with the synchronous intellectual analysis information of described video image:
Judge the intellectual analysis Information sign in the encoding video pictures unit header grammer of current decoding, when described intellectual analysis Information sign is effective, N intellectual analysis information unit after obtaining.
Video coding apparatus provided by the present invention comprises:
Video acquisition unit is used to gather video image;
The intellectual analysis unit is used for described video image is carried out intelligent video analysis, obtains the intelligent video analysis intellectual analysis information of correspondence as a result;
Information provides control unit, is used for according to embedding rule synchronously, and the intellectual analysis information that described intellectual analysis unit is obtained offers video encoding unit;
Video encoding unit, be used for the video image of described video acquisition unit collection is encoded, and according to synchronous embedding rule, the grammer of corresponding intellectual analysis information is embedded in the coding unit head grammer of current video image of encoding, obtained embedding the video data encoder of intellectual analysis information.
Preferably, described video encoding unit comprises:
Grammer generates subelement, is used for generating the grammer of corresponding intellectual analysis information according to the intellectual analysis information that rule and information provide control unit to provide is provided synchronously;
The coding subelement, be used for the video image of described video acquisition unit collection is encoded, to embed in the coding unit head grammer of current video image of encoding from the grammer that described grammer generates the corresponding intellectual analysis information of subelement, obtained embedding the video data encoder of intellectual analysis information.
Video decoder provided by the present invention comprises:
Video decoding unit is used for video data encoder is decoded;
The intellectual analysis information acquisition unit is used for the grammer according to the corresponding intellectual analysis information of encoding video pictures unit header grammer of decoding, obtains the intellectual analysis information synchronous with described video image.
From such scheme as can be seen, pass through among the present invention in the video compression coding data, to embed intellectual analysis information (as various anomalous event information or moving target, special objective etc.) with set form, the grammer that is about to corresponding intellectual analysis information embeds in coding unit head (as image head or the slice header) grammer of current video image of encoding, obtained embedding the video data encoder of intellectual analysis information, this intellectual analysis information is transmitted with the video data of compressed encoding or is stored, synchronous with video pictures, be convenient to analyze and retrieval.
In addition, by the dependent parser of analysis diagram, can obtain the intellectual analysis information of every two field picture correspondence during decoding as corresponding intellectual analysis information (as various anomalous event information or moving target, special objective etc.) in the coding unit head (as image head or slice header).When needs position retrieval to intellectual analysis information, the dependent parser that only needs corresponding intellectual analysis information in parsing and the query image coding unit head (as image head or slice header), do not need video image is all decoded, therefore can realize quick retrieval, this retrieving can be realized with machine or software program in addition, substitute the manual retrieval, raise the efficiency, save cost.
Embodiment
In the embodiment of the invention, consider when video data compaction coding, often be divided into image (picture) and/or band coding units such as (slice).And in the video compression coding standard, each two field picture and/or each band etc. has all defined corresponding syntactic structure, is used for transmitting relevant information between codec, as frame number, image or type of strip, quantization parameter or the like.Therefore, in the embodiment of the invention, in order to make intellectual analysis information and vedio data synchronous, be convenient to analysis and retrieval to the particular video frequency image, consideration embeds the grammer of corresponding intellectual analysis information in coding unit head grammers such as image head grammer or slice header syntax, make to comprise synchronous intellectual analysis information in the video sequence of compressed encoding.
Fig. 1 is for embedding the system flow schematic diagram of the coding and decoding video of intellectual analysis information among the present invention.At first, obtain video image by video acquisition, and carry out intelligent video analysis according to video image simultaneously, obtain the intelligent video analysis intellectual analysis information of correspondence as a result, according to synchronous embedding rule, the intellectual analysis information that obtains is offered video coding, video coding is according to embedding rule synchronously, the grammer of corresponding intellectual analysis information is embedded in the coding unit head grammer of current video image of encoding, the video data encoder that has obtained embedding intellectual analysis information is used for transmission or storage, thereby finishes the cataloged procedure of video.Offer decoding end after transmission of video data encoder process or the storage then and carry out video decode, the grammer according to corresponding intellectual analysis information in the encoding video pictures unit header grammer of decoding obtains the intellectual analysis information synchronous with described video image.Simultaneously, the video image that obtains can be used for displaying the play, thereby finishes the decode procedure of video.
Below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail.
Fig. 2 is the exemplary process diagram of method for video coding in the embodiment of the invention.As shown in Figure 2, this flow process comprises the steps:
Step 201 is gathered video image.
Step 202 is carried out intelligent video analysis to described video image, obtains the intelligent video analysis intellectual analysis information of correspondence as a result.
Step 203 is encoded to described video image, according to synchronous embedding rule, the grammer of corresponding intellectual analysis information is embedded in the coding unit head grammer of current synchronization video image of encoding, and has obtained embedding the video data encoder of intellectual analysis information.
Correspondingly, video data encoder arrives decoding end through storage or transmission back, decoding end can be decoded to video data encoder, and according to the grammer of corresponding intellectual analysis information in the encoding video pictures unit header grammer of decoding, obtains the intellectual analysis information synchronous with described video image.Simultaneously, the video image that obtains can be used for displaying the play.
Wherein, the grammer of intellectual analysis information can be expressed as:
{
The intellectual analysis information unit is counted N;
for(i=0;i<N;i++)
{
Intellectual analysis information unit [i];
}
}
Wherein, the intellectual analysis information unit is counted N, represents the intellectual analysis information unit quantity that exists in this two field picture or this band.During specific implementation, available 8-bit (bit) data representation, the expression scope is 0~255.
Correspondingly, when decoding end is decoded,, then obtain this intellectual analysis information if having intellectual analysis information in the encoding video pictures unit header grammer of current decoding.
Further, also can further comprise in the grammer of intellectual analysis information: the intellectual analysis Information sign, and at this intellectual analysis Information sign when being effective, there is intellectual analysis information thereafter in expression.As follows:
{
The intellectual analysis Information sign;
If the intellectual analysis Information sign is effectively, then exist
{
The intellectual analysis information unit is counted N;
for(i=0;i<N;i++)
{
Intellectual analysis information unit [i];
}
}
}
Wherein, the intellectual analysis Information sign can be used the 1-bit data representation, and for example, available " 1 " expression effectively, and is invalid with " 0 " expression.Vice versa.
Correspondingly, when decoding end is decoded, can judge the intellectual analysis Information sign in the encoding video pictures unit header grammer of current decoding, when described intellectual analysis Information sign is effective, the intellectual analysis information after obtaining.
During specific implementation, the intellectual analysis information unit specifically can comprise following element:
{
The information category element;
The information parameter element;
There is sign in the information spreading parameter;
Be masked as effectively if the information spreading parameter exists, then exist
{
Information spreading parameter length;
Information spreading parameter element;
}
}
Wherein, the information category element is represented the classification of this intellectual analysis information unit, comprises various anomalous events, moving target, special objective (people's face, car plate) etc., and each class occupies a classification.Further, can keep some classifications, after being used for according to technical development or application demand is expanded or User Defined.Preferably, the information category element can represent that the expression scope is 0~255 with 8-bit.
Further, can be divided into two or more levels to information category.For example, information category is divided into two levels of parent and subclass.For the information category element of representing with N bit, parent can take the high M position of bit, and subclass can take the low N-M position of bit.Preferably, for the above-mentioned information category element of representing with 8-bit, parent can occupy high 2, and available " 00 " representative " incident ", " 01 " representative " target ".Correspondingly, subclass can occupy low 6, and the subclass of corresponding " incident " can comprise: invasion, more line, drive in the wrong direction, leave over, lose, pace up and down, trail, assemble, suddenly speed change, cross, spray, block, fire, smog, explode, spill, low speed, hypervelocity, collide, block up or the like; The subclass of corresponding " target " can comprise: moving target, people's face, human body (can further be subdivided into the number of people, hair, face, above the waist, the setting position in the human bodies such as trunk, shank), car plate, automobile (can further be subdivided into motor bus, truck, car etc.), steamer, animal or the like.For example,, then can be expressed as " 0000,0110 ",, then can be expressed as " 0100,0001 " if the subclass alias of people's face target is 1 if the subclass alias of intrusion event is 6.Perhaps, also can parent occupy high 1, and available " 0 " representative " incident ", " 1 " representative " target ".Correspondingly, subclass can occupy low 7.
Certainly, in the practical application, information category also can not divided level, but then the direct representation of information category element for invasion, more line, drive in the wrong direction, leave over, lose, pace up and down, trail, assemble, suddenly speed change, cross, spray, block, fire, smog, explode, spill, setting position, car plate in low speed, hypervelocity, incident or moving target such as collide, block up, people's face, human body, the human body, a kind of in the targets such as all types of automobiles, steamer, animal.
The information parameter element is represented some key parameters of this category information, distributes the byte of varying number according to information category.Preferably, for " incident " information, the information parameter length of element is 1 byte.For example, for intrusion event, this parameter can be the area identification (when having a plurality of invasions zone, the numbering in each invasion zone that is triggered) of intrusion target number and/or invasion.For " target " information, the information parameter element comprises Target id number, target location, target sizes.Preferably, Target id number can occupy 2 bytes, the target level position can occupy 2 bytes (horizontal level of the storage target rectangle frame upper left corner in image, can be to be unit) with pixel or macro block, the target upright position can occupy 2 bytes (the storage upright position of the target rectangle frame upper left corner in image, can be to be unit) with pixel or macro block, the big I of target level direction occupies 2 bytes (can be unit with pixel or macro block), and the big I of target vertical direction occupies 2 bytes (can be unit with pixel or macro block).
There is sign in the information spreading parameter, represents this information unit whether to comprise information spreading parameter element.Preferably, use the 1-bit data representation, " 1 " expression is effective, and " 0 " expression is invalid.
Information spreading parameter length is represented the length of information spreading parameter element thereafter, is unit with bit or byte.Preferably, use the 8-bit data representation.
Information spreading parameter element, the spreading parameter of representative information.For example, for the car plate target, spreading parameter is a license plate number, and preferred, this length of element is 7 bytes, the corresponding license plate character of each byte; For moving target, spreading parameter comprises movement velocity and direction.Or the like.
In the practical application, intellectual analysis information can also have other method for expressing, enumerates no longer one by one herein.
More than the image coding/decoding method in the embodiment of the invention is described in detail, again the coding and decoding device in the embodiment of the invention is described in detail below.
Fig. 3 is the exemplary block diagram of video coding apparatus in the embodiment of the invention.As shown in Figure 3, this device comprises: video acquisition unit, intellectual analysis unit, information provide control unit and video encoding unit.
Wherein, video acquisition unit is used to gather video image.
The intellectual analysis unit is used for described video image is carried out intelligent video analysis, obtains the intelligent video analysis intellectual analysis information of correspondence as a result.
Information provides control unit to be used for according to embedding rule synchronously, and the intellectual analysis information that described intellectual analysis unit is obtained offers video encoding unit.
Video encoding unit is used for the video image of described video acquisition unit collection is encoded, and according to synchronous embedding rule, the grammer of corresponding intellectual analysis information is embedded in the coding unit head grammer of current video image of encoding, obtained embedding the video data encoder of intellectual analysis information.
During specific implementation, video encoding unit can comprise: grammer generates subelement and coding subelement.
Wherein, grammer generation subelement is used for generating the grammer of corresponding intellectual analysis information according to the intellectual analysis information that rule and information provide control unit to provide is provided synchronously.
The coding subelement is used for the video image of described video acquisition unit collection is encoded, to embed in the coding unit head grammer of current video image of encoding from the grammer that described grammer generates the corresponding intellectual analysis information of subelement, obtained embedding the video data encoder of intellectual analysis information.
Fig. 4 is the exemplary block diagram of video decoder in the embodiment of the invention.As shown in Figure 4, this device comprises: video decoding unit and intellectual analysis information acquisition unit.Further, can also comprise display unit.
Wherein, video decoding unit is used for video data encoder is decoded.
The intellectual analysis information acquisition unit is used for the grammer according to the corresponding intellectual analysis information of encoding video pictures unit header grammer of decoding, obtains the intellectual analysis information synchronous with described video image.
Display unit is used for the video image that video decoding unit decodes is displayed the play.
The specific implementation process of each unit can be consistent with method for video coding and the corresponding implementation procedure in the video encoding/decoding method in the embodiment of the invention in video coding apparatus and the video decoder in the embodiment of the invention, gives unnecessary details no longer one by one herein.
As seen, in the embodiment of the invention,, be convenient to intelligent video analysis information and video data synchronous transmission and storage, be beneficial to later retrieval and analysis by in the video compression coding data, embedding intellectual analysis information.And utilize unified syntax format, in image head or slice header syntax, embed intellectual analysis information, both guaranteed the compatibility of information between the different codecs, do not destroy the intrinsic content of video image again.When needing press intellectual analysis information retrieval video content, only need decoding and analysis diagram picture or the corresponding grammer of slice header just can quick positioning video position, do not need video is all decoded, the recall precision height, and can realize replacing the manual retrieval with machine (information) retrieval.
Above-described specific embodiment; purpose of the present invention, technical scheme and beneficial effect are further described; institute is understood that; the above only is preferred embodiment of the present invention; be not to be used to limit protection scope of the present invention; within the spirit and principles in the present invention all, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.