Skip to content

Instantly share code, notes, and snippets.

View simogasp's full-sized avatar

Simone Gasparini simogasp

View GitHub Profile
@simogasp
simogasp / script.py
Created October 12, 2015 14:20
script to launch voctreelocalization
#!/usr/bin/env python
"""
Created on Thu Oct 8 18:13:16 2015
@author: sgaspari
"""
import argparse
import os.path
import subprocess
import shlex
@simogasp
simogasp / convertToNewSfMdata.py
Created November 28, 2015 12:05
script to convert a sfm_data file to the new format with polymorphic views
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Sat Nov 28 11:27:30 2015
@author: sgaspari
"""
import json
import argparse
@simogasp
simogasp / dependencies.dot
Created January 28, 2016 14:22
module dependencies
digraph GG {
node [
fontsize = "12"
];
"node4" [ label="CppUnitLite" shape="diamond"];
"node14" [ label="easyexif" shape="diamond"];
"node13" [ label="flann_cpp_s" shape="diamond"];
"node8" [ label="jpeg" shape="diamond"];
"node7" [ label="lemon" shape="diamond"];
"node0" [ label="lib_CoinUtils" shape="diamond"];
// list::begin
#include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#include <random>
#include <functional>
int main ()
{
@simogasp
simogasp / color3dpointsMAYA.py
Created August 1, 2016 13:57
Script to color and resize the point cloud according to the point visibility
# color points and their size (if spehere) according to their visibility
# create color attribute per particle
# create general attribute radiusPP
import maya.cmds as mc
import colorsys
name = 'mvgPointCloud'
radiusBase = 0.005
@simogasp
simogasp / LimitedBuffer.cpp
Created August 9, 2016 16:41
LimitedBuffer that pops element from front when inserting if maxSize is reached
// queue::push/pop
#include <iostream> // std::cin, std::cout
#include <deque> // std::queue
#include <assert.h>
template<class T>
class LimitedBuffer
{
private:
@simogasp
simogasp / logger.md
Last active November 2, 2016 18:14
how to choose the logger

in Cmake

OPTION(OpenMVG_USE_LOG "Enable logger" ON)

# a variable to set the type of logger to use
set(OpenMVG_LOGGER "LOG_COUT" CACHE STRING "The logger to use for openMVG"))
set(LOGGERS_Values "LOG_COUT;LOG_BOOST;LOG_GLOG" CACHE INTERNAL "List of possible values for the OpenMVG_LOGGER cache variable”)
set_property(CACHE OpenMVG_LOGGER PROPERTY STRINGS ${LOGGERS_Values})
...
@simogasp
simogasp / testRaceCondition.cpp
Last active March 12, 2017 19:57
testRaceCondition - it tests a possible race condition when creating points or adding its observations. It's a simplified version of the relevant omvg code. It takes as input a sfmdata and it basically tries to build a copy of the Landmarks in it by running through all the view and adding either a new point if it does not exist in the new set, o…
#include <openMVG/sfm/sfm_data.hpp>
#include <openMVG/sfm/sfm_data_io.hpp>
#include <openMVG/tracks/tracks.hpp>
#include <openMVG/system/timer.hpp>
#include <openMVG/logger.hpp>
#include <omp>
#include <boost/progress.hpp>
#include <boost/program_options.hpp>
@simogasp
simogasp / pseudocoderesection.cpp
Last active March 13, 2017 21:45
pseudo code
// given the tracks visibleTracks visible for the current view viewIndex
// find the tracks reconstructedTracks in visibleTracks that have already been reconstructed
// reconstructedTracks = set_intersection(visibleTracks, Landmarks)
// update the 3D points observation of reconstructedTracks with viewIndex
// for each of reconstructedTracks (OMP parallelizable)
// update the observation with viewIndex
// the remaining visible tracks of viewIndex are potential 3D points
@simogasp
simogasp / visibility.py
Created December 14, 2017 17:42
[Maya script] Color points according to their visibility in Maya
# color points and their size (if spehere) according to their visibility
# create color attribute per particle
# create general attribute radiusPP
import maya.cmds as mc
import colorsys
name = 'mvgPointCloud'
radiusBase = 0.005
## Count the number of particules
totalParticle = mc.particle(name, query=True, count=True)
print(totalParticle)