MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / usm

Function usm

examples/image_processing/image_editing.cpp:45–50  ·  view source on GitHub ↗

* radius effects the level of details that will effected during sharpening * process amount value should be in the range [0,1] or [1,] note: value of 1.0 * for amount results unsharp masking values > 1.0 results in highboost filter * effect * */

Source from the content-addressed store, hash-verified

43 * effect
44 * */
45array usm(const array &in, float radius, float amount) {
46 int gKernelLen = 2 * radius + 1;
47 array blurKernel = gaussianKernel(gKernelLen, gKernelLen);
48 array blur = convolve(in, blurKernel);
49 return (in + amount * (in - blur));
50}
51
52/**
53 * x,y - starting position of zoom

Callers 1

mainFunction · 0.85

Calls 2

gaussianKernelFunction · 0.50
convolveFunction · 0.50

Tested by

no test coverage detected