Opencl wavelet transform: seeing artifacts in an image

I wrote a forward wavelet transform in opencl.

The basic algorithm is to split the image into 128x8 fragments; two left columns and two right columns are considered as boundary columns.

Tile data is moved to local memory; converted and non-boundary columns are stored at the destination.

I see image artifacts on the horizontal border of the tiles, and I cannot understand what causes them. They are found in the fourth and fourth columns, i.e. The first and last even columns are not on the border.

This open source project is:

https://github.com/boxerab/roger

Dependencies: Visual Studio 2012, Intel OpenCL SDK, and OpenCV

+1
source share
1 answer

Usually, when OpenCL returns unexpected boundary responses, these are problems outside of the bounds. If most of the code works, except for the boundaries, check the kernel for memory access. Usually this will be associated with: global offset + global id, local offset + local identifier, or a combination that exceeds the selection. Make sure that the global and local workize and offsets in the C / C ++ code correspond to the allocated memory, as this translates to global and local identifiers in the kernel.

Edit: try to run the code on the CPU device, as they are less forgiving of OOB and, as a rule, cause a stack overflow or something like that. GPU devices are very forgiving and usually either use undefined, 0 (depending on the compiler options), or some bizarre super huge value.

+2
source

Source: https://habr.com/ru/post/1202784/


All Articles