Blenderproc: Run basic example with custom object

Created on 19 May 2021  路  11Comments  路  Source: DLR-RM/BlenderProc

Hi all,
I am trying to run the basic example using a custom 3D object that i made on tinkercad.
The .obj and .mtl files are attached.
When i change the path from scene.obj to my custom object the pipeline runs but that's all i got:

Schermata del 2021-05-19 17-36-09

Even if the object was:

Schermata del 2021-05-19 17-37-56

Could it be matter of size? How can i take some pic of this custom object?

Thanks in advance

Shiny Blorr-Borwo.zip

question first answer provided

Most helpful comment

I think Blender GUI has always been using degrees as default input. However, now more people seem to use the debug option, so, I agree it might be confusing when using degrees in the GUI and radians in blenderproc.

All 11 comments

@lodm94 Hi,

I would advise running the pipeline in debug mode (--debug after a BlenderProc call), or at least to try and load the object in the Blender first, to verify that it is of the right size and the origin point is where it is supposed to be.

Hi @ideas-man, thanks for that tips. Now i try to explain my problem again with some examples.
Let's assume i built this scene in blender and i saved as _test.blend_:
1
Let's say i want to run coco annotation example on this dummy object. I saved the coordinates (location/rotation) of the camera (upper-right corner in the image above) in a camera_position txt file.
When i run coco annotation in debug mode, i find that the camera is in a completely different position:
2
3

The camera is indeed face-down and i can't capture anything. Please give me some more help i can't figure it out!!

Thanks

@lodm94 Hi,

How does the respective .txt looks like exactly?

P.S.: I assume you tried inputting angles in radians rather than in degrees, right?

@cornerfarmer Can we make sure documentation of the CameraLoader/CameraInterface modules explicitly states what measurement units are used?

for example, this docu line is confusing, it still refers to a deleted csv table. Maybe we could have options explained here (as well as the measurement units in applicable cases) and have parent description mention it too?

In the first case the txt was just:

0.0282 -11.243 1.2644 87.6 0 -0.108
0.0282 -11.243 1.2644 87.6 0 -0.108

Then i tried radians, like you said, and so the txt become:

0.0282 -11.243 1.2644 15.29 0 1.88
0.0282 -11.243 1.2644 15.29 0 1.88

But still no success. This is the debug mode with radians angle:

4
5

Camera is still in the wrong rotation.

@lodm94

Camera is still in the wrong rotation.

This is most likely due to the mistake you made during deg to rad conversion.

In the first case the txt was just:

0.0282 -11.243 1.2644 87.6 0 -0.108
0.0282 -11.243 1.2644 87.6 0 -0.108

Then i tried radians, like you said, and so the txt become:

0.0282 -11.243 1.2644 15.29 0 1.88
0.0282 -11.243 1.2644 15.29 0 1.88

1 deg is approx. 0.01746 rad

then 86.7 deg is 1.52891 rad (not 15.29)
and -0.108 deg is -0.00188 rad (not 1.88)

P.S.: a tip for quick verification in Blender's GUI (I have 1.92, not sure if it works with older versions)

When entering a value, d stands for degrees, when omitted degrees are assumed by default
image
image

you can enter the value in radians, where r stands for radians
image
image

@lodm94 Yes, I agree with @ideas-man, after fixing the radians everything should work normal.

@ideas-man: Yes you are right, the docu is pointing here to a table which is now located in the parent class (Properties per cam pose). I agree we can add there the required metrics, however usually it should be clear, that always radians are used for angles, if not noted otherwise.
I am gonna add an internal issue for that tomorrow.

however usually it should be clear, that always radians are used for angles, if not noted otherwise.

Not so clear anymore, I think. If I remember correctly, Blender's GUI had a default input in radians for quite a while, no? Now it seems that respective input text boxes expect degrees by default, while bpy still expects radians.

Even if I am mixing something up, I would say that radians are assumed unless specified otherwise policy should be explicitly stated in the relevant places.

I think Blender GUI has always been using degrees as default input. However, now more people seem to use the debug option, so, I agree it might be confusing when using degrees in the GUI and radians in blenderproc.

@lodm94 please close the issue if the problem is resolved.

Thanks for the support.
The conversione was wrong indeed. I used an online converter that requires comma for decimal; i used point instead, so the conversion failed.

Recap for people that will read this: set the camera rotation in radians rather than degree in the camera_position txt!

Cheers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

manuelli picture manuelli  路  3Comments

b-yogesh picture b-yogesh  路  5Comments

albertotono picture albertotono  路  3Comments

hummat picture hummat  路  5Comments

soans1994 picture soans1994  路  3Comments