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 | zongwave/IPASS-master | show_bayer_raw.m | .m | IPASS-master/ReadImage/show_bayer_raw.m | 2,940 | utf_8 | 07fb3de8e9e892fb345d92b33e13b085 | % show_bayer_raw.m - convert bayer image to RGB
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by ... |
github | zongwave/IPASS-master | sfb3D.m | .m | IPASS-master/Wavelet/biShrink/sfb3D.m | 1,567 | utf_8 | c7ef9448ec966a9f630ab9be5d316f28 | function y = sfb3D(lo, hi, sf1, sf2, sf3)
% 3D Synthesis Filter Bank
%
% USAGE:
% y = sfb3D(lo, hi, sf1, sf2, sf3);
% INPUT:
% lo, hi - lowpass subbands
% sfi - synthesis filters for dimension i
% OUPUT:
% y - output array
% See afb3D
%
% WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY
% http://taco.p... |
github | zongwave/IPASS-master | afb3D.m | .m | IPASS-master/Wavelet/biShrink/afb3D.m | 2,569 | utf_8 | d60f781f473b436449d0a260f6a420c2 | function [lo, hi] = afb3D(x, af1, af2, af3)
% 3D Analysis Filter Bank
%
% USAGE:
% [lo, hi] = afb3D(x, af1, af2, af3);
% INPUT:
% x - N1 by N2 by N3 array matrix, where
% 1) N1, N2, N3 all even
% 2) N1 >= 2*length(af1)
% 3) N2 >= 2*length(af2)
% 4) N3 >= 2*length(af3)
% afi - analy... |
github | zongwave/IPASS-master | import_video.m | .m | IPASS-master/Wavelet/denoise/import_video.m | 1,567 | utf_8 | 901835343dbf77f79712538cb65eba81 | % import_video.m - import original video
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law ... |
github | zongwave/IPASS-master | denoising_dwt.m | .m | IPASS-master/Wavelet/denoise/denoising_dwt.m | 4,332 | utf_8 | 22df1599fbd981002d1cf611d21aa922 | % denoising_dwt.m - image denoise using wavelet
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicab... |
github | zongwave/IPASS-master | image_denoise.m | .m | IPASS-master/Wavelet/denoise/image_denoise.m | 8,940 | utf_8 | 2dc2762bb65c1d5cf7df5c9c2323027a | % image_denoise.m - image denoise using wavelet
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicab... |
github | zongwave/IPASS-master | wavelet_denoise.m | .m | IPASS-master/Wavelet/denoise/wavelet_denoise.m | 2,731 | utf_8 | 33462ea2d55ccace62dd3cbbf4a3410f | % wavelet_denoise.m - image denoise using wavelet
%
% Licensed under the Apache License, Version 2.0 (the "License");
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applic... |
github | gaoyuantim/LHS-Maximin-master | LHS_multi.m | .m | LHS-Maximin-master/LHS_SUM/LHS_multi.m | 2,284 | utf_8 | 858bdceba6500914048d76fb477d5a8d | % Input : n = number of points
% k = number of dimension
% sum = a group of square distance we are insterested in
%
% Output : A table if there is a conbinaison satisfying the command;
% "FALSE" if the result doesn't exist
%
% SYNTAX : Table = LHS_multi ( n , k , sum)
%
% Exem... |
github | gaoyuantim/LHS-Maximin-master | sos_decompose.m | .m | LHS-Maximin-master/LHS_SUM/sos_decompose.m | 1,980 | utf_8 | bddfc9e37b618824e38d88e896a3f5f9 | % sos_decompose computes decompositions into sum of squares
%
% SYNTAX: sos = sos_decompose (S, k, n - 1)
%
% computes all possible decompositions of integer S into a sum of k squares
%
% EXAMPLE: S = 56, k = 6
%
% >> sos = sos_decompose (56, 6, 6)
%
% sos =
%
% 36 16 1 1 1 1
% ... |
github | gaoyuantim/LHS-Maximin-master | LHS_D2.m | .m | LHS-Maximin-master/LHS_D2TEST/LHS_D2.m | 1,865 | utf_8 | cfb9abb99c5e99461417b1a9aaed6660 | % Input: n = number of points
% m = number of dimension
% D2 = the square distance tested
%
% Output: A table of points constructed by the maximin D2 if D2is suitable;
% "D2 too big" when D2 is too big
% "Dimension is to big" if m is bigger than 3
%
% SYNTAX: table = LHS_D2(n , m... |
github | ojwoodford/ojwul-master | expm_srt_3d_sym.m | .m | ojwul-master/symbolic/expm_srt_3d_sym.m | 1,705 | utf_8 | d73555feef49a0dfba8a2780aed71738 | %EXPM_SRT_3D Compute a transformation matrix, given the Lie algebra vector
%
% M = expm_srt_3d_sym(r, [t, [s]])
%
% Computes the symbolic transformation matrix defined by a Lie vector
% consisting of a rotation, translation and uniform scaling.
%
% This function applies the formula given in the paper:
% "Distances an... |
github | ojwoodford/ojwul-master | line2line_symeq.m | .m | ojwul-master/symbolic/line2line_symeq.m | 1,057 | utf_8 | 0dbe06c4fc41a0ef82989a6c30386fb3 | %LINE2LINE_SYMEQ Compute the shortest vector between two lines
%
% y = line2line_symeq(x1, d1, x2, d2)
%
% Symbolically computes the shortest vector between two lines.
%
%IN:
% x1 - Nx1 point on line 1.
% d1 - Nx1 direction vector of line 1.
% x2 - Nx1 point on line 2.
% d2 - Nx1 direction vector of... |
github | ojwoodford/ojwul-master | point2line_symeq.m | .m | ojwul-master/symbolic/point2line_symeq.m | 861 | utf_8 | 69a05298ede557a9ee8ad43f6ed3c8fe | %POINT2LINE_SYMEQ Compute the shortest vector between a point and a line
%
% V = point2line_symeq(X, Y, D)
%
% Symbolically computes the shortest vector between a point and a line in
% N-D.
%
%IN:
% X - Nx1 point.
% Y - Nx1 point on the line.
% D - Nx1 line direction.
%
%OUT:
% V - Nx1 output vec... |
github | ojwoodford/ojwul-master | auto_jacobian.m | .m | ojwul-master/symbolic/auto_jacobian.m | 4,521 | utf_8 | 59d589cacf7beca35565336113c19730 | %AUTO_JACOBIAN Write and compile a mex file to compute Jacobian of residuals
%
% auto_jacobian(residuals, params, fname, var_fixed, var_sum)
%
% This function differentiates a symbolic set of resdiuals with respect to
% some parameters, creates a mex file which can compute the residuals and
% the derivatives, a... |
github | ojwoodford/ojwul-master | line_plane_intersect_symeq.m | .m | ojwul-master/symbolic/line_plane_intersect_symeq.m | 976 | utf_8 | 0d0bfa0e138deee193332d77058887cf | %LINE_PLANE_INTERSECT_SYMEQ Compute the intersection point of a line and a plane
%
% y = line_plane_intersect_symeq(n, d, x, l)
%
% Symbolically computes the point of intersection of a line and a plane in
% N dimensions.
%
%IN:
% n - Nx1 plane normal.
% d - scalar plane offset from origin.
% x - Nx1 p... |
github | ojwoodford/ojwul-master | rodrigues_sym.m | .m | ojwul-master/symbolic/rodrigues_sym.m | 391 | utf_8 | d5e8d50b3c288fa16f358e632a712665 | %RODRIGUES_SYM Transform angle-axis to rotation matrix via Rodrigues' formula
%
% R = rodrigues_sym(axis, angle)
%
%IN:
% axis - 3x1 normalized rotation axis vector.
% angle - rotation angle in radians.
%
%OUT:
% R - 3x3 rotation matrix
function R = rodrigues_sym(axis, angle)
R = sin(angle) * skew(... |
github | ojwoodford/ojwul-master | line_intersect_symeq.m | .m | ojwul-master/symbolic/line_intersect_symeq.m | 999 | utf_8 | bddacbc394544901eb2327cc6b5a0837 | %LINE_INTERSECT_SYMEQ Compute the intersection point of two lines
%
% y = line_intersect_symeq(x1, n1, x2, n2)
%
% Symbolically computes the point of intersection of two lines in 2D.
%
%IN:
% x1 - 2x1 point on line 1.
% n1 - 2x1 direction of line 1.
% x2 - 2x1 point on line 2.
% n2 - 2x1 direction o... |
github | ojwoodford/ojwul-master | epipolar_disparity_symeq.m | .m | ojwul-master/symbolic/epipolar_disparity_symeq.m | 1,450 | utf_8 | f1f4bffbbd83488796b8172d19b7edd4 | %EPIPOLAR_DISPARITY_SYMEQ Compute the disparity of a point on/near an
% epipolar line
%
% d = epipolar_disparity_symeq(RX, T, x)
%
% Symbolically computes the disparity of a point on an epipolar line that
% is closest to a point in an image.
%
%IN:
% RX - 3x1 world point multiplied ... |
github | ojwoodford/ojwul-master | expm_sym.m | .m | ojwul-master/symbolic/expm_sym.m | 575 | utf_8 | 489d9f3dac40fbc2056f001932f0e1d2 | %EXPM_SYM Symbolic matrix exponential, up to a certain order
%
% B = expm_sym(A, order)
%
% Given a symbolic (or numeric) matrix, this function computes an
% approximation of the matrix exponential up to a certain order.
%
%IN:
% A - MxM input matrix.
% order - scalar indicating the order up to which the... |
github | ojwoodford/ojwul-master | auto_diff.m | .m | ojwul-master/symbolic/auto_diff.m | 1,967 | utf_8 | 8bfe59eb60832fd92cb22fd26784cca2 | %AUTO_DIFF Output C code to compute function values and their Jacobian
%
% C = auto_diff(funcs, vars, curr_val)
%
% This function differentiates a symbolic set of resdiuals with respect to
% some parameters.
%
%IN:
% funcs - Mx1 vector of functional expressions.
% vars - Nx1 vector of variables to differ... |
github | ojwoodford/ojwul-master | skew.m | .m | ojwul-master/geometry/skew.m | 510 | utf_8 | 8d41bfbc4fce7e037e11d9dc8a290ec6 | %SKEW Generate 3x3 skew matrices from 3-vectors
%
% B = skew(A)
%
% Convert one or more 3-vectors to 3x3 skew matrices.
%
%IN:
% A - 3xM matrix of 3-vectors
%
%OUT:
% B - 3x3xM array of skew matrices
function B = skew(A)
sz = size(A);
assert(sz(1) == 3);
sz = [3 3 sz(2:end)];
if isa(A, 'sym')
... |
github | ojwoodford/ojwul-master | dpsimplify.m | .m | ojwul-master/geometry/dpsimplify.m | 7,986 | utf_8 | 3ef3a9b3638b7390a28425512f9f262e | function [ps,ix] = dpsimplify(p,tol)
% Recursive Douglas-Peucker Polyline Simplification, Simplify
%
% [ps,ix] = dpsimplify(p,tol)
%
% dpsimplify uses the recursive Douglas-Peucker line simplification
% algorithm to reduce the number of vertices in a piecewise linear curve
% according to a specified toleranc... |
github | ojwoodford/ojwul-master | icp_sim.m | .m | ojwul-master/geometry/icp_sim.m | 2,615 | utf_8 | e6c911fa5628d4af5a576be7042fc42f | %ICP_SIM Compute the similarity transform that best aligns two point sets
%
% T = icp_sim(X, Y, [initialize])
%
% Given two sets of points, X and Y, this function iteratively solves the
% optimization problem:
%
% T = argmin_T sum_i min_j || T * homg(X(:,i)) - Y(:,j) || ^ 2
%
% subject to T being a similarity tran... |
github | ojwoodford/ojwul-master | expm_srt_3d.m | .m | ojwul-master/geometry/expm_srt_3d.m | 964 | utf_8 | 57095643f98d6b694e028be1a0770c4e | %EXPM_SRT_3D Compute a transformation matrix, given the Lie algebra vector
%
% M = expm_srt_3d(X)
%
% Computes the transformation matrix defined by a Lie vector consisting of
% a rotation, translation and uniform scaling.
%
% The computation is done in closed form, using the formulae given in the
% paper:
% "Distance... |
github | ojwoodford/ojwul-master | msac_essenmatrix.m | .m | ojwul-master/geometry/msac_essenmatrix.m | 3,819 | utf_8 | 0690ca4344b59de9c1327c1934dbc232 | % MSAC_ESSENMATRIX - fits essential matrix using RANSAC
%
% Usage: [F, inliers] = msac_essenmatrix(x1, x2, K, t)
%
% Arguments:
% x1 - 2xN or 3xN set of homogeneous image points. If the data is
% 2xN it is assumed the homogeneous scale factor is 1.
% x2 - 2xN or 3xN set of homogene... |
github | ojwoodford/ojwul-master | P_from_E.m | .m | ojwul-master/geometry/P_from_E.m | 449 | utf_8 | f98fa8604cb24d9a9117de47abe6ed3c | %P_FROM_E Compute potential motion hypotheses from an essential matrix
%
% P = P_from_E(E)
%
%IN:
% E - 3x3 essential matrix.
%
%OUT:
% P - 3x4x4 array of 4 potential extrinsic matrices [R, t] (up to scale).
function P = P_from_E(P)
[U, W, V] = svd(P, 0);
W = [0 -1 0; 1 0 0; 0 0 1];
R = U * W * V';
... |
github | ojwoodford/ojwul-master | msac_homography.m | .m | ojwul-master/geometry/msac_homography.m | 3,945 | utf_8 | 02cbf66faa2fb293c01d4c9dc6f816ff | % msac_homography - fits fundamental matrix using RANSAC
%
% Usage: [H, inliers] = msac_homography(x1, x2, t)
%
% Arguments:
% x1 - 2xN set of points.
% x2 - 2xN set of homogeneous points such that x1<->x2.
% t - The distance threshold between data point and the model
% u... |
github | ojwoodford/ojwul-master | P0To1.m | .m | ojwul-master/geometry/P0To1.m | 193 | utf_8 | 4077eb08e6c6ab002a509f85957f07ee | %P0TO1 Convert projection matrices' principal points from 0 to 1 based
%
% P = P0To1(P)
function P = P0To1(P)
for a = 1:size(P, 3)
P(:,:,a) = [1 0 1; 0 1 1; 0 0 1] * P(:,:,a);
end |
github | ojwoodford/ojwul-master | PcTo1.m | .m | ojwul-master/geometry/PcTo1.m | 296 | utf_8 | 55e365afd092726522dabdacf5b9e609 | %PCTO1 Convert projection matrices' principal points from centre to 1 based
%
% P = PcTo1(P, im)
function P = PcTo1(P, im)
if numel(im) == 2 || numel(im) == 3
h = im(1);
w = im(2);
else
[h, w, c] = size(im);
end
K = [1 0 (w+1)/2; 0 1 (h+1)/2; 0 0 1];
P = tmult(K, P);
|
github | ojwoodford/ojwul-master | lie.m | .m | ojwul-master/geometry/lie.m | 6,684 | utf_8 | f192cb6d610ea2c5d6cbf5e5fea8dd56 | classdef lie
properties (Hidden = true, SetAccess = protected)
G; % Generators for computing tangent
Gv; % Generators for computing matrix
sz;
end
methods
function this = lie(generators_)
if ischar(generators_)
generators_ = generators(generators_)... |
github | ojwoodford/ojwul-master | procrustes.m | .m | ojwul-master/geometry/procrustes.m | 965 | utf_8 | 477416028b7bcef304121f739d72aa54 | % [R,s,t,Y1,p] = procrustes(X,Y) Procrustes alignment
%
% Finds the best similarity transformation Y = s.X.R + ones(N,1).t' (in the
% least squares sense).
%
% References:
% - Borg & Groenen: "Modern Multidimensional Scaling: Theory and Application",
% Springer, 2005 (chapter 20).
% - Cox & Cox: "Multidimensional Sca... |
github | ojwoodford/ojwul-master | proj2orthonormal.m | .m | ojwul-master/geometry/proj2orthonormal.m | 294 | utf_8 | d84258c1578512ceadd4d88a9a6d2b20 | %PROJ2ORTHONORMAL Project a matrix onto an orthonormal basis
%
% B = proj2orthonormal(A)
%
%IN:
% A - MxN matrix
% B - Closest MxN matrix to A, where the rows are unit length and
% orthogonal.
function A = proj2orthonormal(A)
[U, ~, V] = svd(A, 'econ');
A = U * V';
end |
github | ojwoodford/ojwul-master | calibrated_fivepoint.m | .m | ojwul-master/geometry/calibrated_fivepoint.m | 4,166 | utf_8 | 435ccefe3eb92b250019ff7e2679f5d5 | %CALIBRATED_FIVEPOINT Stewenius & Engel's implementation of Nister's 5
%point algorithm
%
% [SOLS,EE] = fivePoint(Q1,Q2)
%
%
% Copyright Chris Engels 2004
%
% The algorithm follows
%@Article{ nister-itpam-04,
% author = {Nist\'er, D.},
% journal = pami,
% month = {June},
% number ... |
github | ojwoodford/ojwul-master | msac_aff2.m | .m | ojwul-master/geometry/msac_aff2.m | 1,187 | utf_8 | 65741399892feffa4ab7b8577b762a62 | % MSAC_AFF2 Fit an affine matrix using RANSAC
%
% Usage: [A, D] = msac_aff2(x1, x2, t)
%
% Arguments:
% x1 - 2xN set of homogeneous image points.
% x2 - 2xN set of image points such that x1<->x2.
% t - The distance threshold between data point and the model
% used to deci... |
github | ojwoodford/ojwul-master | P_align.m | .m | ojwul-master/geometry/P_align.m | 990 | utf_8 | d4e627a28c53154425297cf742ecb33b | %P_ALIGN Align one scene to another
%
% [Ptgt, Xtgt] = P_align(Pref, Ptgt, Xtgt, [indices])
%
%IN:
% Pref - 3x4xN camera poses of reference trajectory.
% Ptgt - 3x4xN camera poses of trajectory to transform.
% Xtgt - 3xM array of world coordinates to transform.
% indices - 2x1 indices of camera frames to use ... |
github | ojwoodford/ojwul-master | P_from_H.m | .m | ojwul-master/geometry/P_from_H.m | 1,772 | utf_8 | 6449c71bf2d483d6f2dc9df73615be4c | %P_FROM_H Compute motion hypotheses from a homography
%
% P = P_from_H(H)
%
%IN:
% H - 3x3 homography on calibrated image coordinates, i.e.
% K^-1 * X2 = H * K^-1 * X1
%
%OUT:
% P - 3x4xM array of M potential extrinsic matrices [R, t] (up to scale).
% N - 3xM array of corresponding plane normals... |
github | ojwoodford/ojwul-master | perspectiveIPPE.m | .m | ojwul-master/geometry/perspectiveIPPE.m | 13,730 | utf_8 | 9eb53fe152d9e4d6869a892a99234d7b | function [IPPEPoses,refinedPoses] = perspectiveIPPE(U,Q,hEstMethod,opts)
%perspectiveIPPE: The solution to Perspective IPPE with point correspondences computed
%between points in world coordinates on the plane z=0, and normalised points in the
%camera's image.
%
%Inputs:
%
%U: 2xN or 3xN matrix holding the model points... |
github | ojwoodford/ojwul-master | euler2rot.m | .m | ojwul-master/geometry/euler2rot.m | 2,142 | utf_8 | 9cff5f197c14a730dd7a9d673a384582 | %EULER2ROT Computes a rotation matrix from a set of Euler angles.
%
% R = euler2rot(X)
% R = euler2rot(X, type)
%
% The Euler representation is a set of 3 angles (in radians), which are
% applied about the three intrinsic axes of the frame specified.
%
%IN:
% X - 3xM matrix of Euler angle vectors.
% ... |
github | ojwoodford/ojwul-master | quat_norm.m | .m | ojwul-master/geometry/quat_norm.m | 221 | utf_8 | 7e72a921038a91e18db404c07385d718 | %QUAT_NORM Normalize quaternions
function Q = quat_norm(Q)
Q = reshape(Q, 4, []);
N = sum(Q .* Q);
M = N == 0;
Q(1,M) = 1;
M = ~M & N ~= 1;
if any(M)
Q(:,M) = bsxfun(@times, Q(:,M), 1./sqrt(N(M)));
end
end |
github | ojwoodford/ojwul-master | P1To0.m | .m | ojwul-master/geometry/P1To0.m | 195 | utf_8 | 2b1dec97e51706a081c886259a724c35 | %P1TO0 Convert projection matrices' principal points from 1 to 0 based
%
% P = P1To0(P)
function P = P1To0(P)
for a = 1:size(P, 3)
P(:,:,a) = [1 0 -1; 0 1 -1; 0 0 1] * P(:,:,a);
end |
github | ojwoodford/ojwul-master | PcTo0.m | .m | ojwul-master/geometry/PcTo0.m | 296 | utf_8 | 07536b43cd308df4bab548824fbba6b6 | %PCTO0 Convert projection matrices' principal points from centre to 0 based
%
% P = PcTo0(P, im)
function P = PcTo0(P, im)
if numel(im) == 2 || numel(im) == 3
h = im(1);
w = im(2);
else
[h, w, c] = size(im);
end
K = [1 0 (w-1)/2; 0 1 (h-1)/2; 0 0 1];
P = tmult(K, P);
|
github | ojwoodford/ojwul-master | expmap2rot.m | .m | ojwul-master/geometry/expmap2rot.m | 1,044 | utf_8 | a35272599335ed029c983ac4d61aba74 | %EXPMAP2ROT Computes a rotation matrix from exponential map angle.
%
% R = expmap2rot(X)
function R = expmap2rot(X)
% Compute the angle
sz = size(X);
X = reshape(X, 3, []);
angle = sqrt(sum(X .* X, 1));
% Initialize output
R = repmat([1 0 0 0 1 0 0 0 1]', 1, numel(angle));
% Only update rotations wit... |
github | ojwoodford/ojwul-master | gridfit.m | .m | ojwul-master/geometry/gridfit.m | 36,357 | utf_8 | 71d40f001761b87b8a56c3b57b6bf849 | function [zgrid,xgrid,ygrid] = gridfit(x,y,z,xnodes,ynodes,varargin)
% gridfit: estimates a surface on a 2d grid, based on scattered data
% Replicates are allowed. All methods extrapolate to the grid
% boundaries. Gridfit uses a modified ridge estimator to
% generate the surface, where the bi... |
github | ojwoodford/ojwul-master | line_plane_intersect.m | .m | ojwul-master/geometry/line_plane_intersect.m | 540 | utf_8 | 9b909d96cedd515c326d8d31911ae40b | %LINE_PLANE_INTERSECT Compute the intersection point of a line and a plane
%
% Z = line_plane_intersect(N, X, Y, D)
%
% Computes the point of intersection of a line and a plane in M dimensions.
%
%IN:
% N - MxN plane normals.
% X - MxN points on plane.
% Y - MxN points on line.
% D - MxN line direct... |
github | ojwoodford/ojwul-master | clip_line2rect.m | .m | ojwul-master/geometry/clip_line2rect.m | 1,709 | utf_8 | 13042b68e1492681d1292f72d51b403a | %CLIP_LINE2RECT Clips a line segment to within a rectangle
%
% X = clip_line2rect(X, rect)
%
% Clip a line to a rectangle using the Cohen-Sutherland algorithm,
% described here: https://en.wikipedia.org/wiki/Cohen-Sutherland_algorithm
%
%IN:
% X - 2x2 matrix of [x1 x2; y1 y2] start and end points.
% rect - 2x2 matrix... |
github | ojwoodford/ojwul-master | epipolar_error.m | .m | ojwul-master/geometry/epipolar_error.m | 795 | utf_8 | f1847d888974856b6633fb045ba76e01 | %EPIPOLAR_ERROR Compute the perpendicular error of points to epipolar lines
%
% d = epipolar_error(RX, T, x, [c])
%
% Computes the point to line error (i.e. signed distance) of points in an
% image to the corresponding epipolar lines.
%
%IN:
% RX - 3xN world points multiplied by rotation part of projection ... |
github | ojwoodford/ojwul-master | msac.m | .m | ojwul-master/geometry/msac.m | 3,015 | utf_8 | 76e32992cb6fdf8c15aa1ebe9b9a3696 | %MSAC Robustly fit a model to data with the MSAC algorithm
%
% [model, sqDists] = msac(X, fittingFunc, distFunc, minSamples, distThresh, maxTrials)
%
%IN:
% X - MxN data matrix, with each column being one datum, to which we are
% seeking to fit a model.
% fittingFunc - Handle to a function that fits a model... |
github | ojwoodford/ojwul-master | proj2so3.m | .m | ojwul-master/geometry/proj2so3.m | 280 | utf_8 | 042f2fb40c7c28f8459adae89d5c9510 | %PROJ2SO3 Project a 3x3 matrix onto the SO(3) manifold
%
% B = proj2so3(A)
%
% Projects a 3x3 matrix onto SO(3) (the space of rotation matrices) in a
% least squares way, s.t. B = argmin_{B in SO(3)} || B - A ||_F.
function R = proj2so3(R)
R = proj2orthonormal(R);
end |
github | ojwoodford/ojwul-master | rot2angle.m | .m | ojwul-master/geometry/rot2angle.m | 383 | utf_8 | 991bf0d787b4959bbd21201f88f7ebc2 | %ROT2ANGLE Given rotation matrices, compute their angle of rotation (in degrees)
%
% angle = rot2angle(R)
%
%IN:
% R - 3x{3,4}xN array of rotation or SO(3) matrices.
%
%OUT:
% angle - 1xN vector of angles, in degrees.
function R = rot2angle(R)
R = reshape(R, 3*size(R, 2), []);
R = sum(R([1 5 9],:), 1... |
github | ojwoodford/ojwul-master | rot2euler.m | .m | ojwul-master/geometry/rot2euler.m | 496 | utf_8 | f762bbc225e86939d19abc9c6814951f | %ROT2EULER Converts 3x3xN rotation matrices to 3xN Euler angle representation
%
% X = rot2euler(R)
%
% The Euler representation is a [roll; pitch; yaw] set of angles (in
% radians), which are applied about the X, Y and Z axes of the frame
% respectively, and in that order.
function X = rot2euler(R)
X = shift... |
github | ojwoodford/ojwul-master | map_points.m | .m | ojwul-master/geometry/map_points.m | 3,939 | utf_8 | 5dee42a5ca70e7692415a6b2b7b8f0bc | %MAP POINTS Maps 3D points onto a series of input images
%
% map_points([options])
%
% Plots the feature points obtained from a Structure from Motion algorithm
% onto the input images in the sequence.
%
% IN:
% options - Pairs of arguments, the first being the option name and the
% second bein... |
github | ojwoodford/ojwul-master | camera_extrinsics.m | .m | ojwul-master/geometry/camera_extrinsics.m | 764 | utf_8 | f97f7abb368f88889cdd2cf50d85e7ec | %CAMERA_EXTRINSICS Compute camera extrinsics from projection matrices
%
% [Pe, K] = camera_extrinsics(P)
%
% Given an array of 3x4 camera projection matrices, this function computes
% their extrinsics (matrices in SE3), and (optionally) their intrinsics
% (upper triangular 3x3 matrices).
%
% The output is suc... |
github | ojwoodford/ojwul-master | iou.m | .m | ojwul-master/geometry/iou.m | 780 | utf_8 | ed9a0b83ae67aa80477559307018ae6f | %IOU Compute the intersection over union of two shapes
%
% score = iou(A, B)
%
% Compute the intersection over union of two shapes, represented either by
% logical images, or by polygons.
%
%IN:
% A - 2xM polygon coordinates, or HxW logical matrix.
% B - 2xN polygon coordinates, or HxW logical matrix.
%
%OUT:
% ... |
github | ojwoodford/ojwul-master | rot2quat.m | .m | ojwul-master/geometry/rot2quat.m | 1,201 | utf_8 | dc07a0572e836f2439454e0544aaecf9 | %ROT2QUAT Convert an array of 3x3 rotation matrices into quaternions
%
% Q = rot2quat(R, [w_last])
%
% This function generates quaternions of the form [w x y z]', such that R =
% eye(3) corresponds to Q = [1 0 0 0]'. If w_last is true, quaternions are
% of the form [x y z w].
%
%IN:
% R - 3x3xN array of r... |
github | ojwoodford/ojwul-master | icp.m | .m | ojwul-master/geometry/icp.m | 19,735 | utf_8 | 9bd93b4bacde8a9293369d5fb1d1af8a | function [TR, TT, ER, t] = icp(q,p,varargin)
% Perform the Iterative Closest Point algorithm on three dimensional point
% clouds.
%
% [TR, TT] = icp(q,p) returns the rotation matrix TR and translation
% vector TT that minimizes the distances from (TR * p + TT) to q.
% p is a 3xm matrix and q is a 3xn matrix.
%
% [TR,... |
github | ojwoodford/ojwul-master | KR_from_P.m | .m | ojwul-master/geometry/KR_from_P.m | 424 | utf_8 | 02dc227cf003aa17ea2fff578a4d449e | %KR_from_P Generate K, R and t matrices from a 3x4 projection matrix
%
% [K, R, t] = KR_from_P(P)
%
% P = scalar * K * R * [eye(3) -t]
function [K, R, t] = KR_from_P(P)
st = @(M) M(end:-1:1,end:-1:1)';
[R, K] = qr(st(P(:,1:3)));
K = st(K);
I = diag(K) < 0;
K(:,I) = -K(:,I);
if nargout > 1
R = st(R);
... |
github | ojwoodford/ojwul-master | epipolar_disparity.m | .m | ojwul-master/geometry/epipolar_disparity.m | 1,249 | utf_8 | 9f4bd1fc9640f3290556b864f06f64e5 | %EPIPOLAR_DISPARITY Compute the disparity of points on/near epipolar lines
%
% d = epipolar_disparity(RX, T, x)
%
% Computes the disparity of points on epipolar lines that are closest to
% points in an image.
%
%IN:
% RX - 3xN world points multiplied by rotation part of projection matrix
% P(:,1:3).... |
github | ojwoodford/ojwul-master | msac_fundmatrix.m | .m | ojwul-master/geometry/msac_fundmatrix.m | 3,810 | utf_8 | e5fd0ac329c9365e4e0dc7ace1eec21b | % MSAC_FUNDMATRIX - fits fundamental matrix using RANSAC
%
% Usage: [F, inliers] = msac_fundmatrix(x1, x2, t)
%
% Arguments:
% x1 - 2xN or 3xN set of homogeneous points. If the data is
% 2xN it is assumed the homogeneous scale factor is 1.
% x2 - 2xN or 3xN set of homogeneous point... |
github | ojwoodford/ojwul-master | plane_fit.m | .m | ojwul-master/geometry/plane_fit.m | 512 | utf_8 | 0c9c37021ab1e4eaf2e1eb03c2d2cf9a | %PLANE_FIT Weighted least squares plane fit to 3D points
%
% N = plane_fit(X, [W])
%
% Finds the (weighted) least squares fit of a plane to 3D points, such that
% N' * homg(X) = 0.
%
%IN:
% X - 3xM matrix of 3D points.
% W - 1xM vector of weights per point. Default: ones(1, M).
%
%OUT:
% N - 1x4 plane equation ... |
github | ojwoodford/ojwul-master | epipolar_demo.m | .m | ojwul-master/geometry/epipolar_demo.m | 2,902 | utf_8 | 33517fb629c7e7fa6883f3ee908344db | %EPIPOLAR_DEMO Interactively show epipolar geometry between two images
%
% epipolar_demo(ims, F)
%
% Given a pair of images and their fundamental matrix, or two projection
% matrices from world to image coordinates, this function renders the
% epipolar geometry of a given pixel from one image in the second ima... |
github | ojwoodford/ojwul-master | line_intersect.m | .m | ojwul-master/geometry/line_intersect.m | 594 | utf_8 | 5e41795b812d28bb6ac63664a7340d16 | %LINE_INTERSECT Compute the intersection point of two lines
%
% [y, l] = line_intersect(x1, n1, x2, n2)
%
% Computes the point of intersection of two lines in 2D.
%
%IN:
% x1 - 2xN points on line 1.
% n1 - 2xN directions of line 1.
% x2 - 2xN points on line 2.
% n2 - 2xN directions of line 2.
%
%O... |
github | ojwoodford/ojwul-master | rot2expmap.m | .m | ojwul-master/geometry/rot2expmap.m | 410 | utf_8 | d484cd1eda51e7558ba93cc2bccd196b | %ROT2EXPMAP Converts 3x3xN rotation matrices to 3xN exponential mappings
%
% X = rot2expmap(R)
function X = rot2expmap(R)
sz = [size(R) 1];
th = reshape(acos(1 - mod((0.5 * (1 - min(R(1,1,:) + R(2,2,:) + R(3,3,:), 3)) - 1), 2)), [1 sz(3:end)]);
X = reshape([R(3,2,:)-R(2,3,:); R(1,3,:)-R(3,1,:); R(2,1,:)-R(1,2,... |
github | ojwoodford/ojwul-master | homg.m | .m | ojwul-master/geometry/homg.m | 257 | utf_8 | db8f103523c3288323bcb424c53c36e5 | %HOMG Homogenize vectors
%
% Y = homg(X)
%
% Homogenize an array of vectors along the first dimension, by
% concatenating a 1.
%
%IN:
% X - MxN input array.
%
%OUT:
% Y - (M+1)xN output array.
function X = homg(X)
X(end+1,:) = 1;
end
|
github | ojwoodford/ojwul-master | proj.m | .m | ojwul-master/geometry/proj.m | 484 | utf_8 | eff570a09cdbf49c19e36e5d6c7ad40c | %PROJ Project points onto the image plane
%
% [Y, z] = proj(X)
%
% Project points into a lower dimension by dividing thorugh by the last
% dimension, e.g. pinhole camera projection.
%
%IN:
% X - MxN input array.
%
%OUT:
% Y - (M-1)xN output array.
% z - 1xN array of normalizing values, z = 1./X(end,... |
github | ojwoodford/ojwul-master | camera_centers.m | .m | ojwul-master/geometry/camera_centers.m | 700 | utf_8 | 80044a4d4a6d96ed96ca63e3fefb787d | %CAMERA_CENTERS Compute camera centers from projection matrices
%
% C = camera_extrinsics(P, [cam2world])
%
% Given an array of 3x4 camera projection matrices, this function computes
% their camera centers in world coordinates.
%
%IN:
% P - 3x4xM array of camera projection matrices.
% cam2world - logical... |
github | ojwoodford/ojwul-master | expmap2quat.m | .m | ojwul-master/geometry/expmap2quat.m | 304 | utf_8 | b77537c91f5fd77950dcf3795b2b11d5 | %EXPMAP2QUAT Convert an exponential mapping rotation to a quaternion
%
% Q = expmap2quat(E)
function Q = expmap2quat(E)
theta = sqrt(sum(E .* E));
M = theta > 1e-8;
m = repmat(0.5, size(theta));
m(M) = sin(theta(M) / 2) ./ theta(M);
Q = [cos(theta / 2); bsxfun(@times, m, reshape(E, 3, []))]; |
github | ojwoodford/ojwul-master | quat2rot.m | .m | ojwul-master/geometry/quat2rot.m | 969 | utf_8 | d9a11247636b15f5ba35afd87b83f742 | %QUAT2ROT Convert a quaternion to a 3x3 rotation matrix
%
% R = quat2rot(Q, [w_last])
%
% This function takes in quaternions of the form [w x y z]', such that Q =
% [1 0 0 0]' corresponds to R = eye(3). If w_last is true, quaternions are
% of the form [x y z w].
%
%IN:
% Q - 4xN array of quaternions in the... |
github | ojwoodford/ojwul-master | F_from_P.m | .m | ojwul-master/geometry/F_from_P.m | 491 | utf_8 | 345ef11fa64de08d9c9894dc39518bf1 | %F_FROM_P Compute a fundamental matrix from two projection matrices
%
% F = F_from_P(P)
%
%IN:
% P - 3x4x2 array of two projection matrices.
%
%OUT:
% F - 3x3 fundamental matrix.
function F = F_from_P(F)
X1 = F([2 3],:,1);
X2 = F([3 1],:,1);
X3 = F([1 2],:,1);
Y1 = F([2 3],:,2);
Y2 = F([3 1],:,2);... |
github | ojwoodford/ojwul-master | compute_homography.m | .m | ojwul-master/geometry/compute_homography.m | 1,054 | utf_8 | 7954818e4f2450fc02a71011d85d3f60 | %COMPUTE_HOMOGRAPHY Compute a best fit homography from correspondences
%
% H = compute_homography(X, Y, [normalize])
%
% Compute a hmography from correspondences using the normalized DLT
% algorithm as described in "Multiple View Geometry in Computer Vision".
%
%IN:
% X - 2xN array of points in image one.
% Y - ... |
github | ojwoodford/ojwul-master | P0toC.m | .m | ojwul-master/geometry/P0toC.m | 332 | utf_8 | 51fe9e195c4a10ae282e822c64ec3bc8 | %P0TOC Convert projection matrices' principal points from 0 to centre based
%
% P = P0toC(P, im)
function P = P0toC(P, im)
if numel(im) == 2 || numel(im) == 3
h = im(1);
w = im(2);
else
[h w c] = size(im);
end
K = [1 0 (1-w)/2; 0 1 (1-h)/2; 0 0 1];
for a = 1:size(P, 3)
P(:,:,a) = K * P(... |
github | ojwoodford/ojwul-master | calibrated_fivepoint_helper.m | .m | ojwul-master/geometry/private/calibrated_fivepoint_helper.m | 292 | utf_8 | 9f053f0467f5d3d87d32dbe5bdae388b | %CALIBRATED_FIVEPOINT_HELPER Helper for the calibrated five point algorithm
function varargout = calibrated_fivepoint_helper(varargin)
sourceList = {'calibrated_fivepoint_helper.c'}; % Cell array of source files
[varargout{1:nargout}] = compile(varargin{:}); % Compilation happens here
return |
github | ojwoodford/ojwul-master | mesh_sample_random.m | .m | ojwul-master/mesh/mesh_sample_random.m | 1,513 | utf_8 | 32282e6edfe831bf30fee01781c6aba8 | %MESH_SAMPLE_RANDOM Randomly sample points on a mesh
%
% [P, N] = mesh_sample_random(V, E, nPts)
%
% Randomly sample points from a uniform distrubution over the surface area
% of a triangulated 3D mesh.
%
%IN:
% V - 3xM matrix of 3D vertex coordinates.
% E - 3xN matrix of the 3 vertex indices for each of... |
github | ojwoodford/ojwul-master | mesh_area.m | .m | ojwul-master/mesh/mesh_area.m | 547 | utf_8 | 91ad16853d5c0df5b926712246af6ac9 | %MESH_AREA Compute the surface area of a triangulated mesh
%
% [a, A] = mesh_area(V, E)
%
% Compute the surface area of a 3D triangulated mesh
%
%IN:
% V - 3xM matrix of 3D vertex coordinates.
% E - 3xN matrix of the 3 vertex indices for each of N triangles.
%
%OUT:
% a - scalar surface area of entir... |
github | ojwoodford/ojwul-master | mesh_sample_regular.m | .m | ojwul-master/mesh/mesh_sample_regular.m | 1,628 | utf_8 | a38dd507da4c7ba30927e37f32533aa1 | %MESH_SAMPLE_REGULAR Regularly sample points on a mesh
%
% [P, I] = mesh_sample_regular(V, E, interval)
%
% Sample points regularly over the surface of a triangulated 3D mesh.
%
%IN:
% V - 3xM matrix of 3D vertex coordinates.
% E - 3xN matrix of the 3 vertex indices for each of N triangles.
% interval ... |
github | ojwoodford/ojwul-master | render_camera_trajectories.m | .m | ojwul-master/graphics/render_camera_trajectories.m | 985 | utf_8 | af131b75b50439f42713b2dd131470e4 | %RENDER_CAMERA_TRAJECTORIES Render the path of a set of cameras
%
% h = render_camera_tractories(P1, P2, ...)
% h = render_camera_tractories(P1, I1, ...)
%
% Render a set of camera trajectories
%
%IN:
% P1 - 3x4xM camera projection matrices defining a camera trajectory.
% I1 - 1xK indices of keyframes ... |
github | ojwoodford/ojwul-master | render_depthmap.m | .m | ojwul-master/graphics/render_depthmap.m | 1,363 | utf_8 | 09395644eca8d75d2ada22a002dd739a | %RENDER_DEPTHMAP Renders a coloured depthmap as a point cloud
%
% h = render_depthmap(P, Z, [im, [num_colors, [marker, [marker_size]]]])
%
% Renders a coloured depthmap in world coordinates.
%
%IN:
% P - 3x4 projection matrix from world to image coordinates.
% Z - MxN depthmap.
% im - MxNx3 RGB image. ... |
github | ojwoodford/ojwul-master | render_confusion.m | .m | ojwul-master/graphics/render_confusion.m | 3,126 | utf_8 | 20180acf03e7d192dc9ad37694994387 | %RENDER_CONFUSION Render a confusion matrix
%
% render_confusion(M[, class_names])
%
% Renders a confusion matrix into the current axes.
%
%IN:
% M - NxN confusion matrix.
% class_names - Nx1 cell array of class name strings. Default: {} (not
% shown).
function render_confusion(M, clas... |
github | ojwoodford/ojwul-master | fill_triangles.m | .m | ojwul-master/graphics/fill_triangles.m | 2,144 | utf_8 | 9f10608ea5309943fb34710bcf314ee8 | %FILL_TRIANGLES Standard, linear interpolation triangle renderer
%
% fill_triangles(I, P, zbuff)
% J = fill_triangles(I, P, zbuff)
%
% A software implementation of a standard, linear interpolation (i.e.
% incorrect for perspective), z-buffered triangle renderer.
%
% IN:
% I - CxMxN double or single in... |
github | ojwoodford/ojwul-master | add_datatip.m | .m | ojwul-master/graphics/add_datatip.m | 4,135 | utf_8 | 95e2c55fdb8fb5e37a1e2ee4524c7206 | %ADD_DATATIP Add datatip data to graphical objects
%
% h = add_datatip(h, callback_func, value)
% h = add_datatip(h, value)
% h = add_datatip(h, 'Name', value, ...)
% h = add_datatip(h, callback_func, value)
% h = add_datatip(h, callback_func, 'Name', value, ...)
%
% Example:
% add_datatip(plot(rand(3, 1)),... |
github | ojwoodford/ojwul-master | fill_triangles_demo.m | .m | ojwul-master/graphics/fill_triangles_demo.m | 7,810 | utf_8 | 46326f2d8edc46a4fa9a86a36d339bcf | %FILL_TRIANGLES_DEMO Demonstrates fill_triangles
%
% fill_triangles_demo([resolution, [use_single]])
%
% Demonstrates usage of the fill_triangles function by rendering a
% cube with flat shaded, gouraud shaded and texture mapped sides.
%
% Rotate the cube using arrow keys. Quit by pressing q.
%
% IN:
% ... |
github | ojwoodford/ojwul-master | render_lines_points.m | .m | ojwul-master/graphics/render_lines_points.m | 3,632 | utf_8 | 888f491af2803912c9d584f8c7b700e8 | %RENDER_LINES_POINTS Renders a set of coloured points and/or lines
%
% h = render_line_points(X, [C, [options]])
%
% Renders a set of coloured 2D or 3D points or lines, either as a set of
% lineseries objects (quantized colours, fast rendering) or as a patch
% object (exact colours, slow rendering), depending o... |
github | ojwoodford/ojwul-master | render_mesh.m | .m | ojwul-master/graphics/render_mesh.m | 1,556 | utf_8 | 2d87007efdf740c405e50b496a7fdd19 | %RENDER_MESH Renders a triangulated mesh
%
% h = render_mesh(vertices, faces)
%
% Renders a triangulated mesh defined by a set of vertices and faces
% containing vertex indices.
%
%IN:
% vertices - Mx3 matrix of triangle vertices (rows).
% faces - Nx3 matrix of vertex indices for each triangle (columns).... |
github | ojwoodford/ojwul-master | select3Dpoints.m | .m | ojwul-master/graphics/select3Dpoints.m | 5,519 | utf_8 | 7c40d771619a082531f50c68e2bc788b | %SELECT3DPOINTS Select a subset of 3D points
%
% ind = select3Dpoints(X)
%
% Interactively select a subset of 3D points, by rotating, translating and
% zooming in on the points, then holding down shift and either clicking on
% or drawing round points. Radio buttons allow the user to toggle whether
% selected points ... |
github | ojwoodford/ojwul-master | render_camera.m | .m | ojwul-master/graphics/render_camera.m | 3,128 | utf_8 | 89969def23d69d6d318684255716a22c | %RENDER_CAMERA Render 3D camera models, given projection matrices
%
% h = render_camera(P, [scale, [colour, [cam2world]])
%
% Render a set of cameras.
%
%IN:
% P - 3x4xN camera projection matrices.
% scale - scalar value indicating the size of the camera. Default: 1.
% colour - 1x3 colour value for the... |
github | ojwoodford/ojwul-master | render_circles.m | .m | ojwul-master/graphics/render_circles.m | 1,041 | utf_8 | 2099e4c0cbaec1fc2da328f579010de1 | %RENDER_CIRCLES Draw a set of circles
%
% h = render_circles(X, nsides, col)
%
%IN:
% X - 3xN array of circles defined by [center_x; center_y; radius].
% nsides - Scalar indicating the number of sides to use for each polygon.
% Default: 64.
% col - Colour to use for the circles. Default: 'b'.
functi... |
github | ojwoodford/ojwul-master | ds2fig.m | .m | ojwul-master/graphics/ds2fig.m | 10,583 | utf_8 | 90ecb3172bcb3caf027cd86737d78a7b | function [XFIG, YFIG, DEEP] = ds2fig(varargin)
%DS2FIG Transform data space coordinates to normalized figure coordinates.
% [XFIG,YFIG,DEEP] = DS2FIG(X,Y,Z) transforms corresponding elements of
% data stored in data space coordinates X,Y,Z to normalized figure
% coordinates (XFIG, YFIG). if the point ... |
github | ojwoodford/ojwul-master | clickA3DPoint.m | .m | ojwul-master/graphics/clickA3DPoint.m | 4,502 | utf_8 | 4fa9bd3ce294023f769a750970db6966 | function index = clickA3DPoint(pointCloud, faces)
%CLICKA3DPOINT
% H = CLICKA3DPOINT(POINTCLOUD) shows a 3D point cloud and lets the user
% select points by clicking on them. The selected point is highlighted
% and its index in the point cloud will is printed on the screen.
% POINTCLOUD should be a 3*N matrix... |
github | ojwoodford/ojwul-master | fcw.m | .m | ojwul-master/graphics/fcw.m | 17,033 | utf_8 | b7936c59c3b9991036fc89d92790ce62 | %FCW Figure Control Widget: Manipulate figures with key and button presses
%
% fcw([fig], [buttons], [modifiers])
% fcw(..., '-link')
% fcw(..., '-block')
%
% Allows the user to rotate, pan and zoom an axes using key presses and
% mouse gestures. Additionally, press q to quit the widget, r to reset the
%... |
github | ojwoodford/ojwul-master | vol3d.m | .m | ojwul-master/graphics/vol3d.m | 7,613 | utf_8 | 2fba9993538c21f421f72e55f2d73836 | %H = VOL3D Volume render 3-D data.
% VOL3D uses the orthogonal plane 2-D texture mapping technique for
% volume rending 3-D data in OpenGL. Use the 'texture' option to fine
% tune the texture mapping technique. This function is best used with
% fast OpenGL hardware.
%
% vol3d Provide a demo o... |
github | ojwoodford/ojwul-master | imstereo.m | .m | ojwul-master/graphics/imstereo.m | 3,367 | utf_8 | 747884c9db67d08af6d700f8d12eaa44 | function imstereo(A, B)
if ischar(A)
A = imread(A);
end
if nargin > 1
if ischar(B)
B = imread(B);
end
state.sbs = [A B];
else
state.sbs = A;
w = floor(size(A, 2) / 2);
B = A(:,w+1:end,:);
A = A(:,1:w,:);
end
state.state = 1;
state.offset = 0;
% Create the first... |
github | ojwoodford/ojwul-master | ojw_gaussian_pyramid.m | .m | ojwul-master/image/ojw_gaussian_pyramid.m | 1,699 | utf_8 | 0a0ef1ad7c73878bf3ce37d9f1cb06d5 | %OJW_GAUSSIAN_PYRAMID Creates a gaussian image pyramid
%
% B = ojw_gaussian_pyramid(A, max_depths, [F])
%
% Generates the gaussian pyramid of an image of any class.
%
% IN:
% A - MxNxC input image, or Sx1 cell array of input images.
% max_depths - scalar indicating maximum number of additional pyramid
%... |
github | ojwoodford/ojwul-master | imfiltsep.m | .m | ojwul-master/image/imfiltsep.m | 865 | utf_8 | 40f8d90cecc063fe74b4b309e2a7af45 | %IMFILTSEP Fast separable filtering on a multi-channel image
%
% B = imfiltsep(A, fy, fx)
%
% Fast separable filtering of multi-channel images, using symmetric
% padding, providing an output of the same size as the input.
%
%IN:
% A - HxWxC input image.
% fy - filter to apply to the columns.
% fx - fi... |
github | ojwoodford/ojwul-master | imdilate_.m | .m | ojwul-master/image/imdilate_.m | 1,183 | utf_8 | c37726cafa9893163e283d0d65a7061e | %IMDILATE_ Dilate image
%
% B = imdilate_(A, nhood)
%
% This function duplicates behaviour of the IMDILATE function (without
% needing the Image Processing Toolbox) for a subset of inputs. If IMDILATE
% is available, it is used.
%
%IN:
% A - HxW logical or grayscale image.
% nhood - PxQ matrix of 1s and 0s indica... |
github | ojwoodford/ojwul-master | imgrad.m | .m | ojwul-master/image/imgrad.m | 4,924 | utf_8 | cd9eb1f9a8f1ad0f709eab8e0ef36557 | %IMGRAD Calculate gradients of an image in x and y directions
%
% [Ix, Iy] = imgrad(I, sigma, [mcm])
% G = imgrad(I, sigma, [mcm])
%
% Computes x and y gradients of an image. The implementation uses
% separable, steerable filters, hence is fast.
%
% For multi-channel images, the gradient is computed in the... |
github | ojwoodford/ojwul-master | ojw_interp2.m | .m | ojwul-master/image/ojw_interp2.m | 1,743 | utf_8 | c89cbb73c375246f6d26894a9f6ecd34 | %OJW_INTERP2 Fast 2d interpolation for images
%
% V = ojw_interp2(A, X, Y)
% V = ojw_interp2(A, X, Y, interp_mode)
% V = ojw_interp2(A, X, Y, interp_mode, oobv)
% V = ojw_interp2(A, X, Y, interp_mode, oobv, max_num_threads)
%
% 2d interpolation on a regular grid - similar to MATLAB's interp2() but
% with much less ove... |
github | ojwoodford/ojwul-master | ojw_box_pyramid.m | .m | ojwul-master/image/ojw_box_pyramid.m | 1,660 | utf_8 | b3cbbd67b60ed5d6b061f81b419c9dc4 | %OJW_BOX_PYRAMID Creates an image pyramid using box filtering
%
% B = ojw_box_pyramid(A, max_depths)
%
% Generates the image pyramid of an image of any class.
%
% IN:
% A - MxNxC input image, or Sx1 cell array of input images.
% max_depths - scalar indicating maximum number of additional pyramid
% ... |
github | ojwoodford/ojwul-master | imnonmaxsup.m | .m | ojwul-master/image/imnonmaxsup.m | 1,581 | utf_8 | 3a434f880c28f81007baab20f9b09472 | %IMNONMAXSUP Non-maxima suppression in an image
%
% M = imnonmaxsup(I, [radius, [mask_val]])
%
%IN:
% I - HxW image
% radius - scalar value of radius (in pixels) within which to suppress
% maxima. Default: 1.5.
% mask_val - scalar value which is used to mask previous maxima prior to
% ... |
github | ojwoodford/ojwul-master | ojw_interp2_debug.m | .m | ojwul-master/image/ojw_interp2_debug.m | 348 | utf_8 | 7fc44f6c579ad0ad1f6dd7ce07c482d0 | %OJW_INTERP2_DEBUG Image sampling, with plotting of the sample points
function varargout = ojw_interp2_debug(varargin)
% Forward the call, for error checking
[varargout{1:nargout}] = ojw_interp2(varargin{:});
% Render the sample points
figure(7429);
clf reset;
imdisp(varargin{1});
hold on;
plot(double(varargin{2}), dou... |
github | ojwoodford/ojwul-master | image_alignment_demo.m | .m | ojwul-master/image/image_alignment_demo.m | 2,999 | utf_8 | 7c9011c2a9ac3111d0ff32d10aa8c9e2 | %IMAGE_ALIGNMENT_DEMO Demonstrates image alignment
%
% image_alignment_demo()
%
% This function demonstrates image alignment via a homography, using
% various techniques:
% - Lie algebra: a Lie representation of homography updates.
% - Auto differentiation: automatically compute the Jacobian of residuals.
... |
github | ojwoodford/ojwul-master | filter_subsample.m | .m | ojwul-master/image/filter_subsample.m | 949 | utf_8 | a5032e2f3563655e0986a6425d71ad82 | %FILTER_SUBSAMPLE Filters and subsamples an image by a factor of 2
%
% B = filter_subsample(A, F)
%
% Given an image and a one dimensional filter, this function convolves the
% image with the filter along its first two dimensions, and then subsamples
% the resulting image by a factor of two in both those dimensions.... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.