我正在尝试使用媒体流追踪器(Media Flow Tracker)来跟踪手部位置,但是边框大小会在一段时间后持续增加。在最开始的10秒钟内,它可以正常工作。
以下是代码片段:
def main():
display = SimpleCV.Display()
cam = Kinect()
ts = []
bb = None
img = cam.getDepth().flipHorizontal()
while display.isNotDone():
depth = cam.getDepth().flipHorizontal()
filtered = depth.stretch(0, 180).binarize().dilate(1)
if bb is None:
blobs = filtered.findBlobs()
if blobs:
hand = blobs.filter(abs(7000 - blobs.area()) < 500)
print hand
if hand:
bb = hand[0].boundingBox()
print bb
if bb is not None:
ts = filtered.track("mftrack", ts, img, bb)
if ts:
ts.drawBB()
ts.showPixelVelocityRT()
ts.drawPath()
filtered.show()