Topic: Drone Camera Image Overlay

I am trying to write a simple drone data visualizer in unity using Online Maps to show the drones location over sat imagery, and I was wondering what the best approach would be for taking imagery from the drone, probably geo-tagged JPGs, and overlaying them on the map at the proper location/size/orientation. Any help on a starting location for this would be greatly appreciated. Thank You.

Re: Drone Camera Image Overlay

Hello.

For each image you need to do the following steps:
1. Get the latitude, longitude and altitude of the central point.
Actually you'll get this from the dron.
2. Convert the latitude and longitude of the center point to Unity World Position.
http://infinity-code.com/doxygen/online … 2992c6e097
3. Calculate the length of the sides of your image in tiles based on the altitude.
I can not give you a direct formula, because I never did it.
But I think you will easily find the correct coefficients by making a few test images.
4. Calculate the corner points (top left, top right, bottom left, bottom right) in Unity World Space. For example:
TopLeft = new Vector3 (-imageTileWidth / 2, 0, -imageTileHeight / 2).
5. Rotate the corner points to the desired angle.
https://docs.unity3d.com/ScriptReferenc … rnion.html
https://docs.unity3d.com/ScriptReference/Matrix4x4.html
6. Create a new mesh, set vertices, triangles, normals and UV.
https://docs.unity3d.com/ScriptReference/Mesh.html
7. Set your image as a texture.
8. Set the position of your image GameObject equal to the center point.
9. When changing the position of the map, update the position of your image GameObject.
http://infinity-code.com/doxygen/online … 37bdd7bfa1
10. When zooming, scale and update the position of your image GameObject.
http://infinity-code.com/doxygen/online … 6575e50112

Something like that.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Drone Camera Image Overlay

I understand that approach, but is there some way to do this as an overlay onto the map, like a overlay tile provider or something That way I can get it to follow the terrain and also seems like a better approach when I am loading up lots of drone images to "update" the outdated sat images. map overlay

Also, say I just wanted to draw a blue square on the ground representing the area that is visible to the drone, even with elevation maps turned on, what would I need to do for that. I understand all the calculations to go from drone images to Geo located images, I just don't know how to do the overlay.

Re: Drone Camera Image Overlay

Online Maps supports tile overlay.
Example:
http://infinity-code.com/atlas/online-m … ample.html

You can draw a rectangle using drawing api.
Example:
http://infinity-code.com/atlas/online-m … ample.html

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: Drone Camera Image Overlay

Thank you, that is what I was looking for, I don't know how I didn't find that example before.
I do have two more questions now though, the first is when I am running this through the unity editor, I see my custom tiles, and when I zoom all the way out I get the following error  -

 Destroying assets is not permitted to avoid data loss.
If you really want to remove an asset use DestroyImmediate (theObject, true);
UnityEngine.Object:Destroy(Object)
OnlineMapsUtils:DestroyImmediate(Object) (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsUtils.cs:351)
OnlineMapsTile:Destroy() (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsTile.cs:489)
OnlineMapsTile:UnloadUnusedTiles() (at Assets/Infinity Code/Online maps/Scripts/Core/OnlineMapsTile.cs:741)
OnlineMaps:CheckBufferComplete() (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:869)
OnlineMaps:LateUpdate() (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:1264)

when I zoom back in, my tiles are still there, but when I publish my "game" zoom out and back in, my tiles are gone. What do i need to do to fix this?

and my second, is there a way to load custom tiles dynamically, what I mean by this is, I want to run my program, and have the drone feeding me back images that a separate program is turning into custom tiles, and putting into some "resource" folder. Am I capable of doing this, or am I limited to what is packaged up into the resource folder when I publish.

Again Thank you, I am loving the OnlineMaps asset, It is making everything much easier for me.

Re: Drone Camera Image Overlay

Most likely the problem is that you do not Instantiate the texture of the tile.
Use Instantiate, and pass the texture instance to the tile.
https://docs.unity3d.com/ScriptReferenc … tiate.html

No, you can not modify (add) resources after publication.
But you can store your tiles in some other source that you can modify, such as a file system, a database, or your own server.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.