@albanD Thank you. I found that. It did works. However I realize that a integral image is not what I want…
My task is that:
given a edge image, for every pixel, I need to specify whether the neighbor pixel in a rectangular area is on the same side with that central pixel. Initialy I think integral image can do that, however I found the counter example that it fails… Any suggestion ?