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 | shayqn/Mouse-Bandit-Behavior-master | NewGUI.m | .m | Mouse-Bandit-Behavior-master/GUI/NewGUI.m | 27,803 | utf_8 | 2c7b635f0ecec1caf916d927eab53cb9 | function varargout = NewGUI(varargin)
% NEWGUI MATLAB code for NewGUI.fig
% NEWGUI, by itself, creates a new NEWGUI or raises the existing
% singleton*.
%
% H = NEWGUI returns the handle to a new NEWGUI or the handle to
% the existing singleton*.
%
% NEWGUI('CALLBACK',hObject,eventData,handles,... |
github | shayqn/Mouse-Bandit-Behavior-master | runTriplePortExperiment_plotly.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/runTriplePortExperiment_plotly.m | 10,638 | utf_8 | dff15066b24de78ece8130cf1e760a50 | function runTriplePortExperiment(varargin)
global arduinoConnection arduinoPort
global arduinoMessageString
global p % parameter structure
%% load parameters from file
parameterFileName = '';
if (nargin > 0) % check for parameter file path as input argument
parameterFileName = varargin{1};
end
[p, parameterFileN... |
github | shayqn/Mouse-Bandit-Behavior-master | setupArduinoSerialPort.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/setupArduinoSerialPort.m | 913 | utf_8 | dc69247ec858f2f211673a90cdba242f | %%
% setupArduinoSerialPort.m
%
% This function will open one of the serial ports by number (see
% listPorts.m) for reading and writing. It returns a serial port object.
%
% JSB 5/2014
function serialPort = setupArduinoSerialPort(portN)
% Get info on all serial ports.
serialInfo = instrhwinfo('serial');
... |
github | shayqn/Mouse-Bandit-Behavior-master | findArduinoPort.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/findArduinoPort.m | 753 | utf_8 | f8e79b55d6ca27db2a920cc792813e48 | % findArduinoPort()
% This fuction examines the list of all available serial ports and tries to
% find the one that has an arduino connected to it. It returns the index of
% that port.
%
% OM 1/2016
function port = findArduinoPort()
serialInfo = instrhwinfo('serial');
archstr = computer('arch');
port = [];
for portN... |
github | shayqn/Mouse-Bandit-Behavior-master | executeFunctionWithDelay.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/executeFunctionWithDelay.m | 310 | utf_8 | 0268aa80dfade284c1ea82346d501fe0 |
function fTimer = executeFunctionWithDelay(func, delay)
% executeFunctionWithDelay: executes a function after a specified delay (in
% sec)
%
fTimer = timer('ExecutionMode', 'singleShot', 'StartDelay', delay);
fTimer.StopFcn = @(o,e)delete(o);
fTimer.TimerFcn = {@(o,e)func()};
start(fTimer);
end
|
github | shayqn/Mouse-Bandit-Behavior-master | readFromArduino.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/readFromArduino.m | 845 | utf_8 | 22f203d04a3d552b77ea9ff8add29538 | %%
% readFromArduino.m
%
% This function is executed whenever MATLAB
% detects bytes available on the arduino serial port.
%
% This function reads in any available characters and calls
% arduinoMessageString() to act on all newline (\n) terminated messages.
%
% OM 1/2016
function readFromArduino(obj, event)
arduino... |
github | shayqn/Mouse-Bandit-Behavior-master | runTriplePortExperiment_plotlyv5.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/runTriplePortExperiment_plotlyv5.m | 11,702 | utf_8 | 9a35613d046697fb7be16471bcf66474 | function runTriplePortExperiment(varargin)
global arduinoConnection arduinoPort
global arduinoMessageString
global p % parameter structure
%% load parameters from file
parameterFileName = '';
if (nargin > 0) % check for parameter file path as input argument
parameterFileName = varargin{1};
end
[p, parameterFileN... |
github | shayqn/Mouse-Bandit-Behavior-master | playTone.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/playTone.m | 246 | utf_8 | 21a26a78a3ee1d5b6db04b4bd0164744 |
%% play a pure tone
function playTone(frequency, duration, intensity)
Fs = 48000; % set sampling rate to 48000 Hz (perhaps some sound cards can handle 96000)
wave = intensity*sin((0:1/Fs:duration)*2*pi*frequency);
sound(wave,Fs) |
github | shayqn/Mouse-Bandit-Behavior-master | clearPorts.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/clearPorts.m | 219 | utf_8 | 2e51415e8428bc1da8a3669350d66592 | %%
% clearPorts.m
%
% This function will close all open serial ports. This frees them up for
% other programs to use.
%
% JSB 5/2014
function clearPorts()
if (length(instrfind))
fclose(instrfind);
end |
github | shayqn/Mouse-Bandit-Behavior-master | interpretArduinoMessage.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/interpretArduinoMessage.m | 1,556 | utf_8 | 71fd25c93d44f45349762b544f10cef1 |
function interpretArduinoMessage(messageString)
global arduinoConnection newPortID
global AllNosePorts
%fprintf('#%s#\n',messageString);
messageString = strtrim(messageString);
%fprintf('##%s##\n',messageString);
messageType = messageString(1);
portNum = [];
if length(messageString) > 1
portNum = str2num(message... |
github | shayqn/Mouse-Bandit-Behavior-master | listPorts.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/listPorts.m | 407 | utf_8 | c2c1a72a8c91d16860cb5df4af890e66 | %%
% listPorts.m
%
% This function will list all the serial ports MATLAB can find.
%
% JSB 5/2014
function listPorts()
% Get info about all the serial ports
serialInfo = instrhwinfo('serial');
% Display the name of each one:d
for portN = 1:length(serialInfo.AvailableSerialPorts)
disp(['Port '... |
github | shayqn/Mouse-Bandit-Behavior-master | TriplePortExperiment_Stage1.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/TriplePortExperiment_Stage1.m | 7,508 | utf_8 | f2586bd7ce78f3cdae623f6cb2b091b8 | function runTriplePortExperiment(varargin)
global arduinoConnection arduinoPort
global arduinoMessageString
global p % parameter structure
%% load parameters from file
parameterFileName = '';
if (nargin > 0) % check for parameter file path as input argument
parameterFileName = varargin{1};
end
[p, parameterFileN... |
github | shayqn/Mouse-Bandit-Behavior-master | writeToArduino.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/writeToArduino.m | 523 | utf_8 | f02ef8e5f449b4a8c3f3c409c9c89f6b | %%
% writeToArduino.m
%
% This function will write a string followed by a '\n' (newline) character,
% to an Arduino over a serial port. It writes them synchronously, meaning
% that MATLAB will pause execution until the bytes are actually written.
%
% OM 1/2016
function writeToArduino(messageChar, arg1, arg2)
globa... |
github | shayqn/Mouse-Bandit-Behavior-master | loadParametersFile.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/loadParametersFile.m | 1,278 | utf_8 | acce6a275fed9cf73c525e775718fdf2 | %% loadParametersFile: loads a .csv file with preferences and
% returns them as a struct. If any parameteters are missing,
% the default values will be loaded from 'generateDefaultValues.m'.
function [params, paramFileName] = loadParametersFile(paramFileName)
%% load parameter file
if ~exist(paramFileName,'fi... |
github | shayqn/Mouse-Bandit-Behavior-master | runTriplePortExperiment.m | .m | Mouse-Bandit-Behavior-master/triplePortCode_v5/runTriplePortExperiment.m | 13,398 | utf_8 | 50b29e280dac1211a158f54d7eaeed13 | function runTriplePortExperiment(varargin)
global arduinoConnection arduinoPort
global arduinoMessageString
global p % parameter structure
global info % structure containing mouse name and folder to be saved in
%% Setup
% cleanup routine to be executed even if this function is terminated early
finishup = onCleanup(@... |
github | seakers/matlab-spacecraft-design-master | test_structures_main.m | .m | matlab-spacecraft-design-master/test_structures_main.m | 2,478 | utf_8 | 577dabcd688edda0e324539f36b97ce0 | function test_structures_main() % Include surfaceArea
% A function that tests the structures subsystem by generating components
% based on the payload that the user wants to generate. This function
% allows the user to skip the process of having to deal with extra time
% waiting for other subsystems to perform calculat... |
github | seakers/matlab-spacecraft-design-master | ParallelAxis.m | .m | matlab-spacecraft-design-master/Structures/ParallelAxis.m | 844 | utf_8 | b2b49e951dfd9fb6dd6b9165efa56afb | function [totalI,rCM,totalMass] = ParallelAxis(m1,m2,r1,r2,I1,I2)
% A function that uses the parallel axis theorum to compute the total
% moment of inertia for two bodies with known center of gravity, Principal
% Moments of Inertia, and mass.
[rCM,totalMass] = CenterOfMass(m1,m2,r1,r2);
totalI = I1 + I2 - m1*CrossMatri... |
github | seakers/matlab-spacecraft-design-master | structures_main2.m | .m | matlab-spacecraft-design-master/Structures/structures_main2.m | 5,755 | utf_8 | 6f7f25b63eac7aedbc9b3e2b7ade3dfb | function [STRUCTURES] = structures_main2(components)
% Calculates the optimal structure for a set of inputted components.
% All dimensions are assumed to be in meters and mass in kg.
% Inputs:
% components a structure array that contains all the components
% for the satellite, se... |
github | seakers/matlab-spacecraft-design-master | initGenParameters.m | .m | matlab-spacecraft-design-master/Structures/initGenParameters.m | 8,302 | utf_8 | 91ab0647a71d33849db9a6b0aa8dd7cf | function [genParameters]= initGenParameters(components)
% Check the size of the largest component. If the largest component is less
% than 0.3 meters, use a cubesat configuration. If the largest size is
% greater than 0.3 meters, then look for the fuel tank in the list of
% components. Check the size of the tank to mak... |
github | seakers/matlab-spacecraft-design-master | CreateStructure.m | .m | matlab-spacecraft-design-master/Structures/CreateStructure.m | 50,180 | utf_8 | afa3bb45f64e77e424578fde6f1b6cbe | function [structures,genParameters] = CreateStructure(genParameters)
% A function that creates the a structure array that contains the physical
% structure of the satellite based on the general parameters that are
% inputted.
if strcmp(genParameters.spacecraftType,'Central Cylinder');
structures = CylinderStructur... |
github | seakers/matlab-spacecraft-design-master | structures_main.m | .m | matlab-spacecraft-design-master/Structures/structures_main.m | 6,895 | utf_8 | ad1702a7d8b44f9f2298ce872bed9ba5 | function [STRUCTURES] = structures_main(components)
% Calculates the optimal structure for a set of inputted components.
% All dimensions are assumed to be in meters and mass in kg.
% Inputs:
% components a structure array that contains all the components
% for the satellite, see the e... |
github | seakers/matlab-spacecraft-design-master | StackingAlgorithm.m | .m | matlab-spacecraft-design-master/Structures/StackingAlgorithm.m | 6,235 | utf_8 | ca413b3c91f4afa24ce14aef3f4c0a83 | function [components,structures,needExpand,isFit] = StackingAlgorithm(components,structures,structuresIndices,genParameters)
%% A function that will stack the components assigned to a structure on top of each other along the structure's normal vector
n1 = length(components);
rollRotate = 0;
isFit = zeros(n1,1);
% Go ... |
github | seakers/matlab-spacecraft-design-master | ComponentSort.m | .m | matlab-spacecraft-design-master/Structures/ComponentSort.m | 570 | utf_8 | a0ca2fd02a868516f89b9ef5f0bc98c3 | function [sortedIndices]= ComponentSort(components)
% Sorts the components by mass in descending order and sends the indices of
% how they should be sorted back.
% First goes through all the components and
sortedComponentIndices = MassSort(components);
function sortedComponentIndices = MassSort(components)
%% sor... |
github | seakers/matlab-spacecraft-design-master | InertiaCalculator.m | .m | matlab-spacecraft-design-master/Structures/InertiaCalculator.m | 3,655 | utf_8 | ad0ae96ff5e3bc8fb8a264039f36b2fe | function [totalI,totalCG] = InertiaCalculator(components,structures)
% A function that calculates the Inertia matrix and CG of the satellite
% for all the components that have a CG. This is all with respect to the LV
% payload adapter.
% Inputs:
% components a structure array that contains all the componen... |
github | seakers/matlab-spacecraft-design-master | PackingAlgorithm.m | .m | matlab-spacecraft-design-master/Structures/PackingAlgorithm.m | 9,841 | utf_8 | 07b4e0858847eb6a1ec7190c5cbb61a2 | function [components,structures,needExpand,isFit] = PackingAlgorithm(components,structures,structuresIndices,genParameters)
% Function that packs the components on a panel using the Sleator
% algorithm.
% Convert the components from their shapes to rectangles in order to be
% compatible with the packing algorithm
[rec... |
github | seakers/matlab-spacecraft-design-master | myslider.m | .m | matlab-spacecraft-design-master/Structures/myslider.m | 1,197 | utf_8 | 95c9febc4ad778ba39c0f6a45ac2f7d9 | % function myslider
% x = 1:10;
% hplot = plot(x,0*x);
% h = uicontrol('style','slider','units','pixel','position',[20 20 300 20]);
% addlistener(h,'ActionEvent',@(hObject, event) makeplot(hObject, event,x,hplot));
%
%
% function makeplot(hObject,event,x,hplot)
% n = get(hObject,'Value');
% set(hplot,'ydata',x.^n);
%... |
github | seakers/matlab-spacecraft-design-master | structOBC.m | .m | matlab-spacecraft-design-master/Avionics/structOBC.m | 2,669 | utf_8 | b33c3fc9b2d0922eca9e5a6e1b6f3a66 | % Creates a Struct array with estimated specifications for a satellite's
% on-board computers, from the data downloaded per and redundancy
function [obc] = structOBC(ddpd, redundancy)
% Units used:
% cost -- $
% power -- W
% mass -- kg
% dimensions --... |
github | seakers/matlab-spacecraft-design-master | sat_adcs_specifications_Joe.m | .m | matlab-spacecraft-design-master/NelsonADCS2/sat_adcs_specifications_Joe.m | 1,955 | utf_8 | 2ab1ef76baee730718588a39dbf0722f | %%User defined specifications
function sat_out = sat_adcs_specifications_Joe()
altitude_prompt = 'What altitude do you want the spacecraft to reside in (m)? ';
altitude = input(altitude_prompt);
impulses_prompt = 'Will a large impulse be needed for orbit insertion (Y/N)? ';
impulses = input(impulses_prompt,'s');
if ... |
github | seakers/matlab-spacecraft-design-master | atmos76.m | .m | matlab-spacecraft-design-master/NelsonADCS2/atmos76.m | 40,954 | utf_8 | a2662113b8f2c4594ca2c72f66850d0d | function [RHO] = atmos76 ( R )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-
%%
%% Use : [RHO] = atmos76 ( R )
%%
%% This function finds the atmospheric density at an altitude above an
%% oblate earth given the position vector in the Geocentric Equatorial
%% frame. The... |
github | seakers/matlab-spacecraft-design-master | sat_adcs_specifications_Joe.m | .m | matlab-spacecraft-design-master/Nelson ADCS/sat_adcs_specifications_Joe.m | 1,955 | utf_8 | 2ab1ef76baee730718588a39dbf0722f | %%User defined specifications
function sat_out = sat_adcs_specifications_Joe()
altitude_prompt = 'What altitude do you want the spacecraft to reside in (m)? ';
altitude = input(altitude_prompt);
impulses_prompt = 'Will a large impulse be needed for orbit insertion (Y/N)? ';
impulses = input(impulses_prompt,'s');
if ... |
github | seakers/matlab-spacecraft-design-master | atmos76.m | .m | matlab-spacecraft-design-master/Nelson ADCS/atmos76.m | 40,954 | utf_8 | a2662113b8f2c4594ca2c72f66850d0d | function [RHO] = atmos76 ( R )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-
%%
%% Use : [RHO] = atmos76 ( R )
%%
%% This function finds the atmospheric density at an altitude above an
%% oblate earth given the position vector in the Geocentric Equatorial
%% frame. The... |
github | seakers/matlab-spacecraft-design-master | PlotSatellite.m | .m | matlab-spacecraft-design-master/Plotting/PlotSatellite.m | 5,279 | utf_8 | 74b7aa11de1928aeb8e9ef06822c4b54 | function PlotSatellite(components, structures,LV)
% hwlRectangle = [2,3,1];
% xyzRectangle = [0,0,0];
hold on
grid 'on'
xlabel('X (m)')
ylabel('Y (m)')
zlabel('Z (m)')
axis equal
% S.LN = plot(S.x,S.x,'r');
% RectangularPlotter(hwlRectangle(1),hwlRectangle(2),hwlRectangle(3),xyzRectangle(1),xyzRectangle(2),xyzRectang... |
github | seakers/matlab-spacecraft-design-master | myslider.m | .m | matlab-spacecraft-design-master/Plotting/myslider.m | 1,197 | utf_8 | 95c9febc4ad778ba39c0f6a45ac2f7d9 | % function myslider
% x = 1:10;
% hplot = plot(x,0*x);
% h = uicontrol('style','slider','units','pixel','position',[20 20 300 20]);
% addlistener(h,'ActionEvent',@(hObject, event) makeplot(hObject, event,x,hplot));
%
%
% function makeplot(hObject,event,x,hplot)
% n = get(hObject,'Value');
% set(hplot,'ydata',x.^n);
%... |
github | seakers/matlab-spacecraft-design-master | PlotSatInfo.m | .m | matlab-spacecraft-design-master/Plotting/PlotSatInfo.m | 3,505 | utf_8 | 816145a685774f95e23ae06fc21dc772 | function PlotSatInfo(payload,comms,eps,avionics,thermal,structures,config,propulsion,adcs,LV)
% Create the vectors containing the mass info
mass = [sum(payload.mass),comms.mass,eps.mass,thermal.mass,avionics.Mass,structures.structuresMass,propulsion.mass,adcs.mass];
mass_subsystemStrings = {'Payload','Comms','EPS','Th... |
github | seakers/matlab-spacecraft-design-master | sat_adcs_specifications_Joe.m | .m | matlab-spacecraft-design-master/NelsonADCS3/sat_adcs_specifications_Joe.m | 1,955 | utf_8 | 2ab1ef76baee730718588a39dbf0722f | %%User defined specifications
function sat_out = sat_adcs_specifications_Joe()
altitude_prompt = 'What altitude do you want the spacecraft to reside in (m)? ';
altitude = input(altitude_prompt);
impulses_prompt = 'Will a large impulse be needed for orbit insertion (Y/N)? ';
impulses = input(impulses_prompt,'s');
if ... |
github | seakers/matlab-spacecraft-design-master | atmos76.m | .m | matlab-spacecraft-design-master/NelsonADCS3/atmos76.m | 40,954 | utf_8 | a2662113b8f2c4594ca2c72f66850d0d | function [RHO] = atmos76 ( R )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-
%%
%% Use : [RHO] = atmos76 ( R )
%%
%% This function finds the atmospheric density at an altitude above an
%% oblate earth given the position vector in the Geocentric Equatorial
%% frame. The... |
github | seakers/matlab-spacecraft-design-master | DeltaV.m | .m | matlab-spacecraft-design-master/Propulsion/DeltaV.m | 1,836 | utf_8 | 14b5da25af9509bb591c93260c32d8eb | function dV = DeltaV(h,life)
%--------------------------------------------------------------------------
% This function estimates the total Delta-V for a mission, excluding ADCS
% Based on Spandan's model; assumes circular orbit
% Inputs:
% h: Altitude [km]
% life: Satellite lifetime [years]
% Output
%... |
github | seakers/matlab-spacecraft-design-master | ParallelAxis.m | .m | matlab-spacecraft-design-master/SamStructures/ParallelAxis.m | 844 | utf_8 | b2b49e951dfd9fb6dd6b9165efa56afb | function [totalI,rCM,totalMass] = ParallelAxis(m1,m2,r1,r2,I1,I2)
% A function that uses the parallel axis theorum to compute the total
% moment of inertia for two bodies with known center of gravity, Principal
% Moments of Inertia, and mass.
[rCM,totalMass] = CenterOfMass(m1,m2,r1,r2);
totalI = I1 + I2 - m1*CrossMatri... |
github | seakers/matlab-spacecraft-design-master | PlotSatellite.m | .m | matlab-spacecraft-design-master/SamStructures/PlotSatellite.m | 5,279 | utf_8 | 74b7aa11de1928aeb8e9ef06822c4b54 | function PlotSatellite(components, structures,LV)
% hwlRectangle = [2,3,1];
% xyzRectangle = [0,0,0];
hold on
grid 'on'
xlabel('X (m)')
ylabel('Y (m)')
zlabel('Z (m)')
axis equal
% S.LN = plot(S.x,S.x,'r');
% RectangularPlotter(hwlRectangle(1),hwlRectangle(2),hwlRectangle(3),xyzRectangle(1),xyzRectangle(2),xyzRectang... |
github | seakers/matlab-spacecraft-design-master | InertiaCalculator.m | .m | matlab-spacecraft-design-master/SamStructures/InertiaCalculator.m | 3,654 | utf_8 | a433920002886ba16392c295c2f24d8c | function [totalI,totalCG] = InertiaCalculator(components,structures)
% A function that calculates the Inertia matrix and CG of the satellite
% for all the components that have a CG. This is all with respect to the LV
% payload adapter.
% Inputs:
% components a structure array that contains all the componen... |
github | seakers/matlab-spacecraft-design-master | myslider.m | .m | matlab-spacecraft-design-master/SamStructures/myslider.m | 1,197 | utf_8 | 95c9febc4ad778ba39c0f6a45ac2f7d9 | % function myslider
% x = 1:10;
% hplot = plot(x,0*x);
% h = uicontrol('style','slider','units','pixel','position',[20 20 300 20]);
% addlistener(h,'ActionEvent',@(hObject, event) makeplot(hObject, event,x,hplot));
%
%
% function makeplot(hObject,event,x,hplot)
% n = get(hObject,'Value');
% set(hplot,'ydata',x.^n);
%... |
github | seakers/matlab-spacecraft-design-master | PlotSatInfo.m | .m | matlab-spacecraft-design-master/SamStructures/PlotSatInfo.m | 3,457 | utf_8 | 3c9b5bd2a969a6da98a1e3992594a9b4 | function PlotSatInfo(payload,comms,eps,avionics,thermal,structures, propulsion,adcs,LV)
% Create the vectors containing the mass info
mass = [sum(payload.mass),comms.mass,eps.mass,thermal.mass,avionics.Mass,structures.structuresMass,propulsion.mass,adcs.mass];
mass_subsystemStrings = {'Payload','Comms','EPS','Thermal'... |
github | seakers/matlab-spacecraft-design-master | PlotSatellite.m | .m | matlab-spacecraft-design-master/SamStructures/Plotting/PlotSatellite.m | 5,279 | utf_8 | 74b7aa11de1928aeb8e9ef06822c4b54 | function PlotSatellite(components, structures,LV)
% hwlRectangle = [2,3,1];
% xyzRectangle = [0,0,0];
hold on
grid 'on'
xlabel('X (m)')
ylabel('Y (m)')
zlabel('Z (m)')
axis equal
% S.LN = plot(S.x,S.x,'r');
% RectangularPlotter(hwlRectangle(1),hwlRectangle(2),hwlRectangle(3),xyzRectangle(1),xyzRectangle(2),xyzRectang... |
github | seakers/matlab-spacecraft-design-master | myslider.m | .m | matlab-spacecraft-design-master/SamStructures/Plotting/myslider.m | 1,197 | utf_8 | 95c9febc4ad778ba39c0f6a45ac2f7d9 | % function myslider
% x = 1:10;
% hplot = plot(x,0*x);
% h = uicontrol('style','slider','units','pixel','position',[20 20 300 20]);
% addlistener(h,'ActionEvent',@(hObject, event) makeplot(hObject, event,x,hplot));
%
%
% function makeplot(hObject,event,x,hplot)
% n = get(hObject,'Value');
% set(hplot,'ydata',x.^n);
%... |
github | seakers/matlab-spacecraft-design-master | PlotSatInfo.m | .m | matlab-spacecraft-design-master/SamStructures/Plotting/PlotSatInfo.m | 3,457 | utf_8 | 3c9b5bd2a969a6da98a1e3992594a9b4 | function PlotSatInfo(payload,comms,eps,avionics,thermal,structures, propulsion,adcs,LV)
% Create the vectors containing the mass info
mass = [sum(payload.mass),comms.mass,eps.mass,thermal.mass,avionics.Mass,structures.structuresMass,propulsion.mass,adcs.mass];
mass_subsystemStrings = {'Payload','Comms','EPS','Thermal'... |
github | seakers/matlab-spacecraft-design-master | power_main.m | .m | matlab-spacecraft-design-master/Power/power_main.m | 1,091 | utf_8 | 7bce89ec79f59050bc667411b651724c | %% Inputs
function [power]=power_main(h,lifetime,payloadpower,commspower,adcspower,obcpower,drymass)
%Mission (payload, orbit)
paramspower.h=h; %altitude [km] (400,500,600,800)
paramspower.lifetime=lifetime; % in years
paramspower.payloadpower=payloadpower; %fins a 3000W
%From Pau
... |
github | seakers/matlab-spacecraft-design-master | sat_adcs_specifications_Joe.m | .m | matlab-spacecraft-design-master/ADCS/sat_adcs_specifications_Joe.m | 1,955 | utf_8 | 2ab1ef76baee730718588a39dbf0722f | %%User defined specifications
function sat_out = sat_adcs_specifications_Joe()
altitude_prompt = 'What altitude do you want the spacecraft to reside in (m)? ';
altitude = input(altitude_prompt);
impulses_prompt = 'Will a large impulse be needed for orbit insertion (Y/N)? ';
impulses = input(impulses_prompt,'s');
if ... |
github | seakers/matlab-spacecraft-design-master | atmos76.m | .m | matlab-spacecraft-design-master/ADCS/atmos76.m | 40,954 | utf_8 | a2662113b8f2c4594ca2c72f66850d0d | function [RHO] = atmos76 ( R )
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%-
%%
%% Use : [RHO] = atmos76 ( R )
%%
%% This function finds the atmospheric density at an altitude above an
%% oblate earth given the position vector in the Geocentric Equatorial
%% frame. The... |
github | seakers/matlab-spacecraft-design-master | structOBC.m | .m | matlab-spacecraft-design-master/Comms/structOBC.m | 2,209 | utf_8 | c2d34e3031bd5ed37a42915a68b92a8f | % Creates a Struct array with estimated specifications for a satellite's
% on-board computers, from the data downloaded per and redundancy
function obcs = structOBC(ddpd, redundancy)
% Units used:
% cost -- $
% power -- W
% mass -- kg
% dimensions -- ... |
github | seakers/matlab-spacecraft-design-master | comms_main.m | .m | matlab-spacecraft-design-master/Comms/comms_main.m | 2,749 | utf_8 | bc3d0cd9dacf1d6bb5eb7ddf9f0d085a | %% Inputs
function [comms]=comms_main(drymass,dataperday,h,inc,lifetime)
%GS: Ground station type ('NEN', 'TDRSS', 'MOBILE')
paramscomms.GS='NEN';
%GS_name: Ground station names ('Wallops', 'WhiteSands', 'McMurdo','Solna')
paramscomms.ngs=1;
paramscomms.GS_name={'Wallops','WhiteSands','Solna'};
[num,txt,rawTim... |
github | seakers/matlab-spacecraft-design-master | LV_selection.m | .m | matlab-spacecraft-design-master/LV/LV_selection.m | 1,396 | utf_8 | 583c1dd06d9f8a46974675b1832dc62b | function LV = LV_selection(mission,structures)
LVData = GetLVData();
n1 = length(LVData);
index = [];
% See which launch vehicles fit the satellite
for i = 1:n1
if structures.width < LVData(i).diameter && structures.height < LVData(i).height
index = [index,i];
end
end
% Select only the launch vehicles... |
github | hitsjt/BetaShapeMachine-master | dl_cluster.m | .m | BetaShapeMachine-master/Code/FineGrainedClassification/dl_cluster.m | 1,839 | utf_8 | c2bf520119320cb92a91a445bc98974f | function dl_cluster(data_path, num_clusters)
% dl_cluster('C:/Users/V/Desktop/BetaShapeMachine/Data/airplane_gt_new', 10);
% fighter jets: 1-2
% second world war: 1
% commercial (engines wing): 1
% commercial (engines back): 1
% commercial (prop. engines wing): 1
% UAVs: 1
% other: 1-2
% dl_cluster('C:/Users/V/Desk... |
github | hitsjt/BetaShapeMachine-master | dl_nn.m | .m | BetaShapeMachine-master/Code/FineGrainedClassification/dl_nn.m | 6,733 | utf_8 | 305b2ba8c1cde444daa991f0c836e804 | function dl_nn(data_path)
% dl_nn('C:/Users/V/Desktop/BetaShapeMachine/Data/airplane_gt_new');
% dl_nn('C:/Users/V/Desktop/BetaShapeMachine/Data/chair_large');
% dl_nn('C:/Users/V/Desktop/BetaShapeMachine/Data/bike_large');
% dl_nn('C:/Users/V/Desktop/BetaShapeMachine/Data/helicopters_large');
X = load( sprintf('%s/de... |
github | hitsjt/BetaShapeMachine-master | faceNormals.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/faceNormals.m | 499 | utf_8 | ae7c9e2bcbcee9fedee9329ceb183ef4 | % NORMALS Compute face and vertex normals
function mesh = faceNormals(mesh)
% Face Normals
% cross product of edges (vertices are specified counterclockwise)
% If face is made up of points P1, P2 and P3, the face normal is the unit
% vector parallel to (P2 - P1) x (P3 - P1)
mesh.Nf = zeros(4, size(mesh.F,2));
mesh... |
github | hitsjt/BetaShapeMachine-master | registerFaceEFM.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/registerFaceEFM.m | 1,134 | utf_8 | fe2438ce82fc253d49a5bb44f013f137 | function [mesh, dup, prob] = registerFaceEFM(mesh, i, dup, prob)
F = sort(mesh.F(:,i));
if nargin < 3
dup = false(size(mesh.F,2),1);
end
[mesh, dup, prob] = registerToEdge(mesh, F(1),F(2), i, dup, prob);
[mesh, dup, prob] = registerToEdge(mesh, F(2),F(3), i, dup, prob);
[mesh, dup, prob] = registerToEdge(mesh, F(... |
github | hitsjt/BetaShapeMachine-master | patchFittingCurvature.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/patchFittingCurvature.m | 5,577 | utf_8 | 3a937fafde51c47cd21f4c7c8d35d6da | function mesh = patchFittingCurvature(mesh, method)
% complete this function to compute principal curvatures,
% mean curvature, and Gaussian curvature for the input mesh
% input: mesh structure from 'loadObj' or 'createTestSurface' functions
% output: values in fields mesh.GK1, mesh.GK2, mesh.GMK, mesh.GGK
% mesh.GK1 ... |
github | hitsjt/BetaShapeMachine-master | surfacePriorSmoothing.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/surfacePriorSmoothing.m | 3,185 | utf_8 | dbb439b4b9c6357ebb0fffdd5a432d31 | function mesh = surfacePriorSmoothing(mesh, iterations, lambda)
mesh = taubinSmoothing(mesh, 2, 0.9, -1.0);
mesh.V = double(mesh.V);
W = eye(3) * lambda;
mesh.originalV = mesh.V;
mesh = normals(mesh);
mesh = faceAdjacencyMatrix(mesh);
mesh.adjF = [];
for k=1:size(mesh.F, 2)
adjF = find( mesh.FaceAdj(k, :) );
f... |
github | hitsjt/BetaShapeMachine-master | meshSubdivide.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/meshSubdivide.m | 1,554 | utf_8 | 3408765b637df064e7791c5c2c60348d | function mesh = meshSubdivide(mesh,n)
if nargin < 2
n = 1;
end
if n <= 0 || fix(n) ~= n
error('Argument n must be an integer number of subdivision steps.')
end
for k = 1:n
mesh = meshSubdivide1(mesh);
end
end
% -------------------------------------------------------------------------
function mesh = mes... |
github | hitsjt/BetaShapeMachine-master | MeyerCurvature.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/MeyerCurvature.m | 4,351 | utf_8 | c09780369590e589a34cb1a2640f4b5c | function mesh = MeyerCurvature(mesh)
if ~isfield(mesh, 'EFM1') || ~isfield(mesh, 'EFM2')
disp('Computing Edge-Face Matrix...')
mesh = getEdgeFaceMatrix(mesh);
end
if ~isfield(mesh, 'Nv')
disp('Computing vertex normals...');
mesh = vertexNormals(mesh);
end
if ~isfield(mesh, 'Adj')
disp('Computing ... |
github | hitsjt/BetaShapeMachine-master | VCurvature.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/VCurvature.m | 8,678 | utf_8 | fb9ce89d0414d2ee523bbe8ab29cdba2 | function mesh = VCurvature(mesh)
% one-ring curvature operator based on the siggraph paper
% RESULTS STORED IN MESH.BK1, mesh.BK2, mesh.BMK and mesh.BGK
mesh = normals(mesh);
if ~isfield(mesh, 'Fa')
disp('Computing face areas...');
mesh = faceAreas(mesh);
end
if ~isfield(mesh, 'Adj')
disp('Computing vert... |
github | hitsjt/BetaShapeMachine-master | unregisterFaceEFM.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/unregisterFaceEFM.m | 551 | utf_8 | 976bb01ed8fb7af518126ba6bb79e239 | function mesh = unregisterFaceEFM(mesh, i)
F = sort(mesh.F(:,i));
mesh = unregisterFromEdge(mesh,F(1),F(2), i);
mesh = unregisterFromEdge(mesh,F(2),F(3), i);
mesh = unregisterFromEdge(mesh,F(1),F(3), i);
% -------------------------------------------------------------------------
function mesh = unregisterFromEdge(me... |
github | hitsjt/BetaShapeMachine-master | loadMesh.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/loadMesh.m | 7,623 | utf_8 | 36d8f4100807580bf4cc289f2b9c449b | function [mesh labels labelsmap] = loadMesh(filestr, labels, labelsmap)
if nargin == 1
labels = {};
labelsmap = {};
end
if nargin == 2
labelsmap = {};
end
fprintf(1, '\nReading %s..\n', filestr);
file = fopen( strtrim( filestr ), 'rt');
if file == -1
warning(['Could not open mesh file: ' filestr]);... |
github | hitsjt/BetaShapeMachine-master | emgm.m | .m | BetaShapeMachine-master/Code/matlab/mesh_toolbox/EM/emgm.m | 3,136 | utf_8 | 132d5a3f18868e52920d9bf9127e5493 | function [label, model, llh] = emgm(X, init, maxiter, model)
% Perform EM algorithm for fitting the Gaussian mixture model.
% X: d x n data matrix
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k)
% Written by Michael Chen (sth4nth@gmail.com).
%% initialization
if maxiter == -1
[R, llh] = exp... |
github | robert-richardson/EKF-Impedance-2D-Temperature-master | func_measure_nl.m | .m | EKF-Impedance-2D-Temperature-master/Functions/Kalman_Filter/func_measure_nl.m | 1,006 | utf_8 | 578c567ccbc5447059006730298ace82 | function [ f ] = func_measure_nl( f, i, Zm, p )
%FUNC_MEASURE Measurment update for non-linear measurement function.
% EKF using Imaginary Impedance measurement input
f.P = f.A_d*f.P*f.A_d' + f.Q; % prediction update covariance
H_x = func_Jacobian(f,p,i);
K = (H_x*f.P*H_x'+f.R)\(f.P*H_x'); ... |
github | RaziEldeen/multi-armed-bandit-master | Egreedy.m | .m | multi-armed-bandit-master/Egreedy.m | 727 | utf_8 | 3dc8cbc12efde9b4edef8abbbe173ad8 |
function [As,R]= Egreedy(N,meu,epsilon)
% N = number of plays
% meu = actual reward for each bandit
% As= action selected on play j, j=1:N
% Q = reward estimate for each bandit
% R = an N*1 vector , the element j of the vector contains the reward at play number j
numbandits=length(meu);
ActNum = zeros(numban... |
github | wangmaoCS/oxford_RANSAC_LBP-master | desc_postprocess_iccv2013.m | .m | oxford_RANSAC_LBP-master/desc_postprocess_iccv2013.m | 561 | utf_8 | fc5a070620a4d031a12da418bcf54e1d | % Apply some post-processing operations
%
% Usage: [X Xm] = desc_postprocess (X, Xm)
%
% X descriptors
% Xm mean descriptor after root-SIFT and L2 normalization
function [X, Xm] = desc_postprocess_iccv2013 (X, Xm)
X = single (X); %out of memory
X = X.^0.5; % Root-SIFT
X = yael_vecs_normalize (X); ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | compute_map_select.m | .m | oxford_RANSAC_LBP-master/compute_map_select.m | 2,035 | utf_8 | 841459a888528a48b57e94093b4aa109 | % This function computes the mAP for a given set of returned results.
%
% Usage: map = compute_map (idx, gnd);
%
% idx ranked list of images
% gnd ground truth structure with ok and junk image ids
% map computed mAP
% aps separate ap for each query image
% Notes:
% 1) ranks starts from 1
funct... |
github | wangmaoCS/oxford_RANSAC_LBP-master | disp_match_features_vgg.m | .m | oxford_RANSAC_LBP-master/disp_match_features_vgg.m | 2,979 | utf_8 | ff3a03449b6c856249c617662930a1a3 | function disp_match_features_vgg(img1,img2,feat1,feat2,match_points)
%
%Displays affine regions on the image
%
%disp_features(file1,imf1,dx,dy)
%
%file1 - 'filename' - ASCII file with affine regions
%imf1 - 'filename'- image
%dx - shifts all the regions in the image by dx
%dy - shifts all the regions in the image by ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_pv_from_pm.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_pv_from_pm.m | 310 | utf_8 | c506df610aaf9c977e6464a727bc11a5 | % L = vgg_line3d_pv_from_pm(G) Conversion of Pluecker matrix to Pluecker vector 3d line representation.
%
% G ... double(4,4), skew-symmetric Pluecker matrix
% L ... double(1,6), Pluecker vector
% T.Werner
function L = vgg_line3d_pv_from_pm(G)
L = [G(1:3,4); vgg_contreps(G(1:3,1:3))']';
return |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_H_from_x_nonlin.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_H_from_x_nonlin.m | 1,766 | utf_8 | 975f485d6aac8bd04e149a78c629a17f | function [H,rms] = vgg_H_from_x_nonlin(H_initial,p1,p2)
% [H,rms] = vgg_H_from_x_nonlin(H_initial,xs1,xs2)
%
% Compute H using non-linear method which minimizes Sampson's approx to
% geometric reprojection error (see Hartley & Zisserman Alg 3.3 page 98 in
% 1st edition, Alg 4.3 page ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_F_from_P.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_F_from_P.m | 697 | utf_8 | 6380e7f6f42bb24f9e45ed0954e38a3f | %F = vgg_F_from_P(P) Compute fundamental matrix from two camera matrices.
% P is cell (2), P = {P1 P2}. F has size (3,3). It is x2'*F*x1 = 0
%
% Overall scale of F is unique and such that, for any X, P1, P2, it is
% F*x1 = vgg_contreps(e2)*x2, where
% x1 = P1*X, x2 = P2*X, e2 = P2*C1, C1 = vgg_wedge(P1).
... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_KR_from_P.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_KR_from_P.m | 853 | utf_8 | 10fb36cab617c6ac5a62c1c95dd50d63 | %VGG_KR_FROM_P Extract K, R from camera matrix.
%
% [K,R,t] = VGG_KR_FROM_P(P [,noscale]) finds K, R, t such that P = K*R*[eye(3) -t].
% It is det(R)==1.
% K is scaled so that K(3,3)==1 and K(1,1)>0. Optional parameter noscale prevents this.
%
% Works also generally for any P of size N-by-(N+1).
% ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_selfcalib_qaffine.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_selfcalib_qaffine.m | 4,575 | utf_8 | f71f15b70c022aaabe933cd54890d0ad | % vgg_selfcalib_qaffine Upgrading projective to quasi-affine reconstruction.
%
% Given projective reconstruction [P,X] with correct signs of P and X
% (the output of vgg_signsPX_from_x), it finds homography H transforming
% [P,X] to quasi-affine reconstruction [Pq,Xq] = [P*inv(H),H*X].
% Let Ainf=[0 0 0 1] be pla... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_X_from_xP_lin.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_X_from_xP_lin.m | 1,095 | utf_8 | 81a7771dabb46e6074b13ade0ad2a66f | %vgg_X_from_xP_lin Estimation of 3D point from image matches and camera matrices, linear.
% X = vgg_X_from_xP_lin(x,P,imsize) computes projective 3D point X (column 4-vector)
% from its projections in K images x (2-by-K matrix) and camera matrices P (K-cell
% of 3-by-4 matrices). Image sizes imsize (2-by-K ma... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_plane_from_2P_H.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_plane_from_2P_H.m | 738 | utf_8 | c4f1c110d184164985ba011c67fd869e | % A = vgg_plane_from_2P_H(P1,P2,H) From two cameras and inter-image homography, it gets the scene plane.
%
% The method is linear and there is no preconditioning - works only for consistent triplet (P1,P2,H).
%
% P1, P2 ... double (3,4)
% H ... double (3,3)
% A ... double (4,1)
%
% It is H = P2*vgg_H_from_2P_p... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_pv_from_XY.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_pv_from_XY.m | 722 | utf_8 | e05d8f5d14296e5923b18024f6152df9 | % L = vgg_line3d_pv_from_XY(X,Y) Pluecker vector 3d line from two 3d points.
%
% Syntax: L = vgg_line3d_pv_from_XY(X,Y) or
% L = vgg_line3d_pv_from_XY(XY)
%
% X, Y ... size (4,N), 3D points
% XY ... size (4,2*N), XY stacked as XY = [X1 Y1 ... XN YN].
% L ... size (N,6), Pluecker vector(s) of 3D line(s... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_fit_hplane_to_x.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_fit_hplane_to_x.m | 930 | utf_8 | 751d7123de9832783cc1a79dd8cd5479 | % vgg_fit_hplane_to_x Fitting hyperplane to set of points.
%
% SYNOPSIS
% [A,e] = vgg_fit_hplane_to_x(s), where
%
% s ... double(N+1,N+1), inv. covariance matrix s = x'*x, the columns of which
% are (N+1)-vectors of homog. coordinates of points in N-space (s(end,:)==1)
% A ... double(1,N+1), fitted hyperplane... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_F_from_7pts_2img.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_F_from_7pts_2img.m | 1,509 | utf_8 | c746c7d6443fd85d50b660f0be1f88ba | %vgg_F_from_7pts_2img Computes fundamental matrix from 7 points across 2 images.
%
% [P,X] = vgg_F_from_7pts_2img(x), where
% x ... double(3,7,2) or cell{2} of double(3,7), 7 homogeneous points in 2 images
% F ... double(3,3), fundamental matrix
% There are 0 to 3 solutions for F. Solutions are prun... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_X_from_xP_nonlin.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_X_from_xP_nonlin.m | 1,745 | utf_8 | de8473e8b82ea73502176fcd3eac4865 | %vgg_X_from_xP_nonlin Estimation of 3D point from image matches and camera matrices, nonlinear.
% X = vgg_X_from_xP_lin(x,P,imsize) computes max. likelihood estimate of projective
% 3D point X (column 4-vector) from its projections in K images x (2-by-K matrix)
% and camera matrices P (K-cell of 3-by-4 matrices)... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_pm_from_pv.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_pm_from_pv.m | 310 | utf_8 | dcbfc96b9057f80afd0af449b51a43a1 | % G = vgg_line3d_pm_from_pv(L) Conversion of Pluecker vector to Puecker matrix 3d line representation.
%
% L ... double(1,6), Pluecker vector of the 3d line
% G ... double(4,4), Puecker matrix
% T.Werner
function G = vgg_line3d_pm_from_pv(L)
G = [vgg_contreps(L(4:6)) L(1:3)'; -L(1:3) 0];
return |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_pv_from_2planes.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_pv_from_2planes.m | 584 | utf_8 | f0afc682caee6ff87d148c9506f3121b | % L = vgg_line3d_pv_from_2planes(A,B) Pluecker vector of 3d line met by two planes.
%
% Syntax: L = vgg_line3d_pv_from_2planes(A,B) or
% L = vgg_line3d_pv_from_2planes(AB)
%
% A, B ... size (N,4), 3d planes
% AB ... size (2*N,4), N pairs of 3d planes. It is AB = [A1; B1; A2; B2; ... ; AN; BN].
% L ... s... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_signsPX_from_x.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_signsPX_from_x.m | 4,005 | utf_8 | c7d5a18241488c1ca8ba5104eee36964 | % [P,X] = vgg_signsPX_from_x(P,X,x) Finds signs of P and X in a projective reconstruction.
%
% Given a projective reconstruction, i.e. P, X, and x such that
% s_n^k x_n^k = P^k X_n,
% where
% - P^k is k-th camera matrix
% - X_n is n-th scene point
% - x_n^k is image projection of X_n in camera P^k
% ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_Ppv.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_Ppv.m | 706 | utf_8 | 397d6699a9971df4388cfd206bc27f97 | % Q = vgg_line3d_Ppv(P) Transforms a camera matrix to use it with Pluecker vector 3d line representation.
%
% P ... double(3,4), ordinary camera matrix
% Q ... double(6,3), transformed camera matrix (quadratic function of elements of P)
% such that the projection of a 3d line by the camera is given by
%
% ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_XY_from_pm.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_XY_from_pm.m | 452 | utf_8 | dc2d6dc79e1ab6a73f12d3c7f663d6b2 | % XY = vgg_line3d_XY_from_pm(L) Converts Pluecker matrix 3d line to a pair of homogeneous 3d points.
%
% L ... double(4,4), skew-symmetric Pluecker matrix of 3d line
% XY ... double(4,2), pair of 3d points spanning the line, in homogen. coordinates
%
% XY are obtained by svd, their homogeneous vectors are mutuall... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_poly3d_orthorectify.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_poly3d_orthorectify.m | 3,268 | utf_8 | 10d4aa22d3379d53ac398daed4a66a6b | %vgg_poly3d_orthorectify Frontoparallel rectification of image of 3D polygon.
% [H,imsize] = vgg_poly3d_orthorectify(Q,u) finds homography H that
% removes perspective distortion of image Q*hom(u) of a 3D polygon. Parameters:
% u ... double(2,N), inhomog. coordinates of polygon vertices measured in an ortho... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_P_from_F.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_P_from_F.m | 424 | utf_8 | 9f421887ea84dc943f597969f47e9483 | %P = vgg_P_from_F(F) Compute cameras from fundamental matrix.
% F has size (3,3), P has size (3,4).
%
% If x2'*F*x1 = 0 for any pair of image points x1 and x2,
% then the camera matrices of the image pair are
% P1 = eye(3,4) and P2 = vgg_P_from_F(F), up to a scene homography.
% Tomas Werner, Oct 2001
... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_T_from_P.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_T_from_P.m | 1,010 | utf_8 | 89c7a744dccc81dbc0a54df89e7c255f | % T = vgg_T_from_P(P) Trifocal tensor from 3 camera matrices.
%
% P ... cell (3), camera matrices
% T ... double (3,3,3)
%
% For 3 corresponding lines l1..l3 (each of size (1,3)) in cameras P1..P3 it is
% for i=1:3, l1(1,i) = l2*T(:,:,i)*l3'; end
% up to scale.
%
% T is obtained by with unique absolu... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_from_lP_nonlin.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_from_lP_nonlin.m | 11,456 | utf_8 | b812873d65b6ae35261f412d8a022e14 | % vgg_line3d_from_lP_nonlin Non-linear estimation of (possibly constrained) 3D line segment from image line segments.
%
% SYNOPSIS
% L = vgg_line3d_from_lP_nonlin(s,P [,imsize] [,L0] [,X] [,nonlin_opt])
%
% s ... cell(K) of double(3,3), inv. covariance matrices of the K image line segments:-
% - If the segment... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_selfcalib_metric_vansq.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_selfcalib_metric_vansq.m | 3,599 | utf_8 | dfec9ad31ae420f250fc7845e5a33102 | % vgg_selfcalib_metric_vansq Metric selfcalibration from 3 orthogonal principal directions and square pixels.
%
% DESCRIPTION
% Given projective camera matrices P and 3 scene points V, it computes 3D-to-3D
% homography H which upgrades the old reconstruction to metric one, i.e.,
% differing from the true one only... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_from_lP_lin.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_from_lP_lin.m | 1,629 | utf_8 | bd8090dc9d71f4476773760a1e035668 | % vgg_line3d_linear Linear estimation of 3d line from image lines and camera matrices.
%
% SYNOPSIS
% L = vgg_line3d_from_lP_lin(s,P [,imsize]), where
%
% s ... cell(K) of double(3,3), inv. covariance matrices of the K image line segments:-
% - If the segments are estimated from edges, it is s(:,k) = x*x',
% ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_PX_from_6pts_3img.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_PX_from_6pts_3img.m | 5,025 | utf_8 | 1ee6156b2ac44f778d4958f453d0eb5e | function [P,X] = vgg_PX_from_6pts_3img(x1,x2,x3)
% vgg_PX_from_6pts_3img Computes camera matrices and world points
% from 6 points across 3 images.
%
% [P,X] = vgg_PX_from_6pts_3img(x), where
% x ... double(3,6,3) or cell{3} of double(3,6), 6 homogeneous points in 3 images
% P ... double(3,4,3), P(:... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_H_from_P_plane.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_H_from_P_plane.m | 768 | utf_8 | 2f3af6a75d064bf889a8ab4118f7d2c5 | % vgg_H_from_P_plane Given 3D plane and camera, returns 4-by-3 matrix mapping image points to points on the plane.
%
% H = vgg_H_from_P_plane(A,P), where
% A ... size (4,1), scene plane
% P ... size (3,4), camera matrix
% H ... size (4,3), matrix such that X = x*H, where x (size (3,1)) is an image point
% ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_line3d_XY_from_pv.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/vgg_line3d_XY_from_pv.m | 402 | utf_8 | 13142cdb3af2b92197eb408f4bbe1ff8 | % XY = vgg_line3d_XY_from_pv(L) Converts Pluecker vector 3d line to a pair of homogeneous points.
%
% L ... double(1,6), Pluecker vector
% XY ... double(4,2), pair of 3d points spanning the line
%
% XY are obtained by svd, their homogeneous vectors are mutually orthogonal.
% T.Werner
function XY = vgg_line3... |
github | wangmaoCS/oxford_RANSAC_LBP-master | vgg_singF_from_FF.m | .m | oxford_RANSAC_LBP-master/vgg_multiview/private/vgg_singF_from_FF.m | 769 | utf_8 | 7880d3aef3030b7b8aa76f889080ff07 | %VGG_SINGF_FROM_FF Linearly combines two 3x3 matrices to a singular one.
%
% a = vgg_singF_from_FF(F) computes scalar(s) a such that given two 3x3 matrices F{1} and F{2},
% it is det( a*F{1} + (1-a)*F{2} ) == 0.
function a = vgg_singF_from_FF(F)
% precompute determinants made from columns of F{1}, F{2}
... |
github | wangmaoCS/oxford_RANSAC_LBP-master | config.m | .m | oxford_RANSAC_LBP-master/utils/config.m | 1,892 | utf_8 | 81ffee28c754dab6242a826242ec5c3c | function cfg = config (params)
% default parameters
cfg.k = 16;
cfg.desc_d = 128; % dimensionality of the descriptor (on disk)
cfg.desc_dd = 128; % dimensionality after PCA
cfg.geom_d = 4; % dimensionality of geometry information
cfg.lopt = '';
cfg.desc_nlearn = 5000000; % number of descripto... |
github | wangmaoCS/oxford_RANSAC_LBP-master | config_paris.m | .m | oxford_RANSAC_LBP-master/utils/config_paris.m | 1,327 | utf_8 | 698b94d4e5ca444ffbbff1a98c5ff84c | % Return a config object that contains all the paths for the paris dataset
% as well as the groundtruth
function cfg = config_paris (params)
% Default parameters
cfg = config (params);
cfg.desc_nlearn = 5000000;
% Load groundtruth
cfg.gnd_fname = [cfg.dir_data 'gnd_paris6k.mat'];
load (cfg.gnd_fname); %... |
github | wangmaoCS/oxford_RANSAC_LBP-master | fvecs_write.m | .m | oxford_RANSAC_LBP-master/utils/fvecs_write.m | 635 | utf_8 | 69a30552f6ea46eddf3605642048b76b | % This function reads a vector of float vectors
%
% Usage: fvecs_write (filename, v)
% where v is a set of vector (stored columnwise)
function fvecs_write (filename, v)
% open the file and count the number of descriptors
fid = fopen (filename, 'wb');
d = size (v, 1);
n = size (v, 2);
for i = 1:n
% first write... |
github | wangmaoCS/oxford_RANSAC_LBP-master | crop_query.m | .m | oxford_RANSAC_LBP-master/utils/crop_query.m | 339 | utf_8 | 8e5ea3655324da535e3c43a6c9fb5361 | % Crop features inside a bounding box
% Usage: [idx] = crop_query (bbx, xy)
% bbx bounding box coordinates
% xy coordinates of the feature position
% idx indices of features inside the bounding box
function idx = crop_query (bbx, xy)
idx = find( xy(1, :)>=bbx(1) & xy(1, :)<=bbx(3) & xy(2, :)>=bbx(2) & xy... |
github | wangmaoCS/oxford_RANSAC_LBP-master | yael_pca.m | .m | oxford_RANSAC_LBP-master/utils/yael_pca.m | 1,664 | utf_8 | b3a27d863d6771cfe89e7502a82d2812 | % PCA with automatic selection of the method: covariance or gram matrix
% Usage: [X, eigvec, eigval, Xm] = pca (X, dout, center, verbose)
% X input vector set (1 vector per column)
% dout number of principal components to be computed
% center need to center data?
%
% Note: the eigenvalues are given in ... |
github | wangmaoCS/oxford_RANSAC_LBP-master | desc_postprocess.m | .m | oxford_RANSAC_LBP-master/utils/desc_postprocess.m | 812 | utf_8 | 4834e2bd5ec71b85c25785be7e323f91 | % Apply some post-processing operations
% Usage: x = desc_postprocess (x)
% x descriptors
% nr_thres optional. Filter descriptors based on norm (0 does nothing)
% desc_mean optional. Remove the mean
function [x, desc_mean, nin, nout] = desc_postprocess (x, nr_thres, desc_mean)
nin = size(x, 2);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.