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 | mc225/Softwares_Tom-master | correctShear.m | .m | Softwares_Tom-master/LightSheet/correctShear.m | 705 | utf_8 | f64b7fdc0a6df81e26117d8162d9573d | % correctedDataCube=correctShear(dataCube,shearFactor)
%
% dataCube: a three-dimensional matrix
% shearFactor: the shear to be undone in units of pixels for the first and second dimension, respectively.
function dataCube=correctShear(dataCube,shearFactor)
if (~isempty(shearFactor) && ~all(shearFactor==0))
l... |
github | mc225/Softwares_Tom-master | lightSheet3DShapeSimulation.m | .m | Softwares_Tom-master/LightSheet/lightSheet3DShapeSimulation.m | 5,746 | utf_8 | e8d3642b3c622cb2fa641586beb5c172 | function lightSheet3DShapeSimulation()
close all;
outputFolderName=[pwd(),'/'];
stepSize=[1 1 1]*.1e-6;
%
% Create figures
%
colorMap=jet(1024);
% colorMap=interpolatedColorMap(1024,[.5 1 .5; .5 .5 1; 0 0 1; 1 1 0; 1 0 0],[0 0.25 .5 .75 1]);
% colorMap=hot(1024);
... |
github | mc225/Softwares_Tom-master | displayDataCubeSlices.m | .m | Softwares_Tom-master/LightSheet/displayDataCubeSlices.m | 35,999 | utf_8 | 888aa32cd3de3dbc6c680870bcff7db8 | function displayDataCubeSlices(folderNames)
close all;
if (nargin<1 || isempty(folderNames))
% folderNames='Z:\RESULTS\2013-05-14_cellspheroidsWGA\2013-05-14_cellspheroidsWGA_nofilter_ap1-3\cropped'; % Cell cluster section at -27.5um
% % folderNames='Z:\RESULTS\2013-05-14_cellspheroidsWGA\2013-... |
github | mc225/Softwares_Tom-master | copyMatFilesOnly.m | .m | Softwares_Tom-master/LightSheet/copyMatFilesOnly.m | 2,403 | utf_8 | 720bb47b2fa9577991dbb81890e7a856 | % copyMatFilesOnly(sourceFolder,targetFolder)
%
% Copies only the .mat files and removes the date-time folders, combining everything into the parent folder.
%
function status=copyMatFilesOnly(sourceFolder,targetFolder)
if nargin<1 || isempty(sourceFolder)
sourceFolder=uigetdir(pwd(),'Select Source Folder...... |
github | mc225/Softwares_Tom-master | simulateAiryAndBesselSI.m | .m | Softwares_Tom-master/LightSheet/simulateAiryAndBesselSI.m | 9,858 | utf_8 | e500dee14c2547d5c544bcbd4f8e6a1a | %
%
%
function [sample xRange yRange zRange]=simulateAiryAndBesselSI()
alpha=7;
beta=5/100;
xRange=single([-25:.15:25]*1e-6); % propagation
yRange=single([-20:.15:20]*1e-6); % swipe
zRange=single([-21:.15:21]*1e-6); % scan
config=struct();
config.excitation=struct();
config.exc... |
github | mc225/Softwares_Tom-master | previewLightSheetRecordings.m | .m | Softwares_Tom-master/LightSheet/previewLightSheetRecordings.m | 4,212 | utf_8 | 54901b2af67bbac18cf1165fc26d700c | %
% previewLightSheetRecordings(folders)
%
% Calls previewLightSheetRecording repeatedly
%
function previewLightSheetRecordings(folderNames,destinationEmails)
if (nargin<1 || isempty(folderNames))
folderNames={'H:\RESULTS\2013-11-27\Amphioxus'};
% folderNames={'H:\RESULTS\2013-11-27\Zebra fish','H:\RES... |
github | mc225/Softwares_Tom-master | deconvolveRecordedImageStack.m | .m | Softwares_Tom-master/LightSheet/deconvolveRecordedImageStack.m | 8,273 | utf_8 | 8c3ebf6ff4d3aa1207bbd66184ddea0a | % [restoredDataCube lightSheetDeconvFilter lightSheetOtf ZOtf xRange,yRange,zRange tRange lightSheetPsf]=deconvolveRecordedImageStack(recordedImageStack,config)
%
% recordedImageStack: The recorded values [x y z]=[down right back]
% config: a light sheet microscope set-up configuration file, including the wavelengths a... |
github | mc225/Softwares_Tom-master | createResolutionPlot.m | .m | Softwares_Tom-master/LightSheet/createResolutionPlot.m | 6,629 | utf_8 | 172b08ac5b385c30f5181b644fc70966 | function createResolutionPlot(inputFolder)
% close all;
% beamTypes={'Gaussian','Airy'};
if nargin<1 || isempty(inputFolder)
% inputFolder='C:\Users\Tom\Dropbox\AirySheetData\FWHMs\forwardscans2';
% inputFolder='C:\Users\Tom\Dropbox\AirySheetData\FWHMs\forwardscans';
% inpu... |
github | mc225/Softwares_Tom-master | plotFieldOfViewWidthAndAxialResolutionVersusNA.m | .m | Softwares_Tom-master/LightSheet/plotFieldOfViewWidthAndAxialResolutionVersusNA.m | 8,351 | utf_8 | f4eb96474608903a149d69fba59c96a2 | % [numericalApertures,FOVWidths,axialResolutions]=plotFieldOfViewWidthAndAxialResolutionVersusNA(refractiveIndex,wavelength)
%
% Calculates the field of view and axial resolution of a light sheet microscope as a function of the illumination NA.
%
% All SI units.
%
function [numericalApertures,FOVWidths,axialResolutions... |
github | mc225/Softwares_Tom-master | extractSubVolumeThenProject_2Colors.m | .m | Softwares_Tom-master/LightSheet/extractSubVolumeThenProject_2Colors.m | 2,408 | utf_8 | ae6e05fdafcae2535c8b4859b603461f | % Takes a subvolume out of corresponding red and green datacubes, makes a
% maximum intensity projection of the 2 subvolumes, applies the
% corresponding colormaps to the data and combines in a 3-colour image.
% Can also output the normalisation factors used to allow the same
% normalisation to be used across multi... |
github | mc225/Softwares_Tom-master | compareBeamProfiles.m | .m | Softwares_Tom-master/LightSheet/compareBeamProfiles.m | 18,256 | utf_8 | ed79ad33dfda4e0606a2269708108d80 | %
%
function compareBeamProfiles()
close all;
config=struct();
config.excitation=struct();
config.excitation.objective=struct();
config.excitation.objective.refractiveIndex=1.00;
config.excitation.objective.numericalAperture=0.42;
config.excitation.objective.magnification=20;
confi... |
github | mc225/Softwares_Tom-master | processCapillaryLightSheetVideos.m | .m | Softwares_Tom-master/LightSheet/processCapillaryLightSheetVideos.m | 9,147 | utf_8 | 5026d17a78cc88cb105294590ac086cc | % processCapillaryLightSheetVideos(folderNames,reprocessData,centerOffset,scanShear,perspectiveScaling,gaussianIlluminationStd,beamAngle)
%
% Reads the recorded date, converts it the matrices and deconvolves.
%
% Input:
% folderNames: a string or cell array of strings indicating folders with avi and json files.
% ... |
github | mc225/Softwares_Tom-master | processLightSheetDataCube.m | .m | Softwares_Tom-master/LightSheet/processLightSheetDataCube.m | 17,786 | utf_8 | d051ac6eefc1099c0ee639467475c284 | % [restoredDataCubeI xRange yRange zRange tRangeExtended recordedImageStack tRange ZOtf lightSheetPsf lightSheetOtf lightSheetDeconvFilter]
% =processLightSheetDataCube(inputFileName,stageTranslationStepSize,excitation,detection,sample,detector,focusCoordinates,openFractionOfRadius,alpha,extraIntegrationTime,illumina... |
github | mc225/Softwares_Tom-master | calcLightSheetPsf.m | .m | Softwares_Tom-master/LightSheet/calcLightSheetPsf.m | 8,171 | utf_8 | 6a6916b89b6b3dff245f22059eca0c83 | % [psf psfTwoPhotonSwiped psfTwoPhotonCylindricalLens]=calcLightSheetPsf(xRange,yRange,zRange,tilt,excitation,alpha,openFractionOfRadius,refractiveIndexOfSample)
% Calculates the 2D intensity profile created by a swiped light-sheet.
%
% Inputs:
% tilt: a scalar indicating the tilt of the pupil, or thus the lateral
... |
github | mc225/Softwares_Tom-master | reconstructScannedImage.m | .m | Softwares_Tom-master/ImageScanningMicroscopy/reconstructScannedImage.m | 13,515 | utf_8 | d449dfb15afa816baa9459a6e591f87b | % [imageScanningImage xRangeOutputImg yRangeOutputImg]=reconstructScannedImage(inputImages,pixelPitch,magnification,outputFileName)
%
function [imageScanningImage xRangeOutputImg yRangeOutputImg]=reconstructScannedImage(inputImages,samplePositions,pixelPitch,magnification,outputFileName)
close all; % TODO: Remove t... |
github | mc225/Softwares_Tom-master | mainpart.m | .m | Softwares_Tom-master/OpticalEigenModes/mainpart.m | 8,988 | utf_8 | 9925c355a9196baf25c88edc2d95e695 | %%
function mainpart()
lgct=[];
%% new
%for na=namin:0.1:namax
na=0.65;
theta=asin(na);
prModes=probemodes(5,16,theta);
%% new end
lambda=0.8e-6;
q1=1.22*lambda/(2*na);%airy disk radius
qb=2.4*lambda/2/pi/sin(theta); %BB radius first zero
[x,y,z,t,nx,ny,nz,nt,ff]=probefield... |
github | mc225/Softwares_Tom-master | probemodes.m | .m | Softwares_Tom-master/OpticalEigenModes/probemodes.m | 3,315 | utf_8 | 6333da58fd1d9b68da4518baedffa662 | %%%
%type=1 bessel
% Row vectors for each mode containing:
% param(1)=omega %optical frequency :wavelength=2 pi c/(omega)
% param(2)=gamma %cone angle
% param(3)=pol %A polaraisation 1:vert; 2:horiz; 3:longi;
% param(4)=L %L number
% param(5)=n %index of refraction
function prmodes=probemodes(t... |
github | mc225/Softwares_Tom-master | savejson.m | .m | Softwares_Tom-master/ThirdPartyDependencies/jsonlab/savejson.m | 13,894 | utf_8 | e7cec5b8f38043b1b4c02348911ff07b | function json=savejson(rootname,obj,varargin)
%
% json=savejson(rootname,obj,filename)
% or
% json=savejson(rootname,obj,opt)
% json=savejson(rootname,obj,'param1',value1,'param2',value2,...)
%
% convert a MATLAB object (cell, struct or array) into a JSON (JavaScript
% Object Notation) string
%
% author: Qianqian Fa... |
github | mc225/Softwares_Tom-master | loadjson.m | .m | Softwares_Tom-master/ThirdPartyDependencies/jsonlab/loadjson.m | 15,312 | ibm852 | 54a5e8d8b39c77904a572c96f3df77a5 | function data = loadjson(fname,varargin)
%
% data=loadjson(fname,opt)
% or
% data=loadjson(fname,'param1',value1,'param2',value2,...)
%
% parse a JSON (JavaScript Object Notation) file or string
%
% authors:Qianqian Fang (fangq<at> nmr.mgh.harvard.edu)
% date: 2011/09/09
% Nedialko Krouchev: http:... |
github | mc225/Softwares_Tom-master | DataHash.m | .m | Softwares_Tom-master/ThirdPartyDependencies/DataHash/DataHash.m | 15,429 | utf_8 | e725a80cb9180de1eb03e47b850a95dc | function Hash = DataHash(Data, Opt)
% DATAHASH - Checksum for Matlab array of any type
% This function creates a hash value for an input of any type. The type and
% dimensions of the input are considered as default, such that UINT8([0,0]) and
% UINT16(0) have different hash values. Nested STRUCTs and CELLs are parsed
%... |
github | mc225/Softwares_Tom-master | poisson.m | .m | Softwares_Tom-master/ThirdPartyDependencies/poisson/poisson.m | 934 | utf_8 | 1df23401d580bc81ca94c8e6aac9f1b5 | function data = poisson(xm, seed)
%function data = poisson(xm, seed)
%
% Generate Poisson random vector with mean xm.
% For small, use poisson1.m
% For large, use poisson2.m
% see num. rec. C, P. 222
%
% Copyright 1997-4-29, Jeff Fessler, The University of Michigan
if nargin < 1, help(mfilename), error(mfilename), en... |
github | mc225/Softwares_Tom-master | cpu.m | .m | Softwares_Tom-master/ThirdPartyDependencies/poisson/cpu.m | 1,220 | utf_8 | 63fff9efef6377a81db14161edbf486d | function out = cpu(arg, varargin)
%function out = cpu(arg, varargin)
% cpu tic
% cpu toc
% cpu toc printarg
% work like tic/toc except they use cpu time instead of wall time.
% also:
% cpu etic
% cpu etoc
% for elapsed time
if nargin < 1, help(mfilename), error(mfilename), end
if streq(arg, 'test'), cpu_test, return,... |
github | mc225/Softwares_Tom-master | poisson2.m | .m | Softwares_Tom-master/ThirdPartyDependencies/poisson/poisson2.m | 1,274 | utf_8 | cc7f650c26ba423cb63b682beb1c27e4 | function data = poisson2(xm, seed)
%function data = poisson2(xm, seed)
% Generate Poisson random column vector with mean xm.
% Uses rejection method - good for large values of xm.
% See "Numerical Recipes in C", P. 222.
if nargin < 2, help(mfilename), error(mfilename), end
if isvar('seed') & ~isempty(seed)
rand('st... |
github | mc225/Softwares_Tom-master | dftregistration.m | .m | Softwares_Tom-master/ThirdPartyDependencies/efficient_subpixel_registration/dftregistration.m | 8,250 | utf_8 | 93265582c4fb73f52c4000db5038f40f | % function [output Greg] = dftregistration(buf1ft,buf2ft,usfac);
%
% Efficient subpixel image registration by crosscorrelation. This code
% gives the same precision as the FFT upsampled cross correlation in a
% small fraction of the computation time and with reduced memory
% requirements. It obtains an initial estimat... |
github | mc225/Softwares_Tom-master | tutorial_filters.m | .m | Softwares_Tom-master/ThirdPartyDependencies/plot2svg/tutorial_filters.m | 5,536 | utf_8 | ef877466a3cde2e45877aa3976c3b92c | function tutorial_filters
file = 'matterhorn_small.jpg';
fig = figure;
set(fig, 'DefaultAxesFontName', 'Arial')
set(fig, 'DefaultAxesFontSize', 6)
plotCounter = 1;
xPlots = 3;
yPlots = 4;
% a) Original plot with a line, patch, and text object
subplot(yPlots, xPlots, plotCounter)
plotCounter = plotCounter + 1;
h = creat... |
github | mc225/Softwares_Tom-master | recordImagePerWavelength.m | .m | Softwares_Tom-master/PrincipalComponentAnalysis/recordImagePerWavelength.m | 3,539 | utf_8 | 08c86de060c5e8d386822d22b45d3920 | % recordImagePerWavelength(sampledWavelengths,outputFolder,nbImagesPerWavelength)
%
% Function to record a series of speckle images for various sampledWavelengths
%
% sampledWavelengths: the range of sampledWavelengths (in meters)
% outputFolder: a string indicating where the data is to be saved. Default:
% ... |
github | mc225/Softwares_Tom-master | scanVoltages.m | .m | Softwares_Tom-master/PrincipalComponentAnalysis/scanVoltages.m | 5,341 | utf_8 | b90ef136aeea13d562314a19ada693d8 | % scanVoltages(voltages,outputFolder,nbImagesPerWavelength,laserStabilizationTime)
%
% Function to record a series of speckle images for various wavelengths
% automatically.
%
% voltages: the range of voltages to drive the Sacher laser
% outputFolder: a string indicating where the data is to be saved. Default:
% ... |
github | mc225/Softwares_Tom-master | determineWavelengthFromSpeckleImage.m | .m | Softwares_Tom-master/PrincipalComponentAnalysis/determineWavelengthFromSpeckleImage.m | 2,776 | utf_8 | f28b7e4b3758bfb5f0e441b836206000 | % [wavelength testImagesInPrincipleComponentSpace] = determineWavelengthFromSpeckleImage(img,calibration)
%
% Determines the wavelength corresponding to a speckle image given the
% calibration data.
%
% Inputs:
% img: a 2D image, or a 3D stack of speckle testImages
% calibration: a struct with calibration data
... |
github | mc225/Softwares_Tom-master | analyzeSpeckleImages.m | .m | Softwares_Tom-master/PrincipalComponentAnalysis/analyzeSpeckleImages.m | 7,432 | utf_8 | b7afb1ec12c2e26235734dcf7fd22e27 | % analyzeSpeckleImages(inputFolderName,outputFileName)
%
% inputFolderName: a string representing the input folder created by analyzeSpeckleImages.m
% outputFileName: the filename of the output .mat file.#
% Default: the same as the input folder.
%
function analyzeSpeckleImages(inputFolderName,outputFil... |
github | mc225/Softwares_Tom-master | testDisorderSpectrometer.m | .m | Softwares_Tom-master/SpeckleSpectrometer/testDisorderSpectrometer.m | 2,786 | utf_8 | dc177aec1ad2fe01958edbcf500e1f78 | %
%
function testDisorderSpectrometer(transferMatrix,wavelengths,cam,slm,source)
if (nargin<1)
logMessage('Please specify the transferMatrix!');
return;
end
if (nargin<2 || isempty(wavelengths))
nbWavelengths=[size(transferMatrix,3) size(transferMatrix,4)];
wavelengths=[500+[... |
github | mc225/Softwares_Tom-master | calibrateDisorderSpectrometer.m | .m | Softwares_Tom-master/SpeckleSpectrometer/calibrateDisorderSpectrometer.m | 5,646 | utf_8 | 1251a14260a2d949e0a73769113d7f78 | % calibrateSpectrometer(wavelengths,slm,cam,outputFileName)
%
%
function calibrateDisorderSpectrometer(wavelengths,slm,cam,source,outputFileName,emailsToNotify)
if (nargin<1 || isempty(wavelengths))
wavelengths=[550 650 600]*1e-9;
% Put them in a rectangle
factors=factor(numel(wavelengths))... |
github | mc225/Softwares_Tom-master | recordScannedWavelength.m | .m | Softwares_Tom-master/SpeckleSpectrometer/recordScannedWavelength.m | 5,350 | utf_8 | a2019dd9e1e9d8b21f48c320b5657800 | function recordScannedWavelength(wavelengths,slm,cam,source,outputFileName)
if (nargin<1 || isempty(wavelengths))
wavelengths=[500:1:700]*1e-9;
end
if (nargin<2 || isempty(slm))
slm=PhaseSLM(1); %Use the whole of display 1
slm.referenceDeflectionFrequency=[1/10 1/10];
end
if ... |
github | mc225/Softwares_Tom-master | calibrateAmplitude.m | .m | Softwares_Tom-master/SLMCalibration/calibrateAmplitude.m | 2,946 | utf_8 | 7a8671e841a487e10564b3aa4a14aec7 | %
% [graylevels,amplitudes]=calibrateAmplitude(slm,cam)
%
% This code is in a beta stage only!
%
% Attempts to measure the amplitude response for a Dual Head SLM.
%
% Input parameters:
% slm: the DualHeadSLM object to measure
% cam: the camera for the measurement
%
% Output parameters:
% graylevels: the measured gr... |
github | mc225/Softwares_Tom-master | calibrateAmplitudeInducedPhase.m | .m | Softwares_Tom-master/SLMCalibration/calibrateAmplitudeInducedPhase.m | 3,495 | utf_8 | 8e6f2ccda46d0ad39fff1f004fd03b0d | %
% [graylevels,phases]=calibrateAmplitudeInducedPhase(slm,cam)
%
% This code is in a beta stage only!
%
% Attempts to measure the phase error when doing amplitude modulation on a Dual Head SLM.
%
% Input parameters:
% slm: the DualHeadSLM object to measure
% cam: the camera for the measurement
%
% Output parameters... |
github | mc225/Softwares_Tom-master | estimateTwoPiEquivalent.m | .m | Softwares_Tom-master/SLMCalibration/estimateTwoPiEquivalent.m | 2,635 | utf_8 | a13759789434e2156382f5fea68e8eff | % [twoPiEquivalent slm]=estimateTwoPiEquivalent(slm,cam,probePos,probeSize)
%
% This code is in a beta stage only!
%
% Optimizes the mean intensity in the region of interest using direct search.
%
% Input parameters:
% slm: the SLM object to measure
% cam: the camera for the measurement
% probePos: the position ([bo... |
github | playerkk/map-words-faster-rcnn-master | classification_demo.m | .m | map-words-faster-rcnn-master/caffe-fast-rcnn/matlab/demo/classification_demo.m | 5,412 | utf_8 | 8f46deabe6cde287c4759f3bc8b7f819 | function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% Image classification demo using BVLC CaffeNet.
%
% IMPORTANT: before you run this demo, you should download BVLC CaffeNet
% from Model Zoo (http://caffe.berkeleyvision.org/model_zoo.html)
%
% *****... |
github | playerkk/map-words-faster-rcnn-master | voc_eval.m | .m | map-words-faster-rcnn-master/lib/datasets/VOCdevkit-matlab-wrapper/voc_eval.m | 1,332 | utf_8 | 3ee1d5373b091ae4ab79d26ab657c962 | function res = voc_eval(path, comp_id, test_set, output_dir)
VOCopts = get_voc_opts(path);
VOCopts.testset = test_set;
for i = 1:length(VOCopts.classes)
cls = VOCopts.classes{i};
res(i) = voc_eval_cls(cls, VOCopts, comp_id, output_dir);
end
fprintf('\n~~~~~~~~~~~~~~~~~~~~\n');
fprintf('Results:\n');
aps = [res(:... |
github | svndl/rcaBase-master | textExportToRca.m | .m | rcaBase-master/functions/textExportToRca.m | 9,408 | utf_8 | 44fabe2307c472b1ad3601606eb67d23 | function [cellData,indF,indB,noiseCell1,noiseCell2,freqLabels,binLabels,chanIncluded]=textExportToRca(pathname,dataType)
if nargin<2 || isempty(dataType), dataType='RLS'; fprintf('Using RLS. '); end;
if nargin<1, error('Path to datafiles is required'); end
if ~strcmp(pathname(end),'/'), pathname=cat(2,... |
github | svndl/rcaBase-master | selectDataForTraining.m | .m | rcaBase-master/functions/selectDataForTraining.m | 5,500 | utf_8 | ee35192a3b33549716213ec182ff17cc | function [signalDataSel,noise1Sel,noise2Sel,indFSel,indBSel,freqLabelsSel,binLabelsSel,trialsSel] = selectDataForTraining(sourceDataFileName,binsToUse,freqsToUse,condsToUse,trialsToUse)
%
% [signalData,noise1,noise2,indF,indB,,freqLabelsSel,binLevelsSel,trialsSel] = selectDataForTraining(sourceDataFileName,bi... |
github | svndl/rcaBase-master | aggregateData.m | .m | rcaBase-master/functions/aggregateData.m | 17,781 | utf_8 | 701058e4e436f4b6df5f6d2851402505 | function rca_struct = aggregateData(rca_struct, keep_conditions, error_type, trial_wise, do_nr)
% rca_struct = aggregateData(rca_struct, keep_conditions, error_type, trial_wise, do_nr)
%
% input:
% rca_struct: created during call to rcaSweep
% keep_conditions: [true]/false
% if false,... |
github | svndl/rcaBase-master | ssdTrain.m | .m | rcaBase-master/ssdCode/ssdTrain.m | 2,021 | utf_8 | 6d6a6d13589cfda218a1706e7866e3cd | % define the ssd function for our application based on signal and noise
% definitions in the fourier domain
function [Wsub, A, W, dGenSort, K] = ssdTrain(C_s, C_n, nComp, K)
% X_s: matrix containing the complex fourier coefficients at the frequency of interest extracted epoch-wise
% X_n2, X_n2: matrix contain... |
github | h2oai/mxnet-master | parse_json.m | .m | mxnet-master/matlab/+mxnet/private/parse_json.m | 19,095 | utf_8 | 2d934e0eae2779e69f5c3883b8f89963 | function data = parse_json(fname,varargin)
%PARSE_JSON parse a JSON (JavaScript Object Notation) file or string
%
% Based on jsonlab (https://github.com/fangq/jsonlab) created by Qianqian Fang. Jsonlab is lisonced under BSD or GPL v3.
global pos inStr len esc index_esc len_esc isoct arraytoken
if(regexp(fname,'^\s*(... |
github | raalf/OPERA-master | alphavol.m | .m | OPERA-master/alphavol.m | 6,537 | utf_8 | ef048ea526531f29fde44a729d4dd6a4 | function [V,S] = alphavol(X,R,fig)
%ALPHAVOL Alpha shape of 2D or 3D point set.
% V = ALPHAVOL(X,R) gives the area or volume V of the basic alpha shape
% for a 2D or 3D point set. X is a coordinate matrix of size Nx2 or Nx3.
%
% R is the probe radius with default value R = Inf. In the default case
% the b... |
github | raalf/OPERA-master | fcnSTLREAD.m | .m | OPERA-master/fcnSTLREAD.m | 3,351 | utf_8 | 2052a3e965c75c593c1432c122d7b11e | function [temp, isBinary] = fcnSTLREAD(stlfile)
%{
% fgetl(fp); % Skipping header line
% count = 1;
% while ~feof(fp)
% try
% % Skip "facet normal" words
% fscanf(fp,'%s',2);
%
% % Normal
% temp(count,:,4) = fscanf(fp,'%f',3);
% fgetl(fp); % Skip to new line
%
% % S... |
github | raalf/OPERA-master | fcnHINTEGRAL.m | .m | OPERA-master/Misc/Old Functions/fcnHINTEGRAL.m | 1,538 | utf_8 | 0cc0c334c7b28ec183a94d8b1f67a708 | function [H00, H10, H01, H20, H11, H02] = fcnHINTEGRAL(a,h,l1,l2)
H00 = fcnH00(a,h,l2) - fcnH00(a,h,l1);
H10 = fcnH10(a,h,l2) - fcnH10(a,h,l1);
H01 = fcnH01(a,h,l2) - fcnH01(a,h,l1);
H20 = fcnH20(a,h,l2) - fcnH20(a,h,l1);
H11 = fcnH11(a,h,l2) - fcnH11(a,h,l1);
H02 = fcnH02(a,h,l2) - fcnH02(a,h,l1);
end
functio... |
github | gpeyre/2016-shannon-theory-master | load_image.m | .m | 2016-shannon-theory-master/code/toolbox/load_image.m | 20,275 | utf_8 | c700b54853577ab37402e27e4ca061b8 | function M = load_image(type, n, options)
% load_image - load benchmark images.
%
% M = load_image(name, n, options);
%
% name can be:
% Synthetic images:
% 'chessboard1', 'chessboard', 'square', 'squareregular', 'disk', 'diskregular', 'quaterdisk', '3contours', 'line',
% 'line_vertical', 'l... |
github | gpeyre/2016-shannon-theory-master | plot_hufftree.m | .m | 2016-shannon-theory-master/code/toolbox/plot_hufftree.m | 869 | utf_8 | 4e86eec0b29a5e46f1218e15a6318f5f | function plot_hufftree(T,offs)
% plot_hufftree - plot a huffman tree
%
% plot_hufftree(T);
%
% Copyright (c) 2008 Gabriel Peyre
if nargin<2
offs=0;
end
hold on;
plot_tree(T{1},[0,0],1, offs);
hold off;
axis tight;
axis off;
end
%%
function plot_tree(T,x,j, offs)
tw = 15;
lw = 1.5;... |
github | gpeyre/2016-shannon-theory-master | perform_huffcoding.m | .m | 2016-shannon-theory-master/code/toolbox/perform_huffcoding.m | 1,491 | utf_8 | 41a9144e1a2da192d37cf10a40add3e2 | function y = perform_huffcoding(x,T,dir)
% perform_huffcoding - perform huffman coding
%
% y = perform_huffcoding(x,T,dir);
%
% dir=+1 for coding
% dir=-1 for decoding
%
% T is a Huffman tree, computed with compute_hufftree
%
% Copyright (c) 2008 Gabriel Peyre
if dir==1
%%% CODING %%%
... |
github | mowangphy/HOPE-CNN-master | cnn_cifar_hope.m | .m | HOPE-CNN-master/examples/cnn_cifar_hope.m | 6,248 | utf_8 | 7001f6382f537fb5735457262d9a42f5 | function [net, info] = cnn_cifar_hope(varargin)
% ------------ CNN Cifar-10 ------------------------
% iFLYTEK Laboratory for Neural Computing and Machine Learning (iNCML) @ York University
% (https://wiki.eecs.yorku.ca/lab/MLL/start)
% Based on MatconvNet (http://www.vlfeat.org/matconvnet/)
% Coding by: Hengyue ... |
github | mowangphy/HOPE-CNN-master | cnn_train_hope.m | .m | HOPE-CNN-master/examples/cnn_train_hope.m | 20,562 | utf_8 | bd9dae5167b22459f3bf29a955c40bea | function [net, info] = cnn_train_hope(net, imdb, getBatch, varargin)
% CNN_TRAIN_HOPE: developed based on cnn_train in matconvnet (by Andrea Vedaldi)
% Do network training
% The hope training method is implemented in the function 'map_gradients'
% Data augmentation methods are implemented in the function 'process_epoch... |
github | mowangphy/HOPE-CNN-master | vl_argparse.m | .m | HOPE-CNN-master/matlab/vl_argparse.m | 3,148 | utf_8 | 74459d2b851e027208bd7ca9ea999037 | function [opts, args] = vl_argparse(opts, args)
% VL_ARGPARSE Parse list of parameter-value pairs
% OPTS = VL_ARGPARSE(OPTS, ARGS) updates the structure OPTS based on
% the specified parameter-value pairs ARGS={PAR1, VAL1, ... PARN,
% VALN}. The function produces an error if an unknown parameter name
% is pass... |
github | mowangphy/HOPE-CNN-master | vl_compilenn.m | .m | HOPE-CNN-master/matlab/vl_compilenn.m | 24,645 | utf_8 | 8ffdf03179d5108a10b46a7fee6410e9 | function vl_compilenn( varargin )
% VL_COMPILENN Compile the MatConvNet toolbox
% The `vl_compilenn()` function compiles the MEX files in the
% MatConvNet toolbox. See below for the requirements for compiling
% CPU and GPU code, respectively.
%
% `vl_compilenn('OPTION', ARG, ...)` accepts the following opt... |
github | mowangphy/HOPE-CNN-master | vl_simplenn_display.m | .m | HOPE-CNN-master/matlab/simplenn/vl_simplenn_display.m | 10,932 | utf_8 | c7ed88fccca92a96ffe9c36dcb72d278 | function info = vl_simplenn_display(net, varargin)
% VL_SIMPLENN_DISPLAY Simple CNN statistics
% VL_SIMPLENN_DISPLAY(NET) prints statistics about the network NET.
%
% INFO=VL_SIMPLENN_DISPLAY(NET) returns instead a structure INFO
% with several statistics for each layer of the network NET.
%
% The function... |
github | mowangphy/HOPE-CNN-master | vl_test_economic_relu.m | .m | HOPE-CNN-master/matlab/xtest/vl_test_economic_relu.m | 790 | utf_8 | 35a3dbe98b9a2f080ee5f911630ab6f3 | % VL_TEST_ECONOMIC_RELU
function vl_test_economic_relu()
x = randn(11,12,8,'single');
w = randn(5,6,8,9,'single');
b = randn(1,9,'single') ;
net.layers{1} = struct('type', 'conv', ...
'filters', w, ...
'biases', b, ...
'stride', 1, ...
... |
github | qq8699444/DeepCascade-master | use_cimgmatlab.m | .m | DeepCascade-master/libs/CImg/examples/use_cimgmatlab.m | 1,242 | utf_8 | c7cefea57d7bf6077ec6a77f3bdda6b6 | /*-----------------------------------------------------------------------
File : use_cimgmatlab.m
Description: Example of use for the CImg plugin 'plugins/cimgmatlab.h'
which allows to use CImg in order to develop matlab external
functions (mex functions).
User should be familiar with Matlab C/C++ mex functi... |
github | mubeipeng/focused_slam-master | VisibilityCheck.m | .m | focused_slam-master/FIRM/VisibilityCheck.m | 1,580 | utf_8 | 0cca7e618b1f8a8745dfd835e891f051 | function Full_data = VisibilityCheck(Full_data)
n_waypoints = size(Full_data.logged_data,1);
for wayPoint_id = 1:n_waypoints
for k = 1 : length(Full_data.logged_data(wayPoint_id,:))
if isempty(Full_data.logged_data(wayPoint_id,k).x)
break
end
x = Full_data.lo... |
github | mubeipeng/focused_slam-master | GetStochasticMap.m | .m | focused_slam-master/FIRM/GetStochasticMap.m | 2,095 | utf_8 | aefe6228bfc64bbe07099ffa88403a8c | function Map_of_landmarks = GetStochasticMap(varargin) % we overwrite the input map
magnifying_focused_cov = 0.1;
GT_landmarks = varargin{1};
lm_file = varargin{2};
% %%% generate_fake_map
%%%% ==========================================================
% for i = 1:size(GT_landmarks.landmarks,2)
% focus... |
github | mubeipeng/focused_slam-master | plot_gaussian_ellipsoid.m | .m | focused_slam-master/FIRM/General_functions/plot_gaussian_ellipsoid.m | 3,942 | utf_8 | cb6edb0cf621ca98f288aeee309948c9 | function h = plot_gaussian_ellipsoid(m, C, sdwidth, npts, axh)
% PLOT_GAUSSIAN_ELLIPSOIDS plots 2-d and 3-d Gaussian distributions
%
% H = PLOT_GAUSSIAN_ELLIPSOIDS(M, C) plots the distribution specified by
% mean M and covariance C. The distribution is plotted as an ellipse (in
% 2-d) or an ellipsoid (in 3-d).... |
github | mubeipeng/focused_slam-master | user_GUI.m | .m | focused_slam-master/FIRM/General_functions/user_GUI.m | 25,536 | utf_8 | 67d6b4693e4b315f1a8c83eee8413f70 | function varargout = user_GUI(varargin)
% USER_GUI MATLAB code for user_GUI.fig
% USER_GUI, by itself, creates a new USER_GUI or raises the existing
% singleton*.
%
% H = USER_GUI returns the handle to a new USER_GUI or the handle to
% the existing singleton*.
%
% USER_GUI('CALLBACK',hO... |
github | mubeipeng/focused_slam-master | Input_XML_reader.m | .m | focused_slam-master/FIRM/General_functions/Input_XML_reader.m | 19,447 | utf_8 | 1604fa089fac9096c424f92268f5e68e | function par_new = Input_XML_reader(old_par, par_new_from_GUI)
% Parameters (they have to go into an XML)
%=======================================================================================
par_new = par_new_from_GUI; % first we copy the newly provided parameters from GUI
%=========== Random seed
seed ... |
github | mubeipeng/focused_slam-master | read_wobj.m | .m | focused_slam-master/FIRM/ExternalToolboxes/WOBJ_toolbox_Version2b/read_wobj.m | 14,274 | utf_8 | 00b739173054009ea85cd8029e45dbdf | function OBJ=read_wobj(fullfilename)
% Read the objects from a Wavefront OBJ file
%
% OBJ=read_wobj(filename);
%
% OBJ struct containing:
%
% OBJ.vertices : Vertices coordinates
% OBJ.vertices_texture: Texture coordinates
% OBJ.vertices_normal : Normal vectors
% OBJ.vertices_point : Vertice data used for poi... |
github | mubeipeng/focused_slam-master | write_wobj.m | .m | focused_slam-master/FIRM/ExternalToolboxes/WOBJ_toolbox_Version2b/write_wobj.m | 8,180 | utf_8 | 0dc52399139f80c689fb89cddc5ebb19 | function write_wobj(OBJ,fullfilename)
% Write objects to a Wavefront OBJ file
%
% write_wobj(OBJ,filename);
%
% OBJ struct containing:
%
% OBJ.vertices : Vertices coordinates
% OBJ.vertices_texture: Texture coordinates
% OBJ.vertices_normal : Normal vectors
% OBJ.vertices_point : Vertice data used for point... |
github | mubeipeng/focused_slam-master | steerLinearSystembyLP.m | .m | focused_slam-master/FIRM/All_motion_models/steerLinearSystembyLP.m | 3,471 | utf_8 | 1386af9e186eab89e654ec5da01f1c1a | %%%%%%%%%% Solve an LP to steer a Linear System %%%%%%%
function [x_seq,u_seq] = steerLinearSystembyLP(A,B,lower,upper,x_init,x_final,dt,numberOfSteps)
% Get dimensions
[stateDim,inputDim] = size(B);
solDim = stateDim*numberOfSteps + inputDim*(numberOfSteps-1);
% Initialize solution
x_seq = zeros(stateDim,numberO... |
github | mubeipeng/focused_slam-master | Aircraft_Kinematic.m | .m | focused_slam-master/FIRM/All_motion_models/Aircraft_Kinematic.m | 28,967 | utf_8 | 5e8129f6bf8fe01b2bf5e822feafe195 | %% Class Definition
classdef Aircraft_Kinematic < MotionModel_interface
properties (Constant = true)
stDim = 7;%state.dim; % state dimension
ctDim = 4; % control vector dimension
wDim = 4; % Process noise (W) dimension % For the generality we also consider the additive noise on kine... |
github | mubeipeng/focused_slam-master | Quadrotor_MM.m | .m | focused_slam-master/FIRM/All_motion_models/Quadrotor_MM.m | 12,667 | utf_8 | eec425366f6ece9508fb7c5cb25d21dd | classdef Quadrotor_MM < MotionModel_interface
% Note that because the class is defined as a handle class, the
% properties must be defined such that they are do not change from an
% object to another one.
properties (Constant)
stDim = state.dim; % state dimension
ctDim = 4; % cont... |
github | mubeipeng/focused_slam-master | Omni_directional_robot.m | .m | focused_slam-master/FIRM/All_motion_models/Omni_directional_robot.m | 17,473 | utf_8 | 98a3c0a20454a1d89bf3e2979909fcc2 | classdef Omni_directional_robot < MotionModel_interface
% Note that because the class is defined as a handle class, the
% properties must be defined such that they are do not change from an
% object to another one.
properties (Constant)
% numRobots = 1;
% stateClassName = 'planar_r... |
github | mubeipeng/focused_slam-master | Unicycle_robot.m | .m | focused_slam-master/FIRM/All_motion_models/Unicycle_robot.m | 38,881 | utf_8 | 364ab552f2479dc26544c3b1eaa1dbf9 | %% Class Definition
classdef Unicycle_robot < MotionModel_interface
%============================== UNICYCLE MOTION MODEL =========================================
% Note that because the class is defined as a handle class, the
% properties must be defined such that they do not change from an
% o... |
github | mubeipeng/focused_slam-master | youbot_base.m | .m | focused_slam-master/FIRM/All_motion_models/youbot_base.m | 14,789 | utf_8 | 8cb1348f049e23cf2bdb6ade776415b1 | classdef youbot_base < MotionModel_interface
% Note that because the class is defined as a handle class, the
% properties must be defined such that they are do not change from an
% object to another one.
properties (Constant)
stDim = state.dim; % state dimension
ctDim = 4; % contr... |
github | mubeipeng/focused_slam-master | MotionModel_class_NotImplementedYet.m | .m | focused_slam-master/FIRM/All_motion_models/Multi_Omni_directional_robots/MotionModel_class_NotImplementedYet.m | 14,853 | utf_8 | ad172bb4f2ce9155039355759020a5ea | classdef MotionModel_class < MotionModel_interface
% Note that because the class is defined as a handle class, the
% properties must be defined such that they are do not change from an
% object to another one.
properties (Constant)
num_robots = user_data_class.par.state_parameters.num_robot... |
github | mubeipeng/focused_slam-master | quadDyn.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/quadDyn.m | 818 | utf_8 | 40737a280d40e345ede7fda2ceafd5eb | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Continous quadrotor dynamics,
% gives xdot for a given x and u
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function xdot = quadDyn(x,u,params)
% The state vector alphabet
px = x(1);
py = x(2);
pz = x(3);
pxdot = x(4);
pydot = x(5);
pzdot = x(6);
phi = x(7);
theta = x(8);
psi = x(9);
p =... |
github | mubeipeng/focused_slam-master | steerHeading.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/steerHeading.m | 468 | utf_8 | 7bc4050a782d8cd40a99cf93903976ac | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Steer heading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function d_yaw_seq = steerHeading(psi_init,psi_final,n_steps,params)
% Heading Control sub-system (states: psi and r)
A = [0,1;0 0];
B = [0;1/(params.Iz)];
lower = [-pi/2;-pi;-1];
upper = [pi/2;pi;1];... |
github | mubeipeng/focused_slam-master | steerLinearSystembyLP.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/steerLinearSystembyLP.m | 3,471 | utf_8 | 1386af9e186eab89e654ec5da01f1c1a | %%%%%%%%%% Solve an LP to steer a Linear System %%%%%%%
function [x_seq,u_seq] = steerLinearSystembyLP(A,B,lower,upper,x_init,x_final,dt,numberOfSteps)
% Get dimensions
[stateDim,inputDim] = size(B);
solDim = stateDim*numberOfSteps + inputDim*(numberOfSteps-1);
% Initialize solution
x_seq = zeros(stateDim,numberO... |
github | mubeipeng/focused_slam-master | steerY.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/steerY.m | 543 | utf_8 | 4dabac2f1131428e5d6cfd0753472897 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Steer heading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function d_pitch_seq = steerY(py_init,py_final,n_steps,params)
% X Control sub-system(states y ydot theta q)
A = zeros(4,4);
A(1,2) = 1;
A(2,3) = -params.g;
A(3,4) = 1;
B = zeros(4,1);
B(4,1) = param... |
github | mubeipeng/focused_slam-master | steerX.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/steerX.m | 538 | utf_8 | bf981478069c31a7ffc15ebc80e00d8a | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Steer heading
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function d_roll_seq = steerX(px_init,px_final,n_steps,params)
% X Control sub-system(states x xdot phi p)
A = zeros(4,4);
A(1,2) = 1;
A(2,3) = params.g;
A(3,4) = 1;
B = zeros(4,1);
B(4,1) = params.L/... |
github | mubeipeng/focused_slam-master | trajectory2.m | .m | focused_slam-master/FIRM/All_motion_models/QuadRelated/trajectory2.m | 11,511 | utf_8 | 5b16be0eceaefd2ffbc39da0e1ccd002 | function trajectory2(x,y,z,pitch,roll,yaw,scale_factor,step,varargin)
% function trajectory2(x,y,z,pitch,roll,yaw,scale_factor,step,selector)
%
%
% x,y,z center trajectory (vector) [m]
%
% pitch,roll,yaw euler's angles [rad]
%
% scale_factor normaliz... |
github | mubeipeng/focused_slam-master | Six_DOF_robot_state.m | .m | focused_slam-master/FIRM/All_state/Six_DOF_robot_state.m | 12,804 | utf_8 | d28bb6f56a79a2d7837de7d06cf94932 | classdef Six_DOF_robot_state < state_interface
% This class encapsulates the state of a 6DOF robot, described by its 3D location and orientation quaternion.
properties (Constant)
dim = 7; % state dimension [X,Y,Z,q0,q1,q2,q3]
zeroQuaternion = [1 ; 0 ; 0 ; 0];
end
properties
... |
github | mubeipeng/focused_slam-master | revolute_joint_manipulator_state.m | .m | focused_slam-master/FIRM/All_state/revolute_joint_manipulator_state.m | 9,225 | utf_8 | ff960810a44dc0b18ff184eae6a8abca | classdef revolute_joint_manipulator_state < state_interface
% This class encapsulates the state of the system.
properties (Constant)
num_revolute_joints = user_data_class.par.state_parameters.num_revolute_joints;
dim = revolute_joint_manipulator_state.num_revolute_joints; % state dimension
... |
github | mubeipeng/focused_slam-master | multi_robot_positional_state.m | .m | focused_slam-master/FIRM/All_state/multi_robot_positional_state.m | 10,155 | utf_8 | 141d95173c43240a01ca1125454acd98 | classdef multi_robot_positional_state < state_interface
% This class encapsulates the state of a planar robot, described by its 2D location and heading angle.
properties
num_robots;
dim; % state dimension
val; % value of the state
plot_handle=[]; % handle for the "dra... |
github | mubeipeng/focused_slam-master | planar_robot_XYTheta_state.m | .m | focused_slam-master/FIRM/All_state/planar_robot_XYTheta_state.m | 10,745 | utf_8 | 4c5314bb8c6748c04648327554223ff7 | classdef planar_robot_XYTheta_state < state_interface
% This class encapsulates the state of a planar robot, described by its 2D location and heading angle.
properties (Constant)
label = 'planar_robot_XYTheta_state';
dim = 3; % state dimension
sup_norm_weights_nonNormalized = 1./[1 ... |
github | mubeipeng/focused_slam-master | Multi_planar_robots_XYTheta_state.m | .m | focused_slam-master/FIRM/All_state/Multi_planar_robots_XYTheta_state.m | 11,131 | utf_8 | 536f5a239512b610e02ff2fee58a0af1 | classdef Multi_planar_robots_XYTheta_state < state_interface
% This class encapsulates the state of a planar robot, described by its 2D location and heading angle.
properties (Constant)
num_robots = user_data_class.par.state_parameters.num_robots;
dim = 3*state.num_robots; % state dimension
... |
github | mubeipeng/focused_slam-master | Planar_dyn_manipulator_state.m | .m | focused_slam-master/FIRM/All_state/Planar_dyn_manipulator_state.m | 9,738 | utf_8 | e63d596a57b2945029a1a83c631b976e | classdef Planar_dyn_manipulator_state < state_interface
% This class encapsulates the state of the system.
properties (Constant)
num_revolute_joints = user_data_class.par.state_parameters.num_revolute_joints;
dim = 2*Planar_dyn_manipulator_state.num_revolute_joints; % state dimension
... |
github | mubeipeng/focused_slam-master | generate_measurements.m | .m | focused_slam-master/focused_mapping/lib/generate_measurements.m | 4,391 | utf_8 | aaa062480dd0541c1874d179f055ca46 | function [lm_edge, t] = generate_measurements(name,J, lm_edge, variableList, focus_lm_list, N_select)
tic
switch name
case 'focus_select'
selectIdx = selection_focus(J, variableList, focus_lm_list, N_select, lm_edge);
case 'full_select'
selectIdx = selection_full(J, variableList, N_sele... |
github | mubeipeng/focused_slam-master | generate_focused_landmark.m | .m | focused_slam-master/focused_mapping/lib/generate_focused_landmark.m | 2,538 | utf_8 | 6b50ff48ce6ff60d2887ae33c9df2931 | function [lm_focused,t] = generate_focused_landmark(N,lm_edge,node_edge)
tic;
%%
lm_list = unique(lm_edge.id2);
lm_focused = [];
N_odom = length(node_edge.id2);
n_observed_lm = zeros(1,N_odom); % No. of landmarks observed at each odom node
odom_count = zeros(1,N_odom);
odom_list = unique(lm_edge.id1);
odom_count(odom... |
github | mubeipeng/focused_slam-master | estimateRigidTransform.m | .m | focused_slam-master/focused_mapping/lib/estimateRigidTransform.m | 3,606 | utf_8 | 8edf7adcc5d938488684040c13b16fb4 | function [T, Eps] = estimateRigidTransform(x, y)
% ESTIMATERIGIDTRANSFORM
% [T, EPS] = ESTIMATERIGIDTRANSFORM(X, Y) estimates the rigid transformation
% that best aligns x with y (in the least-squares sense).
%
% Reference: "Estimating Rigid Transformations" in
% "Computer Vision, a modern approach" by... |
github | markf94/QML_Thesis-master | bloch.m | .m | QML_Thesis-master/Octave/bloch.m | 1,061 | utf_8 | 2a9113b120276358d347c2d37793db53 | %Project a two-level qubit state onto Bloch sphere
function [x,y,z,theta,phi] = bloch(alpha, beta)
% INPUT
% alpha|0> + beta|1>
% a and b are probability amplitudes from qubit
% Find and eliminate global phase
angle_alpha = angle(alpha)
angle_beta = angle(beta)
if angle_alpha < angle_beta
alpha_new = alpha/exp(i*angl... |
github | markf94/QML_Thesis-master | f.m | .m | QML_Thesis-master/Octave/f.m | 2,049 | utf_8 | efed95ffb8ca4100c49f6b71a56545aa | %% SCRIPT FOR CREATING A CONTROLLED-U QUANTUM GATE
% THEOREM:
% For any unitary matrix U we can find a decomposition into A,B,C such that:
% A*B*C = I
% exp(i*alpha)*A*X*B*X*C = U
% where X is the first Pauli matrix (NOT gate) and alpha is some real number
% The circuit goes C > CNOT > B > CNOT > A
%% Function that c... |
github | markf94/QML_Thesis-master | ownnormdistr.m | .m | QML_Thesis-master/Octave/ownnormdistr.m | 323 | utf_8 | 304575e882204550698678db0124a4c0 |
%global sigma = 1
%global mu = 0
% Define function for normal distribution
function y = f (x)
%global sigma
%global mu
%sigma = 1
%mu = 0
y = 1/(1 .* sqrt(2 .*pi)).*exp(-(x).^2/(2));
%y = 1/(sigma .* sqrt(2 .*pi)).*exp(-(x-mu).^2/(2.*sigma.^2));
endfunction
%x=[-4:0.1:4];
%for i=0:3
myprob = f(1)
%endfor
%plot(x,mypr... |
github | optisimon/ft5406-capacitive-touch-master | analyze_raw_data.m | .m | ft5406-capacitive-touch-master/analyze_raw_data.m | 3,577 | utf_8 | c01b6592a3ecd2a39350e1fe8f415f08 | %
% Process captures of raw capacitance values, and plot the mutual capacitance images.
%
% Assumes that the user previously
% 1) captured a number of background mutual capacitance images (with nothing on
% the touch screen):
% for var in $(seq 1 10) ; do ./dump_raw_data.sh > background_$var.raw ; done
%
% 2) Cap... |
github | Rathcke/uni-master | projfilter.m | .m | uni-master/ad/AAD/SIP/ass5/src/projfilter.m | 535 | utf_8 | 715dd7bb0a74b77728560e652abda084 | % The code below takes a matrix of projections and returns
% a matrix with filtered projections whose Fourier Transform
% is |w|. By uncommenting the vairous filters, various aspects
% of the reconstructed picture will be emphasized or lost.
function FIL = projfilter(Image)
[L,C]=size(Image);
w = [-pi : (2*pi)/L : ... |
github | Rathcke/uni-master | q3_4.m | .m | uni-master/ad/AAD/SIP/src/q3_4.m | 197 | utf_8 | 107c8c55b87184a43d4a545f32cb5f04 | I = imread('hand.tiff');
zeros(size(I, 1), size(I, 2), 100)
for i = 1:100
subplot(1, 1, 1);
imshow(I);
end
function res = dsa(x, y, t)
t/(sqrt(2*pi*s^2))*1/(2*pi*(s^2+t^2))*exp(-x/(2*
end |
github | Rathcke/uni-master | math412demo.m | .m | uni-master/optimization/ass1/src/math412demo.m | 12,929 | utf_8 | 6761f8a78b28bbc2e332db4bcc7df2ac |
function [f,x] = math412demo(fname,method,LStype,info,acc,...
maxitns,LSlimit)
% WARNING: THIS CODE IS FOR DEMONSTRATING THE BASIC PROPERTIES OF
% VARIOUS ALGORITHM TYPES ONLY. USE AT OWN RISK.
% [bestf,x] = math412demo(fname, search_direction_type,
% line_search_method, info, accuracy, maxitns, LSli... |
github | Rathcke/uni-master | math412demo.m | .m | uni-master/optimization/ass2/src/math412demo.m | 13,089 | utf_8 | 8d18ad82cf948542ea25b06b3854c046 |
function [f,x] = math412demo(fname,method,LStype,info,acc,...
maxitns,LSlimit)
% WARNING: THIS CODE IS FOR DEMONSTRATING THE BASIC PROPERTIES OF
% VARIOUS ALGORITHM TYPES ONLY. USE AT OWN RISK.
% [bestf,x] = math412demo(fname, search_direction_type,
% line_search_method, info, accuracy, maxitns, LSli... |
github | Rathcke/uni-master | q2_4.m | .m | uni-master/sip/ass3/src/q2_4.m | 316 | utf_8 | c531e726ae2dad95ce674f3c1ae9b300 | function q2_4()
for i = 1:6
res = scale((i-1)*3+1);
subplot(2, 3, i);
imshow(res);
title(sprintf('With sigma = %d', (i-1)*3+1));
end
end
function res = scale(arg)
I = imread('lena.tiff');
h = fspecial('gaussian', [arg arg], arg);
res = imfilter(I, h);
end |
github | Rathcke/uni-master | q2_2.m | .m | uni-master/sip/ass3/src/q2_2.m | 2,682 | utf_8 | ed9165b054f9d4749be6fc2984655dbc | function q2_2()
%q2_2a()
%q2_2b()
q2_2c()
end
function q2_2a()
I = imread('lena.tiff');
h = fspecial('gaussian');
A = nestedConv(h, I);
B = fourConv(h, I);
subplot(1, 3, 1);
imagesc(I);
colormap gray;
title('Original image');
subplot(1, 3, 2);
imagesc... |
github | Rathcke/uni-master | q2_3.m | .m | uni-master/sip/ass3/src/q2_3.m | 850 | utf_8 | 08a7a6fbb57427610672bdd8eeea1461 | function q2_3()
I = imread('lena.tiff');
I2 = addFunc(I, 50, 0.25, 0.25);
subplot(2,2,1);
imshow(I);
title('Original image');
colormap gray;
subplot(2,2,2);
imshow(I2);
title('Image with added function');
colormap gray;
ps = 10*log10(fftshift(abs(fft2(... |
github | Rathcke/uni-master | q2_6.m | .m | uni-master/sip/ass3/src/q2_6.m | 534 | utf_8 | 1dcd1970ffdcab5ea4550620c5cc68d6 | function q2_6()
I = imread('lena.tiff');
for i = 0:2
for j = 0:2
A = deriveImg(I, i, j);
subplot(3, 3, 3*i+j+1);
imagesc(A);
colormap gray;
title(sprintf('With n = %d and m = %d', i, j));
end
end
end
function res = deriveImg(img, n... |
github | Rathcke/uni-master | SVM_soft.m | .m | uni-master/dataAnalysis/afl6/code/SVM_soft.m | 1,011 | utf_8 | 8f4c7fd36aa1ffa4d511447f87cd15ce | % N is number of datapoints
% X is data in rows
% Y is labels in a column
% C is a number
function u = SVM_soft(X, Y, C)
% Get the datasample dimension
[N, d]=size(X);
% p: a column of N 0's followed by N C/N's
p = [zeros(d+1,1); (C/N)*ones(N,1)];
% c: a column of N 1's followed by N 0... |
github | zhuhan1236/dhn-caffe-master | prepare_batch.m | .m | dhn-caffe-master/matlab/caffe/prepare_batch.m | 1,298 | utf_8 | 68088231982895c248aef25b4886eab0 | % ------------------------------------------------------------------------
function images = prepare_batch(image_files,IMAGE_MEAN,batch_size)
% ------------------------------------------------------------------------
if nargin < 2
d = load('ilsvrc_2012_mean');
IMAGE_MEAN = d.image_mean;
end
num_images = length... |
github | zhuhan1236/dhn-caffe-master | matcaffe_demo_vgg.m | .m | dhn-caffe-master/matlab/caffe/matcaffe_demo_vgg.m | 3,036 | utf_8 | f836eefad26027ac1be6e24421b59543 | function scores = matcaffe_demo_vgg(im, use_gpu, model_def_file, model_file, mean_file)
% scores = matcaffe_demo_vgg(im, use_gpu, model_def_file, model_file, mean_file)
%
% Demo of the matlab wrapper using the networks described in the BMVC-2014 paper "Return of the Devil in the Details: Delving Deep into Convolutional... |
github | zhuhan1236/dhn-caffe-master | matcaffe_demo.m | .m | dhn-caffe-master/matlab/caffe/matcaffe_demo.m | 3,344 | utf_8 | 669622769508a684210d164ac749a614 | function [scores, maxlabel] = matcaffe_demo(im, use_gpu)
% scores = matcaffe_demo(im, use_gpu)
%
% Demo of the matlab wrapper using the ILSVRC network.
%
% input
% im color image as uint8 HxWx3
% use_gpu 1 to use the GPU, 0 to use the CPU
%
% output
% scores 1000-dimensional ILSVRC score vector
%
% You m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.