Skip to content

Instantly share code, notes, and snippets.

@tomas789
Last active October 31, 2017 15:25
Show Gist options
  • Save tomas789/ec223f9c690b78b66e5f7b02958f693f to your computer and use it in GitHub Desktop.
Save tomas789/ec223f9c690b78b66e5f7b02958f693f to your computer and use it in GitHub Desktop.
include Makefile.vars
all: \
reconstruction_global/ok.txt \
reconstruction_incremental/ok.txt
exports: \
export_keypoints \
export_matches \
images:
ln -snf ../images images
matches/sfm_data.json: images
$(OPENMVG_MAIN_SFMINIT) -i images -o matches -f 554
matches/computefeatures.ok.txt: matches/sfm_data.json
$(OPENMVG_MAIN_COMPUTEFEATURES) -i matches/sfm_data.json -o matches -m $(OMVG_IMAGE_DESCRIBER) -p $(OMVG_DESCRIBER_PRESET)
touch matches/computefeatures.ok.txt
export_keypoints/ok.txt: matches/computefeatures.ok.txt
$(OPENMVG_MAIN_EXPORTKEYPOINTS) -i matches/sfm_data.json -d matches -o export_keypoints
ln -snf ../images export_keypoints/images
touch export_keypoints/ok.txt
export_keypoints/png.ok.txt: export_keypoints/ok.txt
$(foreach var,$(wildcard export_keypoints/*.svg),$(IMAGEMAGICK_CONVERT) $(var) $(var:svg=png);)
touch export_keypoints/png.ok.txt
export_keypoints: export_keypoints/ok.txt export_keypoints/png.ok.txt
export_keypoints/video.mkv: export_keypoints/png.ok.txt
$(IMAGEMAGICK_CONVERT) -quality 100 -set delay 15 export_keypoints/*.png export_keypoints/video.mkv
matches/matches.f.bin: matches/computefeatures.ok.txt
$(OPENMVG_MAIN_COMPUTEMATCHES) -i matches/sfm_data.json -o matches -g f
matches/matches.e.bin: matches/computefeatures.ok.txt
$(OPENMVG_MAIN_COMPUTEMATCHES) -i matches/sfm_data.json -o matches -g e
matches/matches.h.bin: matches/computefeatures.ok.txt
$(OPENMVG_MAIN_COMPUTEMATCHES) -i matches/sfm_data.json -o matches -g h
reconstruction_global/sfm_data.bin: matches/matches.e.bin
$(OPENMVG_MAIN_GLOBALSFM) -i matches/sfm_data.json -m matches -o reconstruction_global
matches/matches.putative.bin: matches/matches.f.bin
export_matches_putative/ok.txt: matches/matches.putative.bin
$(OPENMVG_MAIN_EXPORTMATCHES) -i matches/sfm_data.json -d matches -m matches/matches.putative.bin -o export_matches_putative
touch export_matches_putative/ok.txt
export_matches_fundamental/ok.txt: matches/matches.f.bin
$(OPENMVG_MAIN_EXPORTMATCHES) -i matches/sfm_data.json -d matches -m matches/matches.f.bin -o export_matches_fundamental
touch export_matches_fundamental/ok.txt
export_matches_essential/ok.txt: matches/matches.e.bin
$(OPENMVG_MAIN_EXPORTMATCHES) -i matches/sfm_data.json -d matches -m matches/matches.e.bin -o export_matches_essential
touch export_matches_essential/ok.txt
export_matches_putative/png.ok.txt: export_matches_putative/ok.txt
ln -snf ../images export_matches_putative/images
$(foreach var,$(wildcard export_matches_putative/*.svg),$(IMAGEMAGICK_CONVERT) $(var) $(var:svg=png);)
touch export_matches_putative/png.ok.txt
export_matches_homography/ok.txt: matches/matches.h.bin
$(OPENMVG_MAIN_EXPORTMATCHES) -i matches/sfm_data.json -d matches -m matches/matches.h.bin -o export_matches_homography
touch export_matches_homography/ok.txt
export_matches_fundamental/png.ok.txt: export_matches_fundamental/ok.txt
ln -snf ../images export_matches_fundamental/images
$(foreach var,$(wildcard export_matches_fundamental/*.svg),$(IMAGEMAGICK_CONVERT) $(var) $(var:svg=png);)
touch export_matches_fundamental/png.ok.txt
export_matches_essential/png.ok.txt: export_matches_essential/ok.txt
ln -snf ../images export_matches_essential/images
$(foreach var,$(wildcard export_matches_essential/*.svg),$(IMAGEMAGICK_CONVERT) $(var) $(var:svg=png);)
touch export_matches_essential/png.ok.txt
export_matches_homography/png.ok.txt: export_matches_homography/ok.txt
ln -snf ../images export_matches_homography/images
$(foreach var,$(wildcard export_matches_homography/*.svg),$(IMAGEMAGICK_CONVERT) $(var) $(var:svg=png);)
touch export_matches_homography/png.ok.txt
export_matches: \
export_matches_putative/ok.txt \
export_matches_fundamental/ok.txt \
export_matches_essential/ok.txt \
export_matches_homography/ok.txt \
export_matches_putative/png.ok.txt \
export_matches_fundamental/png.ok.txt \
export_matches_essential/png.ok.txt \
export_matches_homography/png.ok.txt \
reconstruction_global/cloud_and_poses_structure.ply: reconstruction_global/sfm_data.bin
$(OPENMVG_MAIN_COMPUTESTRUCTUREFROMKNOWNPOSES) -i reconstruction_global/sfm_data.bin -m matches -o reconstruction_global/sfm_data_structure.bin
mv reconstruction_global/sfm_data_structure.ply reconstruction_global/cloud_and_poses_structure.ply
reconstruction_global/sfm_data.json: reconstruction_global/sfm_data.bin
$(OPENMVG_MAIN_CONVERTSFM_DATAFORMAT) -i reconstruction_global/sfm_data.bin -o reconstruction_global/sfm_data.json
reconstruction_global/sfm_data_structure.json: reconstruction_global/sfm_data_structure.bin
$(OPENMVG_MAIN_CONVERTSFM_DATAFORMAT) -i reconstruction_global/sfm_data_structure.bin -o reconstruction_global/sfm_data_structure.json
reconstruction_global/cloud_and_poses_color.ply: reconstruction_global/sfm_data.bin
$(OPENMVG_MAIN_COMPUTESFM_DATACOLOR) -i reconstruction_global/sfm_data.bin -o reconstruction_global/cloud_and_poses_color.ply
reconstruction_global/cloud_and_poses_structure_color.ply: reconstruction_global/sfm_data_structure.bin
$(OPENMVG_MAIN_COMPUTESFM_DATACOLOR) -i reconstruction_global/sfm_data_structure.bin -o reconstruction_global/cloud_and_poses_structure_color.ply
reconstruction_global/ok.txt: \
reconstruction_global/sfm_data.bin \
reconstruction_global/sfm_data.bin \
reconstruction_global/sfm_data.json \
reconstruction_global/cloud_and_poses_structure.ply \
reconstruction_global/cloud_and_poses_color.ply \
reconstruction_global/cloud_and_poses_structure_color.ply \
reconstruction_global/sfm_data_structure.json
touch reconstruction_global/ok.txt
reconstruction_incremental/sfm_data.bin: matches/matches.f.bin
$(OPENMVG_MAIN_INCREMENTALSFM) -i matches/sfm_data.json -m matches -o reconstruction_incremental
reconstruction_incremental/cloud_and_poses_structure.ply: reconstruction_incremental/sfm_data.bin
$(OPENMVG_MAIN_COMPUTESTRUCTUREFROMKNOWNPOSES) -i reconstruction_incremental/sfm_data.bin -m matches -o reconstruction_incremental/sfm_data_structure.bin
mv reconstruction_incremental/sfm_data_structure.ply reconstruction_incremental/cloud_and_poses_structure.ply
reconstruction_incremental/sfm_data.json: reconstruction_incremental/sfm_data.bin
$(OPENMVG_MAIN_CONVERTSFM_DATAFORMAT) -i reconstruction_incremental/sfm_data.bin -o reconstruction_incremental/sfm_data.json
reconstruction_incremental/sfm_data_structure.json: reconstruction_incremental/sfm_data_structure.bin
$(OPENMVG_MAIN_CONVERTSFM_DATAFORMAT) -i reconstruction_incremental/sfm_data_structure.bin -o reconstruction_incremental/sfm_data_structure.json
reconstruction_incremental/cloud_and_poses_color.ply: reconstruction_incremental/sfm_data.bin
$(OPENMVG_MAIN_COMPUTESFM_DATACOLOR) -i reconstruction_incremental/sfm_data.bin -o reconstruction_incremental/cloud_and_poses_color.ply
reconstruction_incremental/cloud_and_poses_structure_color.ply: reconstruction_incremental/sfm_data_structure.bin
$(OPENMVG_MAIN_COMPUTESFM_DATACOLOR) -i reconstruction_incremental/sfm_data_structure.bin -o reconstruction_incremental/cloud_and_poses_structure_color.ply
reconstruction_incremental/ok.txt: \
reconstruction_incremental/sfm_data.bin \
reconstruction_incremental/sfm_data.bin \
reconstruction_incremental/sfm_data.json \
reconstruction_incremental/cloud_and_poses_structure.ply \
reconstruction_incremental/cloud_and_poses_color.ply \
reconstruction_incremental/cloud_and_poses_structure_color.ply \
reconstruction_incremental/sfm_data_structure.json
touch reconstruction_incremental/ok.txt
.PHONY: clean
clean:
rm -rf images
rm -rf export_keypoints
rm -rf export_matches_putative
rm -rf export_matches_fundamental
rm -rf export_matches_essential
rm -rf export_matches_homography
rm -rf matches
rm -rf reconstruction_global
rm -rf reconstruction_incremental
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment