计算图像积分 [英] Computing image integral

查看:85
本文介绍了计算图像积分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何从图像积分中找到均值,标准差和梯度?给出如下图像:

How do one find the mean, std dev, and gradient from image integral? Given an image such as follows:

如上图所示,要找到突出显示部分的总和,sum = C+A-B-D.
所以我们有sum = 22.

As shown in the figure above, to find the sum of the highlighted parts, sum = C+A-B-D.
So we have sum = 22.

我该如何下一步才能找到:

How can I proceed next in order to find:

  • 平均值
  • 标准开发
  • 渐变

推荐答案

C+A-B-D为您提供由A,B,C,D划定的区域中的灰度级总和,因此,为了获取您所需的均值按区域区域进行潜水:

C+A-B-D gives you the sum of the gray levels in the zone delimited by A,B,C,D, so, to get the mean you just need to dived it by the area of the zone:

mean = (C+A-B-D)/4

要获取开发者,您必须计算平方面积表的总和(使用cv::integral您可以传递其他参数以获取平方和).引用维基百科,标准差等于的平方根(平方的平均值减去平均值的平方).因此,假设A',B',C',D'在您的正方形区域表中的值:

To get the dev, you must compute the sum of square area table (using cv::integral you can pass a additional parameters to get the sum of squares). Quoting wikipedia, the standard deviation is equal to the square root of (the average of the squares less the square of the average). So assuming A',B',C',D' the values in your square area table:

dev = sqrt((C'+A'-B'-D')/4 - (mean*mean))

因此,使用积分图像计算均值和dev的速度非常,特别是如果您要在图像块的随机位置和随机尺寸上计算这些数量,则尤其如此.

So computing mean and dev using integral image is very fast using integral images, especially if you want to compute those quantities at random locations and on random size of image patches.

关于渐变,它更复杂.您确定不想使用sobel运算符吗?

Concerning the gradient, it's more complex. Are you sure you do not want to use sobel operator?

这篇关于计算图像积分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆