CUHA实现的Circle Hough Transform [英] CUDA implementation of the Circle Hough Transform

查看:240
本文介绍了CUHA实现的Circle Hough Transform的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在CUDA中实现最大性能Circle Hough Transform,由此边缘像素坐标在hough空间中投票。 CHT的伪代码如下,我使用256 x 256像素的图片大小:

I'm trying to implement a maximum performance Circle Hough Transform in CUDA, whereby edge pixel coordinates cast votes in the hough space. Pseudo code for the CHT is as follows, I'm using image sizes of 256 x 256 pixels:

int maxRadius = 100;
int minRadius = 20;
int imageWidth = 256;
int imageHeight = 256;

int houghSpace[imageWidth x imageHeight * maxRadius];

for(int radius = minRadius; radius < maxRadius; ++radius)
{
    for(float theta = 0.0; theta < 180.0; ++theta)
    {
        xCenter = edgeCoordinateX + (radius * cos(theta));
        yCenter = edgeCoordinateY + (radius * sin(theta));

        houghSpace[xCenter, yCenter, radius] += 1;
    }
}



我的基本想法是让每个线程块计算(小)瓦片的输出霍夫空间(可能一个块为输出休眠空间的每一行)。因此,我需要将输入图像的必需部分输入到共享内存中,以便在特定输出子休眠空间中进行投票。

My basic idea is to have each thread block calculate a (small) tile of the output Hough space (maybe one block for each row of the output hough space). Therefore, I need to get the required part of the input image into shared memory somehow in order to carry out the voting in a particular output sub-hough space.

我的问题如下:


  1. 如何计算和存储共享内存中输入图像所需部分的坐标? br>

  1. How do I calculate and store the coordinates for the required part of the input image in shared memory?

如何检索先前存储在共享内存中的边缘像素的x,y坐标?

How do I retrieve the x,y coordinates of the edge pixels, previously stored in shared memory?

我在另一个共享内存数组中投票或将投票直接写入全局内存吗?

Do I cast votes in another shared memory array or write the votes directly to global memory?

感谢大家提前为您的时间。我是新来的CUDA,任何帮助这将是非常感谢。

Thanks everyone in advance for your time. I'm new to CUDA and any help with this would be gratefully received.

推荐答案

这种滤波,但是从源传播特性的基本思想与用于求解静止Eikonal方程的前进和扫描方法听起来不太相同。有一个很好的论文,解决这类问题(PDF可能仍然可用 here ):

I don't profess to know much about this sort of filtering, but the basic idea of propagating characteristics from a source doesn't sound too different to marching and sweeping methods for solving the stationary Eikonal equation. There is a very good paper on solving this class of problem (PDF might still be available here):


Eikonal方程的快速迭代法。 Won-Ki Jeong,Ross T.
Whitaker。 SIAM Journal on Scientific Computing,Vol 30,No 5,
pp.2512-2534,2008

A Fast Iterative Method for Eikonal Equations. Won-Ki Jeong, Ross T. Whitaker. SIAM Journal on Scientific Computing, Vol 30, No 5, pp.2512-2534, 2008

基本思想将计算域分解为瓦片,以及从源跨越域扫描特征。随着瓦片被前进特性触及,它们被添加到有效瓦片的列表中并被计算。每次一个图块被求解(收敛到Eikonal情况下的数字容差,可能是你的问题中的一个状态),它将从工作集中退出,并激活其邻居。如果再次触摸图块,则会将其重新添加到活动列表。该过程继续,直到计算所有图块并且活动列表为空。每个计算迭代可以通过内核启动来解决,其明确地同步计算。根据需要连续运行多个内核,以达到一个空的工作列表。

The basic idea is to decompose the computational domain into tiles, and the sweep the characteristic from source across the domain. As tiles get touched by the advancing characteristic, they get added to a list of active tiles and calculated. Each time a tile is "solved" (converged to a numerical tolerance in the Eikonal case, probably a state in your problem) it is retired from the working set and its neighbours are activated. If a tile is touched again, it is re-added to the active list. The process continues until all tiles are calculated and the active list is empty. Each calculation iteration can be solved by a kernel launch, which explictly synchronizes the calculation. Run as many kernels in series as required to reach an empty work list.

我不认为这是值得回答你的问题,直到你有一个更具体的算法方法并正在实施细节。

I don't think it is worth trying to answer your questions until you have a more concrete algorithmic approach and are getting into implementation details.

这篇关于CUHA实现的Circle Hough Transform的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆