clij / clij2

GPU-accelerated image processing for everyone
https://clij.github.io/clij2
Other
48 stars 14 forks source link

Linear interpolation doesn't work on Intel GPUs #20

Closed haesleinhuepf closed 4 years ago

haesleinhuepf commented 4 years ago

Affine transform uses OpenCL interpolation (CLK_FILTER_NEAREST) which is apparently not supported, or not functional.

This bug is reproducible using this macro:

run("T1 Head (16-bits)");
run("Duplicate...", " ");

transform = "-center rotate=45 center";

run("CLIJ2 Macro Extensions", "cl_device=[Intel(R) UHD Graphics 620]");
Ext.CLIJ2_clear();

image = getTitle();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();

run("CLIJ2 Macro Extensions", "cl_device=[Quadro P520]");
Ext.CLIJ2_clear();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();

image

Thanks to Johannes Girstmair for reporting!

haesleinhuepf commented 4 years ago

The bug does not happen with Float images...

run("T1 Head (16-bits)");
run("32-bit");
run("Duplicate...", " ");

transform = "-center rotate=45 center";

run("CLIJ2 Macro Extensions", "cl_device=[Intel(R) UHD Graphics 620]");
Ext.CLIJ2_clear();

image = getTitle();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();

run("CLIJ2 Macro Extensions", "cl_device=[Quadro P520]");
Ext.CLIJ2_clear();
Ext.CLIJ2_push(image);
Ext.CLIJ2_affineTransform2D(image, transformed_image, transform);
Ext.CLIJ2_pull(transformed_image);
Ext.CLIJ2_clear();