Open soutobias opened 1 month ago
This should be merged with the feature matching-based overlap removal. Indeed it provides the full explanation here. However, it is not what we expect in terms of 'overlap removal' based on theoretical imprint which is specified in the issue #8 . The later uses ray-tracing reprojection calculation to define overlap or not. This is highly influenced by navigation accuracy but it is time efficient.
What:
Overlapping images can be detected using computer vision techniques based on the features located within the images.
Why:
Duplicates in image datasets can bias ecological analyses, as they may lead to overestimations of certain species or individuals. However, these duplicates can also provide valuable alternate views of rare morphotypes. In large datasets with more than 1,000 images, manually detecting overlaps can be time-consuming. Automated detection using computer vision offers an efficient solution.
How:
Feature matching is a method that allows a computer to detect common features in pairs of images. These common features can be validated by assessing the distance between points in candidate pairs using RANSAC (Random Sample Consensus) regression. The number of features detected is typically sufficient to establish a threshold for overlap, which can then be stored in a contingency matrix.
There’s also the possibility of using these matched points to calculate a homography matrix, which can then be used for mosaicking or cropping overlapping portions of images. The sequence of image comparison can be customized depending on the user's needs (refer to the COLMAP tutorial).
Python Code Example:
Feature Matching and Overlap Detection:
Creating a Contingency Matrix:
Optional: Homography Matrix for Mosaicking or Cropping:
What to expect:
The process will produce a contingency matrix indicating whether each pair of images overlaps (1 for overlap, 0 for no overlap). This matrix can guide further analysis, such as removing duplicates or preparing data for mosaicking. Additionally, the homography matrix calculated from feature matching can be used for mosaicking or cropping overlapping portions of images.
What makes it difficult:
Computer vision algorithms can yield variable results depending on image quality, so parameter tuning might be necessary. It's important to validate the feature-matching overlap detection by manually checking a subset of the images. This ensures that the automated process is functioning as expected and that no important details are missed.