Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate uv_position_map #6

Open
jnulzl opened this issue Dec 19, 2019 · 4 comments
Open

Rotate uv_position_map #6

jnulzl opened this issue Dec 19, 2019 · 4 comments

Comments

@jnulzl
Copy link

jnulzl commented Dec 19, 2019

Hi @reshow
In file augmentation.py, there is a rotateData function, whose input are x, y, ..... .
Obviously, x is the network input image, y is the uv_position_map(or target, label, ground truth). But I confused to follow code:

    rotate_y = y.copy()
    rotate_y[:, :, 2] = 1.
    rotate_y = rotate_y.reshape(image_width * image_height, image_channel)
    # rotate_y = rotate_y.dot(rform.T)
    rotate_y = myDot(rotate_y, rform.T)
    rotate_y = rotate_y.reshape(image_height, image_width, image_channel)
    rotate_y[:, :, 2] = y[:, :, 2]

Here, you only rotate the first two channels of y, whose shape is [height,width,channels]. But the third channel do nothing. I can not understand it. Would you interpret to me? Thank you so much!!

@reshow
Copy link
Owner

reshow commented Dec 19, 2019

Hi @reshow
In file augmentation.py, there is a rotateData function, whose input are x, y, ..... .
Obviously, x is the network input image, y is the uv_position_map(or target, label, ground truth). But I confused to follow code:

    rotate_y = y.copy()
    rotate_y[:, :, 2] = 1.
    rotate_y = rotate_y.reshape(image_width * image_height, image_channel)
    # rotate_y = rotate_y.dot(rform.T)
    rotate_y = myDot(rotate_y, rform.T)
    rotate_y = rotate_y.reshape(image_height, image_width, image_channel)
    rotate_y[:, :, 2] = y[:, :, 2]

Here, you only rotate the first two channels of y, whose shape is [height,width,channels]. But the third channel do nothing. I can not understand it. Would you interpret to me? Thank you so much!!

The rotation is performed on XY plane. So the depth doesn't change.

@banmaczk
Copy link

这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。

@reshow
Copy link
Owner

reshow commented Dec 23, 2019

这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。

The rotation of image is changing the position of pixels. But the rotation of uv map is changing the xy values of points.

@banmaczk
Copy link

这里的旋转我也有同样的疑问就是在于如果直接对uv_map进行旋转是否是正确的,因为不管原图如何旋转,uv_map中每个点的含义应当保持一致,以眼睛中心为例,这个点在uvmap中的位置应当是不变的,但是如果直接旋转uv_map是否意味着眼睛中心点在这个map中的坐标位置已经发生改变了呢,希望您能替我解答一下。

The rotation of image is changing the position of pixels. But the rotation of uv map is changing the xy values of points.

OK, I got that. Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants