Gradual transition detection for video partitioning using morphological operators