我目前正在使用OpenCV内置的基于补丁的直方图反投影(cv :: calcBackProjectPatch())来识别图像中目标材质的区域.图像分辨率为640 x 480,窗口大小为10 x 10,处理单个图像需要约1200 ms.虽然结果很好,但这对于实时应用程序来说太慢了(应该具有不超过~100毫秒的处理时间).
我已经尝试过减小窗口大小并从CV_COMP_CORREL切换到CV_COMP_INTERSECT以加快处理速度,但是没有看到任何明显的加速.这可以通过OpenCV文档解释(强调我的):
Each new image is measured and then
converted into an image image array
over a chosen ROI. Histograms are
taken from this image image in an area
covered by a “patch” with an anchor at
center as shown in the picture below.
The histogram is normalized using the
parameter norm_factor so that it may
be compared with hist. The calculated
histogram is compared to the model
histogram; hist uses The function
cvCompareHist() with the comparison
method=method
). The resulting
output is placed at the location
corresponding to the patch anchor in
the probability image dst. This
process is repeated as the patch is
slid over the ROI. Iterative histogram
update by subtracting trailing pixels
covered by the patch and adding newly
covered pixels to the histogram can
save a lot of operations, though it is
not implemented yet.
这给我留下了一些问题:
>是否有另一个支持迭代直方图更新的库?
>使用迭代更新时,我期望加速的重要程度如何?
>还有其他技术可以加速这种类型的操作吗?
最佳答案 正如OpenCV Integral Histograms中提到的,肯定会提高速度.
请查看以下链接中的示例实现
http://smsoftdev-solutions.blogspot.com/2009/08/integral-histogram-for-fast-calculation.html