Rebased Pol's IntegralImage PR
Fixed integral image PR + small features
merge with cbecker master