Skip to content

Rotate uv_position_map #6

Open
Open

Description

@jnulzl

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!!

Activity

  1. reshow commented on Dec 19, 2019

    @reshow
    Owner

    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.

  2. banmaczk commented on Dec 23, 2019

    @banmaczk

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

  3. reshow commented on Dec 23, 2019

    @reshow
    Owner

    这里的旋转我也有同样的疑问就是在于如果直接对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.

  4. banmaczk commented on Dec 23, 2019

    @banmaczk

    这里的旋转我也有同样的疑问就是在于如果直接对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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions