Numerical Integral of an image?

136 Views Asked by At

I am currently trying to implement the method described in this paper. In short we have a system of the form $a=B\times c$. Where $a_i = \int d^3r \space w(r)f_i(r)t(r) $ and $B_{ij} = \int d^3r \space w(r)f_i(r)f_j(r)$. The solution is given by $c = B^{-1}a$. In this case $w,t,f_i$ are volumes, specifically a sequence of images obtained from an x-ray simulation. When I solve these integrals using matlab's trapz function I get a poorly-conditioned $B$ matrix. Is there any other way to integrate this type of data (images)? Or a different way to calculate my $a$ and $B$ terms?