Motion blur ValueError when blur_limit is even
See original GitHub issue🐛 Bug
I’m not sure that this line https://github.com/albumentations-team/albumentations/blob/master/albumentations/augmentations/blur/transforms.py#L77 works as expected. It doesn’t take into account allow_shifted parameter at all, since there is or operator.
To Reproduce
Steps to reproduce the behavior:
- A.Compose([A.MotionBlur(blur_limit=20)])
ValueError: Blur limit must be odd when centered=True. Got: (3, 20)
Expected behavior
I think that check for motion_limit should take the expression like this
if not allow_shifted and (self.blur_limit[0] % 2 != 1 or self.blur_limit[1] % 2 != 1):
Environment
- Albumentations version (e.g., 0.1.8): 1.3.0
- Python version (e.g., 3.7): 3.10.8
- OS (e.g., Linux): MacOs
- How you installed albumentations (
conda
,pip
, source): pip - Any other relevant information:
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
How to Fix Motion Blur in PC Games - PCMag
If blurry motion is ruining your PC gaming experiences, tweak these settings in Windows, on your monitor, or in your game to reduce...
Read more >Freya Holmér on Twitter: "Motion blur - Twitter
In this case, motion blur is a bit of a misnomer though - makes it sound as if it's a simple blur effect,...
Read more >Motion Blur — Blender Manual
Motion Blur ... Blender's animations are by default rendered as a sequence of perfectly still images. While great for stop-motion and time-lapses, this...
Read more >Blur transforms (augmentations.blur.transforms)
maximum Gaussian kernel size for blurring the input image. Must be zero or odd and in range [0, inf). If set to 0...
Read more >Intro to Blur filters in Motion - Apple Support
Gaussian Blur creates a soft blur effect. Gradient Blur creates a graduated blur between two points. Prism blurs and refracts the image as...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@Dipet Error says that blur_limit should be odd when centered=True. I mean that this expression:
doesn’t take into account allow_shifted parameter at all (If self.blur_limir[1] is even it will always raise an error if allow_shifted is True or False). If Motion blur works only with odd blur_limit we should specify it somewhere and make this expression without allow_shifted variable. What do you think?
No, otherwise, It works with odd sizes only when
allow_shifted=False
. In that case we need odd value to make centered kernel. Yes. it will work correctly with even kenel sizes, but it maybe a little bit confusing whe you set limit to odd value, but it newer will be reached. At least we need warning thatkernel
is even and real limit is lower to by 1.