本文整理汇总了Python中Analysis.loadsplit方法的典型用法代码示例。如果您正苦于以下问题:Python Analysis.loadsplit方法的具体用法?Python Analysis.loadsplit怎么用?Python Analysis.loadsplit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Analysis
的用法示例。
在下文中一共展示了Analysis.loadsplit方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: single_processor
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import loadsplit [as 别名]
def single_processor(filequeue, pointslist, donelist, bgimg = None,
basedir = None, thresh=THRESH):
while not filequeue.empty():
fname = filequeue.get()
frame_num = int(path.splitext(path.split(fname)[-1])[0])
if basedir:
pass
if len(donelist)%100 == 0:
sys.stderr.write("Completed %d\n"%(len(donelist)))
sys.stderr.write("Found %d holes\n" %
len(pointslist))
try:
img1, img2 = Analysis.loadsplit(fname, bgimg = bgimg)
pointslist.extend(Analysis.findpairs(img1, img2, thresh=thresh,
DEBUG=DEBUG, abs_thresh=True,
frame_num = frame_num))
donelist.append(fname)
except IOError:
pass
except KeyboardInterrupt:
return
示例2: processor
# 需要导入模块: import Analysis [as 别名]
# 或者: from Analysis import loadsplit [as 别名]
def processor(args):
"""map-able function that processes a single frame of data
Argument: a single tuple composed of the following, in order
file_name : string, required
pointslist : list, required
file_number : ignored, optional
background : array, optional
donelist : list, optional
A list of files that have already been processed
status : ??????
"""
fname = args[0]
frame_num = int(path.splitext(path.split(fname)[-1])[0])
pointslist = args[1]
if len(args) > 2: i = args[2]
if len(args) > 3:
bgimg = args[3]
else:
bgimg = None
if len(args) > 4:
donelist = args[4]
donelist.append(i)
if len(donelist)%1000 == 1:
sys.stderr.write("Completed %d\n"%(len(donelist)-1))
sys.stderr.write("Found %d holes\n" % len(pointslist))
if len(donelist)%10000 == 0 and len(pointslist) > 0:
xl, yl, varxl, varyl, el, xr, yr, varxr, varyr, er, framenum =\
zip(*list(pointslist))
savemat('tempfile.mat',
{'xl':xl, 'yl':yl, 'varxl': varxl, 'xr':xr, 'yr':yr,
'el': el, 'er': er, 'varxr': varxr, 'framenum':framenum},
oned_as = 'row')
sys.stderr.write("Saved a snapshot\n")
if len(args) > 5:
THRESH = args[5]
# Finally, load in the image
try:
img1, img2 = Analysis.loadsplit(fname, bgimg = bgimg)
except IOError:
print "Failed loading!"
return
pointslist.extend(Analysis.findpairs(img1, img2, thresh=THRESH,
DEBUG=DEBUG, abs_thresh=True,
frame_num = frame_num))