How to find integral over 2D image

9 ビュー (過去 30 日間)
Koen Franse
Koen Franse 2020 年 9 月 28 日
回答済み: Bjorn Gustavsson 2020 年 9 月 28 日
Hi all,
I'm working on some image processing and try to reproduce something from an article, in which they integrate over an 2D image. I'm familiar with with finding the derivative of an image with the help of for example Sobel masking, but is there any procedure you would recommend for integration?
The problem I'm trying to work out is the following:
in which H is a vector with an x and y component. Or to put it differently, I've got to 2D images for H: Hx and Hy. I need to integrate both of them over x and y, to obtain the following:
Anyone any suggestions how to achieve this? I was already looking into the integralImage function, but was questioning if this was what I needed.
Thanks in advance! Cheers Koen
  3 件のコメント
Koen Franse
Koen Franse 2020 年 9 月 28 日
I think over an area, at least the idea is that all the components of dW and therefore dW itself result in a 2D image as well
Koen Franse
Koen Franse 2020 年 9 月 28 日
In the meantime I found the functions 'IntegralFilter' and 'IntegralKernel', would that be a way to adress this? And if so, do you have any suggestions on what kernel to use?

サインインしてコメントする。

回答 (2 件)

Steve Eddins
Steve Eddins 2020 年 9 月 28 日
Try integralImage. This function computes a cumulative in both directions, which would approximate the two-dimensional integral from the discrete image samples. The function integralFilter uses the output of integralImage to efficiently perform several different kinds of filtering operations, and I don't think that's what you need.

Bjorn Gustavsson
Bjorn Gustavsson 2020 年 9 月 28 日
If you want to have dW at the same resolution as your original image, just add the four terms together. If you want some local smooting of dW then I think you should simply convolve dW with a suitable filter-kernel, if you want a reduced size on dW, then I figure you could downsample such a filtered image. Since I don't know what your Hx and Hy are nor what they were used for in the paper you refer to more detailed suggestions become blind guesses.
One point to mention is that the second and third term looks very peculiar to me as a physicist.
HTH

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by