This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.utils import shuffle | |
from sklearn.model_selection import KFold, StratifiedKFold | |
import numpy as np | |
n_1 = 50 # elements in data1 | |
n_2 = 10 # elements in data2 | |
n_folds = 3 | |
alpha = 0.2 | |
datasource1 = np.arange(0,n_1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
include(mtfConfig.cmake) | |
include_directories(${MTF_INCLUDE_DIRS}) | |
add_definitions(${MTF_CXX_FLAGS}) | |
add_executable(test_MTF test_MTF.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - Basig config file generator for the MTF package | |
# It defines the following variables | |
# MTF_INCLUDE_DIRS - include directories for MTF | |
# MTF_CXX_FLAGS - Compile flags for GCC | |
# MTF_LIBRARIES - libraries to link against | |
# MTF_DEFS - Preprocessor definitions for MTF | |
# MTF_VERSION - The current MTF version | |
# MTF_LIB_DIRS - Dir where MTF compiled lib is installed | |
# Compute paths |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
find_package (Eigen3 REQUIRED DENSE) | |
include_directories(${EIGEN3_INCLUDE_DIR}) | |
find_package( OpenCV REQUIRED ) | |
include_directories(${OpenCV_INCLUDE_DIRS}) | |
set(MTF_LIBS mtf boost_system) | |
set(MTF_INCLUDE_DIRS /usr/local/include/mtf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import vtk | |
import numpy as np | |
from vtk.util import numpy_support | |
import cv2 | |
class Camera_VTK(): | |
""" | |
Example class showing how to project a 3D world coordinate onto a 2D image plane using VTK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import timeit | |
def norm(A): | |
if A.ndim == 1: | |
return np.sqrt(np.inner(A,A)) | |
return np.linalg.norm(A) | |
def time_norms(A, n_eval): | |
start_time = timeit.default_timer() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert standard camera intrinsic and extrinsic parameters to a vtkCamera instance for rendering | |
* Assume square pixels and 0 skew (for now). | |
* | |
* focal_len : camera focal length (units pixels) | |
* nx,ny : image dimensions in pixels | |
* principal_pt: camera principal point, | |
* i.e. the intersection of the principal ray with the image plane (units pixels) | |
* camera_rot, camera_trans : rotation, translation matrix mapping world points to camera coordinates | |
* depth_min, depth_max : needed to set the clipping range |