Skip to content

Instantly share code, notes, and snippets.

@readicculus
readicculus / exhaustive_matcher.sh
Last active November 30, 2021 22:43
Camera Model Generation
colmap exhaustive_matcher \
--database_path fl09.db \
--SiftMatching.num_threads=-1 \
--SiftMatching.use_gpu=1 \
--SiftMatching.gpu_index=0 \
--SiftMatching.max_ratio=0.80000000000000004 \
--SiftMatching.max_distance=0.69999999999999996 \
--SiftMatching.cross_check=1 \
--SiftMatching.max_error=4 \
--SiftMatching.max_num_matches=32768 \
## Instructions
# 1. first generate a list in a text file of all IR .tif images, one filename per line, it is ok to include files from different
# cameras and flights but if a flight_camera is included in the list you should include all images from that flight_camera.
# 2. Preprocess(extract features). Run the script with the preprocess target and list from step 1
# ex 'python nuc.py preprocess --image_list images.txt'
# this will take some time and in the end will save an output.csv in the same directory that the script was run from
# you can override the output default name by specifying the flag --csv_out custom_name.csv
#
# Once you have this output.csv there are two commands available for getting the NUCs.
# 1. To list the NUCs use the list command and pass in the csv that step 2 generated.
@readicculus
readicculus / 1_nuc_svm.py
Last active July 23, 2021 20:05
NUC detector
import argparse
import os
import cv2
import numpy as np
from sklearn import svm
from sklearn.base import BaseEstimator
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split
from sklearn.pipeline import Pipeline