Skip to content

Commit 4069e3b

Browse files
committed
Increase sensor sample size to 10%
1 parent 0f3628a commit 4069e3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The Observer Effect is optimized to run on a wide range of devices, from high-en
7171
- Camera frames throttled to ~5 FPS to reduce CPU usage by 80%
7272
- Automatic memory management - pauses detection during low memory conditions
7373
- Low resolution processing (320×240) for minimal resource usage
74-
- Efficient pixel sampling (~1000 pixels per frame)
74+
- Efficient pixel sampling (10% of pixels, ~7,680 samples per frame)
7575

7676
**High-end device features:**
7777
- Optional app preload for instant appearance (100-300ms vs 2-5 seconds)

app/src/main/kotlin/com/observer/effect/MotionDetector.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,9 @@ class MotionDetector(
227227

228228
previousFrame?.let { prevFrame ->
229229
if (data.size == prevFrame.size) {
230-
// Calculate frame difference by sampling ~1000 pixels
230+
// Calculate frame difference by sampling 10% of pixels (~7680 pixels at 320x240)
231231
var diff = 0L
232-
val step = maxOf(1, data.size / 1000)
232+
val step = 10
233233
for (i in data.indices step step) {
234234
diff += abs(data[i].toInt() - prevFrame[i].toInt())
235235
}

0 commit comments

Comments
 (0)