Currently, most preprocessing functions assume 3-channel RGB images. This causes errors when grayscale images (shape (H, W)) are passed. Some datasets are already in grayscale, and many models (e.g., edge detection, classical CV tasks) expect grayscale inputs.
Functions like median_filter, Gaussian_blur, and resize should be updated to:
- Accept both grayscale and RGB images.
- Handle channel dimension consistently (e.g., add a dummy channel if grayscale, or branch logic).
- Ensure output dtype/shape matches the input format.
Currently, most preprocessing functions assume 3-channel RGB images. This causes errors when grayscale images (shape (H, W)) are passed. Some datasets are already in grayscale, and many models (e.g., edge detection, classical CV tasks) expect grayscale inputs.
Functions like median_filter, Gaussian_blur, and resize should be updated to: