ODM icon indicating copy to clipboard operation
ODM copied to clipboard

Generate oblique orthophotos

Open chriswilley opened this issue 2 years ago • 6 comments

This would be an enhancement to ODM, the idea being that a user could generate one or more oblique orthomosaics (aka: "2.5D") of a scene provided (possibly) that the flight was conducted with sufficient oblique-ness. An example is here: https://oblique.sanborn.com/25sample_new/ (click the compass at the bottom to see the oblique versions of the scene).

A discussion of this feature is on the Community Forum. In the example above it appears four orthos were created, one for each cardinal point; I think this would be the ideal way to have the feature work in ODM as well. Then as suggested by @smathermather in the Forum, create a nice way to view the oblique orthos in WebODM.

Looking for help/guidance on how to do this as I have never contributed code to this project, but I'm game to give it a go.

chriswilley avatar Nov 04 '22 19:11 chriswilley

This would be a really cool improvement for sure.

You would probably need to write a new module, similar to https://github.com/OpenDroneMap/odm_orthophoto, to render oblique imagery. You might find the help of a rasterizer engine library helpful here (something like https://github.com/Zielon/CPURasterizer ?), but maybe you can write it from scratch.

Once you can render oblique shots, I think you will need to render multiple shots from different angles, but that's a second step. Don't worry about it until you have a renderer ready!

pierotofy avatar Nov 04 '22 20:11 pierotofy

Yeah, you're confirming what I was thinking after I peeked at the code. The mesh-to-ortho is done in C++ which is outside my wheelhouse for sure (not to mention the geometry involved). Manipulating the mesh in Python before handing it to odm_orthophoto seems like it would require one or more big dependencies that I assume you would want to avoid; plus, not sure it would matter since my noob reading of the C++ indicates it's doing some 3D transforms to align the model before writing the TIFF out.

I agree it would be a nice feature; however, I think it's beyond my skills for the moment. Maybe another intrepid volunteer will pick this up.

chriswilley avatar Nov 04 '22 21:11 chriswilley

I just had a quick look. In a first time wouldn't it be possible to cheat by rotating the .obj with the blender bpy package already including (and the pointcloud if needed with pdal) and using this has the input of the actual odm_orthophoto stage ?

coumbsek avatar Dec 13 '22 09:12 coumbsek

I've looked a bit more into this, I think the odm_orthophoto might be sufficient for the task (I thought it wouldn't work):

image

The cleanest way to do this would be to add a parameter in odm_orthophoto to rotate the model around its center prior to rendering; the next steps would be to add the necessary lines of code to ODM to generate multiple orthophotos, crop, georeference, etc.

pierotofy avatar Jan 09 '23 21:01 pierotofy

Looking at this feature, I am wondering how to simply rotate the model. Should we make our own function based on one of the version of load_obj or look for a lib that handle obj files and model and allow to rotate it ?

coumbsek avatar Mar 02 '23 10:03 coumbsek

As a workaround (and to start from a .obj file) I've written about a method of creating oblique orthophotos by rotating in Blender and then running odm_orthophoto, expanding on this forum comment: https://community.opendronemap.org/t/creating-2-5d-oblique-orthophoto/13579/4

I agree adding flags to odm_orthophoto to set rotation axis and rotation degrees would be optimal. Would a PR into https://github.com/OpenDroneMap/odm_orthophoto be the next step or is that a fork of the logic in this repo?

https://jakecoppinger.com/2023/03/generating-aerial-imagery-with-your-iphones-lidar-sensor/

jakecoppinger avatar Mar 12 '23 12:03 jakecoppinger