A CDVA implementation based on multiple CDVS descriptors.
More...
#include <CdvaImpl.h>
|
| CdvaImpl () |
|
virtual | ~CdvaImpl () |
|
virtual void | init (OPERATION op, bool verbose, size_t n_videos, int querybitrate, int refbitrate=0, bool calcdescsizes=false, bool rwCompressed=false, bool optMatch=false, double set_drop_th=-1, double set_encode_th=-1) |
| initialization method - called once before processing videos. More...
|
|
void | extract (const std::string &descrname, const std::string &videopathname, int bitrate, ExtractData &outdata) const |
| Video processing method - called once for each video in the list. More...
|
|
virtual double | match (MatchData &matchResults, const std::string &qdescrname, const std::string &rdescrname, int qbitrate, int rbitrate) |
| Video matching method - called once for each pair of videos in the list. More...
|
|
virtual void | makeindex (const std::string &cdva_descriptor, const std::string &relativepathname) |
| Video indexing method - builds a DB of reference video descriptors. More...
|
|
virtual void | retrieve (std::vector< MatchData > &retrievalResults, const std::string &qdescrname, int qbitrate) |
| Video retrieval method - returns a list of reference videos matching the query video. More...
|
|
void | commitDB () |
| Save database information. More...
|
|
virtual void | close () |
| de-initialization method - called once at the end of processing. More...
|
|
|
static bool | checkBitrate (int bitrate) |
| check if the given bitrate is one of the standard values defined in the CDVA evaluation framework. More...
|
|
static const char * | getDescriptorExt (int bitrate) |
| get the file extension corresponding to the given bitrate. More...
|
|
|
virtual void | parse (const std::string &descFile, ShotDescriptorList &shotList) |
|
virtual double | match (MatchData &matchResults, const ShotDescriptorList &qDescList, const ShotDescriptorList &rDescList) |
|
virtual double | match_med1 (MatchData &matchResults, const ShotDescriptorList &qDescList, const ShotDescriptorList &rDescList) |
| matching using medoid - variant 1 check medoids against min threshold, then perform full match More...
|
|
virtual double | match_med2 (MatchData &matchResults, const ShotDescriptorList &qDescList, const ShotDescriptorList &rDescList) |
| matching using medoid - variant 2 check medoids against min threshold, then iteratively match frames More...
|
|
virtual int | encodeShot (SegmentDescriptor &shot, unsigned long endTime, mpeg7cdvs::CdvsDescriptor &medoid, std::ofstream &fout, ExtractData &outdata) const |
|
virtual void | getDiffSignature (mpeg7cdvs::SCFVSignature &medoid, mpeg7cdvs::SCFVSignature &other, mpeg7cdvs::SCFVSignature &diffSig, unsigned int &bufferSize, unsigned char *buffer, unsigned int *globaldstatsBin) const |
|
virtual void | localDescCodingAbs (SegmentDescriptor &shot, std::vector< int > &framesToCode, unsigned int &bufferSize, unsigned char *buffer, int medoidIdx, unsigned int *localdstats) const |
| lossy local descriptor coding, applying ABAC to absolute descriptors More...
|
|
void | generateDTM (CompressedSegmentDescriptor &shot, std::vector< int > &framesToCode, int medoidIdx, std::vector< RefFeature > refFeatureList, std::vector< int > ldOffsets, std::vector< int > localFrameOrder, int totalNrFeatures) const |
| generate frame - descriptor map More...
|
|
virtual void | encodeCoordinates (CompressedSegmentDescriptor &shot, std::vector< int > &framesToCode, int medoidIdx, std::vector< RefFeature > refFeatureList, std::vector< int > ldOffsets) const |
| encode coordinates of local descriptors of as one block More...
|
|
A CDVA implementation based on multiple CDVS descriptors.
◆ CdvaImpl()
mpeg7cdva::CdvaImpl::CdvaImpl |
( |
| ) |
|
◆ ~CdvaImpl()
virtual mpeg7cdva::CdvaImpl::~CdvaImpl |
( |
| ) |
|
|
virtual |
◆ byDescendingScore()
static bool mpeg7cdva::CdvaImpl::byDescendingScore |
( |
const MatchData & |
m1, |
|
|
const MatchData & |
m2 |
|
) |
| |
|
staticprotected |
◆ checkBitrate()
static bool mpeg7cdva::CdvaImpl::checkBitrate |
( |
int |
bitrate | ) |
|
|
static |
check if the given bitrate is one of the standard values defined in the CDVA evaluation framework.
- Parameters
-
bitrate | the bitrate in Kilo-byte per second (KB/s) |
- Returns
- true if valid
◆ close()
virtual void mpeg7cdva::CdvaImpl::close |
( |
| ) |
|
|
virtual |
de-initialization method - called once at the end of processing.
◆ commitDB()
void mpeg7cdva::CdvaImpl::commitDB |
( |
| ) |
|
Save database information.
◆ encodeCoordinates()
virtual void mpeg7cdva::CdvaImpl::encodeCoordinates |
( |
CompressedSegmentDescriptor & |
shot, |
|
|
std::vector< int > & |
framesToCode, |
|
|
int |
medoidIdx, |
|
|
std::vector< RefFeature > |
refFeatureList, |
|
|
std::vector< int > |
ldOffsets |
|
) |
| const |
|
protectedvirtual |
encode coordinates of local descriptors of as one block
◆ encodeShot()
virtual int mpeg7cdva::CdvaImpl::encodeShot |
( |
SegmentDescriptor & |
shot, |
|
|
unsigned long |
endTime, |
|
|
mpeg7cdvs::CdvsDescriptor & |
medoid, |
|
|
std::ofstream & |
fout, |
|
|
ExtractData & |
outdata |
|
) |
| const |
|
protectedvirtual |
◆ extract()
void mpeg7cdva::CdvaImpl::extract |
( |
const std::string & |
descrname, |
|
|
const std::string & |
videopathname, |
|
|
int |
bitrate, |
|
|
ExtractData & |
outdata |
|
) |
| const |
Video processing method - called once for each video in the list.
- Parameters
-
descrname | output descriptor pathname |
videopathname | input video stream pathname |
bitrate | encoding bitrate (one of 0,16,64,256) |
outdata | the container for output data |
◆ generateDTM()
void mpeg7cdva::CdvaImpl::generateDTM |
( |
CompressedSegmentDescriptor & |
shot, |
|
|
std::vector< int > & |
framesToCode, |
|
|
int |
medoidIdx, |
|
|
std::vector< RefFeature > |
refFeatureList, |
|
|
std::vector< int > |
ldOffsets, |
|
|
std::vector< int > |
localFrameOrder, |
|
|
int |
totalNrFeatures |
|
) |
| const |
|
protected |
generate frame - descriptor map
◆ getDescriptorExt()
static const char* mpeg7cdva::CdvaImpl::getDescriptorExt |
( |
int |
bitrate | ) |
|
|
static |
get the file extension corresponding to the given bitrate.
- Parameters
-
bitrate | the bitrate in Kilo-byte per second (KB/s) |
- Returns
- the file extension
◆ getDiffSignature()
virtual void mpeg7cdva::CdvaImpl::getDiffSignature |
( |
mpeg7cdvs::SCFVSignature & |
medoid, |
|
|
mpeg7cdvs::SCFVSignature & |
other, |
|
|
mpeg7cdvs::SCFVSignature & |
diffSig, |
|
|
unsigned int & |
bufferSize, |
|
|
unsigned char * |
buffer, |
|
|
unsigned int * |
globaldstatsBin |
|
) |
| const |
|
protectedvirtual |
◆ getExt()
static std::string mpeg7cdva::CdvaImpl::getExt |
( |
const std::string & |
imageName | ) |
|
|
staticprotected |
◆ init()
virtual void mpeg7cdva::CdvaImpl::init |
( |
OPERATION |
op, |
|
|
bool |
verbose, |
|
|
size_t |
n_videos, |
|
|
int |
querybitrate, |
|
|
int |
refbitrate = 0 , |
|
|
bool |
calcdescsizes = false , |
|
|
bool |
rwCompressed = false , |
|
|
bool |
optMatch = false , |
|
|
double |
set_drop_th = -1 , |
|
|
double |
set_encode_th = -1 |
|
) |
| |
|
virtual |
initialization method - called once before processing videos.
- Parameters
-
op | one of EXTRACT, MATCH, RETRIEVE |
verbose | when set, more information is provided |
n_videos | the number of videos to be processed |
querybitrate | the query encoding bitrate (one of 0,16,64,256) |
refbitrate | the reference encoding bitrate (one of 0,16,64,256) |
calcdescsizes | if true, the size of individual elements of the CDVS descriptor is reported in the output log files |
rwCompressed | if true, compressed descriptor representations are used for serialising and parsing |
optMatch | if true, use approximate matching of medoid-based descriptors |
set_drop_th | value to override default drop frame threshold |
set_encode_th | value to override default encode frame threshold |
◆ localDescCodingAbs()
virtual void mpeg7cdva::CdvaImpl::localDescCodingAbs |
( |
SegmentDescriptor & |
shot, |
|
|
std::vector< int > & |
framesToCode, |
|
|
unsigned int & |
bufferSize, |
|
|
unsigned char * |
buffer, |
|
|
int |
medoidIdx, |
|
|
unsigned int * |
localdstats |
|
) |
| const |
|
protectedvirtual |
lossy local descriptor coding, applying ABAC to absolute descriptors
- Parameters
-
localdstats | for gathering encoding statistics only |
◆ makeindex()
virtual void mpeg7cdva::CdvaImpl::makeindex |
( |
const std::string & |
cdva_descriptor, |
|
|
const std::string & |
relativepathname |
|
) |
| |
|
virtual |
Video indexing method - builds a DB of reference video descriptors.
- Parameters
-
cdva_descriptor | the descriptor to add to the DB |
relativepathname | the relative pathname of the video file to be used as unique identifier |
◆ match() [1/2]
◆ match() [2/2]
virtual double mpeg7cdva::CdvaImpl::match |
( |
MatchData & |
matchResults, |
|
|
const std::string & |
qdescrname, |
|
|
const std::string & |
rdescrname, |
|
|
int |
qbitrate, |
|
|
int |
rbitrate |
|
) |
| |
|
virtual |
Video matching method - called once for each pair of videos in the list.
- Parameters
-
matchResults | container for the results of matching |
qdescrname | input query descriptor name |
rdescrname | input reference descriptor name |
qbitrate | query bitrate (one of 16,64,256) |
rbitrate | reference bitrate (one of 16,64,256) |
- Returns
- the matching score (normalized in the [0..1] range)
◆ match_med1()
matching using medoid - variant 1 check medoids against min threshold, then perform full match
◆ match_med2()
matching using medoid - variant 2 check medoids against min threshold, then iteratively match frames
◆ nBitsSet() [1/2]
static int mpeg7cdva::CdvaImpl::nBitsSet |
( |
unsigned char |
byte | ) |
|
|
inlinestaticprotected |
◆ nBitsSet() [2/2]
static int mpeg7cdva::CdvaImpl::nBitsSet |
( |
unsigned int |
word | ) |
|
|
inlinestaticprotected |
◆ parse()
virtual void mpeg7cdva::CdvaImpl::parse |
( |
const std::string & |
descFile, |
|
|
ShotDescriptorList & |
shotList |
|
) |
| |
|
protectedvirtual |
◆ retrieve()
virtual void mpeg7cdva::CdvaImpl::retrieve |
( |
std::vector< MatchData > & |
retrievalResults, |
|
|
const std::string & |
qdescrname, |
|
|
int |
qbitrate |
|
) |
| |
|
virtual |
Video retrieval method - returns a list of reference videos matching the query video.
- Parameters
-
retrievalResults | the output vector containing an ordered list of matching reference videos |
qdescrname | the video query descriptor |
qbitrate | query bitrate (one of 16,64,256) |
◆ calc_desc_sizes
bool mpeg7cdva::CdvaImpl::calc_desc_sizes |
|
protected |
calculate size of descriptor components
◆ cdvsclient
mpeg7cdvs::CdvsClient* mpeg7cdva::CdvaImpl::cdvsclient |
|
protected |
◆ cdvsconfig
mpeg7cdvs::CdvsConfiguration* mpeg7cdva::CdvaImpl::cdvsconfig |
|
protected |
◆ cdvsMode
int mpeg7cdva::CdvaImpl::cdvsMode |
|
protected |
the CDVS mode that will be used to encode keyframe descriptors
◆ cdvsserver
mpeg7cdvs::CdvsServer* mpeg7cdva::CdvaImpl::cdvsserver |
|
protected |
◆ current_op
◆ drop_frame_th
double mpeg7cdva::CdvaImpl::drop_frame_th |
|
protected |
◆ encode_th
double mpeg7cdva::CdvaImpl::encode_th |
|
protected |
threshold for encoding other frames than median
◆ forceSampleMs
int mpeg7cdva::CdvaImpl::forceSampleMs |
|
protected |
enforce a sample every x milliseconds
◆ max_retrieved
size_t mpeg7cdva::CdvaImpl::max_retrieved |
|
protected |
maximum number of retrieved images
◆ minLocalDiff
int mpeg7cdva::CdvaImpl::minLocalDiff |
|
protected |
min local difference for lossy local descriptor coding (if diff is larger, descriptor is encoded, otherwise replaced by reference)
◆ minShotLen
int mpeg7cdva::CdvaImpl::minShotLen |
|
protected |
◆ optMatch
bool mpeg7cdva::CdvaImpl::optMatch |
|
protected |
approx. matching of medoid-based descriptors
◆ optMatch_b
double mpeg7cdva::CdvaImpl::optMatch_b |
|
protected |
divider for fraction of key frames to check to decide for match (opt matching mode 2)
◆ optMatch_mode
int mpeg7cdva::CdvaImpl::optMatch_mode |
|
protected |
mode for optimised matching (1 or 2)
◆ optMatch_tau
double mpeg7cdva::CdvaImpl::optMatch_tau |
|
protected |
factor to define threshold to continue matching (opt matching modes 1 and 2)
◆ readWriteCompressed
bool mpeg7cdva::CdvaImpl::readWriteCompressed |
|
protected |
read and write compressed descriptors
◆ shot_cut_th
double mpeg7cdva::CdvaImpl::shot_cut_th |
|
protected |
◆ shot_ver_th
double mpeg7cdva::CdvaImpl::shot_ver_th |
|
protected |
shot verification threshold
◆ skip_after
int mpeg7cdva::CdvaImpl::skip_after |
|
protected |
number of video frames to skip after decoding one
◆ skip_before
int mpeg7cdva::CdvaImpl::skip_before |
|
protected |
number of video frames to skip before decoding one
◆ verboseMode
bool mpeg7cdva::CdvaImpl::verboseMode |
|
protected |
The documentation for this class was generated from the following file: