depthToDisparity()
Converts from an image containing depth data to an image containing disparity data.
Declaration
class func depthToDisparity() -> any CIFilter & CIDepthToDisparityReturn Value
An image containing the disparity data.
Discussion
This method applies the depth-to-disparity filter. The filter takes depth data as an input and produces disparity data in the output image. You can use the output of this filter to create a stereo image.
The depth-to-disparity filter uses the following property:
inputImageAn image with the type CIImage.
The following code creates a filter that generates a depth map image:
func depthToDisparity(inputImage: CIImage) -> CIImage {
let depthToDisparityFilter = CIFilter.depthToDisparity()
depthToDisparityFilter.inputImage = inputImage
return depthToDisparityFilter.outputImage!
}[Image]