Prerequisites
- A working iOS quickstart
- Background effects enabled for the project
Enable blur
NosmaiBackgroundSegmentationConfig *config =
[[NosmaiBackgroundSegmentationConfig alloc] init];
config.mode = NosmaiBackgroundSegmentationModeBlur;
config.blurStrength = 50.0f;
[[NosmaiCore shared].effects setBackgroundSegmentation:config];
blurStrength uses 0 through 100. Apply an updated configuration when the user changes the slider.
Disable blur
[[NosmaiCore shared].effects clearBackgroundSegmentation];
Verify it worked
The subject should stay sharp while the scene behind it becomes blurred.
Common errors
| Symptom | Fix |
|---|---|
| Blur covers the subject edge | Improve lighting and reduce fast motion |
| Preview slows | Start at 720p and test the Release build on the lowest supported device |
| No blur | Check advanced-filter capability and camera readiness |