Commit 8ff685dd authored by Kalle Kabell's avatar Kalle Kabell

Add check of depth value in appendix 9 to avoid crash when depth map is not normalized

parent 71ec9727
......@@ -60,7 +60,7 @@ public class StereogramKernel: CIImageProcessorKernel {
for x in 0..<Int(inputRegion.width) {
let pixel = row.advanced(by: x * 4)
let z: Float = pixel.r
let z: Float = min(pixel.r, 1)
let stereoSeperation = Int(
(
(1 - (depthOfField * z)) * eyeSeperation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment