本文整理匯總了Python中datalogger.DataLogger.write方法的典型用法代碼示例。如果您正苦於以下問題:Python DataLogger.write方法的具體用法?Python DataLogger.write怎麽用?Python DataLogger.write使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalogger.DataLogger
的用法示例。
在下文中一共展示了DataLogger.write方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: set
# 需要導入模塊: from datalogger import DataLogger [as 別名]
# 或者: from datalogger.DataLogger import write [as 別名]
t_A = kpHist[clsid].timehist[-1][-1]
# update matched expanding keypoints with accurate scale, latest
# keypoint and descriptor
kpHist[clsid].update(trainKP[m.trainIdx],tdesc[m.trainIdx],t_A,t_curr,scale)
keypoints.append(kpMsg(x=trainKP[m.trainIdx].pt[0]
, y=trainKP[m.trainIdx].pt[1]
, scale=scale, class_id=clsid
, detects=kpHist[clsid].detects
, trainSize=trainKP[m.trainIdx].size
, querySize=queryKP[m.queryIdx].size))
if opts.publish:
keypoints=sorted(keypoints, key=op.attrgetter('scale','detects'), reverse=True)[:10]
datalog.write(frame_id=frmbuf.frameNum
, timestep=Duration(int((t_curr-t_last)/1000), ((t_curr-t_last)%1000)*1e6)
, keypoints=keypoints)
# Update the keypoint history for previously expanding keypoint that were
# not detected/matched in this frame
detected = set(map(op.attrgetter('class_id'),trainKP))
# get rid of old matches
kpHist = OrderedDict(filter(lambda kv: kv[1].downdate().age < LAST_DAY, kpHist.iteritems()))
# keep matches that were missed in this frame
missed = filter(lambda k: (kpHist[k].age > 0) and (k not in detected), kpHist.iterkeys())
missed = [(kpHist[k].keypoint,kpHist[clsid].descriptor.reshape(1,-1)) for k in missed]
if missed:
missed_kp, missed_desc = zip(*missed)
trainKP.extend( missed_kp )