Definition at line 218 of file mainMonetTest.cpp. References Impala::Core::Table::AnnotationTable::AddNegative(), Impala::Core::Table::AnnotationTable::AddPositive(), Impala::Core::Table::AnnotationTable::AddSkip(), Impala::FileNameBase(), Impala::Core::VideoSet::VideoSet::GetQuidFrame(), Impala::Core::Database::RawDataSet::GetSetNameBase(), ILOG_ERROR, ILOG_VAR, Impala::QUID_CLASS_FRAME, and Impala::QuidId(). Referenced by MakeAnnotationTableSetMapi(). 00220 { 00221 ILOG_VAR(Impala.Samples.MonetTest.MakeAnnotationTableMapi); 00222 00223 if (quidClass != QUID_CLASS_FRAME) 00224 { 00225 ILOG_ERROR("Can do Frame only"); 00226 return 0; 00227 } 00228 00229 String vidSetBase = vidSet->GetSetNameBase(); 00230 String query = 00231 "select f.quid, fr.fragment_start, a.relevance \ 00232 from fragment fr, file f, video_set vs, video_sets vss, \ 00233 keyword_sets kss, keyword_set ks, keyword k, annotator a, \ 00234 annotation a \ 00235 where vss.set_name = '" + vidSetBase + "' and \ 00236 vs.video_sets_id = vss.video_sets_id and \ 00237 f.file_id = vs.file_id and \ 00238 fr.media_id = f.media_id and \ 00239 fr.fragment_length = 1 and \ 00240 fr.keyframe = false and \ 00241 kss.set_name = '" + FileNameBase(conceptSet) + "' and \ 00242 kss.video_sets_id = vss.video_sets_id and \ 00243 ks.keyword_sets_id = kss.keyword_sets_id and \ 00244 ks.keyword_id = k.keyword_id and \ 00245 k.keyword_name = '" + keyword + "' and \ 00246 a.annotator_name = 'fabchannel' and \ 00247 a.fragment_id = fr.fragment_id and \ 00248 a.keyword_id = k.keyword_id and \ 00249 a.approved = true \ 00250 order by f.quid, fr.fragment_start;"; 00251 00252 MapiHdl hdl = conn->QueryPartStart(query); 00253 if (hdl == 0) 00254 return 0; 00255 00256 Quid* quid = 0; 00257 int quidSize = 0; 00258 if (!conn->QueryPartFetchULL(hdl, 0, quid, quidSize)) 00259 return 0; 00260 00261 int* start = 0; 00262 int startSize = 0; 00263 if (!conn->QueryPartFetchInt(hdl, 1, start, startSize)) 00264 return 0; 00265 00266 double* rel = 0; 00267 int relSize; 00268 if (!conn->QueryPartFetchDouble(hdl, 2, rel, relSize)) 00269 return 0; 00270 00271 conn->QueryPartEnd(hdl); 00272 00273 AnnotationTable* anno = new AnnotationTable(keyword, quidSize); 00274 for (int i=0 ; i<quidSize ; i++) 00275 { 00276 int vidId = QuidId(quid[i]); 00277 Quid q = vidSet->GetQuidFrame(vidId, start[i], false); 00278 if (rel[i] == 1.0) 00279 anno->AddPositive(q); 00280 else if (rel[i] == 0.0) 00281 anno->AddNegative(q); 00282 else 00283 anno->AddSkip(q); 00284 } 00285 00286 delete quid; 00287 delete start; 00288 delete rel; 00289 return anno; 00290 }
Here is the call graph for this function:
|