A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.arrayfire.org/docs/image_processing_2deconvolution_8cpp-example.htm below:

ArrayFire: image_processing/deconvolution.cpp

#include <stdio.h>

#include <cstdlib>

const unsigned ITERATIONS = 96;

const float RELAXATION_FACTOR = 0.05f;

float

mx = max<float>(in.

as

(

f32

));

float

mn = min<float>(in.

as

(

f32

));

return (in - mn) / (mx - mn);

}

int main(int argc, char *argv[]) {

int device = argc > 1 ? atoi(argv[1]) : 0;

try {

printf("** ArrayFire Image Deconvolution Demo **\n");

array

in = loadImage(ASSETS_DIR

"/examples/images/house.jpg"

,

false

);

array

kernel = gaussianKernel(13, 13, 2.25, 2.25);

array

blurred = convolve(in, kernel);

iterativeDeconv(blurred, kernel, ITERATIONS, RELAXATION_FACTOR,

iterativeDeconv(blurred, kernel, ITERATIONS, RELAXATION_FACTOR,

while (!myWindow.close()) {

myWindow.grid(2, 3);

myWindow(0, 0).image(normalize(in), "Input Image");

myWindow(1, 0).image(normalize(blurred), "Blurred Image");

myWindow(0, 1).image(normalize(tikhonov), "Tikhonov");

myWindow(1, 1).image(normalize(landweber), "Landweber");

myWindow(0, 2).image(normalize(richlucy), "Richardson-Lucy");

myWindow.show();

}

fprintf(stderr,

"%s\n"

, e.

what

());

throw;

}

return 0;

}

Window object to render af::arrays.

A multi dimensional data container.

const array as(dtype type) const

Casts the array into another data type.

An ArrayFire exception class.

virtual const char * what() const

Returns an error message for the exception in a string format.

@ f32

32-bit floating point values

@ AF_ITERATIVE_DECONV_LANDWEBER

Landweber Deconvolution.

@ AF_ITERATIVE_DECONV_RICHARDSONLUCY

Richardson-Lucy Deconvolution.

@ AF_INVERSE_DECONV_TIKHONOV

Tikhonov Inverse deconvolution.

AFAPI void setDevice(const int device)

Sets the current device.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4