[][src]Function opencv::imgproc::integral_titled_sq

pub fn integral_titled_sq(
    src: &dyn ToInputArray,
    sum: &mut dyn ToOutputArray,
    sqsum: &mut dyn ToOutputArray,
    tilted: &mut dyn ToOutputArray,
    sdepth: i32,
    sqdepth: i32
) -> Result<()>

Calculates the integral of an image.

The function calculates one or more integral images for the source image as follows:

block formula

block formula

block formula

Using these integral images, you can calculate sum, mean, and standard deviation over a specific up-right or rotated rectangular region of the image in a constant time, for example:

block formula

It makes possible to do a fast blurring or fast block correlation with a variable window size, for example. In case of multi-channel images, sums for each channel are accumulated independently.

As a practical example, the next figure shows the calculation of the integral of a straight rectangle Rect(3,3,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the original image are shown, as well as the relative pixels in the integral images sum and tilted .

integral calculation example

Parameters

  • src: input image as inline formula, 8-bit or floating-point (32f or 64f).
  • sum: integral image as inline formula , 32-bit integer or floating-point (32f or 64f).
  • sqsum: integral image for squared pixel values; it is inline formula, double-precision floating-point (64f) array.
  • tilted: integral for the image rotated by 45 degrees; it is inline formula array with the same data type as sum.
  • sdepth: desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or CV_64F.
  • sqdepth: desired depth of the integral image of squared pixel values, CV_32F or CV_64F.

C++ default parameters

  • sdepth: -1
  • sqdepth: -1