— The lack of a parameterized observation model in robot localization using occupancy grids requires the application of sampling-based methods, or particle filters. This work addresses the problem of optimal Bayesian filtering for dynamic systems with observation models that cannot be approximated properly as any parameterized distribution, which includes localization and SLAM with occupancy grids. By integrating ideas from previous works on adaptive sample size, auxiliary particle filters, and rejection sampling, we derive a new particle filter algorithm that enables the usage of the optimal proposal distribution to estimate the true posterior density of a non-parametric dynamic system. Our solution avoids approximations adopted in previous approaches at the cost of a higher computational burden. We present simulations and experimental results for a real robot showing the suitability of the method for localization.