Closed shifan-Z closed 1 year ago
(1) Regarding the Fibanicci sampling: please refer to this. NeurVPS uses a slightly different sampling (the constant bias term).
(2) Check this tutorial on OpenGL and to_pixel function in NerVPS. It is indeed confusing. If I remember correctly (vaguely), y is pointing up in both cases. Let me know if the confusion remains.
(3) I am afraid you are wrong. The outputs are a list (array) of rhos/thetas used to sample a grid, rather than the rho_res or theta_res where "res" indicate resolution
(4) em, it seems "vote_index_ht" should have been replaced by "mapping_ht". Before releasing code, I used a slightly different naming convention. Sorry for the confusion. The commented lines are for debug or visualization only.
Thank you so much to be so patient. I have already understand the reply to question(1) and (4).
I still have some problems with question (2) and (3).
(2)Sorry, I am still confused. In line 100, coords
is [x,y], whose shape is $[rowls*cols]\times2,$ sin_cos is $[sin\theta, cos\theta]$, whose shape is $2\times180$. So the coords @ sin_cos
is $xsin\theta+ycos\theta$. However, I thought that the $\rho$ might be $\rho = xcos\theta +ysin\theta$. https://github.com/yanconglin/VanishingPoint_HoughTransform_GaussianSphere/blob/0926733b1bd58531c0a50216017aa29a4cd18025/parameterization.py#L93-L100
(3)So because of the first appearance of the variable theta_res
in function main is in line 410: theta_res = opt.theta_res
. Should the line484 to 485 be : theta_res
and rho_res
? Otherwise these two variables are not defined.
https://github.com/yanconglin/VanishingPoint_HoughTransform_GaussianSphere/blob/0926733b1bd58531c0a50216017aa29a4cd18025/parameterization.py#L408-L413
https://github.com/yanconglin/VanishingPoint_HoughTransform_GaussianSphere/blob/0926733b1bd58531c0a50216017aa29a4cd18025/parameterization.py#L475-L490
Looking forward to your reply.
Regarding (3): I see. you are right. they are indeed typos. Fixed now. Many thanks!
Regarding (4): coords = np.concatenate((coords_r[:,None], coords_w[:,None]), axis=1).astype(np.float32)
is the concatenation of row indices and column indices, where row indices are y and column indices are x.
Hough Transform: rho = x cos + y sin. In the code: vote_map = (coords @ sin_cos).astype(np.float32)
, which is rho = row_id sin + col_id cos, or equivalently rho = y sin + x cos.
The (x-y) and (col-row) conversion is tricky there. row/col differs from x/y (image plane vs Cartesian coordinate).
Thank you so much. I got it !
Thanks for posting your excellent code! I have some problems when reading the code.
theta = opt.theta
andrho = opt.rho
line 418 be :mapping_ht, rho_res, theta_res = hough_transform(rows, cols, theta, rho)
? https://github.com/yanconglin/VanishingPoint_HoughTransform_GaussianSphere/blob/0926733b1bd58531c0a50216017aa29a4cd18025/parameterization.py#L410-L436