cfernandezlab / CFL

Tensorflow implementation of our end-to-end model to recover 3D layouts. Also with equirectangular convolutions!
GNU General Public License v3.0
105 stars 18 forks source link

Question about formula (5) in 4.1 EquiConvs Details #10

Closed FocusK closed 4 years ago

FocusK commented 4 years ago

Thanks for your great work! First, I meet some diffculty when I saw formula(5). I can't understand this formula, your aim is project each point in kernel into the sphere surface, but can you explain why your rotation matrix like this? And the code of rotation matrix is bot same with Rodrigues' Rotation Formula, I found when theta = pi/2, the result is different. Second, have you trid DCN-V1 or V2?

cfernandezlab commented 4 years ago

Hello! Thanks for writing!

Formula (5), as you say, is used to move the kernel coordinates to the corresponding position on the sphere using the spherical coordinates (φ and θ) (see Figure 4 in the paper) For the rotation matrix we use Euler–Rodrigues formula associated with counterclockwise rotation, which is based on Rodrigues' rotation formula but uses a different parametrization. You can play with this notebook that I recently uploaded to visualize the deformed kernel on the equirectangular image at different positions: https://github.com/cfernandezlab/360-Scene-Understanding/tree/master/EquiConvs

Regarding DCN, we used this implementation: https://github.com/Zardinality/TF_Deformable_Net, which was v1, but feel free to try v2 :)

FocusK commented 4 years ago

Thanks for your reply. Best wishes for you!

FocusK commented 4 years ago
I am so sorry to trouble you again. I am not understand the code below. According to the paper,I know rays is pij = [i j d],rays[0] is corresponding to i, rays[1] is corresponding to j, … but I can't know the role of K.  As you say in the paper, i and j are integer in the range [- (r-1)/2, (r-1)/2]. So why do you need to multiply inv_K and rays. 
Another, the value of c_x and c_y is always 0? 

c_x = 0 c_y = 0 K = np.array([[d,0,c_x],[0,d,c_y],[0,0,1]]) inv_K = np.linalg.inv(K) rays = np.matmul(inv_K, rays.reshape(3,r_h*r_w))