OpenDroneMap / ODM

A command line toolkit to generate maps, point clouds, 3D models and DEMs from drone, balloon or kite images. 📷
https://opendronemap.org
GNU Affero General Public License v3.0
4.88k stars 1.11k forks source link

Feature Request: Perform Edge Enhancement and Histogram Adjustment for Matching only #1301

Open Saijin-Naib opened 3 years ago

Saijin-Naib commented 3 years ago

In the past, I've done a bit of a hacky pre-processing of images by sharpening and auto-contrasting in a tool like XNConvert. I was reminded of this today working with a particularly reticent dataset.

I think it'd be great if we (optionally? I don't think always would hurt, though) pre-processed the input images for feature matching/extraction only, to help stitch datasets with contrast/exposure/sharpness issues, and maybe even net some better matching/extraction on good data, as well!

Ideally, these would be done non-destructively (in memory on the fly? cached on disk?) for the matching, and once matching is completed, the originally submitted images would be passed to the pipeline to colorize the point cloud and generate the orthophoto and textured models.

Saijin-Naib commented 3 years ago

ff3ba29685506372b82c1f465ffe9e282cebcb1c.png

Further experiments have lead me to this arrangement of pre-processing steps. I think they strike a good balance between increasing tiepoint extraction and aesthetic improvements to the data.

Saijin-Naib commented 3 years ago

I'm noticing that pre-processing the data seems to reduce the reported Error in ODM by orders of magnitude, which is quite interesting.

Please find Report.pdf attached for original data:
report.pdf

Please find Report.pdf attached for pre-processed data:
report.pdf

theoway commented 2 years ago

I'd love to contribute. I'd need to know a few things first:

As for the approach, I think pre-processing them on the fly and keeping in memory will slow things down. Images should be pre-processed and kept in a separate folder for reference during feature matching. Let me know your thoughts.

Saijin-Naib commented 2 years ago

I'm not super well-versed in this, but my thoughts are these:

pierotofy commented 2 years ago

If I may suggest, any image enhancement for feature detection should be done on-the-fly (without storing the images onto disk). It will be faster (and much less complicated).

theoway commented 2 years ago

I'll defer to your suggestion as you guys have built it 😄 About image pre-processing, opencv can be used to shaprness and contrast increase, provided it won't be an extra dependency. I'll share some code snippets/articles here on how it can be done.

theoway commented 2 years ago

Increasing contrast using opencv Sharpening an image is pretty simple. Link Let me know your thoughts... Can't wait to get started on this and get better results :)

Saijin-Naib commented 1 year ago

This line of thought was recently corroborated by a user's test dataset consisting of mostly open snow, which, when they performed automatic contrast and adaptive histogram equalization. Their approach created severe artifacting and "tiling" on the output due to not having the pipeline only use the pre-processed images for matching, but it did greatly increase their reconstruction.

I've been curious about, and researching, using a First-Order PCA on the images to match on the most significant features. This should be sensor and dataset agnostic.

@smathermather has suggested doing an IHS (Intensity/Hue/Saturation) transform and then using the Intensity channel.

In cruising around the literature, it seems like both have some prior art.

Saijin-Naib commented 1 year ago

@theoway

Not sure if you've had the bandwidth to investigate any of the above.

What are your thoughts?

theoway commented 1 year ago

@theoway

Not sure if you've had the bandwidth to investigate any of the above.

What are your thoughts?

@Saijin-Naib Hey! I won't be able to research, however, can definitely help in dev 😄 Do share the relevant literature here, I'll give them a read.

Saijin-Naib commented 1 year ago

Do share the relevant literature here, I'll give them a read.

Now I have to go back and find the papers, I've un-pinned the tabs haha