Wavelet transform written in opencl: seeing artifacts in image

风流意气都作罢 提交于 2019-12-13 01:30:08

问题


I have written a forward wavelet transform in opencl.

Basic algorithm is to divide the image into tiles of 128x8; the two left columns and two right columns are treated as boundary columns.

Tile data is moved into local memory, transformed, and non-boundary columns are stored in destination.

I am seeing image artifacts at the horizontal boundary of the tiles, and I can't figure out what is causing them. They occur on the fourth and 124th column, i.e. the first and last even column not on the boundary.

This project is open source:

https://github.com/boxerab/roger

Dependencies: Visual Studio 2012, Intel OpenCL SDK and OpenCV


回答1:


Usually when OpenCL returns unexpected answers on boundaries it is an Out-of-Bounds issues. If the majority of the code works except on boundaries, check that the memory access in the kernel is correct. Usually it is going to be something to do with: global offset + global id, local offset + local id, or a combination being larger than what was allocated. Make sure the global and local worksize and offsets in the C/C++ code match the memory allocated, since this gets translated into global and local ids in the kernel.

Edit: Try running the code on a CPU device, as these are less forgiving of OOB and will (usually) cause a stack overflow or something similar. GPU devices are very forgiving and will usually either use undefined, 0 (depending on compiler options), or some bizarre super huge value.



来源:https://stackoverflow.com/questions/25536033/wavelet-transform-written-in-opencl-seeing-artifacts-in-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!