@@ -1324,6 +1324,78 @@ def anisotropic_diffusion(image, time_step, conductance, iterations, flux_functi
1324
1324
flux_function_type .value , diffusion_kind .value ))
1325
1325
return out
1326
1326
1327
+ def iterativeDeconv (image , psf , iterations , relax_factor , algo = ITERATIVE_DECONV .DEFAULT ):
1328
+ """
1329
+ Iterative deconvolution algorithm.
1330
+
1331
+ Parameters
1332
+ ----------
1333
+ image: af.Array
1334
+ The blurred input image.
1335
+
1336
+ psf: af.Array
1337
+ The kernel(point spread function) known to have caused
1338
+ the blur in the system.
1339
+
1340
+ iterations:
1341
+ Number of times the algorithm will run.
1342
+
1343
+ relax_factor: scalar.
1344
+ is the relaxation factor multiplied with distance
1345
+ of estimate from observed image.
1346
+
1347
+ algo:
1348
+ takes enum value of type af.ITERATIVE_DECONV
1349
+ indicating the iterative deconvolution algorithm to be used
1350
+
1351
+ Returns
1352
+ -------
1353
+ out: af.Array
1354
+ sharp image estimate generated from the blurred input
1355
+
1356
+ Note
1357
+ -------
1358
+ relax_factor argument is ignored when the RICHARDSONLUCY algorithm is used.
1359
+
1360
+ """
1361
+ out = Array ()
1362
+ safe_call (backend .get ().
1363
+ af_iterative_deconv (c_pointer (out .arr ), image .arr , psf .arr ,
1364
+ c_uint_t (iterations ), c_float_t (relax_factor ), algo .value ))
1365
+ return out
1366
+
1367
+ def inverseDeconv (image , psf , gamma , algo = ITERATIVE_DECONV .DEFAULT ):
1368
+ """
1369
+ Inverse deconvolution algorithm.
1370
+
1371
+ Parameters
1372
+ ----------
1373
+ image: af.Array
1374
+ The blurred input image.
1375
+
1376
+ psf: af.Array
1377
+ The kernel(point spread function) known to have caused
1378
+ the blur in the system.
1379
+
1380
+ gamma: scalar.
1381
+ is a user defined regularization constant
1382
+
1383
+ algo:
1384
+ takes enum value of type af.INVERSE_DECONV
1385
+ indicating the inverse deconvolution algorithm to be used
1386
+
1387
+ Returns
1388
+ -------
1389
+ out: af.Array
1390
+ sharp image estimate generated from the blurred input
1391
+
1392
+ """
1393
+ out = Array ()
1394
+ safe_call (backend .get ().
1395
+ af_inverse_deconv (c_pointer (out .arr ), image .arr , psf .arr ,
1396
+ c_float_t (gamma ), algo .value ))
1397
+ return out
1398
+
1327
1399
def is_image_io_available ():
1328
1400
"""
1329
1401
Function to check if the arrayfire library was built with Image IO support.
0 commit comments