Added hole detection in roi partitioning algorithm