尽管初始大小固定,但用于跟踪对象的边界框/ROI 的大小仍在不断增加
Size of BoundingBox/ROI to track object keeps on increasing despite fixed initial size
我正在尝试使用媒体流跟踪器根据区域跟踪我的手,但一段时间后边界框不断增加。它在前 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()
我会从以下行中删除对dilate
的调用:
filtered = depth.stretch(0, 180).binarize().dilate(1)
从 SimpleCV 文档中:
扩张(迭代次数=1) 应用形态扩张。膨胀具有平滑斑点的效果,同时增强噪声斑点的数量。此实现使用默认的 openCV 3X3 方形内核侵蚀实际上是一个局部极大值检测器,内核在图像上移动并在内核内获取最大值。
变量filtered
在每次循环迭代中使用,filtered.findBlobs()
.这些斑点的强度和密度用于确定边界框的尺寸。
您正在调用 stretch
函数以及扩张。随着时间的推移,对dilate
的调用会导致噪音被检测为手的一部分,因此边界框相应增加。
相关文章:
- 数组索引的值没有增加
- 为什么我的代码在输出中增加了93天
- 不断收到相同的错误...怎么了?C++
- 有效地使用std::unordered_map来插入或增加键的值
- std::当在256字节边界上写入整数时,流的奇怪行为
- Vulkan验证层不断在VkQueuePresentKHR()上抛出图像布局错误
- ActiveMQ使用者的内存使用量在onMessage调用后不断增加
- 不断增加的指针数组 错误:赋值中的类型不兼容
- 我的值不断增加,而不是在循环语句中重置
- C++不断增加阵列大小
- 当使用动态数组时,循环中的内存使用量不断增加.(C++)
- 随着C++程序的运行,内存使用量不断增加
- Arduino Serial.available() 不断增加
- gtkmm应用程序内存使用量不断增加
- 不断增加物理内存Visual c++ CryptMsgClose和CryptReleaseContext
- 在AIX上,VSZ和RSS不断增加
- 信号量句柄的数量不断增加
- 尽管初始大小固定,但用于跟踪对象的边界框/ROI 的大小仍在不断增加
- Linux:为什么 smaps 中的值会不断增加
- c++ -不断增加一个整数