Depth of Field Filter
Filter
RIF_IMAGE_FILTER_DEPTH_OF_FIELD
Description
The filter emulates the depth of field of the real camera (Depth of field).
Parameters
Parameter  | 
Type  | 
Input/Output  | 
Description  | 
|---|---|---|---|
depthImg  | 
image  | 
input  | 
The image which contains depths, i.e. the distance from the camera to the captured pixel in meters.  | 
focalL  | 
float  | 
input  | 
The focal length of the camera lens in millimeters.   | 
focusD  | 
float  | 
input  | 
The focus distance in meters; objects at that distance from the camera will be in focus.   | 
aperture  | 
float  | 
input  | 
The opening through which light travels. The aperture limits the ray bundle (Aperture).   | 
kernelSize  | 
uint  | 
input  | 
The blurring area (circle) size.  
  | 
Usage Example
rif_image_filter filter = nullptr;
rifContextCreateImageFilter(context, RIF_IMAGE_FILTER_DEPTH_OF_FIELD, &filter);
rifImageFilterSetParameter1u(filter, "kernelSize", RIF_DEPTH_OF_FIELD_FILTER_KERNEL_SIZE_LARGE);
rifImageFilterSetParameter1f(filter, "focusD", 1.8f);
rifImageFilterSetParameter1f(filter, "aperture", 0.8f);
rifImageFilterSetParameterImage(filter, "depthImg", depthImage);
rifCommandQueueAttachImageFilter(queue, filter, inputImage, outputImage);
rifContextExecuteCommandQueue(context, queue, nullptr, nullptr, nullptr);
Results
 
                Input image  | 
 
                Output image (focusing on the middle of the table)  |