Git Product home page Git Product logo

bmanczak / aom-linematching Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 27.71 MB

Detecting, filtering and matching geometrical features from an extraction set to the query image. Project for Superposition in collaboration with Netherlands Institute for Sound and Vision .

Home Page: https://superposition-cc.medium.com/artifacts-of-memory-voortgang-okt-nov-2020-b76a89869c3d

License: Apache License 2.0

Jupyter Notebook 99.12% Python 0.88%
line-detection feature-matching hough-transform hough-lines

aom-linematching's Introduction

Artifacts Of Memory - Line Matching system:

extracting, filtering and matching lines from a set of frames to a query image .

Welcome to this repo! In this repo you can find an efficient implementation of detecting, filtering and matching the lines from a set of frames to the lines detected in the query image. You can find step by step details in walkthrough.ipynb. This project has been realized in collaboration with the Netherlands Institute of Sound and Vision and Superposition in the context of their project Artifacts of Memory. We used the frames extracted from video archives as the extraction set.

The pipeline

The pipeline consists of two main parts. The first part concerns dealing with the video archives and the second part with matching the lines from a query image with the matched lines from the archive.

Step 1: Preprocess the video archives into a format from which we can extract lines. This has to only be done once.

  • Sample frames from videos to work on static data
  • For each frame, run a line extraction together with additional line features such as line angle and length.
  • Discard the frames with no detected lines and filter out weak (short) and closely similiar lines (reduce noise and dimensionality for later retrival)
  • Save the information about the filtered data in an format that is easy to query (we chose Pandas dataframe)

This step can be applied with processArchives.py script (customize with command line arguments). This script uses methods in processingMethods.py.

Step 2: Extract and match the lines from the query image to the database of candidate matches from the archive.

  • run the line extraction and filter algorithm on the query image
  • choose the line(s) to be matched. How? We prefer long, non-horizontal lines.
  • perform the matching procedure
  • fetch the match and overlay it on the query image

This step can be applied with overlay.py script (customize with command line arguments). This script uses methods from matchingMethods.py.

Environment

We provide a conda environment called AOM which contains all packages you need to execute the scripts in this repo.

Structure

ArtifactsOfMemory
│   walkthrough.ipynb
│   processingMethods.py
│   processArchives.py
│   matchingMethods.py
│   overlay.py
│   
│   archives/ % contains at least one folder
│      folderWithImgs/  % folder containing images from which to extract line
│   
│   frames/ 
│       contemporary/ % folder containing the query images on which the matches should be overlayed
│       outputs/ % Directory where the overlayed images should be stored, 
│
│   data/ % stores the data produced by processArchives.py

Note that folders archives, frames and data is not in this repo. Prior to execution you must create these folders yourself.

Example execution

cd ../ArtifactsOfMemory
conda activate AOM
python processArchives.py --scale 0.8 --sample 0.5 
python overlay.py --num_lines 2 --hough_params 200,150,25

Example output

Example output

aom-linematching's People

Contributors

bmanczak avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.