Created by: flishwang
The calculation may be not correct when the input bbox is not ordered by prob. This commit fixes the problem.