问题标签 [particle-filter]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
257 浏览

python - Gui for Particlefilter with Python

I'm trying to implement a particle filter and I chose python for it because I kinda like python. By now i have written my gui using tkinter and python 3.4.

I use the tkinter.canvas object to display a map (png image loaded with PIL) and then i create dots for each particle like:

dot = canvas.create_oval(x, y, x + 1, y + 1)

When the robot moves I calculate the new position of each particle with the control command of the robot, the particles position and the particles alignment. To move the particle tkinter.canvas has two methods:

canvas.move()
canvas.coords()

But both methods seem to update the gui immediately which is OK when there are about 100 particles but not if there are 200 - 5000 (what I actually should have in the beginning for the global localization). So my problem is the performance of the gui.

So my actual question is: Is there a way in tkinter to stop the canvas from updating the gui, then change the gui and then update the gui again? Or can you recommend me a module that is better than tkinter for my use-case?

0 投票
0 回答
87 浏览

matlab - 在matlab中使用粒子滤波器进行配准

我编写了以下代码作为在一篇名为“E. Arce-Santana, D. Campos-Delgado and A. Alba, Affine image registrationguided byparticle filter , IET Image Process. 6 (2012 ) 的文章中介绍的配准算法的实现。 )”。

问题一:当我运行代码时,无论我选择多少粒子或迭代,输出仍然不准确。不知道是什么问题?

问题 2:我评论了一个用于更新粒子权重的公式,我的问题是,我是否实现了等式写入或出现在它上面的那个(依赖于熵)是正确的,因此删除评论的那个并留下基于熵的方程?

代码如下:

0 投票
0 回答
130 浏览

python - 粒子过滤器意外显示离散结果

我正在尝试对AR(1) 过程进行建模,该过程以一定的概率生成二元观察。

我已经实现了一个粒子过滤器(顺序重要性重采样),但它的行为似乎很奇怪。


定义一些辅助函数后:

我生成潜在变量:

它通过 sigmoid 链接生成观察到的二进制数据:

然后这是我的粒子过滤器代码:

在这里,我的建议被定义为

虽然实际模型是

我看到粒子数量多和少的情况是,对基础状态的估计是离散的和跳跃的。两幅图像的加权平均值估计值: 在此处输入图像描述

当我不重新采样时,我看不到这个: 在此处输入图像描述


这种行为可能是什么原因?是预期的还是代码中有错误?

(安装相关模块后,提供的代码应该开箱即用)

0 投票
1 回答
1295 浏览

c++ - HOG特征相似度测量?

我正在尝试为基于检测的跟踪实现粒子过滤器,目前正在尝试根据外观模型更新权重。在跟踪之前,我有一个基于 HOG+SVM 的检测器,这意味着目前,我对每个检测到的人都有 HOG 向量。对于新生成的粒子,我想根据 HOG 向量与检测器的 HOG 向量的相似性来设置权重。那么对可以测量HOG向量相似性的算法有什么建议吗?谢谢

0 投票
1 回答
238 浏览

c++ - 这个测试是重言式的吗?

鉴于一些

有什么区别

if(true)?有什么区别吗?我认为它们是等效的,但似乎并非如此?有人知道为什么吗?

好的,我是 cpp 的新手,我很抱歉这个问题。但我确实需要解决这个问题 double sigmaX = 0.1; 双 sigmaY = 0.1;

` 在 measure_prob 函数中,我发现 if(true) 或 if(x>=0 || x<0) 给出不同的结果。当 if(true) 它可以跟踪两个对象,但是当我使用 if(x>=0 || x<0) 时,它会快速收敛到一个对象。我真的很困惑……

0 投票
1 回答
298 浏览

python - 使用粒子过滤器回溯

我刚刚为室内跟踪实现了一个粒子过滤器。它看起来不错,但有时粒子会进入房间并被困在那里。

什么是回溯的聪明方法?我保存了粒子最后 10 次运动的状态。

谢谢

0 投票
0 回答
146 浏览

math - 将 L 形(角)拟合到点以删除异常值

我正在尝试从一组激光雷达传感器点(粉红色)中提取长度和宽度,如下图所示。蓝色和白色圈出的点实际上是我希望消除的噪音。【橙色框是我目前根据点数计算出来的长宽。正如所见,计算出的宽度比预期的宽 1/3,这是由于蓝白相间的噪声点]

我已经阅读了一些方法来进行角/矩形拟合,然后丢弃 x% 的最差拟合点。这将帮助我摆脱圈出的点。但到目前为止,经过多次搜索,我仍然找不到任何关于如何进行拟合的具体实现。

任何人都可以提供任何建议我可以如何去做吗? 在此处输入图像描述

0 投票
1 回答
1033 浏览

positioning - Range-based positioning/trilateration: Solving with a Kalman-Filter, smoothing with a particle filter (et vice versa)?

So, in this question I'd be grateful for hints and further information if I am correct or no.

To calculate the position upon range-measurments to fixed anchors (like GPS) you need to solve the trilateration problem, for example: non-linear least squares, geometrical algorithms or the particle filter, which also is able to solve the trilateration-problem as such.

Due to noise/errors the result might be a jagged line -> you can use the Kalman-Filter to smooth it. So far: Particle - calculation, Kalman - smoothing. Now:

  1. Is it possible to use a Kalman-Filter NOT to smoothen an already existing result, BUT to solve the trilateration as such?

  2. Regarding the particle filter: How to use the particle filter NOT to solve trilateration, BUT to smoothen an already existing result (e.g. calculated with NLLS)?

Best and thank you for any hints, papers, videos, solutions etc.!

0 投票
0 回答
1066 浏览

python - 在python中绘制多元法线的快速方法

我正在使用顺序蒙特卡罗方法来估计某种金融模型。然而,这种方法在计算上确实很昂贵,瓶颈归结为从多元高斯分布中采样。假设我使用的样本(粒子)数量为 5000,问题的维度为 5。这意味着我将有 5000 个形状为 (5,) 的不同均值向量,5000 个形状为 (5,5) 的不同协方差数组),我需要从这 5000 对中抽取 5000 个样本。我该如何快速完成?到目前为止,我最快的解决方案是:

其中 np.einsum 是 numpy 中做爱因斯坦求和的函数,mean 和 covs 是上面提到的给定的 5000 对。

我认为在 for 循环中执行 cholesky 的步骤非常缓慢,但在这种情况下我找不到任何进行矢量化计算的方法。欢迎大家提出意见。

0 投票
3 回答
751 浏览

matlab - matlab中RGB组合的直方图

我有一个 RGB 图像(uint8 类型),我想执行以下过程:

  1. 将图像量化为 16 级(每层)
  2. 计算每个RGB 组合的直方图:首先我需要一个 16*16*16 矩阵来保存这些值 - 即,如果我们表示直方图矩阵hist,那么hist(2,9,3)应该保存直方图中的像素数量,强度级别为 r=2,g= 9, b=3 etc. 下一阶段是将其重塑为 4096*1 向量(但这是最简单的部分)

现在我有以下实现:

此实现有效,但速度非常慢 - 我需要重复该过程 100 次(作为实现粒子过滤器的一部分),即使在尺寸为 ~80*40 的非常小的图像(实际上是图像部分)上执行它需要很长时间。我正在寻找一种更有效的方法来做到这一点。谢谢!