SAM2 for Image and Video Segmentation: A Comprehensive Survey