GuidedFilter  1.2.0
 Hosted by GitHub
Functions
guidedFilter_kernels.cl File Reference

Kernels for performing Guided Image Filtering. More...

Functions

kernel void gf_ab (global float4 *mean_p, global float4 *mean_p2, global float4 *a, global float4 *b, float eps)
 Computes the a and b coefficients in the Guided Filter algorithm. More...
 
kernel void gf_q (global float4 *p, global float4 *mean_a, global float4 *mean_b, global float4 *q, int zero_out, float scaling)
 Computes the filtered output q in the Guided Filter algorithm. More...
 
kernel void gf_var_Ip (global float4 *corr_I, global float4 *corr_Ip, global float4 *mean_I, global float4 *mean_p, global float4 *var_I, global float4 *cov_Ip)
 Computes the a and b coefficients in the Guided Filter algorithm. More...
 
kernel void gf_ab_Ip (global float4 *var_I, global float4 *cov_Ip, global float4 *mean_I, global float4 *mean_p, global float4 *a, global float4 *b, float eps)
 Computes the a and b coefficients in the Guided Filter algorithm. More...
 

Detailed Description

Kernels for performing Guided Image Filtering.

Author
Nick Lamprianidis
Version
1.1
Date
2015
Copyright (c) 2015 Nick Lamprianidis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

kernel void gf_ab ( global float4 *  mean_p,
global float4 *  mean_p2,
global float4 *  a,
global float4 *  b,
float  eps 
)

Computes the a and b coefficients in the Guided Filter algorithm.

Note
The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the arrays, M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
Parameters
[in]mean_parray of average \( p \) values in the local windows.
[in]mean_p2array of average \( p^2 \) values in the local windows.
[out]aarray of \( a \) coefficients for the local models.
[out]barray of \( b \) coefficients for the local models.
[in]epsregularization parameter \( \epsilon \).
kernel void gf_ab_Ip ( global float4 *  var_I,
global float4 *  cov_Ip,
global float4 *  mean_I,
global float4 *  mean_p,
global float4 *  a,
global float4 *  b,
float  eps 
)

Computes the a and b coefficients in the Guided Filter algorithm.

Note
The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the arrays, M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
Parameters
[in]var_Iarray of variance values for \( p \) in the local windows.
[in]cov_Iparray of covariance values for \( I,p \) in the local windows.
[in]mean_Iarray of average \( I \) values in the local windows.
[in]mean_parray of average \( p \) values in the local windows.
[out]aarray of \( a \) coefficients for the local models.
[out]barray of \( b \) coefficients for the local models.
[in]epsregularization parameter \( \epsilon \).
kernel void gf_q ( global float4 *  p,
global float4 *  mean_a,
global float4 *  mean_b,
global float4 *  q,
int  zero_out,
float  scaling 
)

Computes the filtered output q in the Guided Filter algorithm.

x.

Note
The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the arrays, M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
When dealing with depth images, there might be invalid pixels (for Kinect, those pixels have value \( 0 \)). Those invalid pixels define surfaces that the Guided Filter algorithm tries to smooth out / bring closer to nearby surfaces. The result is that those pixels end up all over the place. By setting the zero_out flag, a procedure is enabled for zeroing out in the \( q \) array those pixels that are zero in the \( p \) array.
Parameters
[in]pinput array \( p \).
[in]mean_aarray of average \( a \) values in the local windows.
[in]mean_barray of average \( b \) values in the local windows.
[in]qoutput array \( q \).
[in]zero_outflag to indicate whether to zero out invalid pixels.
[in]scalingfactor by which to scale the pixel values in the output array.
kernel void gf_var_Ip ( global float4 *  corr_I,
global float4 *  corr_Ip,
global float4 *  mean_I,
global float4 *  mean_p,
global float4 *  var_I,
global float4 *  cov_Ip 
)

Computes the a and b coefficients in the Guided Filter algorithm.

Note
The global workspace should be one-dimensional. The x dimension of the global workspace, \( gXdim \), should be equal to the number of elements in the arrays, M x N, divided by 4. That is, \( \ gXdim = M*N/4 \). The local workspace is irrelevant.
Parameters
[in]corr_Iarray of average \( I*I \) values in the local windows.
[in]corr_Iparray of average \( I*p \) values in the local windows.
[in]mean_Iarray of average \( I \) values in the local windows.
[in]mean_parray of average \( p \) values in the local windows.
[out]var_Iarray of variance values for \( p \) in the local windows.
[out]cov_Iparray of covariance values for \( I,p \) in the local windows.