plateform
stringclasses
1 value
repo_name
stringlengths
13
113
name
stringlengths
3
74
ext
stringclasses
1 value
path
stringlengths
12
229
size
int64
23
843k
source_encoding
stringclasses
9 values
md5
stringlengths
32
32
text
stringlengths
23
843k
github
ojwoodford/ojwul-master
convert2gray.m
.m
ojwul-master/image/convert2gray.m
394
utf_8
20ef7eae75c457cf26bbaa3348131014
%CONVERT2GRAY Convert an RGB image to grayscale % % B = convert2gray(A) % %IN: % A - HxWxC input image, where C = 3 (RGB) or 1 (already grayscale). % %OUT: % B - HxW grayscale output image, of the same class as A. function im = convert2gray(im) if size(im, 3) == 3 im = cast(reshape(double(reshape(im, [], 3))...
github
ojwoodford/ojwul-master
imwarp.m
.m
ojwul-master/image/imwarp.m
429
utf_8
e6216334a08f75eb5428bedae35469cf
%IMWARP Warp an image according to a homography % % im = imwarp(im, H) % %IN: % im - HxWxC image % H - 3x3 homography matrix from source to target % %OUT: % im - HxWxC resampled output image function im = imwarp(im, H) % Compute the coordinates to sample at X = proj(H \ homg(flipud(ndgrid_cols(1:size(im, 1), ...
github
ojwoodford/ojwul-master
im2mov.m
.m
ojwul-master/image/im2mov.m
5,227
utf_8
41e469b5c3e2fb96e4aa5403e2c49598
%IM2MOV Convert a sequence of images to a movie file % % Examples: % im2mov infile outfile % im2mov(A, outfile) % im2mov(..., '-fps', n) % im2mov(..., '-quality', q) % im2mov(..., '-profile', profile) % im2mov(..., '-nocrop') % % This function converts an image sequence to a movie. % % To cr...
github
ojwoodford/ojwul-master
mov2im.m
.m
ojwul-master/image/mov2im.m
641
utf_8
f623093ad1a8a6cae5684eb639972909
%MOV2IM Convert a movie file to a sequence of images % % Examples: % mov2im infile outfile_format % %IN: % infile - string containing the name of the input video. % outfile_format - format string for the movie frames. The filename for % frame N is given by sprintf(outfile_format, N). ...
github
ojwoodford/ojwul-master
imnorm.m
.m
ojwul-master/image/imnorm.m
1,278
utf_8
a6b4caa2db5fa5166a2b34ff89d87eb9
%IMNORM Spatially local image normalization % % B = imnorm(A, sigma, noise_variance) % B = imnorm(A, [szy szx], noise_variance) % % Apply a local normalization operator (subtracting the mean and % normalizing the variance) to an image, either with a Gaussian or window % average weighting. % %IN: % A - H...
github
ojwoodford/ojwul-master
rng_seeder.m
.m
ojwul-master/utils/rng_seeder.m
589
utf_8
37ed4745dc7d52079ad2aaced05010da
%RNG_SEEDER Seed the random number generator, and print the seed if generated % % seed = rng_seeder() % rng_seeder(seed) % % This function intializes the random number generator, and prints out the % seed if one is not given or output. % %IN: % seed - scalar seed for the random number generator. % %OUT: % seed ...
github
ojwoodford/ojwul-master
qfig.m
.m
ojwul-master/utils/qfig.m
450
utf_8
9f8367ca4007ca0eb5e1e401272d1009
%QFIG Quietly select the figure % % fh = qfig(fn) % % Quietly selects the figure specified, without bringing it into focus % (unless the figure doesn't exist yet). % % IN: % fn - scalar positive integer, or figure handle indicating the figure % to select. % % OUT: % fh - handle to the figure. functio...
github
ojwoodford/ojwul-master
ojw_progressbar.m
.m
ojwul-master/utils/ojw_progressbar.m
9,531
utf_8
ca29d395f2e8d30da82e8b0f31717b83
%OJW_PROGRESSBAR Simple progress bar implementation % % [this, retval] = ojw_progressbar(tag, proportion, [total, [min_update_interval]]) % % Starts, updates and closes a progress bar according to the proportion of % time left. There are two ways of using the function: % % % Simple (one line) but more overhea...
github
ojwoodford/ojwul-master
add_genpath_exclude.m
.m
ojwul-master/utils/add_genpath_exclude.m
804
utf_8
ad7336761638201f97ff7c4fbd2a1b78
%ADD_GENPATH_EXCLUDE Add a folder and subdirectories to the path, with exclusions % % add_genpath_exclude(folder_path, ...) % % For example: % add_genpath_exclude('ojwul', '/.git', '\.git') % adds ojwul and subdirectories to the path, excluding .git folders. % %IN: % folder_path - Relative or absolute path to th...
github
ojwoodford/ojwul-master
string2hash.m
.m
ojwul-master/utils/string2hash.m
453
utf_8
89a6f95ed4a295f057af5040c85cac81
%STRING2HASH Convert a string to a 64 char hex hash string (256 bit hash) % % hash = string2hash(string) % %IN: % string - a string! % %OUT: % hash - a 64 character string, encoding the 256 bit SHA hash of string % in hexadecimal. function hash = string2hash(string) persistent md if isempty(md) md ...
github
ojwoodford/ojwul-master
col.m
.m
ojwul-master/utils/col.m
391
utf_8
7730db6cdeaee9ea0865f10334719fba
%COL Convert an array to a column vector along a particular dimension % % B = col(A, [dim]) % %IN: % A - Array of any size. % dim - Positive integer indicating the dimension to arrange the elements % of A along. Default: 1. % %OUT: % B - Result of shiftdim(A(:), 1-dim). function x = col(x, dim) x = res...
github
ojwoodford/ojwul-master
recurse_subdirs.m
.m
ojwul-master/utils/recurse_subdirs.m
1,769
utf_8
79eab70a46d565eaeeca552e4c34314e
%RECURSE_SUBDIRS Run a function recursively on a directory structure % % varargout = recurse_subdirs(func, base) % % This function calls a function, passing in the path to each subdirectory % in the tree of the current directory (i.e. including subdirectories of % subdirectories). % %IN: % func - A handle ...
github
ojwoodford/ojwul-master
ndgrid_cols.m
.m
ojwul-master/utils/ndgrid_cols.m
727
utf_8
5cbe7e8b53cc0ad85a2e74377eeaac21
%NDGRID_COLS Like NDGRID, but creates column vectors from the outputs % % [X, sz] = ndgrid_cols(...) % % This function applies passes its inputs directly to NDGRID, then converts % the outputs to row vectors, which are stacked vertically, so each % combination of inputs becomes a column vector in the output matrix. %...
github
ojwoodford/ojwul-master
compile.m
.m
ojwul-master/utils/compile.m
15,693
utf_8
b2adcd1ca5e0fd46a553b939e43229cb
%COMPILE Mex compilation helper function % % Examples: % compile func1 func2 ... -option1 -option2 ... % % This function can be used to (re)compile a number of mex functions, but % is also a helper function enabling inline compilation. function varargout = compile(varargin) % There are two types of call: %...
github
ojwoodford/ojwul-master
temp_cd.m
.m
ojwul-master/utils/temp_cd.m
486
utf_8
d5d5464b0d93132d4d3e0090e0ec7165
%TEMP_CD Switch to a directory for the duration of the calling function % % cwd = temp_cd(dirname) % %IN: % dirname - Full or relative path to the directory to switch to. % %OUT: % cwd - Path string to current directory. function cwd = temp_cd(dirname) assert(evalin('caller', 'exist(''temp_cd_cleanupObj'', ''var...
github
ojwoodford/ojwul-master
str2fun.m
.m
ojwul-master/utils/str2fun.m
1,423
utf_8
cbdee8fc068af54566c8a6c414da697f
%STR2FUN Construct a function_handle from a function name or path. % FUNHANDLE = STR2FUN(S) constructs a function_handle FUNHANDLE to the % function named in the character vector S. The S input must be a % character vector. The S input cannot be a character array with % multiple rows or a cell array of cha...
github
ojwoodford/ojwul-master
vgg_argparse.m
.m
ojwul-master/utils/vgg_argparse.m
1,946
utf_8
9831dc65a204ed7cf28af3acd5487ffd
%VGG_ARGPARSE Parse variable arguments into a structure % opts = vgg_argparse(inopts,varargin) % inopts: structure (cells array) listing valid members and default values % varargin: variable arguments of form '<name>',<value>,... % opts: opts modified by varargin % % Example: % function f = foo(va...
github
ojwoodford/ojwul-master
user_string.m
.m
ojwul-master/utils/user_string.m
3,273
utf_8
1001def19cdf03ef0095097e934b6640
%USER_STRING Get/set a user specific string % % Examples: % string = user_string(string_name) % isSaved = user_string(string_name, new_string) % % Function to get and set a string in a system or user specific file. This % enables, for example, system specific paths to binaries to be saved. % % The specified strin...
github
ojwoodford/ojwul-master
bsxfun.m
.m
ojwul-master/utils/bsxfun.m
4,309
utf_8
2f5ffcbfa7ab333f15990ab47e3fe49f
% BSXFUN Binary Singleton Expansion Function % C = BSXFUN(FUNC,A,B) applies the element-by-element binary operation % specified by the function handle FUNC to arrays A and B, with singleton % expansion enabled. FUNC can be one of the following built-in functions: % % @plus Plus % ...
github
ojwoodford/ojwul-master
maximize.m
.m
ojwul-master/utils/maximize.m
884
utf_8
2b1e724a67b717d50a29e1186d1e6612
%MAXIMIZE Maximize a figure window to fill the entire screen % % Examples: % maximize % maximize(hFig) % % Maximizes the current or input figure so that it fills the whole of the % screen that the figure is currently on. This function is platform % independent. % %IN: % hFig - Handle of figure to maxi...
github
ojwoodford/ojwul-master
bitwise_hamming.m
.m
ojwul-master/bitwise/bitwise_hamming.m
4,768
utf_8
9f5bb67a39572295bc759ee01457d8c9
%BITWISE_HAMMING Compute all hamming distances between two sets of bit vectors % % C = bitwise_hamming(A, B, [thresh]) % % Given two sets of bit vectors (each column being a bit vector), compute % the hamming distances between all pairs of vectors between the two sets. % If a threshold is given, return only tho...
github
ojwoodford/ojwul-master
DataHash.m
.m
ojwul-master/bitwise/DataHash.m
22,490
utf_8
f8f52f3077dddaf31779b71355a47695
function Hash = DataHash(Data, varargin) % DATAHASH - Checksum for Matlab array of any type % This function creates a hash value for an input of any type. The type and % dimensions of the input are considered as default, such that UINT8([0,0]) and % UINT16(0) have different hash values. Nested STRUCTs and CELLs are par...
github
ojwoodford/ojwul-master
bitcount.m
.m
ojwul-master/bitwise/bitcount.m
1,281
utf_8
08975f47b04e6ab70dc6894320d1e49d
%BITCOUNT Count the number of set bits in each column of the input % % B = bitcount(A) % % Count the number of set bits in each column of the input array, % typecast as a bit vector. % %IN: % A - MxNx... input array. % %OUT: % B - 1xNx... output array of bit counts. function A = bitcount(A) persi...
github
ojwoodford/ojwul-master
fit_gaussian.m
.m
ojwul-master/stats/fit_gaussian.m
647
utf_8
e4bfa184e5ae30b876c1a3415e6ddfbd
%FIT_GAUSSIAN Fit a multi-variate gaussian to data. % % [mu, whiten] = fit_gaussian(X) % % Fit a multi-variate gaussian to data. This function can handle % under-constrained data. % % IN: % X - MxN matrix of N vectors of dimension M. % % OUT: % mu - Mx1 distribution mean. % whiten - Mx(min(M,N)) ...
github
ojwoodford/ojwul-master
qpbo.m
.m
ojwul-master/optimize/qpbo.m
4,377
utf_8
5a8872c3010e87e8bc72194a2040c0d7
%QPBO Binary MRF energy minimization on non-submodular graphs % % [L stats] = qpbo(UE, PI, PE, [TI, TE], [options]) % % Uses the Quadratic Pseudo-Boolean Optimization (QPBO - an extension of % graph cuts that solves the "roof duality" problem, allowing graphs with % submodular edges to be solved) to solve binary, pa...
github
ojwoodford/ojwul-master
cd_learn_normal.m
.m
ojwul-master/optimize/cd_learn_normal.m
6,890
utf_8
938e9df7096531476e5785896d25e2be
function estim = cd_learn_normal(varargin) %CD_LEARN_NORMAL Demos contrastive divergence learning % % params = cd_learn_normal(options) % % Uses contrastive divergence to learn the parameters of a normal % distribution that training data is generated from, and displays the % results on completion. Assumes we don't k...
github
ojwoodford/ojwul-master
dp_pair_chain.m
.m
ojwul-master/optimize/dp_pair_chain.m
708
utf_8
cfd16b503833f9e7ed38686b86431031
%DP_PAIR_CHAIN Dynamic programming on a chain of pairwise links % % Examples: % L = dp_pair_chain(U, E) % [L en] = dp_pair_chain(U, E) % % Minimize the cost of a set of pairwise chains. % %IN: % U - PxQxR array of unary costs (double, single or uint32) % E - PxP or PxPx(Q-1)xR array of pairwise costs (same type as U)....
github
ojwoodford/ojwul-master
simulated_annealing.m
.m
ojwul-master/optimize/simulated_annealing.m
4,238
utf_8
f7934e45f1d5640779962e7f527c9e5f
%SIMULATED_ANNEALING Perform simulated annealing on conditional energies % % [X en] = simulated_annealing(X0, energy, T, varargin) % % Simulated annealing for discrete energy minimization labelling problems % for which conditional energy distributions can be computed. Given an % initial labelling, a normalized...
github
ojwoodford/ojwul-master
trw_bp.m
.m
ojwul-master/optimize/trw_bp.m
2,447
utf_8
57d5a8ab7552ea350909384ce697dec5
%TRW_BP Multi-label MRF energy minimization using TRW-S & LBP % % [L energy lower_bound] = vgg_trw_bp(UE, PI, PE, [options]) % % Uses the message passing algorithms TRW-S or LBP to solve an MRF energy % minimization problem with binary or multiple labels. % % This function uses mexified C++ code written by Vladimir ...
github
ojwoodford/ojwul-master
global_basin.m
.m
ojwul-master/optimize/global_basin.m
718
utf_8
4ed7d9117482aaf974cadcde31d9c101
%GLOBAL_BASIN Output binary mask of watershed for the global min of array % % B = global_basin(A) % % This function computes the binary mask of all those points in an array % from which local minimization (e.g. gradient descent with small steps) % would lead to the global minimum of the array. This is the water...
github
ojwoodford/ojwul-master
load_field.m
.m
ojwul-master/io/load_field.m
317
utf_8
0c31b7afe4727eefccf1f04a9c95a46f
%LOAD_FIELD Load only one field from a file % % x = load_field(name, field) % %IN: % name - Filename string of the file containing the field. % field - Name string of the field to be loaded. %OUT: % x - Loaded field. function x = load_field(name, field) x = load(name, field); x = x.(field); end
github
ojwoodford/ojwul-master
read_wobj.m
.m
ojwul-master/io/read_wobj.m
15,880
utf_8
6ae16c6146e94ba4869abdc7d72d8084
function OBJ=read_wobj(fullfilename) % Read the objects from a Wavefront OBJ file % % OBJ=read_wobj(filename); % % OBJ struct containing: % % OBJ.vertices : Vertices coordinates % OBJ.vertices_texture: Texture coordinates % OBJ.vertices_normal : Normal vectors % OBJ.vertices_point : Vertice data used for poi...
github
ojwoodford/ojwul-master
read_float32.m
.m
ojwul-master/io/read_float32.m
306
utf_8
ca7c4beb289a078ff916ee21d5220d62
%READ_FLOAT32 Read an entire file in as an array of 32-bit floats % % A = read_float32(fname) % %IN: % fname - string containing the filename of the file to be read. % %OUT: % A - Nx1 single array of the values in the file. function A = read_float32(fname) A = read_bin(fname, 'float32');
github
ojwoodford/ojwul-master
write_text.m
.m
ojwul-master/io/write_text.m
1,376
utf_8
220bb0478703b9cb82ce59c35f18ab32
%WRITE_TEXT Write out an array to a text file % % write_text(A, fname, append) % % Writes out an array to a text file using the minimum number of % significant figures required to reconstruct the exact binary number when % read in. % % The array is written out row by row, with dimensions 3 and higher % conca...
github
ojwoodford/ojwul-master
read_ply.m
.m
ojwul-master/io/read_ply.m
5,687
utf_8
b34b22a96aec386a8a7c5cbf579eb898
%% read ply % Read mesh data from ply format mesh file % %% Syntax % [face,vertex]= read_ply(filename) % [face,vertex,color] = read_ply(filename) % %% Description % filename: string, file to read. % % face : double array, nf x 3 array specifying the connectivity of the mesh. % vertex: double array, nv x 3 arra...
github
ojwoodford/ojwul-master
get_user_path.m
.m
ojwul-master/io/get_user_path.m
1,844
utf_8
be1d8bac23899f0064233e1635f9aee4
%GET_USER_PATH Get a user/computer-specific directory or file path % % path_str = get_user_path(name, check_path, type [append]) % % Ask a user to select a specific directory or file, and store its path. % If a valid path already exists, use this. % %IN: % name - Name of the directory to be found. % check_path - ...
github
ojwoodford/ojwul-master
json_write.m
.m
ojwul-master/io/json_write.m
794
utf_8
88d106691d8319da9c329c12fcc0a16d
%JSON_WRITE Write a MATLAB variable to a JSON file % % json_write(var, fname) % % This function wraps the JSON for Modern C++ class in a mex wrapper, for % fast writing of MATLAB variables into JSON files. % %IN: % var - MATLAB variable to be written to a JSON file. % filename - String of filename (if...
github
ojwoodford/ojwul-master
stlwrite.m
.m
ojwul-master/io/stlwrite.m
10,820
utf_8
c0d2afd34d9e64039055c0120d2a0800
function stlwrite(filename, varargin) %STLWRITE Write STL file from patch or surface data. % % STLWRITE(FILE, FV) writes a stereolithography (STL) file to FILE for a % triangulated patch defined by FV (a structure with fields 'vertices' % and 'faces'). % % STLWRITE(FILE, FACES, VERTICES) takes faces an...
github
ojwoodford/ojwul-master
write_wobj.m
.m
ojwul-master/io/write_wobj.m
9,798
utf_8
3004ab65ebe5ca6b284c74c7b326861d
function write_wobj(OBJ,fullfilename) % Write objects to a Wavefront OBJ file % % write_wobj(OBJ,filename); % % OBJ struct containing: % % OBJ.vertices : Vertices coordinates % OBJ.vertices_texture: Texture coordinates % OBJ.vertices_normal : Normal vectors % OBJ.vertices_point : Vertice data used for point...
github
ojwoodford/ojwul-master
write_bin.m
.m
ojwul-master/io/write_bin.m
715
utf_8
a0c3679b8d3d39851291017cce94c39d
%WRITE_BIN Write out an array to a binary file % % write_bin(A, fname) % % Writes out an array to a binary file in the format of the data in the % array. I.e. if the array is of type uint32 then the values are saved to % file as 32-bit unsigned integers. This function cannot save complex % numbers. % %IN: %...
github
ojwoodford/ojwul-master
json_read.m
.m
ojwul-master/io/json_read.m
812
utf_8
bab4c1c2c0d67a3e0d2f0d01b385fa9a
%JSON_READ Mex wrapper to C++ class for fast reading of JSON files % % var = json_read(filename) % % This function wraps the JSON for Modern C++ class in a mex wrapper, for % fast loading of JSON files into MATLAB variables. % %IN: % filename - String of filename (if in current directory) or full or % ...
github
ojwoodford/ojwul-master
read_bin.m
.m
ojwul-master/io/read_bin.m
498
utf_8
9b2d92e5eda0ed038bf0e108342fbac4
%READ_BIN Read an entire file in as an array of a given type % % A = read_bin(fname, type) % %IN: % fname - string containing the filename of the file to be read. % type - string indicating the datatype of the values in the file. % %OUT: % A - Nx1 array of the values in the file, of datatype type. f...
github
ojwoodford/ojwul-master
fopens.m
.m
ojwul-master/io/fopens.m
5,918
utf_8
b712bcfc2438ae7217099a12ba390fc6
%FOPENS Open file which is always closed when the function exits. % FID = FOPENS(FILENAME) opens the file FILENAME for read access. % FILENAME is a string containing the name of the file to be opened. % (On PC systems, FOPENS opens files for binary read access.) % % FILENAME can be a MATLABPATH relative part...
github
ojwoodford/ojwul-master
svm_read_sparse.m
.m
ojwul-master/classify/svm_read_sparse.m
254
utf_8
2156b44a43e178996d2b95d5723a22f5
% SVM_READ_SPARSE Mex wrapper interface to the svm library function varargout = svm_read_sparse(varargin) sourceList = {'svm_read_sparse.c'}; % Cell array of source files [varargout{1:nargout}] = compile(varargin{:}); % Compilation happens here return
github
ojwoodford/ojwul-master
roc_curve.m
.m
ojwul-master/classify/roc_curve.m
1,184
utf_8
ee9f65b707b7f495ee759487bafaa1d2
%ROC_CURVE Compute the x and y parameters of an ROC curve % % [X, Y, auc] = roc_curve(scores, ground_truth) % % Compute the parameters of a Receiver Operating Characteristic curve, % which plots true positive rate against false positive rate, over a range % of classification thresholds. % %IN: % scores - Mx1 vector...
github
ojwoodford/ojwul-master
svm_predict.m
.m
ojwul-master/classify/svm_predict.m
1,026
utf_8
688b6ffb6f6bdb0e0f1d9e065a701fd1
% SVM_PREDICT Mex wrapper interface to the svm library % % [predicted_label, accuracy, decision_values/prob_estimates] = svmpredict(testing_label_vector, testing_instance_matrix, model [,'libsvm_options']); % % -testing_label_vector: % An m by 1 vector of prediction labels. If labels of test ...
github
ojwoodford/ojwul-master
fiksvm_predict.m
.m
ojwul-master/classify/fiksvm_predict.m
971
utf_8
619c7d52f9ec6e4903b099fe3295215d
% FIKSVM_PREDICT Mex wrapper interface to the svm library % % Usage: [exact_values, pwconst_values, pwlinear_values,[times]] = ... % fiksvm_predict(testing_label_vector, testing_instance_matrix, model,'libsvm_options') % % Output: % exact_values : predictions using binary search % pwconst_values ...
github
ojwoodford/ojwul-master
svm_demo.m
.m
ojwul-master/classify/svm_demo.m
2,009
utf_8
e635ff91ea3db75613b2d90885d71a9e
%SVM_DEMO A simple demo of SVM classification % % svm_demo(N) % % Train different binary SVM classifiers on 2D data, and visualize the % results. % %IN: % N - Integer number of 2D points to train and test on. Default: 500. function svm_demo(N) if nargin < 1 N = 500; end % Create some classifica...
github
ojwoodford/ojwul-master
linear_predict.m
.m
ojwul-master/classify/linear_predict.m
1,333
utf_8
51ebe96e9f67b299e7822af80f846381
% LINEAR_PREDICT Mex wrapper interface to the linear svm library % % [predicted_label, accuracy, decision_values/prob_estimates] = linear_predict(testing_label_vector, testing_instance_matrix, model [, 'liblinear_options', 'col']); % % -testing_label_vector: % An m by 1 vector of prediction label...
github
ojwoodford/ojwul-master
linear_train.m
.m
ojwul-master/classify/linear_train.m
1,135
utf_8
9d26e561f17d09f7178f3a3c68b33e85
% LINEAR_TRAIN Mex wrapper interface to the linear svm library % % model = linear_train(training_label_vector, training_instance_matrix [,'liblinear_options', 'col']); % % -training_label_vector: % An m by 1 vector of training labels. (type must be double) % -training_instance_matrix: % ...
github
ojwoodford/ojwul-master
svm_precomp_model.m
.m
ojwul-master/classify/svm_precomp_model.m
414
utf_8
93448d99ffc7328ebb914386e77e8eb8
% SVM_PRECOMP_MODEL Mex wrapper interface to the svm library function varargout = svm_precomp_model(varargin) sourceDir = 'private/libsvm/'; sourceList = {['-I' sourceDir], 'svm_precomp_model.cpp', [sourceDir 'svm.cpp'], ... [sourceDir 'svm_model_matlab.cpp'], [sourceDir 'fiksvm.cpp']}; % Cell array of ...
github
ojwoodford/ojwul-master
svm_train.m
.m
ojwul-master/classify/svm_train.m
824
utf_8
6e6b58d056e746c8dd4e981e19013be6
% SVM_TRAIN Mex wrapper interface to the svm library % % model = svm_train(training_label_vector, training_instance_matrix, [,'libsvm_options']); % % -training_label_vector: % An m by 1 vector of training labels. % -training_instance_matrix: % An m by n matrix of m training i...
github
ojwoodford/ojwul-master
separable_steerable_filter.m
.m
ojwul-master/filter/separable_steerable_filter.m
3,348
utf_8
e3883fff343cc4c0c1a56aa00bbac3be
%SEPARABLE_STEERABLE_FILTER Compute the basis and weights of separable steerable filters % % [basis, weight_fun] = separable_steerable_filter(r, coeff, X) % % Decompose a steerable filter formed from an odd or even parity polynomial % times a Gaussian window into a separable basis using the equations in % Appen...
github
ojwoodford/ojwul-master
find_first.m
.m
ojwul-master/numeric/find_first.m
1,001
utf_8
f48f512bfb5b53e2022805b0c86b9125
%FIND_FIRST Fast, vectorized version of find(A, 1, 'first') % % B = find_first(A) % B = find_first(A, start) % B = find_first(A, operator, value) % B = find_first(A, operator, value, start) % % Find the first element in each column vector of an array which meets a % particular comparison criterion. % % Example: % fin...
github
ojwoodford/ojwul-master
dimsel.m
.m
ojwul-master/numeric/dimsel.m
1,511
utf_8
21dccb0ea6801c98b303e4707b05f5f8
%DIMSEL Select one indexed element from each vector along a given dimension % % B = dimsel(A, I) % % Given as input a numeric array, A, and an index array, I, which contains % indices along a particular dimension of A, output the indexed elements of % A. % % For example, in the code: % A = rand(3); % [B...
github
ojwoodford/ojwul-master
first.m
.m
ojwul-master/numeric/first.m
819
utf_8
6656ebac8a73f0f3965ebb5eb3161baa
%FIRST Returns indices of the first non-zero elements along the given dimension % % B = first(A, [dim]) % % For each vector along the given dimension, this function returns the % index of the first non-zero element along that vector, or 0 if there is % no non-zero element. % %IN: % A - MxNx... input array ...
github
ojwoodford/ojwul-master
gauss_mask.m
.m
ojwul-master/numeric/gauss_mask.m
1,101
utf_8
fb9150428ba19cc33aa5d2f465a0a953
%GAUSS_MASK Compute 1D Nth derivative of a Gaussian % % Examples: % F = gauss_mask(sigma) % F = gauss_mask(sigma, deriv) % F = gauss_mask(sigma, deriv, X) % % This function computes the Nth derivative of a Gaussian, in 1D. % % IN: % sigma - Standard deviation of the Gaussian. % deriv - The derivative to...
github
ojwoodford/ojwul-master
zero_mean.m
.m
ojwul-master/numeric/zero_mean.m
523
utf_8
b8edf0ff597b9b20b5cf70e48aeaee55
%ZERO_MEAN Subtract the means from a set of vectors to make them zero mean % % Y = zero_mean(X) % Y = zero_mean(X, dim) % % Subtract the mean along a specified dimension from all vectors in an % array, making them zero mean. % %IN: % X - Array containing vectors to zero mean. % dim - Dimension along ...
github
ojwoodford/ojwul-master
isapprox.m
.m
ojwul-master/numeric/isapprox.m
1,409
utf_8
5ebc8a650be39b533bbbfe311488be94
%ISAPPROX Check if A and B are approximately equal % % [tf, d] = isapprox(A, B, tol) % % Determines whether two input arrays are approximately equal. If a % tolerance is given, and no outputs are requested, the function asserts if % the inputs aren't approximately equal. % %IN: % A - Numeric array. % B - Nume...
github
ojwoodford/ojwul-master
extremum.m
.m
ojwul-master/numeric/extremum.m
614
utf_8
51a4fafafae5abcb7335319637a6da18
%EXTREMUM Compute the extreme value along a given dimension % % B = extremum(A, [dim]) % % Output the most extreme value (furthest from 0) along a specified % dimension of an input array. % %IN: % A - Numeric input array. % dim - Dimension along which to compute the extremum. Default: first % no...
github
ojwoodford/ojwul-master
sqdist.m
.m
ojwul-master/numeric/sqdist.m
784
utf_8
56bd1dee4c97472b5aebb3d958a26641
%SQDIST Squared Euclidean distance between sets of vectors % % D = sqdist(A, [B]) % % IN: % A - MxJ matrix of columnwise vectors. % B - MxK matrix of columnwise vectors. Default: B = A. % % OUT: % D - JxK Squared distance between each vector in A and each vector in B. function D = sqdist(A, B) ...
github
ojwoodford/ojwul-master
normalize.m
.m
ojwul-master/numeric/normalize.m
582
utf_8
a11f36e044a61612a4bb2b0651a2062b
%NORMALIZE Set vectors in an array to be of unit length % % Y = normalize(X) % Y = normalize(X, dim) % % Set all the non-zero vectors in an array, along a specified dimension, to % be of unit length. % %IN: % X - Array containing vectors to normalize. % dim - Dimension along which to normalize X. Defa...
github
ojwoodford/ojwul-master
all_finite.m
.m
ojwul-master/numeric/all_finite.m
291
utf_8
1f4977902fa9382cafc15932c81c65f7
%ALL_FINITE Checks if all the elements in an array are finite % % tf = all_finite(x) % %IN: % x - Numeric array. % %OUT: % tf - Boolean indicating whether all elements of x are finite. function x = all_finite(x) if issparse(x) [~, ~, x] = find(x); end x = all(isfinite(x(:))); end
github
ojwoodford/ojwul-master
array_snake_indices.m
.m
ojwul-master/numeric/array_snake_indices.m
921
utf_8
1036fca344d56d2f1a94ebffb868560d
%ARRAY_SNAKE_INDICES List of indices snaking through an array % % I = array_snake_indices(sz) % % Produces a list of all the indices into an array of size sz, with each % consecutive index referencing a neighbouring element to the previous % index. % %IN: % sz - 1xN vector of the size of array to index. % %OUT: % ...
github
ojwoodford/ojwul-master
range01.m
.m
ojwul-master/numeric/range01.m
665
utf_8
e05a9fe686b93d39d6355913b9be9179
%RANGE01 Apply gain and bias so range of data is exactly [0, 1] % % Y = range01(X, [dim]) % % Set all vectors in X along the specified dimension to be in the range % [0,1]. % %IN: % X - Array containing vectors to rescale to range [0, 1]. % dim - Dimension along which to zero-mean X. Default: first % ...
github
ojwoodford/ojwul-master
normd.m
.m
ojwul-master/numeric/normd.m
483
utf_8
15ade47822ea81b1839ab3528ecf0fa4
%NORMD Compute the 2-norms of vectors in an array along a specific dimension % % Y = normd(X) % Y = normd(X, dim) % % Compute the 2-norms of vectors in an array, along a specific dimension. % %IN: % X - Array containing vectors to compute the norms of. % dim - Dimension along which to compute the 2-nor...
github
ojwoodford/ojwul-master
inv44n.m
.m
ojwul-master/linear/inv44n.m
2,251
utf_8
14bff2f4c1537e18cea4be0b8fc0b81c
%INV44N Compute the inverse of an array of 4x4 matrices % % [B, d] = inv44n(A) % % Vectorized computation of the inverse of multiple 4x4 matrices. % %IN: % A - 4x4xN array. % %OUT: % B - 4x4xN array, where B(:,:,a) = inv(A(:,:,a)). % d - 1xN array, where d(a) = det(A(:,:,a)). function [B, det] = i...
github
ojwoodford/ojwul-master
cross.m
.m
ojwul-master/linear/cross.m
2,275
utf_8
730d29b6bf45181cf2d3a230017ba4af
function c = cross(a,b,dim) %CROSS Vector cross product. % C = CROSS(A,B) returns the cross product of the vectors % A and B. That is, C = A x B. A and B must be 3 element % vectors. % % C = CROSS(A,B) returns the cross product of A and B along the % first dimension of length 3. % % C = CROSS(A,B,DIM), w...
github
ojwoodford/ojwul-master
isposdef.m
.m
ojwul-master/linear/isposdef.m
266
utf_8
0c7220c903df17ddae3c6d1f2f6d7544
%ISPOSDEF Check if a square matrix is positive definite % % tf = isposdef(A) % %IN: % A - NxN matrix. % %OUT: % tf - boolean indicating whether A is positive definite. function tf = isposdef(A) [~, tf] = chol(A); tf = (tf == 0) && (rank(A) == size(A, 1)); end
github
ojwoodford/ojwul-master
inv33n.m
.m
ojwul-master/linear/inv33n.m
564
utf_8
cc713280e9ef287893c776d0bb44b625
%INV33N Compute the inverse of an array of 3x3 matrices % % [B, d] = inv33n(A) % % Vectorized computation of the inverse of multiple 3x3 matrices. % %IN: % A - 3x3xN array. % %OUT: % B - 3x3xN array, where B(:,:,a) = inv(A(:,:,a)). % d - 1xN array, where d(a) = det(A(:,:,a)). function [T, det] = i...
github
ojwoodford/ojwul-master
invSE3n.m
.m
ojwul-master/linear/invSE3n.m
435
utf_8
b18da849ddbbaed68c17c33dbcb4a630
%INVSE3N Compute the inverse of an array of 3x4 SE3 matrices % % [B, d] = invSE3n(A) % % Vectorized computation of the inverse of multiple 3x4 SE3 matrices. % %IN: % A - 3x4xN array of SE3 matrices. % %OUT: % B - 3x4xN array of inverse SE3 matrices. function T = invSE3n(T) R = permute(T(1:3,1:3,:), ...
github
ojwoodford/ojwul-master
det33n.m
.m
ojwul-master/linear/det33n.m
584
utf_8
3d07d701f15024db467c402a4600390a
%DET33N Compute the determinant of an array of 3x3 matrices % % d = det33n(A) % % Vectorized computation of the determinant of multiple 3x3 matrices. % %IN: % A - 3x3xN array. % %OUT: % d - 1xN array, where d(a) = det(A(:,:,a)). function T = det33n(T) T = reshape(T, 9, []); cond = zeros(size(T)); ...
github
ojwoodford/ojwul-master
pca.m
.m
ojwul-master/linear/pca.m
1,299
utf_8
41e51e264202aacba6887d551cf4746e
%PCA Principal component analysis % % [T, Y, V] = pca(X) % % IN: % X - MxN matrix of N vectors of dimension M. % % OUT: % T - Mx(M+1) Projection matrix for PCA transformation % Y - MxN matrix of transformed vectors, where Y = T * [X; ones(1, N)]. % V - Mx1 list of eigen values associated with ea...
github
ojwoodford/ojwul-master
tmult.m
.m
ojwul-master/linear/tmult.m
2,711
utf_8
a0e531042d0030663fd3f37c2dc1fbc2
%TMULT Tensor matrix multiply % % C = tmult(A, B, [transpose]) % % Matrix multiplication over tensor arrays (i.e. arrays of matrices), with % the ability to transpose matrices first. % % C = tmult(A, B) is equivalent to: % % sz = [size(B) 1]; % sz(1) = size(A, 1); % C = zeros(sz); % for a = 1:pr...
github
ojwoodford/ojwul-master
chol22n.m
.m
ojwul-master/linear/chol22n.m
525
utf_8
cac431a9a2f1d476ea0b607172597a6f
%CHOL22N Compute the Cholesky decomposition of an array of 2x2 matrices % % B = chol22n(A) % % Vectorized computation of the Cholesky decomposition of multiple 2x2 % matrices. % %IN: % A - 2x2xN array. % %OUT: % B - 2x2xN array, where B(:,:,a) = chol(A(:,:,a), 'lower'). % Formula from here: http://m...
github
ojwoodford/ojwul-master
whiten_srt.m
.m
ojwul-master/linear/whiten_srt.m
693
utf_8
81a53816a156dc60778e232690a33aa9
%WHITEN_SRT Transform data to be zero mean and close to identity covariance % % [Y, T] = whiten_srt(X) % % Apply a similarity transform to the data such that the mean is zero and % the covariance is as close to the identity as possible. % %IN: % X - MxN array of N vectors of dimension M to be whitened % % Y - (M+...
github
ojwoodford/ojwul-master
whiten.m
.m
ojwul-master/linear/whiten.m
762
utf_8
74a208f31dba9cc99791735e5ef5310d
%WHITEN Transform data to be zero mean and identity covariance % % [Y, T] = whiten(X, [epsilon]) % %IN: % X - MxN array of N vectors od dimension M to be whitened % epsilon - scalar value to add to eigen values to avoid amplifying % noise. Default: 1e-4. % % Y - MxN array of whitened data. % T - (...
github
ojwoodford/ojwul-master
linear_regressor.m
.m
ojwul-master/linear/linear_regressor.m
2,399
utf_8
2b1edd7949fb50b4886bc0009e8a8527
classdef linear_regressor < handle properties (SetAccess = private, Hidden = true) parameters; regularization_lambda = 0; isquadratic = false; end methods function this = linear_regressor(quad, reg) if nargin > 0 this.isquadratic = quad; ...
github
ojwoodford/ojwul-master
eig22n.m
.m
ojwul-master/linear/eig22n.m
710
utf_8
d4eb84365738b510a317624640f6432c
%EIG22N Compute the eigenvalues and eigenvectors of 2x2 matrices % % [e, V] = eig22n(A) % % Vectorized computation of the eigenvalues and eigenvectors of multiple % 2x2 matrices. % %IN: % A - 2x2xN array. % %OUT: % e - 2x1xN array, where e(:,a) = eig(A(:,:,a)). % V - 2x2xN array, where [V(:,:,a), ~] = eig(A(:,:...
github
ojwoodford/ojwul-master
inv22n.m
.m
ojwul-master/linear/inv22n.m
509
utf_8
d3988bcba15c758442d58d984be90c23
%INV22N Compute the inverse of an array of 2x2 matrices % % [B, d] = inv22n(A) % % Vectorized computation of the inverse of multiple 2x2 matrices. % %IN: % A - 2x2xN array. % %OUT: % B - 2x2xN array, where B(:,:,a) = inv(A(:,:,a)). % d - 1xN array, where d(a) = det(A(:,:,a)). function [T, det] = i...
github
ojwoodford/ojwul-master
edge_demo.m
.m
ojwul-master/edges/edge_demo.m
1,554
utf_8
9a4ed09075dbf09302013c950184e2b6
%EDGE_DEMO Compute and visualize the gradient and edgels of an image % % edge_demo % edge_demo(A, scale, thresh) % %IN: % A - HxWxC image. Default: Use peppers.png % scale - sigma of Gaussian blur to apply during edge detection. % Default: 0.7. % thresh - Threshold on edgel suppression. If...
github
ojwoodford/ojwul-master
edge_orient.m
.m
ojwul-master/edges/edge_orient.m
1,697
utf_8
15cb5f6b3da227debeff758ef7043493
%EDGE_ORIENT Calculate edge filter responses at any orientation % % [R, O, G] = edge_orient(I, sigma, [mcm]) % % Returns a handle to a function that generates an edge filter response % image using angularly adaptive filtering, and also outputs the angle that % gives maximal edge response. The implementation us...
github
ojwoodford/ojwul-master
edge_grad_max.m
.m
ojwul-master/edges/edge_grad_max.m
2,128
utf_8
59bbc912b76006eae4bc3b0b297e10d2
%EDGE_GRAD_MAX Mask of gradient maxima % % M = edge_grad_max(G, [thresh, [M]]) % % Given a gradient image, computes the magnitude of locally maximal (in the % direction of maximum gradient) gradients. % % IN: % G - HxWx2 array of gradient images in x and y directions, along third % dimension. % t...
github
ojwoodford/ojwul-master
edge_scale.m
.m
ojwul-master/edges/edge_scale.m
3,642
utf_8
2f8b378bdf47530ade9e24ab3a115f5a
%EDGE_SCALE Compute an edge scale image % % [S, G, E] = edge_scale(I, [max_octaves, [levels_per_octave, [thresh]]]) % % Output the edge scale of each pixel, and a list of edgels, if requested. % The scale of an edge is determined by the amount of image smoothing % required before it stops being a locally maxim...
github
ojwoodford/ojwul-master
compute_edgels.m
.m
ojwul-master/edges/compute_edgels.m
3,118
utf_8
f0cfd6d776fe3d002ffd49a5f7164962
%COMPUTE_EDGELS Extract edgels from a gradient image % % E = compute_edgels(G, thresh) % % Returns a list of edgel positions and normal angles, each edgel being a % pixel long, given a gradient image and threshold parameter. % % IN: % G - HxWx2 array of gradient images in x and y directions, along third %...
github
ojwoodford/ojwul-master
tensor_voted_edges.m
.m
ojwul-master/edges/tensor_voted_edges.m
2,114
utf_8
0f69548b15f818bc7e694233d37f96d7
% Author: Emmanuel Maggiori. March 2014. % % Complimentary material for the literature review: % "Perceptual grouping by tensor voting: a comparative survey of recent approaches". E Maggiori, HL Manterola, M del fresno. To be published in IET Computer Vision. % % Implementation of Steerable Tensor Voting as published...
github
ojwoodford/ojwul-master
fast_kmeans.m
.m
ojwul-master/cluster/fast_kmeans.m
1,324
utf_8
6cf23c5f257a6576ed755100821fcb1f
%FAST_KMEANS Compute k-means cluster centres % % [CX sse I] = fast_kmeans(X, params[, CX]) % % This function computes k-means cluster centres. It will work faster if % data is projected onto principle components first. % % IN: % X - MxN matrix of N input vectors of dimension M. % params - [nclusters max_it...
github
ojwoodford/ojwul-master
isautodiff.m
.m
ojwul-master/autodiff/isautodiff.m
104
utf_8
114480bc63ab1389236fc7fac0cbbea5
%ISAUTODIFF Helper for autodiff function tf = isautodiff(varargin) tf = false(1, max(nargin, 1)); end
github
ojwoodford/ojwul-master
var_indices.m
.m
ojwul-master/autodiff/var_indices.m
90
utf_8
343c2c6be93b20eb08c12d5780c90d43
%VAR_INDICES Dummy helper function for autodiff function c = var_indices(a) c = []; end
github
ojwoodford/ojwul-master
autodiff.m
.m
ojwul-master/autodiff/autodiff.m
25,193
utf_8
27a380b7799c8c8099d41e76ab04c2e2
% A class for doing autodifferentiation classdef autodiff properties (SetAccess = private, Hidden = true) value; % Function values Mx...xN deriv; % Jacobian values VxMx...xN varind; % Variable indices 1xV end methods function obj = autodiff(a, v, b) ...
github
ojwoodford/ojwul-master
ojw_interp2_alt.m
.m
ojwul-master/autodiff/ojw_interp2_alt.m
850
utf_8
d8690ddac7c190d31d55d7348871f54d
%OJW_INTERP2_ALT Fast 2d interpolation for images % % V = ojw_interp2_alt(A, X) % V = ojw_interp2_alt(A, X, interp_mode) % V = ojw_interp2_alt(A, X, interp_mode, oobv) % % Wrapper to ojw_interp2 which has horizontal and vertical coordinates % concatenated along the third dimension into one array. % %IN: % A - HxWxC do...
github
ojwoodford/ojwul-master
grad.m
.m
ojwul-master/autodiff/grad.m
221
utf_8
401e020bd53921b653fe42f0dc0629b9
%GRAD Dummy helper function for autodiff function c = grad(a, vars) if nargin < 2 c = 0; elseif isscalar(vars) && vars < 0 c = sparse(-vars, numel(a)); else c = zeros([numel(vars) size(a)]); end end
github
ojwoodford/ojwul-master
refine_subpixel.m
.m
ojwul-master/features/refine_subpixel.m
1,323
utf_8
2fb324b22128ffd02507ef1746c82bb5
%REFINE_SUBPIXEL N-dimensional sub-pixel refinement % % [offset, val] = refine_subpixel(A, M) % % Computes the offsets and values of the refined positions of maxima/minima % in an N-dimensional array, by fitting a quadratic around the points. % %IN: % A - An N-dimensional array of size sz. % M - A binary...
github
ojwoodford/ojwul-master
fast_corners.m
.m
ojwul-master/features/fast_corners.m
892
utf_8
51b22d38c75dfc9d3eeca1cd61e2fae2
%FAST_CORNERS Call mexed FAST corner detector % % [XY, scores] = fast_corners(I, thresh, type) % % FAST corner detection using Ed Rosten's C implementation. Method % published in: % "Machine learning for high-speed corner detection", % E. Rosten & T. Drummond, ECCV 2006. % %IN: % I - HxW uint8 grayscale...
github
ojwoodford/ojwul-master
extract_features.m
.m
ojwul-master/features/extract_features.m
1,610
utf_8
5e25a2a041b3867b15db27af4864c6bb
%EXTRACT_FEATURES Extract interest points from a detector score image % % [X, s] = extract_features(score, [radius, [thresh, [subpixel]]]) % % Finds the local maxima in the input detector score image. % %IN: % score - HxW interest point detector score. % radius - Scalar indicating the radius of non-maxima...
github
ojwoodford/ojwul-master
corners.m
.m
ojwul-master/features/corners.m
1,326
utf_8
cb352371b69acdedf06ea6f61d8d00b4
%CORNERS Compute corner detector score % % score = corners(I, [sigma], method) % %IN: % I - HxWxC image % sigma - Scalar value determing the scale of the gradient filter. % Default: 1. % method - String determing the method to use: 'harris', 'noble' % or 'shi-tomasi'. Default: 'shi-...
github
ojwoodford/ojwul-master
dog.m
.m
ojwul-master/features/dog.m
279
utf_8
a1b8d4163884aa428f3e0c43500dd4a6
%DOG Difference of Gaussians blob detector % % features = dog(I) % %IN: % I - HxWxC image % %OUT: % features - 4xN frames of N features: [X; Y; scale; orientation]. function features = dog(I) if size(I, 3) == 3 I = rgb2gray(I); end features = vl_sift(single(I)); end
github
ojwoodford/ojwul-master
interest_point_demo.m
.m
ojwul-master/features/interest_point_demo.m
3,385
utf_8
8516f6ee54d76a2f85743454d8f59737
%INTEREST_POINT_DEMO Compute and visualize the interest points of an image % % interest_point_demo % interest_point_demo(A, [scale, [thresh, [detector]]]) % %IN: % A - HxWxC image. Default: Use peppers.png % scale - scale of the interest points to be detected (if applicable). % Default: 2. %...
github
ojwoodford/ojwul-master
vl_dsift.m
.m
ojwul-master/features/vlfeat/vl_dsift.m
5,724
utf_8
a5e67611f562f0b69ababcc52b234260
% VL_DSIFT Dense SIFT % [FRAMES,DESCRS] = VL_DSIFT(I) extracts a dense set of SIFT % keypoints from image I. I must be of class SINGLE and grayscale. % FRAMES is a 2 x NUMKEYPOINTS, each colum storing the center (X,Y) % of a keypoint frame (all frames have the same scale and % orientation). DESCRS is a 128 x...
github
ojwoodford/ojwul-master
vl_ubcmatch.m
.m
ojwul-master/features/vlfeat/vl_ubcmatch.m
1,416
utf_8
9fa45a4773984b53f3103700b3b9b2e0
% VL_UBCMATCH Match SIFT features % MATCHES = VL_UBCMATCH(DESCR1, DESCR2) matches the two sets of SIFT % descriptors DESCR1 and DESCR2. % % [MATCHES,SCORES] = VL_UBCMATCH(DESCR1, DESCR2) retuns the matches and % also the squared Euclidean distance between the matches. % % The function uses the algorithm s...