bug fixed, integral image variable -- sum should be double type