Ask Your Question
0

CvIntegral

asked 2013-02-04 00:54:06 -0500

Bibliarij gravatar image

updated 2013-02-04 00:55:23 -0500

Hello all! I have some questions about function cvIntegral().
1. Why resulting integral image have size (source_width+1) x (source_height+1), but not source_width x source_height?
2. How integral image of colored image (3-channel) is calculating?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
3

answered 2013-02-04 02:05:28 -0500

Michael Burdinov gravatar image
  1. Because for row with 5 elements you may need 6 sums: with 0, 1, 2, 3, 4 or 5 elements.

  2. It is supposed to be single channel image. See documentation of this function.

edit flag offensive delete link more

Comments

Sorry, but I don't understand you... For example, for 3x3 matrix {{1 2 3} {3 2 1} {2 3 1}} integral matrix will be {{1 3 6}{4 8 12}{6 13 18}}. Am i right?

Bibliarij gravatar imageBibliarij ( 2013-02-04 08:22:02 -0500 )edit
1

You missed the row and column of zeros. It will be {{0 0 0 0} {0 1 3 6} {0 4 8 12} {0 6 13 18}}. Please see how sum(X,Y) is calculated in the documentation.

This column and row of zeros are needed for convenience. Without them you will need to check boundary conditions in computations that use integral image.

Michael Burdinov gravatar imageMichael Burdinov ( 2013-02-04 08:43:51 -0500 )edit

thanks a lot

Bibliarij gravatar imageBibliarij ( 2013-02-04 08:45:44 -0500 )edit

You are welcome

Michael Burdinov gravatar imageMichael Burdinov ( 2013-02-04 09:10:23 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-02-04 00:54:06 -0500

Seen: 1,171 times

Last updated: Feb 04 '13