neumicha / Blender2Helios

Blender addon to convert a blender scene to a Helios scene (LiDAR simulation, 3D point clouds)
GNU General Public License v3.0
17 stars 7 forks source link

Provide an example for implementation #11

Closed Xiaofei-Kevin-Yang closed 1 year ago

Xiaofei-Kevin-Yang commented 1 year ago

Hi there,

Thanks for your excellent work. Could you please provide an example to generate synthetic data with semantic labels?

Thanks and regards, Xiaofei

neumicha commented 1 year ago

Dear Xiaofei, thank you very much. I am currently on vacation and don't have access to my files. I'll see if I have a good example mid/end next week.

In the meantime you can have a look at https://github.com/neumicha/Blender2Helios/wiki/Collections-and-Semantic-Classification which shows the "difficult" part: Labeling the objects in Blender and creating the materials file.

I'll get back to you.

Best regards, Michael

Xiaofei-Kevin-Yang commented 1 year ago

Dear Michael,

Thanks for your feedback. I have carefully read the section titled "Collections-and-Semantic-Classification", but I did not generate the synthetic data with semantic labels.

Hope to connect with you when you come back to the office.

Thanks, Xiaofei

On Fri, 29 Sept 2023 at 19:46, Michael @.***> wrote:

Dear Xiaofei, thank you very much. I am currently on vacation and don't have access to my files. I'll see if I have a good example mid/end next week.

In the meantime you can have a look at https://github.com/neumicha/Blender2Helios/wiki/Collections-and-Semantic-Classification which shows the "difficult" part: Labeling the objects in Blender and creating the materials file.

I'll get back to you.

Best regards, Michael

— Reply to this email directly, view it on GitHub https://github.com/neumicha/Blender2Helios/issues/11#issuecomment-1740758393, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6LQNYOYS3NWKTYQEXWC3DX42YHDANCNFSM6AAAAAA5IZVRVY . You are receiving this because you authored the thread.Message ID: @.***>

neumicha commented 1 year ago

Dear Xiaofei,

I added a simple example to the repository. Please have a look at https://github.com/neumicha/Blender2Helios/tree/master/examples/1_classification The readme explains all steps to convert the provided example1.blend Blender scene to a point cloud with semantic labels using Helios. This procedures takes a pre-labeled Blender scene as input. If you want to generate multiple scenes you may want to write a script that generates Blender scenes for you...

Hope this was helpful to you.

Best regards, Michael

Xiaofei-Kevin-Yang commented 1 year ago

Dear Michael,

Thanks for your help. I will have a try by following your example. Much appreciated!

Thanks, Xiaofei

On Mon, 2 Oct 2023 at 23:54, Michael @.***> wrote:

Dear Xiaofei,

I added a simple example to the repository. Please have a look at https://github.com/neumicha/Blender2Helios/tree/master/examples/1_classification The readme explains all steps to convert the provided example1.blend Blender scene to a point cloud with semantic labels using Helios. This procedures takes a pre-labeled Blender scene as input. If you want to generate multiple scenes you may want to write a script that generates Blender scenes for you...

Hope this was helpful to you.

Best regards, Michael

— Reply to this email directly, view it on GitHub https://github.com/neumicha/Blender2Helios/issues/11#issuecomment-1743280128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6LQN5GWOAQGWU7FX67EPDX5LPUVAVCNFSM6AAAAAA5IZVRV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGI4DAMJSHA . You are receiving this because you authored the thread.Message ID: @.***>

Xiaofei-Kevin-Yang commented 1 year ago

Dear Michael,

Thanks very much for your help. I noticed that the file "data/surveys/blender2heliosScene.xml" is generated automatically. How can I identify the position of the laser scanner?

Looking forward to hearing from you.

Thanks, Xiaofei

On Mon, 2 Oct 2023 at 23:54, Michael @.***> wrote:

Dear Xiaofei,

I added a simple example to the repository. Please have a look at https://github.com/neumicha/Blender2Helios/tree/master/examples/1_classification The readme explains all steps to convert the provided example1.blend Blender scene to a point cloud with semantic labels using Helios. This procedures takes a pre-labeled Blender scene as input. If you want to generate multiple scenes you may want to write a script that generates Blender scenes for you...

Hope this was helpful to you.

Best regards, Michael

— Reply to this email directly, view it on GitHub https://github.com/neumicha/Blender2Helios/issues/11#issuecomment-1743280128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6LQN5GWOAQGWU7FX67EPDX5LPUVAVCNFSM6AAAAAA5IZVRV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGI4DAMJSHA . You are receiving this because you authored the thread.Message ID: @.***>

neumicha commented 1 year ago

Dear Xiaofei,

Blender2Helios uses the location of the Blender "3D cursor" as position for the laser scanner: https://github.com/neumicha/Blender2Helios/blob/master/Blender2Helios.py#L94C18-L94C18

In Blender it's very likely to accidentally change the 3D cursor position by just lef-clicking somewhere in the scene. You have two options:

  1. Press Shift + C: This resets 3D cursor back to (0,0,0)
  2. Press N to open Sidebar. Go to View -> 3D Cursor. There you can define where you want the 3D cursor/laser scanner to be. image

Note that most other settings in the survey file are hard-coded: https://github.com/neumicha/Blender2Helios/blob/f109cdf043e602f7ea54c035162bbf7cb6b44131/Blender2Helios.py#L213C1-L226C8 Feel free to open a pull request if you improve this.

Best regards, Michael

Xiaofei-Kevin-Yang commented 1 year ago

Dear Michael,

Much appreciated for your help. I was wondering if I could set multiple positions for the laser scanner at the same time.

Looking forward to hearing from you.

Thanks, Xiaofei

On Wed, 4 Oct 2023 at 19:13, Michael @.***> wrote:

Dear Xiaofei,

Blender2Helios uses the location of the Blender "3D cursor" as position for the laser scanner: https://github.com/neumicha/Blender2Helios/blob/master/Blender2Helios.py#L94C18-L94C18

In Blender it's very likely to accidentally change the 3D cursor position by just lef-clicking somewhere in the scene. You have two options:

  1. Press Shift + C: This resets 3D cursor back to (0,0,0)
  2. Press N to open Sidebar. Go to View -> 3D Cursor. There you can define where you want the 3D cursor/laser scanner to be. [image: image] https://user-images.githubusercontent.com/32911558/272555193-0ea9d460-1f02-4684-9743-afa0fde3d19d.png

Note that most other settings in the survey file are hard-coded: https://github.com/neumicha/Blender2Helios/blob/f109cdf043e602f7ea54c035162bbf7cb6b44131/Blender2Helios.py#L213C1-L226C8 Feel free to open a pull request if you improve this.

Best regards, Michael

— Reply to this email directly, view it on GitHub https://github.com/neumicha/Blender2Helios/issues/11#issuecomment-1746659143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6LQN62VZ7VZYDDXNPMVXLX5VAE7AVCNFSM6AAAAAA5IZVRV2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBWGY2TSMJUGM . You are receiving this because you authored the thread.Message ID: @.***>

neumicha commented 1 year ago

Dear Xiaofei,

at the moment, Blender2Helios doesn't support multiple scanner locations. However, I think Helios does. So you just need to create a survey xml with multiple scanners (legs). References:

  1. https://github.com/GIScience/helios/wiki/Manual#defining-own-surveys
  2. Scene generator that creates XML files with multiple scanner locations: https://github.com/GIScience/helios/tree/master/assets/sceneGenerator_PythonScript
  3. Helios GUI allows setting multiple scanner locations: https://github.com/GIScience/helios/wiki/Quick-start-guide#addingmoving-scan-positions

If manually creating/changing the survey xml doesn't fit your needs, you might either (1) add a Blender add-on parameter with a list of scanner positions (stored in Blender, not within your .blend-files) or (2) put some special objects in the scene that will be converted to scanner position (then they are stored within your .blend files). For solution 2 you could e.g. add objects named "scanner_1", "scanner_2", ... to the collection "Ignore" (so they are not exported in the scene) and could loop through those objects while creating the survey file to instantiate multiple legs.

Best regards