DanielCoelho112 / synfeal

Synfeal: A Data-Driven Simulator for Camera Localization
9 stars 1 forks source link

Create datasets with variable lighting conditions #57

Closed DanielCoelho112 closed 2 years ago

DanielCoelho112 commented 2 years ago

To increase the robustness of our models with respect to various lighting conditions throughout the day, we should produce datasets with variable lighting conditions.

DanielCoelho112 commented 2 years ago

Hi @miguelriemoliveira,

to give continuity to my desert pass, this is proving to be harder than I thought.

So we have two options to change the illumination:

  1. through services
  2. through topic

Services

I create a script that changes the illumination via SetLightProperties service. The service works in a way that if I do SetLIghtProperties, and then GetLightProperties, the information retrieved is the one that I sent. The problem is that in gazebo nothing changes...

Topic

There is a topic called "/gazebo/my_room_024/light/modify" that we can use to change the lighting conditions. When I do:

gz topic -i /gazebo/my_room_024/light/modify

I get this:

Type: gazebo.msgs.Light

The problem is that I cannot import that message... The documentation of that msg is the following: https://osrf-distributions.s3.amazonaws.com/gazebo/msg-api/dev/light_8proto.html

I read somewhere that I need to build that message, but I have no idea how to do it, do you have any ideas? I looked around and I found this:

https://github.com/arpg/Gazebo/blob/master/gazebo/msgs/light.proto

I was thinking about creating our own custom message, but the extension of this file is .proto, and I don't know what to do with it.

DanielCoelho112 commented 2 years ago

Hi @miguelriemoliveira and @pmdjdias,

Now we can produce datasets with variable lighting conditions.

I added 6 lights, check the model with lights almost completely off:

lights_off

and now with lights completely on:

lights_on

We have 2 modes:

  1. Random Lights

In this case, in each frame a light intensity is randomly generated. Run:

rosrun localbot_core data_collector --mode automatic_path --seq seq1  -nf 200 -uvl -rl

Using these methods, in consecutive frames, we can obtain a significate light difference, check these images:

frame-00012 rgb

frame-00013 rgb

  1. Continuous Lights

In this case, the logic is similar to the poses. We have a continuous variation of the lights over time.

Run:

rosrun localbot_core data_collector --mode automatic_path --seq seq1  -nf 200 -uvl 
pmdjdias commented 2 years ago

Nice, looking forward to see the impact on training ;-)!

miguelriemoliveira commented 2 years ago

Yes, I also like it. One light I think is missing is the outside directional light of the sun.

In any case I think this looks very nice: we now have these highly illuminated walls which are actually very realistic, Lucas had to take some real images that looked very much like this from the color correction.

DanielCoelho112 commented 2 years ago

This is done.