So I've been meaning to do some work on improving the orthophoto results (I've started a conversation here time ago: https://github.com/OpenDroneMap/OpenDroneMap/pull/444)
Achieving a 2.5D mesh can be done using a constrained delaunay triangulation and it's detailed here https://github.com/CloudCompare/CloudCompare/blob/579ee91594e16beba5863e2e4d15cf0729eb68a8/libs/qCC_db/ccMesh.cpp and here https://github.com/CloudCompare/CloudCompare/blob/579ee91594e16beba5863e2e4d15cf0729eb68a8/CC/src/Delaunay2dMesh.cpp

CloudCompare offers this feature built-in and has a command line mode http://www.cloudcompare.org/doc/wiki/index.php?title=Command_line_mode, however I don't think I'd want to include all of its dependencies (including QT!) just for the sake of generating a 2.5D mesh.
I could isolate just the code that takes care of the 2.5D mesh generation (and add some filtering of my own to reduce the spikes), but it will be necessary to add http://www.cgal.org/ as a dependency. PCL does not have any support for delaunay triangulations.
@dakotabenjamin what are your thoughts?
Also cc @smathermather
Can we also isolate just the bits of CGAL we need, or is that a fools errand?
CGAL is complicated to just use as-is, I wouldn't venture as far as isolating a single component. What are the downsides of including CGAL, besides increased compilation time and docker image size?
Just that. We can include it and then put it on a list of dependencies to remove later. I'm happy to take that approach: we're at an add features stage for the project, so I'd say proceed!
Feel free to assign me the task.
Can we migrate all the current PCL functions over to CGAL? I don't have any experience with it. Removing PCL could speed up complication times significantly.
Probably. The good news is that there's a prebuilt package for including CGAL in Ubuntu. apt-get install libcgal-dev.
That is pretty good news. PCL is heavy.
I would suggest for now just getting the 2.5D work in and we can sit down and sort through the possibilities of a full migration at a later date.
Boom!

Still need to do some smoothing / filtering.

Awesome!
Starting to look a lot better:

Still need to do further smoothing, but I think we're going to get free cropping along with this enhancement!

This is due to the delaunay triangulation and outlier removal which makes some nice sharp edges around the resulting orthophoto (vs poisson).
It seems nice, how to test it ?
Checkout this commit https://github.com/pierotofy/OpenDroneMap/commit/503671487020fa4ff6dad77bdf984bb5592f5313
And run with the --use-25dmesh argument. It's still a work in progress though, expect improvements in the next few days.
You will also need to compile the odm_25dmeshing module and copy the resulting binary in the bin folder. If you are not comfortable with cmake, make, etc. I would wait until I configure the configure.sh script properly.
How is the cropping? Any areas that are over-cropped when compared to a ortho generated via 3d mesh?
It depends on the outlier removal parameter. The more outliers are removed, the more conservative the crop is.
Ok, I'm familiar with make and cmake but use it with docker under archlinux. I will wait to test.
Control of outlier is planned ?
Yes, I'm adding a outlier removal parameter that can be tuned as well as a max vertex count parameter that defines the precision of the output mesh.
Old:

2.5D:

Old:

2.5D:

Look nice!
Any idea why struture between 2 trees is wavy with delaunay ?
I'm not entirely sure; I'm not very familiar with the mvs texturing package, which is the component that overlays the texture over the surface model.
Probably because of noise:

Looks like more a shiny surface with different shine on each picture.
No that's because illumination is turned on.

Re-ran it with half the number of vertices (less noise, but less definition on edges):


@kikislater you should be able to test the 2.5D mesh feature by checking out the changes in #542 and running . configure.sh.
Most helpful comment
Starting to look a lot better: