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

3 camera parameters of weak-perspective camera #134

Open
emojiLee opened this issue Dec 30, 2021 · 6 comments
Open

3 camera parameters of weak-perspective camera #134

emojiLee opened this issue Dec 30, 2021 · 6 comments

Comments

@emojiLee
Copy link

大佬您好,感谢您所做的工作,目前遇到些问题想向您请教,希望您提供思路。

当只使用save_dict_results里面保存的smpl 85维参数实现可视化时,cam相机结果不准,使用以下值:

  • cam (3,) # 3 camera parameters of weak-perspective camera, (scale, tranlation_x, tranlation_y)
  • pose (72,) # 72 SMPL pose parameters.
  • betas (10,) # 10 SMPL shape parameters.

更改smpl_mesh_root_align: False没用,cam、pose、betas值并没有改变,所以结果还是不对。

效果如下:
results.zip

@Arthur151
Copy link
Owner

Arthur151 commented Dec 30, 2021

wow,你的demo有点酷啊!高手你好~

这个原因是因为ROMP估计的相机参数是输入图片中人的位置。输入图片是原图经过处理之后的,可以看一下处理过程,或者直接用ROMP输入网络的图作为渲染图比较方便。

如果还有问题可以直接问,我看到后会尽快回复的。

闲话:你的这个项目会开源么?看起来挺酷,哈哈。如果有计划地话,我可以把项目链接放在ROMP readme里,帮你推广一下。

@emojiLee
Copy link
Author

emojiLee commented Jan 4, 2022

抱歉抱歉,碰上节假日回复的慢了。

  1. 视频中的效果是使用ipercore开源项目实现的:https://github.com/iPERDance/iPERCore

  2. 我的测试视频分辨率是720720,网络输入图处理为512512,保存网络输入图看了resize为512没有padding,然后把输出的cam在512的图上测试了效果木有变,人物渲染出来还是有偏差。然后想修改cam转变为原图720的orig_cam,尝试了如下方法:
    `def convert_crop_cam_to_orig_img(cam, cx, cy, h, img_width=720, img_height=720):

    hw, hh = img_width / 2., img_height / 2.
    sx = cam[0] * (1. / (img_width / h))
    sy = cam[0] * (1. / (img_height / h))
    tx = ((cx - hw) / hw / sx) + cam[1]
    ty = ((cy - hh) / hh / sy) + cam[2]
    orig_cam = np.stack([sx, tx, ty]).T
    return orig_cam
    `
    其中cx, cy, h由输出保存的pj2d_org计算检测框得到,效果还是不太对。
    想请教一下如何由model输出的cam计算出原图像的orig_cam,谢谢大佬~

附:使用其他算法的cam且使用romp的pose测试的结果是正确的:
new_results.zip

@Arthur151
Copy link
Owner

Arthur151 commented Jan 4, 2022

我知道了!我的相机参数的定义和你的函数反应出来的定义不太一样。你看你第一次给我的可视化demo里,tx,ty都乘2可能就对了。
我相机是以图片中心(256,256)为相机坐标中心(0,0)的,tx,ty是(-1,1)对应于(0,512)。所以从我的tx,ty转变成原图的坐标位置直接(tx+1)/2*720就行了。不知道你理解了吗?

@emojiLee
Copy link
Author

emojiLee commented Jan 4, 2022

可以理解坐标位置转换(tx+1)/2720,但是tx,ty为什么2,不是*(720/512),*2后的效果前半部分看起来对的,但视频画面转换后后半部分不太对。

效果如下:
new_results2.zip

@Arthur151
Copy link
Owner

因为我的相机参数是标准化后的,始终认为图片大小是-1~1,跟具体图像大小无关。
前半部分对说明转换关系对,后面不对应该是你其他代码有问题。

@emojiLee
Copy link
Author

emojiLee commented Jan 5, 2022

好的,谢谢大佬,我再瞅瞅

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

2 participants