Questions tagged «timing»

2
如何实现基于梯度的霍夫变换
我正在尝试使用霍夫变换进行边缘检测,并希望使用渐变图像作为基础。 我迄今所做,给出的图像I尺寸的[M,N]和它的部分衍生物gx,gy是计算中的每个像素作为梯度角thetas = atan(gy(x,y) ./ gx。同样,我将梯度幅度计算为magnitudes = sqrt(gx.^2+gy.^2)。 要构建霍夫变换,我使用以下MATLAB代码: max_rho = ceil(sqrt(M^2 + N^2)); hough = zeros(2*max_rho, 101); for x=1:M for y=1:N theta = thetas(x,y); rho = x*cos(theta) + y*sin(theta); rho_idx = round(rho)+max_rho; theta_idx = floor((theta + pi/2) / pi * 100) + 1; hough(rho_idx, theta_idx) = hough(rho_idx, theta_idx) + …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.