zju3dv / pvnet-rendering

render images for pvnet training
Apache License 2.0
183 stars 46 forks source link

Custom my object, which hard code should i change? #48

Closed DCC-lzhy closed 3 years ago

DCC-lzhy commented 3 years ago

I read all closed issues, and I read the source code. Although I have run the sample successfully, but there are so many params in the codes, I have no idea about customing my data. Because I found the pvnet test results aren't good, I want to synthesize more data for training. Could you help me if it's not very complicated?

pengsida commented 3 years ago

It is not trivial to render your custom object using the code. You need to understand the code.

DCC-lzhy commented 3 years ago

用合成图片时使用的位姿+相机内参(自己的相机参数),将3D模型做离屏渲染的时候,渲染出来的结果与合成的图片对不齐,比原图缩小了。只有将相机内参改成700那一组才能对齐。请问我是哪里没改,我是将blender和linemod对应的内参改成了我自己的相机内参(只改linemod也是对不齐)。

pengsida commented 3 years ago

你用什么进行3D模型离屏渲染的

DCC-lzhy commented 3 years ago

用的pyrender

pengsida commented 3 years ago

我不知道怎么改blender的内参。

Xiaflowers commented 3 years ago

你好,我真的很想知道这代码只能渲染linemod里面的模型吗?我将我自己创建的ply格式的模型替换进取渲染发现图片中的物体都是黑色的。期待您的回复!

DCC-lzhy commented 3 years ago

可以渲染,但是ply格式的模型不是我创建的,是我同事创建的。 更改代码里的相机内参,可以参考这个地址:https://github.com/DLR-RM/BlenderProc/blob/787f1873d5dd786305728c9973849c6c5f50e083/src/camera/CameraInterface.py#L58 具体就是在blender/render_backend.py -> setup()添加如下代码: cam_K = cfg.render_K fx, fy = cam_K[0,0], cam_K[1,1] cx, cy = cam_K[0,2], cam_K[1,2] if fx > fy: bpy.context.scene.render.pixel_aspect_y = fx/fy elif fx < fy: bpy.context.scene.render.pixel_aspect_x = fy/fx