Fix bug in ComputeSearchRegion function related to the test if(static_cast< int >(size[i]) - d < 0)