Skip to content

Applying a filter

Romain Milbert edited this page Oct 19, 2017 · 9 revisions

You can apply any of the predefined filters available in ArcV. As of now, there are 4 at your disposal:

ARCV_FILTER_TYPE_GAUSSIAN_BLUR
ARCV_FILTER_TYPE_SHARPEN
ARCV_FILTER_TYPE_EDGE_ENHANCEMENT
ARCV_FILTER_TYPE_EMBOSS

You can call this feature with the following line:

Arcv::Matrix<float> res = Arcv::Image::applyFilter<ARCV_FILTER_TYPE_XXX>(mat);

Original image:

Lena

Filter Output image
ARCV_FILTER_TYPE_GAUSSIAN_BLUR Blurred Lena
ARCV_FILTER_TYPE_SHARPEN Sharpened Lena
ARCV_FILTER_TYPE_EDGE_ENHANCEMENT Edge-enhanced Lena
ARCV_FILTER_TYPE_EMBOSS Embossed Lena

This obviously works for any number of channels your image has. As such, an emboss filter applied onto a grayscale image would output:

Gray embossed Lena