Prerequisites
- A working Android quickstart
- Background effects enabled for the project
Enable blur
NosmaiBackgroundSegmentationConfig config =
new NosmaiBackgroundSegmentationConfig(
NosmaiBackgroundSegmentationConfig.Mode.BLUR
);
config.blurStrength = 55.0f;
NosmaiEffects.setBackgroundSegmentation(config);
blurStrength uses 0 through 100. Update the configuration from the main thread when a slider changes.
Disable blur
NosmaiEffects.clearBackgroundSegmentation();
Verify it worked
The subject should remain visible and sharp while the scene behind it is blurred.
Common errors
| Symptom | Fix |
|---|---|
| No blur | Confirm the pipeline is ready and advanced filters are enabled |
| Edge quality changes during motion | Improve lighting and reduce camera motion |
| Lower frame rate | Use 30 FPS, lower input resolution, and profile a Release build |