├── .gitignore ├── README.md ├── channels ├── Contents.m ├── chnsCompute.m ├── chnsPyramid.m ├── chnsScaling.m ├── convBox.m ├── convMax.m ├── convTri.m ├── fhog.m ├── gradient2.m ├── gradientHist.m ├── gradientMag.m ├── hog.m ├── hogDraw.m ├── imPad.m ├── imResample.m ├── private │ ├── chnsTestCpp.cpp │ ├── convConst.cpp │ ├── convConst.mexa64 │ ├── convConst.mexmaci64 │ ├── convConst.mexw64 │ ├── gradientMex.cpp │ ├── gradientMex.mexa64 │ ├── gradientMex.mexmaci64 │ ├── gradientMex.mexw64 │ ├── gradientMexNew.mexmaci64 │ ├── imPadMex.cpp │ ├── imPadMex.mexa64 │ ├── imPadMex.mexmaci64 │ ├── imPadMex.mexw64 │ ├── imResampleMex.cpp │ ├── imResampleMex.mexa64 │ ├── imResampleMex.mexmaci64 │ ├── imResampleMex.mexw64 │ ├── rgbConvertMex.cpp │ ├── rgbConvertMex.mexa64 │ ├── rgbConvertMex.mexmaci64 │ ├── rgbConvertMex.mexw64 │ ├── sse.hpp │ └── wrappers.hpp └── rgbConvert.m ├── classify ├── Contents.m ├── adaBoostApply.m ├── adaBoostTrain.m ├── binaryTreeApply.m ├── binaryTreeTrain.m ├── confMatrix.m ├── confMatrixShow.m ├── demoCluster.m ├── demoGenData.m ├── distMatrixShow.m ├── fernsClfApply.m ├── fernsClfTrain.m ├── fernsInds.m ├── fernsRegApply.m ├── fernsRegTrain.m ├── forestApply.m ├── forestTrain.m ├── kmeans2.m ├── meanShift.m ├── meanShiftIm.m ├── meanShiftImExplore.m ├── pca.m ├── pcaApply.m ├── pcaData.mat ├── pcaRandVec.m ├── pcaVisualize.m ├── pdist2.m ├── private │ ├── IDX2order.m │ ├── binaryTreeTrain1.cpp │ ├── binaryTreeTrain1.mexa64 │ ├── binaryTreeTrain1.mexmaci64 │ ├── binaryTreeTrain1.mexw64 │ ├── fernsInds1.c │ ├── fernsInds1.mexa64 │ ├── fernsInds1.mexmaci64 │ ├── fernsInds1.mexw64 │ ├── forestFindThr.cpp │ ├── forestFindThr.mexa64 │ ├── forestFindThr.mexmaci64 │ ├── forestFindThr.mexw64 │ ├── forestInds.cpp │ ├── forestInds.mexa64 │ ├── forestInds.mexmaci64 │ ├── forestInds.mexw64 │ ├── meanShift1.c │ ├── meanShift1.mexa64 │ ├── meanShift1.mexmaci64 │ ├── meanShift1.mexw64 │ └── meanShiftPost.m ├── rbfComputeBasis.m ├── rbfComputeFtrs.m ├── rbfDemo.m ├── softMin.m └── visualizeData.m ├── detector ├── Contents.m ├── acfDemoCal.m ├── acfDemoInria.m ├── acfDetect.m ├── acfModify.m ├── acfReadme.m ├── acfSweeps.m ├── acfTest.m ├── acfTrain.m ├── bbApply.m ├── bbGt.m ├── bbLabeler.m ├── bbNms.m ├── models │ ├── AcfCaltech+Detector.mat │ ├── AcfCaltech+Log.txt │ ├── AcfCaltech+Roc.png │ ├── AcfInriaDetector.mat │ ├── AcfInriaLog.txt │ ├── AcfInriaRoc.png │ ├── LdcfCaltechDetector.mat │ ├── LdcfCaltechLog.txt │ ├── LdcfCaltechRoc.png │ ├── LdcfInriaDetector.mat │ ├── LdcfInriaLog.txt │ └── LdcfInriaRoc.png └── private │ ├── acfDetect1.cpp │ ├── acfDetect1.mexa64 │ ├── acfDetect1.mexmaci64 │ └── acfDetect1.mexw64 ├── doc ├── alpha.png ├── c++.png ├── c.png ├── channels │ ├── Contents.html │ ├── chnsCompute.html │ ├── chnsPyramid.html │ ├── chnsScaling.html │ ├── convBox.html │ ├── convMax.html │ ├── convTri.html │ ├── fhog.html │ ├── gradient2.html │ ├── gradientHist.html │ ├── gradientMag.html │ ├── hog.html │ ├── hogDraw.html │ ├── imPad.html │ ├── imResample.html │ ├── menu.html │ └── rgbConvert.html ├── classify │ ├── Contents.html │ ├── adaBoostApply.html │ ├── adaBoostTrain.html │ ├── binaryTreeApply.html │ ├── binaryTreeTrain.html │ ├── confMatrix.html │ ├── confMatrixShow.html │ ├── demoCluster.html │ ├── demoGenData.html │ ├── distMatrixShow.html │ ├── fernsClfApply.html │ ├── fernsClfTrain.html │ ├── fernsInds.html │ ├── fernsRegApply.html │ ├── fernsRegTrain.html │ ├── forestApply.html │ ├── forestTrain.html │ ├── kmeans2.html │ ├── meanShift.html │ ├── meanShiftIm.html │ ├── meanShiftImExplore.html │ ├── menu.html │ ├── pca.html │ ├── pcaApply.html │ ├── pcaRandVec.html │ ├── pcaVisualize.html │ ├── pdist2.html │ ├── rbfComputeBasis.html │ ├── rbfComputeFtrs.html │ ├── rbfDemo.html │ ├── softMin.html │ └── visualizeData.html ├── demoicon.gif ├── detector │ ├── Contents.html │ ├── acfDemoCal.html │ ├── acfDemoInria.html │ ├── acfDetect.html │ ├── acfModify.html │ ├── acfReadme.html │ ├── acfSweeps.html │ ├── acfTest.html │ ├── acfTrain.html │ ├── bbApply.html │ ├── bbGt.html │ ├── bbLabeler.html │ ├── bbNms.html │ └── menu.html ├── down.png ├── favicon.ico ├── filters │ ├── Contents.html │ ├── FbApply2d.html │ ├── FbCrop.html │ ├── FbMake.html │ ├── FbReconstruct2d.html │ ├── FbVisualize.html │ ├── filterBinomial1d.html │ ├── filterDog2d.html │ ├── filterDoog.html │ ├── filterGabor1d.html │ ├── filterGabor2d.html │ ├── filterGauss.html │ ├── filterSteerable.html │ ├── filterVisualize.html │ ├── medfilt1m.html │ ├── menu.html │ └── modefilt1.html ├── fortran.png ├── history.txt ├── hp.png ├── images │ ├── Contents.html │ ├── assignToBins.html │ ├── clusterMontage.html │ ├── convnFast.html │ ├── filmStrip.html │ ├── gaussSmooth.html │ ├── histMontage.html │ ├── histc2.html │ ├── histcImLoc.html │ ├── histcImWin.html │ ├── im.html │ ├── imMlGauss.html │ ├── imNormalize.html │ ├── imRectRot.html │ ├── imShrink.html │ ├── imtransform2.html │ ├── imwrite2.html │ ├── jitterImage.html │ ├── localSum.html │ ├── makeGif.html │ ├── maskCircle.html │ ├── maskEllipse.html │ ├── maskGaussians.html │ ├── maskSphere.html │ ├── menu.html │ ├── montage2.html │ ├── movieToImages.html │ ├── nonMaxSupr.html │ ├── nonMaxSuprList.html │ ├── nonMaxSuprWin.html │ ├── normxcorrn.html │ ├── playMovie.html │ ├── textureMap.html │ ├── xcorrn.html │ └── xeucn.html ├── index.html ├── left.png ├── linux.png ├── m2html.css ├── matlab │ ├── Contents.html │ ├── arrayCrop.html │ ├── arrayToDims.html │ ├── c.html │ ├── cc.html │ ├── ccc.html │ ├── cell2array.html │ ├── char2img.html │ ├── checkNumArgs.html │ ├── dijkstra.html │ ├── dirSynch.html │ ├── diskFill.html │ ├── dispMatrixIm.html │ ├── fevalArrays.html │ ├── fevalDistr.html │ ├── fevalDistrDisk.html │ ├── fevalImages.html │ ├── fevalMats.html │ ├── figureResized.html │ ├── gauss2ellipse.html │ ├── getPrmDflt.html │ ├── imLabel.html │ ├── ind2sub2.html │ ├── int2str2.html │ ├── isfield2.html │ ├── mat2cell2.html │ ├── medianw.html │ ├── menu.html │ ├── multiDiv.html │ ├── multiTimes.html │ ├── normpdf2.html │ ├── num2strs.html │ ├── plotEllipse.html │ ├── plotGaussEllipses.html │ ├── plotRoc.html │ ├── randSample.html │ ├── randint2.html │ ├── rotationMatrix.html │ ├── simpleCache.html │ ├── spBlkDiag.html │ ├── sub2ind2.html │ ├── subsToArray.html │ ├── text2.html │ ├── ticStatus.html │ ├── tocStatus.html │ ├── tpsGetWarp.html │ ├── tpsInterpolate.html │ ├── tpsInterpolateIm.html │ ├── tpsRandom.html │ ├── txt2img.html │ └── uniqueColors.html ├── matlabicon.gif ├── menu.html ├── mex.png ├── new.gif ├── overview.html ├── right.png ├── sgi.png ├── simulinkicon.gif ├── solaris.png ├── up.png ├── videos │ ├── Contents.html │ ├── behaviorAnnotator.html │ ├── behaviorData.html │ ├── imagesAlign.html │ ├── imagesAlignSeq.html │ ├── kernelTracker.html │ ├── menu.html │ ├── opticalFlow.html │ ├── seqIo.html │ ├── seqPlayer.html │ ├── seqReaderPlugin.html │ └── seqWriterPlugin.html └── windows.png ├── external ├── bsd.txt ├── deprecated │ ├── apply_homography.m │ ├── clfData.mat │ ├── clfDecTree.m │ ├── clfDecTreeFwd.m │ ├── clfDecTreeTrain.m │ ├── clfEcoc.m │ ├── clfEcocCode.m │ ├── clfKnn.m │ ├── clfKnnDist.m │ ├── clfKnnFwd.m │ ├── clfKnnTrain.m │ ├── clfLda.m │ ├── clfLdaFwd.m │ ├── clfLdaTrain.m │ ├── clfSvm.m │ ├── demoClassify.m │ ├── diffTracker.m │ ├── filter_gauss_1D.m │ ├── getargs.m │ ├── imRectLite.m │ ├── imSubsResize.m │ ├── imrotate2.m │ ├── imtranslate.m │ ├── imwrite2split.m │ ├── localsum_block.m │ ├── makemovie.m │ ├── mode2.m │ ├── montages2.m │ ├── nfoldxval.m │ ├── normxcorrn_fg.m │ ├── pca_apply.m │ ├── pca_apply_large.m │ ├── playmovies.m │ ├── randperm2.m │ └── subsampleMatrix.m ├── history.txt ├── m2html │ ├── @template │ │ ├── char.m │ │ ├── display.m │ │ ├── get.m │ │ ├── parse.m │ │ ├── private │ │ │ ├── finish.m │ │ │ ├── loadtpl.m │ │ │ └── subst.m │ │ ├── set.m │ │ └── template.m │ ├── Changelog │ ├── Contents.m │ ├── GPL │ ├── INSTALL │ ├── LICENSE │ ├── README │ ├── TODO │ ├── m2html.m │ ├── mdot.m │ ├── mwizard.m │ ├── mwizard2.m │ ├── private │ │ ├── doxyread.m │ │ ├── doxysearch.m │ │ ├── doxywrite.m │ │ ├── m2htmltoolbarimages.mat │ │ ├── mexexts.m │ │ ├── mfileparse.m │ │ ├── openfile.m │ │ ├── searchindex.m │ │ ├── splitcode.m │ │ └── strtok.m │ └── templates │ │ ├── blue │ │ ├── Thumbs.db │ │ ├── alpha.png │ │ ├── c++.png │ │ ├── c.png │ │ ├── demoicon.gif │ │ ├── down.png │ │ ├── doxysearch.php │ │ ├── fortran.png │ │ ├── graph.tpl │ │ ├── hp.png │ │ ├── left.png │ │ ├── linux.png │ │ ├── m2html.css │ │ ├── master.tpl │ │ ├── matlabicon.gif │ │ ├── mdir.tpl │ │ ├── mex.png │ │ ├── mfile.tpl │ │ ├── pcode.png │ │ ├── right.png │ │ ├── search.tpl │ │ ├── sgi.png │ │ ├── simulinkicon.gif │ │ ├── solaris.png │ │ ├── todo.tpl │ │ ├── up.png │ │ └── windows.png │ │ ├── brain │ │ ├── alpha.png │ │ ├── brain.png │ │ ├── c++.png │ │ ├── c.png │ │ ├── demoicon.gif │ │ ├── down.png │ │ ├── doxysearch.php │ │ ├── fortran.png │ │ ├── graph.tpl │ │ ├── hp.png │ │ ├── index.html │ │ ├── left.png │ │ ├── linux.png │ │ ├── m2html.css │ │ ├── master.tpl │ │ ├── matlabicon.gif │ │ ├── mdir.tpl │ │ ├── menu.css │ │ ├── mex.png │ │ ├── mfile.tpl │ │ ├── pcode.png │ │ ├── right.png │ │ ├── search.tpl │ │ ├── sgi.png │ │ ├── simulinkicon.gif │ │ ├── solaris.png │ │ ├── todo.tpl │ │ ├── up.png │ │ └── windows.png │ │ ├── frame-piotr │ │ ├── alpha.png │ │ ├── c++.png │ │ ├── c.png │ │ ├── demoicon.gif │ │ ├── down.png │ │ ├── favicon.ico │ │ ├── fortran.png │ │ ├── graph.tpl │ │ ├── hp.png │ │ ├── index.html │ │ ├── left.png │ │ ├── linux.png │ │ ├── m2html.css │ │ ├── master.tpl │ │ ├── matlabicon.gif │ │ ├── mdir.tpl │ │ ├── mex.png │ │ ├── mfile.tpl │ │ ├── new.gif │ │ ├── overview.html │ │ ├── right.png │ │ ├── sgi.png │ │ ├── simulinkicon.gif │ │ ├── solaris.png │ │ ├── todo.tpl │ │ ├── up.png │ │ └── windows.png │ │ ├── frame │ │ ├── alpha.png │ │ ├── c++.png │ │ ├── c.png │ │ ├── demoicon.gif │ │ ├── down.png │ │ ├── doxysearch.php │ │ ├── fortran.png │ │ ├── graph.tpl │ │ ├── hp.png │ │ ├── index.html │ │ ├── left.png │ │ ├── linux.png │ │ ├── m2html.css │ │ ├── master.tpl │ │ ├── matlabicon.gif │ │ ├── mdir.tpl │ │ ├── mex.png │ │ ├── mfile.tpl │ │ ├── pcode.png │ │ ├── right.png │ │ ├── search.tpl │ │ ├── sgi.png │ │ ├── simulinkicon.gif │ │ ├── solaris.png │ │ ├── todo.tpl │ │ ├── up.png │ │ └── windows.png │ │ └── menu-for-frame-piotr.html ├── other │ ├── compareStructs.m │ ├── matrix2latex.m │ ├── multiprod.m │ └── savefig.m ├── toolboxCompile.m ├── toolboxGenDoc.m ├── toolboxHeader.m └── toolboxUpdateHeader.m ├── filters ├── Contents.m ├── FbApply2d.m ├── FbCrop.m ├── FbDoG.mat ├── FbGabor.mat ├── FbMake.m ├── FbReconstruct2d.m ├── FbVisualize.m ├── filterBinomial1d.m ├── filterDog2d.m ├── filterDoog.m ├── filterGabor1d.m ├── filterGabor2d.m ├── filterGauss.m ├── filterSteerable.m ├── filterVisualize.m ├── medfilt1m.m └── modefilt1.m ├── images ├── Contents.m ├── assignToBins.m ├── clusterMontage.m ├── convnFast.m ├── filmStrip.m ├── gaussSmooth.m ├── histMontage.m ├── histc2.m ├── histcImLoc.m ├── histcImWin.m ├── im.m ├── imMlGauss.m ├── imNormalize.m ├── imRectRot.m ├── imShrink.m ├── images.mat ├── imtransform2.m ├── imwrite2.m ├── jitterImage.m ├── localSum.m ├── makeGif.m ├── maskCircle.m ├── maskEllipse.m ├── maskGaussians.m ├── maskSphere.m ├── montage2.m ├── movieToImages.m ├── nonMaxSupr.m ├── nonMaxSuprList.m ├── nonMaxSuprWin.m ├── normxcorrn.m ├── playMovie.m ├── private │ ├── assignToBins1.c │ ├── assignToBins1.mexa64 │ ├── assignToBins1.mexmaci64 │ ├── assignToBins1.mexw64 │ ├── histc2c.c │ ├── histc2c.mexa64 │ ├── histc2c.mexmaci64 │ ├── histc2c.mexw64 │ ├── imtransform2_c.c │ ├── imtransform2_c.mexa64 │ ├── imtransform2_c.mexmaci64 │ ├── imtransform2_c.mexw64 │ ├── nlfiltersep.m │ ├── nlfiltersep_max.c │ ├── nlfiltersep_max.mexa64 │ ├── nlfiltersep_max.mexmaci64 │ ├── nlfiltersep_max.mexw64 │ ├── nlfiltersep_sum.c │ ├── nlfiltersep_sum.mexa64 │ ├── nlfiltersep_sum.mexmaci64 │ └── nlfiltersep_sum.mexw64 ├── textureMap.m ├── xcorrn.m └── xeucn.m ├── matlab ├── Contents.m ├── arrayCrop.m ├── arrayToDims.m ├── c.m ├── cc.m ├── ccc.m ├── cell2array.m ├── char2img.m ├── checkNumArgs.m ├── dijkstra.m ├── dirSynch.m ├── diskFill.m ├── dispMatrixIm.m ├── fevalArrays.m ├── fevalDistr.m ├── fevalDistrDisk.m ├── fevalImages.m ├── fevalMats.m ├── figureResized.m ├── gauss2ellipse.m ├── getPrmDflt.m ├── imLabel.m ├── ind2sub2.m ├── int2str2.m ├── isfield2.m ├── mat2cell2.m ├── medianw.m ├── multiDiv.m ├── multiTimes.m ├── normpdf2.m ├── num2strs.m ├── plotEllipse.m ├── plotGaussEllipses.m ├── plotRoc.m ├── private │ ├── char2img_h015.mat │ ├── char2img_h020.mat │ ├── char2img_h025.mat │ ├── char2img_h030.mat │ ├── char2img_h035.mat │ ├── char2img_h050.mat │ ├── dijkstra1.cpp │ ├── dijkstra1.mexa64 │ ├── dijkstra1.mexmaci64 │ ├── dijkstra1.mexw64 │ ├── fibheap.cpp │ └── fibheap.h ├── randSample.m ├── randint2.m ├── rotationMatrix.m ├── simpleCache.m ├── spBlkDiag.m ├── sub2ind2.m ├── subsToArray.m ├── text2.m ├── ticStatus.m ├── tocStatus.m ├── tpsGetWarp.m ├── tpsInterpolate.m ├── tpsInterpolateIm.m ├── tpsRandom.m ├── txt2img.m └── uniqueColors.m └── videos ├── Contents.m ├── behaviorAnnotator.m ├── behaviorData.m ├── imagesAlign.m ├── imagesAlignSeq.m ├── kernelTracker.m ├── opticalFlow.m ├── opticalFlowTest.mat ├── peds30-seek.mat ├── peds30.seq ├── private ├── ktComputeW_c.c ├── ktComputeW_c.mexa64 ├── ktComputeW_c.mexmaci64 ├── ktComputeW_c.mexw64 ├── ktHistcRgb_c.c ├── ktHistcRgb_c.mexa64 ├── ktHistcRgb_c.mexmaci64 ├── ktHistcRgb_c.mexw64 ├── opticalFlowHsMex.cpp ├── opticalFlowHsMex.mexa64 ├── opticalFlowHsMex.mexmaci64 └── opticalFlowHsMex.mexw64 ├── seqIo.m ├── seqPlayer.m ├── seqReaderPlugin.m └── seqWriterPlugin.m /.gitignore: -------------------------------------------------------------------------------- 1 | /videos/private/*png*.* 2 | /videos/private/*jpg8c.* 3 | /detector/models/*Dets.txt 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Documentation: https://pdollar.github.io/toolbox/ 2 | -------------------------------------------------------------------------------- /channels/Contents.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/Contents.m -------------------------------------------------------------------------------- /channels/chnsCompute.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/chnsCompute.m -------------------------------------------------------------------------------- /channels/chnsPyramid.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/chnsPyramid.m -------------------------------------------------------------------------------- /channels/chnsScaling.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/chnsScaling.m -------------------------------------------------------------------------------- /channels/gradient2.m: -------------------------------------------------------------------------------- 1 | function [Gx,Gy] = gradient2( I ) 2 | % Compute numerical gradients along x and y directions. 3 | % 4 | % For 2D arrays identical to Matlab's gradient() with a spacing value of 5 | % h=1 but ~10-20x faster (due to mexed implementation). Like gradient(), 6 | % computes centered derivatives in interior of image and uncentered 7 | % derivatives along boundaries. For 3D arrays computes x and y gradient 8 | % separately for each channel and concatenates the results. 9 | % 10 | % This code requires SSE2 to compile and run (most modern Intel and AMD 11 | % processors support SSE2). Please see: http://en.wikipedia.org/wiki/SSE2. 12 | % 13 | % USAGE 14 | % [Gx,Gy] = gradient2( I ) 15 | % 16 | % INPUTS 17 | % I - [hxwxk] input k channel single image 18 | % 19 | % OUTPUTS 20 | % Gx - [hxwxk] x-gradient (horizontal) 21 | % Gy - [hxwxk] y-gradient (vertical) 22 | % 23 | % EXAMPLE 24 | % I=single(imread('peppers.png'))/255; 25 | % tic, [Gx1,Gy1]=gradient(I,1); toc 26 | % tic, [Gx2,Gy2]=gradient2(I); toc 27 | % isequal(Gx1,Gx2), isequal(Gy1,Gy2) 28 | % 29 | % See also gradient, gradientMag 30 | % 31 | % Piotr's Computer Vision Matlab Toolbox Version 3.00 32 | % Copyright 2014 Piotr Dollar & Ron Appel. [pdollar-at-gmail.com] 33 | % Licensed under the Simplified BSD License [see external/bsd.txt] 34 | 35 | [Gx,Gy]=gradientMex('gradient2',I); 36 | -------------------------------------------------------------------------------- /channels/gradientHist.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/gradientHist.m -------------------------------------------------------------------------------- /channels/hogDraw.m: -------------------------------------------------------------------------------- 1 | function V = hogDraw( H, w, fhog ) 2 | % Create visualization of hog descriptor. 3 | % 4 | % USAGE 5 | % V = hogDraw( H, [w], [fhog] ) 6 | % 7 | % INPUTS 8 | % H - [m n oBin*4] computed hog features 9 | % w - [15] width for each glyph 10 | % fhog - [0] if true draw features returned by fhog 11 | % 12 | % OUTPUTS 13 | % V - [m*w n*w] visualization of hog features 14 | % 15 | % EXAMPLE 16 | % 17 | % See also hog, fhog 18 | % 19 | % Piotr's Computer Vision Matlab Toolbox Version 3.23 20 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 21 | % Licensed under the Simplified BSD License [see external/bsd.txt] 22 | 23 | % fold normalizations 24 | if(nargin<3 || isempty(fhog)), fhog=0; end 25 | m=size(H,3); if(fhog), m=(m-5)/3; H=H(:,:,1:m*3); m=3; else m=4; end 26 | s=size(H); s(3)=s(3)/m; w0=H; H=zeros(s); 27 | for o=0:m-1, H=H+w0(:,:,(1:s(3))+o*s(3)); end; 28 | 29 | % construct a "glyph" for each orientaion 30 | if(nargin<2 || isempty(w)), w=15; end 31 | bar=zeros(w,w); bar(:,round(.45*w):round(.55*w))=1; 32 | bars=zeros([size(bar) s(3)]); 33 | for o=1:s(3), bars(:,:,o)=imrotate(bar,-(o-1)*180/s(3),'crop'); end 34 | 35 | % make pictures of positive weights by adding up weighted glyphs 36 | H(H<0)=0; V=zeros(w*s(1:2)); 37 | for r=1:s(1), rs=(1:w)+(r-1)*w; 38 | for c=1:s(2), cs=(1:w)+(c-1)*w; 39 | for o=1:s(3), V(rs,cs)=V(rs,cs)+bars(:,:,o)*H(r,c,o); end 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /channels/private/convConst.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/convConst.mexa64 -------------------------------------------------------------------------------- /channels/private/convConst.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/convConst.mexmaci64 -------------------------------------------------------------------------------- /channels/private/convConst.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/convConst.mexw64 -------------------------------------------------------------------------------- /channels/private/gradientMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/gradientMex.mexa64 -------------------------------------------------------------------------------- /channels/private/gradientMex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/gradientMex.mexmaci64 -------------------------------------------------------------------------------- /channels/private/gradientMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/gradientMex.mexw64 -------------------------------------------------------------------------------- /channels/private/gradientMexNew.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/gradientMexNew.mexmaci64 -------------------------------------------------------------------------------- /channels/private/imPadMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imPadMex.mexa64 -------------------------------------------------------------------------------- /channels/private/imPadMex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imPadMex.mexmaci64 -------------------------------------------------------------------------------- /channels/private/imPadMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imPadMex.mexw64 -------------------------------------------------------------------------------- /channels/private/imResampleMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imResampleMex.mexa64 -------------------------------------------------------------------------------- /channels/private/imResampleMex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imResampleMex.mexmaci64 -------------------------------------------------------------------------------- /channels/private/imResampleMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/imResampleMex.mexw64 -------------------------------------------------------------------------------- /channels/private/rgbConvertMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/rgbConvertMex.mexa64 -------------------------------------------------------------------------------- /channels/private/rgbConvertMex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/rgbConvertMex.mexmaci64 -------------------------------------------------------------------------------- /channels/private/rgbConvertMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/channels/private/rgbConvertMex.mexw64 -------------------------------------------------------------------------------- /channels/private/wrappers.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Piotr's Computer Vision Matlab Toolbox Version 3.00 3 | * Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 4 | * Licensed under the Simplified BSD License [see external/bsd.txt] 5 | *******************************************************************************/ 6 | #ifndef _WRAPPERS_HPP_ 7 | #define _WRAPPERS_HPP_ 8 | #ifdef MATLAB_MEX_FILE 9 | 10 | // wrapper functions if compiling from Matlab 11 | #include "mex.h" 12 | inline void wrError(const char *errormsg) { mexErrMsgTxt(errormsg); } 13 | inline void* wrCalloc( size_t num, size_t size ) { return mxCalloc(num,size); } 14 | inline void* wrMalloc( size_t size ) { return mxMalloc(size); } 15 | inline void wrFree( void * ptr ) { mxFree(ptr); } 16 | 17 | #else 18 | 19 | // wrapper functions if compiling from C/C++ 20 | inline void wrError(const char *errormsg) { throw errormsg; } 21 | inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); } 22 | inline void* wrMalloc( size_t size ) { return malloc(size); } 23 | inline void wrFree( void * ptr ) { free(ptr); } 24 | 25 | #endif 26 | 27 | // platform independent aligned memory allocation (see also alFree) 28 | void* alMalloc( size_t size, int alignment ) { 29 | const size_t pSize = sizeof(void*), a = alignment-1; 30 | void *raw = wrMalloc(size + a + pSize); 31 | void *aligned = (void*) (((size_t) raw + pSize + a) & ~a); 32 | *(void**) ((size_t) aligned-pSize) = raw; 33 | return aligned; 34 | } 35 | 36 | // platform independent alignned memory de-allocation (see also alMalloc) 37 | void alFree(void* aligned) { 38 | void* raw = *(void**)((char*)aligned-sizeof(void*)); 39 | wrFree(raw); 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /classify/adaBoostApply.m: -------------------------------------------------------------------------------- 1 | function hs = adaBoostApply( X, model, maxDepth, minWeight, nThreads ) 2 | % Apply learned boosted decision tree classifier. 3 | % 4 | % USAGE 5 | % hs = adaBoostApply( X, model, [maxDepth], [minWeight], [nThreads] ) 6 | % 7 | % INPUTS 8 | % X - [NxF] N length F feature vectors 9 | % model - learned boosted tree classifier 10 | % maxDepth - [] maximum depth of tree 11 | % minWeight - [] minimum sample weigth to allow split 12 | % nThreads - [16] max number of computational threads to use 13 | % 14 | % OUTPUTS 15 | % hs - [Nx1] predicted output log ratios 16 | % 17 | % EXAMPLE 18 | % 19 | % See also adaBoostTrain 20 | % 21 | % Piotr's Computer Vision Matlab Toolbox Version 3.40 22 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 23 | % Licensed under the Simplified BSD License [see external/bsd.txt] 24 | 25 | if(nargin<3 || isempty(maxDepth)), maxDepth=0; end 26 | if(nargin<4 || isempty(minWeight)), minWeight=0; end 27 | if(nargin<5 || isempty(nThreads)), nThreads=16; end 28 | if(maxDepth>0), model.child(model.depth>=maxDepth) = 0; end 29 | if(minWeight>0), model.child(model.weights<=minWeight) = 0; end 30 | nWeak=size(model.fids,2); N=size(X,1); hs=zeros(N,1); nt=nThreads; 31 | for i=1:nWeak 32 | ids = forestInds(X,model.thrs(:,i),model.fids(:,i),model.child(:,i),nt); 33 | hs = hs + model.hs(ids,i); 34 | end 35 | 36 | end 37 | -------------------------------------------------------------------------------- /classify/adaBoostTrain.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/adaBoostTrain.m -------------------------------------------------------------------------------- /classify/binaryTreeApply.m: -------------------------------------------------------------------------------- 1 | function hs = binaryTreeApply( X, tree, maxDepth, minWeight, nThreads ) 2 | % Apply learned binary decision tree classifier. 3 | % 4 | % USAGE 5 | % hs = binaryTreeApply( X, tree, [maxDepth], [minWeight], [nThreads] ) 6 | % 7 | % INPUTS 8 | % X - [NxF] N length F feature vectors 9 | % tree - learned tree classification model 10 | % maxDepth - [] maximum depth of tree 11 | % minWeight - [] minimum sample weigth to allow split 12 | % nThreads - [16] max number of computational threads to use 13 | % 14 | % OUTPUTS 15 | % hs - [Nx1] predicted output log ratios 16 | % 17 | % EXAMPLE 18 | % 19 | % See also binaryTreeTrain 20 | % 21 | % Piotr's Computer Vision Matlab Toolbox Version 3.40 22 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 23 | % Licensed under the Simplified BSD License [see external/bsd.txt] 24 | 25 | if(nargin<3 || isempty(maxDepth)), maxDepth=0; end 26 | if(nargin<4 || isempty(minWeight)), minWeight=0; end 27 | if(nargin<5 || isempty(nThreads)), nThreads=16; end 28 | if(maxDepth>0), tree.child(tree.depth>=maxDepth) = 0; end 29 | if(minWeight>0), tree.child(tree.weights<=minWeight) = 0; end 30 | hs = tree.hs(forestInds(X,tree.thrs,tree.fids,tree.child,nThreads)); 31 | 32 | end 33 | -------------------------------------------------------------------------------- /classify/binaryTreeTrain.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/binaryTreeTrain.m -------------------------------------------------------------------------------- /classify/demoCluster.m: -------------------------------------------------------------------------------- 1 | % Clustering demo. 2 | % 3 | % Used to test different clustering algorithms on 2D and 3D mixture of 4 | % gaussian data. Alter demo by edititing this file. 5 | % 6 | % USAGE 7 | % demoCluster 8 | % 9 | % INPUTS 10 | % 11 | % OUTPUTS 12 | % 13 | % EXAMPLE 14 | % demoCluster 15 | % 16 | % See also KMEANS2, MEANSHIFT 17 | % 18 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 19 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 20 | % Licensed under the Simplified BSD License [see external/bsd.txt] 21 | 22 | %%% generate data 23 | if(1) % mixture of gaussians -- see demoGenData 24 | kTr = 5; sep = 3; ecc = 3; nFracTr = 0.1; nPnts = 1000; d = 2; 25 | [X,IDXtr] = demoGenData(nPnts,0,kTr,d,sep,ecc,nFracTr); 26 | else 27 | % two parallel clusters - kmeans will fail 28 | kTr = 2; nPnts = 200; sep = 4; 29 | X = [([5 0; 0 .5] * randn(2,nPnts) + sep/2)' ; ... 30 | ([5 0; 0 .5] * randn(2,nPnts) - sep/2)' ] / 5; 31 | IDXtr = [ones(1,nPnts) 2*ones(1,nPnts)]; 32 | nFracTr=0; 33 | end; 34 | nFrac = nFracTr; k = kTr; 35 | 36 | %%% cluster 37 | switch 'kmeans2' 38 | case 'kmeans2' 39 | prm.nTrial=4; prm.display=1; prm.outFrac=nFrac; 40 | [IDX,C,sumd] = kmeans2( X, k, prm ); 41 | case 'meanShift' 42 | %(X,radius,rate,maxiter,minCsize,blur) 43 | [IDX,C] = meanShift( X, .4, .2, 100 , 10, 0 ); 44 | end 45 | 46 | %%% show data & clustering results 47 | figure(1); clf; d2 = min(d,3); 48 | subplot(2,2,1); visualizeData(X, d2); title('orig points'); 49 | if(~isempty(IDXtr)) 50 | subplot(2,2,2); visualizeData(X, d2, IDXtr); title('true clusters'); 51 | end; 52 | subplot(2,2,3); visualizeData(X, d2, IDX, [], C); title('rec clusters'); 53 | subplot(2,2,4); D=distMatrixShow(sqrt(pdist2(X,X)),IDX,0); im(D); 54 | -------------------------------------------------------------------------------- /classify/fernsClfApply.m: -------------------------------------------------------------------------------- 1 | function [hs,probs] = fernsClfApply( data, ferns, inds ) 2 | % Apply learned fern classifier. 3 | % 4 | % USAGE 5 | % [hs,probs] = fernsClfApply( data, ferns, [inds] ) 6 | % 7 | % INPUTS 8 | % data - [NxF] N length F binary feature vectors 9 | % ferns - learned fern classification model 10 | % inds - [NxM] cached inds (from previous call to fernsInds) 11 | % 12 | % OUTPUTS 13 | % hs - [Nx1] predicted output labels 14 | % probs - [NxH] predicted output label probabilities 15 | % 16 | % EXAMPLE 17 | % 18 | % See also fernsClfTrain, fernsInds 19 | % 20 | % Piotr's Computer Vision Matlab Toolbox Version 2.50 21 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 22 | % Licensed under the Simplified BSD License [see external/bsd.txt] 23 | if( nargin<3 || isempty(inds) ) 24 | inds = fernsInds(data,ferns.fids,ferns.thrs); end 25 | [N,M]=size(inds); H=ferns.H; probs=zeros(N,H); 26 | for m=1:M, probs = probs + ferns.pFern(inds(:,m),:,m); end 27 | if(ferns.bayes==0), probs=probs/M; end; [~,hs]=max(probs,[],2); 28 | end 29 | -------------------------------------------------------------------------------- /classify/fernsInds.m: -------------------------------------------------------------------------------- 1 | function inds = fernsInds( data, fids, thrs ) 2 | % Compute indices for each input by each fern. 3 | % 4 | % USAGE 5 | % inds = fernsInds( data, fids, thrs ) 6 | % 7 | % INPUTS 8 | % data - [NxF] N length F binary feature vectors 9 | % fids - [MxS] feature ids for each fern for each depth 10 | % thrs - [MxS] threshold corresponding to each fid 11 | % 12 | % OUTPUTS 13 | % inds - [NxM] computed indices for each input by each fern 14 | % 15 | % EXAMPLE 16 | % 17 | % See also fernsClfTrain, fernsClfApply 18 | % 19 | % Piotr's Computer Vision Matlab Toolbox Version 2.50 20 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 21 | % Licensed under the Simplified BSD License [see external/bsd.txt] 22 | 23 | inds = fernsInds1( data, fids, thrs ); 24 | 25 | %%% OLD MATLAB CODE -- NOW IN MEX 26 | % [M,S]=size(fids); N=size(data,1); 27 | % inds = zeros(N,M,'uint32'); 28 | % for n=1:N 29 | % for m=1:M 30 | % for s=1:S 31 | % inds(n,m)=inds(n,m)*2; 32 | % if( data(n,fids(m,s))0), tree.child(tree.depth>=maxDepth) = 0; end 34 | if(minCount>0), tree.child(tree.count<=minCount) = 0; end 35 | ids = forestInds(data,tree.thrs,tree.fids,tree.child); 36 | if(best), hs(:,i)=tree.hs(ids); else ps=ps+tree.distr(ids,:); end 37 | end 38 | if(discr), ps=[]; return; end % output is actually {NxM} in this case 39 | if(best), ps=histc(hs',1:H)'; end; [~,hs]=max(ps,[],2); ps=ps/M; 40 | end 41 | -------------------------------------------------------------------------------- /classify/pcaData.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/pcaData.mat -------------------------------------------------------------------------------- /classify/private/IDX2order.m: -------------------------------------------------------------------------------- 1 | function order = IDX2order( IDX ) 2 | % Converts class labels into an ordering. 3 | % 4 | % Creates an ordering order such that IDX(order)=[1 1...1 2...2 ... k...k]. 5 | % All points within a class retain the ordering in which they originally 6 | % appeared. Also, Xb = X(order,:) has cluster labels IDX(order), ie 7 | % adjacent elements in X typically belong to the same cluster. 8 | % 9 | % USAGE 10 | % order = IDX2order( IDX ) 11 | % 12 | % INPUTS 13 | % IDX - cluster membership [see kmeans2.m] 14 | % 15 | % OUTPUTS 16 | % order - n-by-1 vector containing a new ordering for the points. 17 | % 18 | % EXAMPLE 19 | % order = IDX2order( [1 1 3 1 2 2] ) % should be: [1 2 4 5 6 3] 20 | % 21 | % See also DISTMATRIXSHOW 22 | % 23 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 24 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 25 | % Licensed under the Simplified BSD License [see external/bsd.txt] 26 | 27 | k = max(IDX); n = length(IDX); 28 | order = zeros(1,n); count = 0; 29 | for i=1:k 30 | locs = (IDX==i); orderi = cumsum(locs); 31 | order(locs) = orderi(locs) + count; 32 | count = count+sum(locs); 33 | end 34 | [dis,order] = sort(order); 35 | -------------------------------------------------------------------------------- /classify/private/binaryTreeTrain1.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/private/binaryTreeTrain1.mexa64 -------------------------------------------------------------------------------- /classify/private/binaryTreeTrain1.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/private/binaryTreeTrain1.mexmaci64 -------------------------------------------------------------------------------- /classify/private/binaryTreeTrain1.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/classify/private/binaryTreeTrain1.mexw64 -------------------------------------------------------------------------------- /classify/private/fernsInds1.c: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Piotr's Computer Vision Matlab Toolbox Version 2.50 3 | * Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 4 | * Licensed under the Simplified BSD License [see external/bsd.txt] 5 | *******************************************************************************/ 6 | #include "mex.h" 7 | #include 8 | typedef unsigned int uint; 9 | 10 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { 11 | int N, F, M, S, n, f, m, s; 12 | double *data, *thrs; 13 | uint *fids, *inds; 14 | 15 | /* Error checking on arguments */ 16 | if( nrhs!=3) mexErrMsgTxt("Three input arguments required."); 17 | if( nlhs>1 ) mexErrMsgTxt("Too many output arguments."); 18 | if( !mxIsClass(prhs[0], "double") || !mxIsClass(prhs[1], "uint32") 19 | || !mxIsClass(prhs[2], "double")) 20 | mexErrMsgTxt("Input arrays are of incorrect type."); 21 | 22 | /* extract inputs */ 23 | data = (double*) mxGetData(prhs[0]); /* N x F */ 24 | fids = (uint*) mxGetData(prhs[1]); /* M x S */ 25 | thrs = (double*) mxGetData(prhs[2]); /* N x F */ 26 | N=mxGetM(prhs[0]); F=mxGetN(prhs[0]); 27 | M=mxGetM(prhs[1]); S=mxGetN(prhs[1]); 28 | 29 | /* create outputs */ 30 | plhs[0] = mxCreateNumericMatrix(N, M, mxUINT32_CLASS, mxREAL); 31 | inds = (uint*) mxGetData(plhs[0]); /* N x M */ 32 | 33 | /* compute inds */ 34 | for(m=0; m= minCl ); break; end; 41 | 42 | % otherwise discard smallest [last] cluster 43 | C( end, : ) = []; 44 | for i=find(IDX==k)' 45 | D = pdist2( X(i,:), C ); 46 | [mind IDx] = min(D,[],2); 47 | IDX(i) = IDx; 48 | end; 49 | k = k-1; 50 | 51 | tocStatus( ticId, (kinit-k)/kinit ); 52 | end 53 | tocStatus( ticId, 1 ); 54 | -------------------------------------------------------------------------------- /classify/rbfComputeFtrs.m: -------------------------------------------------------------------------------- 1 | function Xrbf = rbfComputeFtrs( X, rbfBasis ) 2 | % Evaluate features of X given a set of radial basis functions. 3 | % 4 | % See rbfComputeBasis for discussion of rbfs and general usage. 5 | % 6 | % USAGE 7 | % Xrbf = rbfComputeFtrs( X, rbfBasis ) 8 | % 9 | % INPUTS 10 | % X - [N x d] N points of d dimensions each 11 | % rbfBasis - rbfBasis struct (see rbfComputeBasis) 12 | % 13 | % OUTPUTS 14 | % Xrbf - [N x k] computed feature vectors 15 | % 16 | % EXAMPLE 17 | % 18 | % See also RBFDEMO, RBFCOMPUTEBASIS 19 | % 20 | % Piotr's Computer Vision Matlab Toolbox Version 2.50 21 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 22 | % Licensed under the Simplified BSD License [see external/bsd.txt] 23 | 24 | % compute distance to each basis function 25 | % mu=[k x d]; onesK=[k x 1]; Xi=[1 x d]; 26 | Xrbf = pdist2(X,rbfBasis.mu','sqeuclidean'); 27 | 28 | % compute gaussian response 29 | if( rbfBasis.globalVar ) 30 | Xrbf = exp( Xrbf / (-2*rbfBasis.var) ); 31 | else 32 | Xrbf = exp( bsxfun(@rdivide, Xrbf, -2*rbfBasis.vars ) ); 33 | end 34 | 35 | % add constant vector of ones as last feature 36 | if( rbfBasis.constant ) 37 | Xrbf(:,end+1) = 1; 38 | end 39 | 40 | % normalize rbfs to sum to 1 41 | if( rbfBasis.normalize ) 42 | Xrbf = bsxfun(@rdivide, Xrbf, sum(Xrbf,2)); 43 | end 44 | -------------------------------------------------------------------------------- /detector/Contents.m: -------------------------------------------------------------------------------- 1 | % DETECTOR 2 | % See also 3 | % 4 | % Please see acfReadme for an overview of the detection code. 5 | % 6 | % Aggregate channel features object detector: 7 | % acfDemoCal - Demo for aggregate channel features object detector on Caltech dataset. 8 | % acfDemoInria - Demo for aggregate channel features object detector on Inria dataset. 9 | % acfDetect - Run aggregate channel features object detector on given image(s). 10 | % acfModify - Modify aggregate channel features object detector. 11 | % acfReadme - Aggregate Channel Features Detector Overview. 12 | % acfSweeps - Parameter sweeps for ACF pedestrian detector. 13 | % acfTest - Test aggregate channel features object detector given ground truth. 14 | % acfTrain - Train aggregate channel features object detector. 15 | % 16 | % Object bounding box utilities and labeling tools: 17 | % bbApply - Functions for manipulating bounding boxes (bb). 18 | % bbGt - Bounding box (bb) annotations struct, evaluation and sampling routines. 19 | % bbLabeler - Bounding box or ellipse labeler for static images. 20 | % bbNms - Bounding box (bb) non-maximal suppression (nms). 21 | -------------------------------------------------------------------------------- /detector/acfReadme.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/acfReadme.m -------------------------------------------------------------------------------- /detector/acfTrain.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/acfTrain.m -------------------------------------------------------------------------------- /detector/models/AcfCaltech+Detector.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/AcfCaltech+Detector.mat -------------------------------------------------------------------------------- /detector/models/AcfCaltech+Roc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/AcfCaltech+Roc.png -------------------------------------------------------------------------------- /detector/models/AcfInriaDetector.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/AcfInriaDetector.mat -------------------------------------------------------------------------------- /detector/models/AcfInriaRoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/AcfInriaRoc.png -------------------------------------------------------------------------------- /detector/models/LdcfCaltechDetector.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/LdcfCaltechDetector.mat -------------------------------------------------------------------------------- /detector/models/LdcfCaltechRoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/LdcfCaltechRoc.png -------------------------------------------------------------------------------- /detector/models/LdcfInriaDetector.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/LdcfInriaDetector.mat -------------------------------------------------------------------------------- /detector/models/LdcfInriaRoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/models/LdcfInriaRoc.png -------------------------------------------------------------------------------- /detector/private/acfDetect1.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/private/acfDetect1.mexa64 -------------------------------------------------------------------------------- /detector/private/acfDetect1.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/private/acfDetect1.mexmaci64 -------------------------------------------------------------------------------- /detector/private/acfDetect1.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/detector/private/acfDetect1.mexw64 -------------------------------------------------------------------------------- /doc/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/alpha.png -------------------------------------------------------------------------------- /doc/c++.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/c++.png -------------------------------------------------------------------------------- /doc/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/c.png -------------------------------------------------------------------------------- /doc/channels/Contents.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/channels/Contents.html -------------------------------------------------------------------------------- /doc/channels/chnsCompute.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/channels/chnsCompute.html -------------------------------------------------------------------------------- /doc/channels/chnsPyramid.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/channels/chnsPyramid.html -------------------------------------------------------------------------------- /doc/channels/chnsScaling.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/channels/chnsScaling.html -------------------------------------------------------------------------------- /doc/channels/gradientHist.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/channels/gradientHist.html -------------------------------------------------------------------------------- /doc/classify/adaBoostTrain.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/classify/adaBoostTrain.html -------------------------------------------------------------------------------- /doc/classify/binaryTreeTrain.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/classify/binaryTreeTrain.html -------------------------------------------------------------------------------- /doc/demoicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/demoicon.gif -------------------------------------------------------------------------------- /doc/detector/acfReadme.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/detector/acfReadme.html -------------------------------------------------------------------------------- /doc/detector/acfTrain.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/detector/acfTrain.html -------------------------------------------------------------------------------- /doc/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/down.png -------------------------------------------------------------------------------- /doc/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/favicon.ico -------------------------------------------------------------------------------- /doc/fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/fortran.png -------------------------------------------------------------------------------- /doc/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/hp.png -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Piotr's Matlab Toolbox 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Sorry, your browser doesn't support frames. 20 | Go to menu.html for the documentation of all 21 | the Matlab functions. 22 | 23 | 24 | -------------------------------------------------------------------------------- /doc/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/left.png -------------------------------------------------------------------------------- /doc/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/linux.png -------------------------------------------------------------------------------- /doc/m2html.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: white; 3 | color: black; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | div.fragment { 10 | width: 98%; 11 | border: 1px solid #CCCCCC; 12 | background-color: #f5f5f5; 13 | padding-left: 4px; 14 | margin: 4px; 15 | } 16 | 17 | div.box { 18 | width: 98%; 19 | background-color: #f5f5f5; 20 | border: 1px solid #CCCCCC; 21 | color: black; 22 | padding: 4px; 23 | } 24 | 25 | .comment { 26 | color: #228B22; 27 | } 28 | .string { 29 | color: #B20000; 30 | } 31 | .keyword { 32 | color: #0000FF; 33 | } 34 | 35 | .keywordtype { color: #604020; } 36 | .keywordflow { color: #e08000; } 37 | .preprocessor { color: #806020; } 38 | .stringliteral { color: #002080; } 39 | .charliteral { color: #008080; } 40 | 41 | a { 42 | text-decoration: none; 43 | } 44 | 45 | a:hover { 46 | background-color: #006699; 47 | color:#FFFFFF; 48 | } 49 | 50 | a.code { 51 | font-weight: normal; 52 | color: #A020F0; 53 | } 54 | 55 | a.code:hover { 56 | background-color: #FF0000; 57 | color: #FFFFFF; 58 | } 59 | 60 | h1 { 61 | background: transparent; 62 | color: #006699; 63 | font-size: x-large; 64 | text-align: center; 65 | } 66 | 67 | h2 { 68 | background: transparent; 69 | color: #006699; 70 | font-size: large; 71 | } 72 | 73 | address { 74 | font-size:small; 75 | } 76 | -------------------------------------------------------------------------------- /doc/matlabicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/matlabicon.gif -------------------------------------------------------------------------------- /doc/mex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/mex.png -------------------------------------------------------------------------------- /doc/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/new.gif -------------------------------------------------------------------------------- /doc/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/right.png -------------------------------------------------------------------------------- /doc/sgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/sgi.png -------------------------------------------------------------------------------- /doc/simulinkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/simulinkicon.gif -------------------------------------------------------------------------------- /doc/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/solaris.png -------------------------------------------------------------------------------- /doc/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/up.png -------------------------------------------------------------------------------- /doc/videos/imagesAlignSeq.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/videos/imagesAlignSeq.html -------------------------------------------------------------------------------- /doc/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/doc/windows.png -------------------------------------------------------------------------------- /external/bsd.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Piotr Dollar 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | The views and conclusions contained in the software and documentation are those 25 | of the authors and should not be interpreted as representing official policies, 26 | either expressed or implied, of the FreeBSD Project. 27 | -------------------------------------------------------------------------------- /external/deprecated/clfData.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/deprecated/clfData.mat -------------------------------------------------------------------------------- /external/deprecated/clfDecTree.m: -------------------------------------------------------------------------------- 1 | function clf = clfDecTree( p, varargin ) 2 | % Wrapper for treefit that makes decision trees compatible with nfoldxval. 3 | % 4 | % USAGE 5 | % clf = clfDecTree( p, varargin ) 6 | % 7 | % INPUTS 8 | % p - data dimension 9 | % varargin- params for treefit, ex: 'splitmin'',2,'priorprob',ones(1,n)/n 10 | % 11 | % OUTPUTS 12 | % clf - model ready to be trained 13 | % 14 | % EXAMPLE 15 | % 16 | % See also NFOLDXVAL, TREEFIT, CLFDECTREEFWD, CLFDECTREETRAIN 17 | % 18 | % Piotr's Image&Video Toolbox Version 2.0 19 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 20 | % Please email me if you find bugs, or have suggestions or questions! 21 | % Licensed under the Lesser GPL [see external/lgpl.txt] 22 | 23 | clf.p = p; 24 | clf.type = 'dectree'; 25 | clf.params = varargin; 26 | 27 | clf.funTrain = @clfDecTreeTrain; 28 | clf.funFwd = @clfDecTreeFwd; 29 | -------------------------------------------------------------------------------- /external/deprecated/clfDecTreeFwd.m: -------------------------------------------------------------------------------- 1 | function Y = clfDecTreeFwd( clf, X ) 2 | % Apply the decision tree to data X. 3 | % 4 | % USAGE 5 | % Y = clfDecTreeFwd( clf, X ) 6 | % 7 | % INPUTS 8 | % clf - trained model 9 | % X - nxp data array 10 | % 11 | % OUTPUTS 12 | % Y - nx1 vector of labels predicted according to the clf 13 | % 14 | % EXAMPLE 15 | % 16 | % See also CLFDECTREE 17 | % 18 | % Piotr's Image&Video Toolbox Version 2.0 19 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 20 | % Please email me if you find bugs, or have suggestions or questions! 21 | % Licensed under the Lesser GPL [see external/lgpl.txt] 22 | 23 | if(~strcmp(clf.type,'dectree')); error( ['incor. type: ' clf.type] ); end; 24 | if( size(X,2)~= clf.p ); error( 'Incorrect data dimension' ); end; 25 | T = clf.T; 26 | 27 | [Y,d,cnames] = treeval( T, X ); 28 | Y = str2double( cnames ); % convert Y back to an int format 29 | -------------------------------------------------------------------------------- /external/deprecated/clfDecTreeTrain.m: -------------------------------------------------------------------------------- 1 | function clf = clfDecTreeTrain( clf, X, Y ) 2 | % Train a decision tree classifier. 3 | % 4 | % USAGE 5 | % clf = clfDecTreeTrain( clf, X, Y ) 6 | % 7 | % INPUTS 8 | % clf - model to be trained 9 | % X - nxp data array 10 | % Y - nx1 array of labels 11 | % 12 | % OUTPUTS 13 | % clf - a trained binary decision tree clf 14 | % 15 | % EXAMPLE 16 | % 17 | % See also CLFDECTREE 18 | % 19 | % Piotr's Image&Video Toolbox Version 2.0 20 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 21 | % Please email me if you find bugs, or have suggestions or questions! 22 | % Licensed under the Lesser GPL [see external/lgpl.txt] 23 | 24 | if(~strcmp(clf.type,'dectree')); error( ['incor. type: ' clf.type] ); end 25 | if( size(X,2)~= clf.p ); error( 'Incorrect data dimension' ); end 26 | 27 | % apply treefit 28 | Y = int2str2( Y ); % convert Y to string format for treefit. 29 | params = clf.params; 30 | T = treefit(X,Y,'method','classification',params{:}); 31 | 32 | % apply cross validation (on training data), and prune 33 | [c,s,n,best] = treetest(T,'cross',X,Y); 34 | T = treeprune(T,'level',best); 35 | 36 | clf.T = T; 37 | -------------------------------------------------------------------------------- /external/deprecated/clfEcoc.m: -------------------------------------------------------------------------------- 1 | function clf = clfEcoc(p,clfInit,clfparams,nclasses,use01targets) 2 | % Wrapper for ecoc that makes ecoc compatible with nfoldxval. 3 | % 4 | % Requires the SVM toolbox by Anton Schwaighofer. 5 | % 6 | % USAGE 7 | % clf = clfEcoc(p,clfInit,clfparams,nclasses,use01targets) 8 | % 9 | % INPUTS 10 | % p - data dimension 11 | % clfInit - binary classifier init (see nfoldxval) 12 | % clfparams - binary classifier parameters (see nfoldxval) 13 | % nclasses - num of classes (currently 3<=nclasses<=7 suppored) 14 | % use01targets - see ecoc 15 | % 16 | % OUTPUTS 17 | % clf - see ecoc 18 | % 19 | % EXAMPLE 20 | % 21 | % See also ECOC, NFOLDXVAL, CLFECOCCODE 22 | % 23 | % Piotr's Image&Video Toolbox Version 2.0 24 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 25 | % Please email me if you find bugs, or have suggestions or questions! 26 | % Licensed under the Lesser GPL [see external/lgpl.txt] 27 | 28 | if( nclasses<3 || nclasses>7 ) 29 | error( 'currently only works if 3<=nclasses<=7'); end; 30 | if( nargin<5 || isempty(use01targets)); use01targets=0; end; 31 | 32 | % create code (limited for now) 33 | [C,nbits] = clfEcocCode( nclasses ); 34 | clf = ecoc(nclasses, nbits, C, use01targets ); % didn't use to pass use01? 35 | clf.verbosity = 0; % don't diplay output 36 | 37 | % initialize and temporarily store binary learner 38 | clf.templearner = feval( clfInit, p, clfparams{:} ); 39 | 40 | % ecoctrain2 is custom version of ecoctrain 41 | clf.funTrain = @clfEcocTrain; 42 | clf.funFwd = @ecocfwd; 43 | 44 | function clf = clfEcocTrain( clf, varargin ) 45 | 46 | clf = ecoctrain( clf, clf.templearner, varargin{:} ); 47 | -------------------------------------------------------------------------------- /external/deprecated/clfEcocCode.m: -------------------------------------------------------------------------------- 1 | function [C,nbits] = clfEcocCode( k ) 2 | % Generates optimal ECOC codes when 3<=nclasses<=7. 3 | % 4 | % USAGE 5 | % [C,nbits] = clfEcocCode( k ) 6 | % 7 | % INPUTS 8 | % k - number of classes 9 | % 10 | % OUTPUTS 11 | % C - code 12 | % nbits - number of bits 13 | % 14 | % EXAMPLE 15 | % 16 | % See also CLFECOC 17 | % 18 | % Piotr's Image&Video Toolbox Version 2.0 19 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 20 | % Please email me if you find bugs, or have suggestions or questions! 21 | % Licensed under the Lesser GPL [see external/lgpl.txt] 22 | 23 | if( k<3 || k>7 ) 24 | error( 'method only works if k is small: 3<=k<=7'); end 25 | 26 | % create C 27 | C = ones(k,2^(k-1)); 28 | for i=2:k 29 | partw = 2^(k-i); nparts = 2^(i-2); 30 | row = [zeros(1,partw) ones(1,partw)]; 31 | row = repmat( row, 1, nparts ); 32 | C(i,:) = row; 33 | end 34 | C = C(:,1:end-1); 35 | nbits = size(C,2); 36 | 37 | % alter C to have entries [-1,1] 38 | C(C==0)=-1; 39 | -------------------------------------------------------------------------------- /external/deprecated/clfKnn.m: -------------------------------------------------------------------------------- 1 | function clf = clfKnn( p, k, metric ) 2 | % Create a k nearest neighbor classifier. 3 | % 4 | % USAGE 5 | % clf = clfKnn( p, k, metric ) 6 | % 7 | % INPUTS 8 | % p - data dimension 9 | % k - number of nearest neighbors to look at 10 | % metric - [] distance function, squared euclidean by default 11 | % 12 | % OUTPUTS 13 | % clf - model ready to be trained 14 | % 15 | % EXAMPLE 16 | % 17 | % See also NFOLDXVAL, CLFKNNTRAIN, CLFKNNFWD, CLFKNNDIST 18 | % 19 | % Piotr's Image&Video Toolbox Version 2.0 20 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 21 | % Please email me if you find bugs, or have suggestions or questions! 22 | % Licensed under the Lesser GPL [see external/lgpl.txt] 23 | 24 | if( nargin<3 ); metric = []; end 25 | 26 | clf.p = p; 27 | clf.type = 'knn'; 28 | clf.k = k; 29 | clf.metric = metric; 30 | clf.funTrain = @clfKnnTrain; 31 | clf.funFwd = @clfKnnFwd; 32 | -------------------------------------------------------------------------------- /external/deprecated/clfKnnFwd.m: -------------------------------------------------------------------------------- 1 | function Y = clfKnnFwd( clf, X ) 2 | % Apply a k-nearest neighbor classifier to X. 3 | % 4 | % USAGE 5 | % Y = clfKnnFwd( clf, X ) 6 | % 7 | % INPUTS 8 | % clf - trained model 9 | % X - nxp data array 10 | % 11 | % OUTPUTS 12 | % Y - nx1 vector of labels predicted according to the clf 13 | % 14 | % EXAMPLE 15 | % 16 | % See also CLFKNN, CLFKNNTRAIN 17 | % 18 | % Piotr's Image&Video Toolbox Version 2.0 19 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 20 | % Please email me if you find bugs, or have suggestions or questions! 21 | % Licensed under the Lesser GPL [see external/lgpl.txt] 22 | 23 | if( ~strcmp(clf.type,'knn')); error( ['incorrect type: ' clf.type] ); end 24 | if( size(X,2)~= clf.p ); error( 'Incorrect data dimension' ); end 25 | 26 | metric = clf.metric; 27 | Xtrain = clf.Xtrain; 28 | Ytrain = clf.Ytrain; 29 | k = clf.k; 30 | 31 | % get nearest neighbors for each X point 32 | D = pdist2( X, Xtrain, metric ); 33 | Y = clfKnnDist( D, Ytrain, k ); 34 | -------------------------------------------------------------------------------- /external/deprecated/clfKnnTrain.m: -------------------------------------------------------------------------------- 1 | function clf = clfKnnTrain( clf, X, Y ) 2 | % Train a k nearest neighbor classifier (memorization). 3 | % 4 | % USAGE 5 | % clf = clfKnnTrain( clf, X, Y ) 6 | % 7 | % INPUTS 8 | % clf - model to be trained 9 | % X - nxp data array 10 | % Y - nx1 array of labels 11 | % 12 | % OUTPUTS 13 | % clf - a trained k-nearest neighbor classifier. 14 | % 15 | % EXAMPLE 16 | % 17 | % See also CLFKNN, CLFKNNFWD 18 | % 19 | % Piotr's Image&Video Toolbox Version 2.0 20 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 21 | % Please email me if you find bugs, or have suggestions or questions! 22 | % Licensed under the Lesser GPL [see external/lgpl.txt] 23 | 24 | if( ~strcmp(clf.type,'knn')); error( ['incorrect type: ' clf.type] ); end; 25 | if( size(X,2)~= clf.p ); error( 'Incorrect data dimension' ); end; 26 | 27 | %%% error check 28 | n=size(X,1); Y=double(Y); 29 | [Y,er] = checkNumArgs( Y, [n 1], 0, 0 ); error(er); 30 | 31 | %%% training is memorization 32 | clf.Xtrain = X; 33 | clf.Ytrain = Y; 34 | -------------------------------------------------------------------------------- /external/deprecated/clfLda.m: -------------------------------------------------------------------------------- 1 | function clf = clfLda( p, type, prior ) 2 | % Create a Linear Discriminant Analysis (LDA) classifier. 3 | % 4 | % Same algorithm as matlab's function 'classify' (in the statistics 5 | % toolbox). Nice to have in form that actually stores a model that can be 6 | % applied multiple times. For the meaning and usage of prior and type see 7 | % classify.m 8 | % 9 | % USAGE 10 | % clf = clfLda( p, [type], [prior] ) 11 | % 12 | % INPUTS 13 | % p - data dimension 14 | % type - ['linear'] 'linear', 'quadratic', 'mahalanobis' 15 | % prior - [] prior to use 16 | % 17 | % OUTPUTS 18 | % clf - an LDA model ready to be trained (see clfLdaTrain) 19 | % 20 | % EXAMPLE 21 | % 22 | % See also NFOLDXVAL, CLASSIFY, CLFLDATRAIN, CLFLDAFWD 23 | % 24 | % Piotr's Image&Video Toolbox Version 2.0 25 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 26 | % Please email me if you find bugs, or have suggestions or questions! 27 | % Licensed under the Lesser GPL [see external/lgpl.txt] 28 | 29 | if( nargin<3 ); prior=[]; end 30 | 31 | %%% get type 32 | if( nargin < 2 || isempty(type) ) 33 | type = 1; % 'linear' 34 | elseif ischar(type) 35 | i = strmatch(lower(type), {'linear','quadratic','mahalanobis'}); 36 | if( length(i)>1 ); 37 | error('Ambiguous value for TYPE: %s.', type); 38 | elseif( isempty(i)); 39 | error('Unknown value for TYPE: %s.', type); 40 | end; 41 | type = i; 42 | else 43 | error('TYPE must be a string.'); 44 | end 45 | 46 | %%% save clfLda parameters 47 | clf.prior = prior; 48 | clf.p = p; 49 | clf.type = 'lda'; 50 | clf.clfLdaType = type; 51 | clf.funTrain = @clfLdaTrain; 52 | clf.funFwd = @clfLdaFwd; 53 | -------------------------------------------------------------------------------- /external/deprecated/clfSvm.m: -------------------------------------------------------------------------------- 1 | function net = clfSvm(varargin) 2 | % Wrapper for svm that makes svm compatible with nfoldxval. 3 | % 4 | % Requires the SVM toolbox by Anton Schwaighofer. 5 | % 6 | % USAGE 7 | % net = clfSvm(varargin) 8 | % 9 | % INPUTS 10 | % see svm in SVM toolbox by Anton Schwaighofer. 11 | % 12 | % OUTPUTS 13 | % see svm in SVM toolbox by Anton Schwaighofer. 14 | % 15 | % EXAMPLE 16 | % 17 | % See also SVM, NFOLDXVAL 18 | % 19 | % Piotr's Image&Video Toolbox Version 2.0 20 | % Copyright 2008 Piotr Dollar. [pdollar-at-caltech.edu] 21 | % Please email me if you find bugs, or have suggestions or questions! 22 | % Licensed under the Lesser GPL [see external/lgpl.txt] 23 | 24 | net = svm( varargin{:} ); 25 | net.funTrain = @svmtrain; 26 | net.funFwd = @svmfwd; 27 | -------------------------------------------------------------------------------- /external/deprecated/filter_gauss_1D.m: -------------------------------------------------------------------------------- 1 | % 1D Gaussian filter. 2 | % 3 | % Equivalent to (but faster then): 4 | % f = fspecial('Gaussian',[2*r+1,1],sigma); 5 | % f = filter_gauss_nD( 2*r+1, r+1, sigma^2 ); 6 | % 7 | % USAGE 8 | % f = filter_gauss_1D( r, sigma, [show] ) 9 | % 10 | % INPUTS 11 | % r - filter size=2r+1, if r=[] -> r=ceil(2.25*sigma) 12 | % sigma - standard deviation of filter 13 | % show - [0] figure to use for optional display 14 | % 15 | % OUTPUTS 16 | % f - 1D Gaussian filter 17 | % 18 | % EXAMPLE 19 | % f1 = filter_gauss_1D( 10, 2, 1 ); 20 | % f2 = filter_gauss_nD( 21, [], 2^2, 2); 21 | % 22 | % See also FILTER_BINOMIAL_1D, FILTER_GAUSS_ND, FSPECIAL 23 | 24 | % Piotr's Image&Video Toolbox Version 1.5 25 | % Written and maintained by Piotr Dollar pdollar-at-cs.ucsd.edu 26 | % Please email me if you find bugs, or have suggestions or questions! 27 | 28 | function f = filter_gauss_1D( r, sigma, show ) 29 | 30 | if( nargin<3 || isempty(show) ); show=0; end 31 | if( isempty(r) ); r = ceil(sigma*2.25); end 32 | if( mod(r,1)~=0 ); error( 'r must be an integer'); end 33 | 34 | % compute filter 35 | x = -r:r; 36 | f = exp(-(x.*x)/(2*sigma*sigma))'; 37 | f(f20K images) rather poorly (I'm talking to you Bill). Thus, can take 5 | % 100K images, and write into 5 separate directories, then read them back 6 | % in. 7 | % 8 | % USAGE 9 | % I = imwrite2split( I, nSplits, spliti, path, [varargin] ) 10 | % 11 | % INPUTS 12 | % I - image or images (if [] reads else writes) 13 | % nSplits - number of directories to split data into 14 | % spliti - first split number 15 | % path - directory where images are 16 | % writePrms - [varargin] parameters to imwrite2 17 | % 18 | % OUTPUTS 19 | % I - image or images (read from disk if input I=[]) 20 | % 21 | % EXAMPLE 22 | % load images; clear IDXi IDXv t video videos; 23 | % imwrite2split( images(:,:,1:10), 2, 0, 'rats', 'rats', 'png', 5 ); 24 | % images2=imwrite2split( [], 2, 0, 'rats', 'rats', 'png', 5 ); 25 | % 26 | % See also IMWRITE2 27 | 28 | % Piotr's Image&Video Toolbox Version NEW 29 | % Written and maintained by Piotr Dollar pdollar-at-cs.ucsd.edu 30 | % Please email me if you find bugs, or have suggestions or questions! 31 | 32 | function I = imwrite2split( I, nSplits, spliti, path, varargin ) 33 | 34 | n = size(I,3); if( isempty(I) ); n=0; end 35 | nSplits = min(n,nSplits); 36 | for s=1:nSplits 37 | pathSplit = [path int2str2(s-1+spliti,2)]; 38 | if( n>0 ) % write 39 | nPerDir = ceil( n / nSplits ); 40 | ISplit = I(:,:,1:min(end,nPerDir)); 41 | imwrite2( ISplit, nPerDir>1, 0, pathSplit, varargin{:} ); 42 | if( s~=nSplits ); I = I(:,:,(nPerDir+1):end); end 43 | else % read 44 | ISplit = imwrite2( [], 1, 0, pathSplit, varargin{:} ); 45 | I = cat(3,I,ISplit); 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /external/deprecated/localsum_block.m: -------------------------------------------------------------------------------- 1 | % Calculates the sum in non-overlapping blocks of I of size dims. 2 | % 3 | % Similar to localsum except gets sum in non-overlapping windows. 4 | % Equivalent to doing localsum, and then subsampling (except more 5 | % efficient). 6 | % 7 | % USAGE 8 | % I = localsum_block( I, dims ) 9 | % 10 | % INPUTS 11 | % I - matrix to compute sum over 12 | % dims - size of volume to compute sum over 13 | % 14 | % OUTPUTS 15 | % I - resulting array 16 | % 17 | % EXAMPLE 18 | % load trees; I=ind2gray(X,map); 19 | % I2 = localsum_block( I, 11 ); 20 | % figure(1); im(I); figure(2); im(I2); 21 | % 22 | % See also LOCALSUM 23 | 24 | % Piotr's Image&Video Toolbox Version 1.5 25 | % Written and maintained by Piotr Dollar pdollar-at-cs.ucsd.edu 26 | % Please email me if you find bugs, or have suggestions or questions! 27 | 28 | function I = localsum_block( I, dims ) 29 | 30 | I = nlfiltblock_sep( I, dims, @rnlfiltblock_sum ); 31 | -------------------------------------------------------------------------------- /external/deprecated/makemovie.m: -------------------------------------------------------------------------------- 1 | % [3D] Used to convert a stack of T images into a movie. 2 | % 3 | % To display same data statically use montage. 4 | % 5 | % USAGE 6 | % M = makemovies( IS ) 7 | % 8 | % INPUTS 9 | % IS - MxNxT or MxNx1xT or MxNx3xT array of movies. 10 | % 11 | % OUTPUTS 12 | % M - resulting movie 13 | % 14 | % EXAMPLE 15 | % load( 'images.mat' ); 16 | % M = makemovie( videos(:,:,:,1) ); 17 | % movie( M ); 18 | % 19 | % See also MONTAGE2, MAKEMOVIES, PLAYMOVIE, CELL2ARRAY, FEVALARRAYS, 20 | % IMMOVIE, MOVIE2AVI 21 | 22 | % Piotr's Image&Video Toolbox Version NEW 23 | % Written and maintained by Piotr Dollar pdollar-at-cs.ucsd.edu 24 | % Please email me if you find bugs, or have suggestions or questions! 25 | 26 | function M = makemovie( IS ) 27 | 28 | % get images format (if image stack is MxNxT convert to MxNx1xT) 29 | if (ndims(IS)==3); IS = permute(IS, [1,2,4,3] ); end 30 | siz = size(IS); nch = siz(3); nd = ndims(IS); 31 | if ( nd~=4 ); error('unsupported dimension of IS'); end 32 | if( nch~=1 && nch~=3 ); error('illegal image stack format'); end; 33 | 34 | % normalize for maximum contrast 35 | if( isa(IS,'double') ); IS = IS - min(IS(:)); IS = IS / max(IS(:)); end 36 | 37 | % make movie 38 | for i=1:siz(4) 39 | Ii=IS(:,:,:,i); 40 | if( nch==1 ); [Ii,Mi] = gray2ind( Ii ); else Mi=[]; end 41 | if i==1 42 | M=repmat(im2frame( Ii, Mi ),[1,siz(4)]); 43 | else 44 | M(i) = im2frame( Ii, Mi ); 45 | end 46 | end 47 | 48 | -------------------------------------------------------------------------------- /external/deprecated/mode2.m: -------------------------------------------------------------------------------- 1 | % Returns the mode of a vector. 2 | % 3 | % Was mode not part of Matlab before? 4 | % 5 | % USAGE 6 | % y = mode2( x ) 7 | % 8 | % INPUTS 9 | % x - vector of integers 10 | % 11 | % OUTPUTS 12 | % y - mode 13 | % 14 | % EXAMPLE 15 | % x = randint2( 1, 10, [1 3] ) 16 | % mode(x), mode2( x ) 17 | % 18 | % See also MODE 19 | 20 | % Piotr's Image&Video Toolbox Version 1.5 21 | % Written and maintained by Piotr Dollar pdollar-at-cs.ucsd.edu 22 | % Please email me if you find bugs, or have suggestions or questions! 23 | 24 | function y = mode2( x ) 25 | 26 | wid = sprintf('Images:%s:obsoleteFunction',mfilename); 27 | warning(wid,[ '%s is obsolete in Piotr''s toolbox.\n MODE is its '... 28 | 'recommended replacement.'],upper(mfilename)); 29 | 30 | y = mode( x ); 31 | 32 | % [b,i,j] = unique(x); 33 | % [ mval, ind ] = max(hist(j,length(b))); 34 | % y = b(ind); 35 | -------------------------------------------------------------------------------- /external/deprecated/randperm2.m: -------------------------------------------------------------------------------- 1 | % Returns a random permutation of integers. 2 | % 3 | % randperm2(n) is a random permutation of the integers from 1 to n. For 4 | % example, randperm2(6) might be [2 4 5 6 1 3]. randperm2(n,k) is only 5 | % returns the first k elements of the permuation, so for example 6 | % randperm2(6) might be [2 4]. This is a faster version of randperm.m if 7 | % only need first k< 9 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 10 | 11 | s = ['Template Object: root ''',... 12 | tpl.root,''', ',... 13 | num2str(length(tpl.file)), ' files, ',... 14 | num2str(length(tpl.varkeys)), ' keys, ',... 15 | tpl.unknowns, ' unknowns.']; 16 | -------------------------------------------------------------------------------- /external/m2html/@template/display.m: -------------------------------------------------------------------------------- 1 | function display(tpl) 2 | %TEMPLATE Display a template object in Matlab window 3 | % DISPLAY(TPL) displays informations about the content of template 4 | % object TPL: 5 | % Template Object: root '.', 2 files, 9 keys, comment unknowns. 6 | % root element of template files, number of template files, number of 7 | % keywords defined and the way of handling unknowns tags. 8 | 9 | % Copyright (C) 2003 Guillaume Flandin 10 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 11 | 12 | disp(' '); 13 | disp([inputname(1),' = ']); 14 | disp(' '); 15 | for i=1:prod(size(tpl)) 16 | disp([blanks(length(inputname(1))+3) char(tpl(i))]); 17 | end 18 | disp(' '); 19 | -------------------------------------------------------------------------------- /external/m2html/@template/get.m: -------------------------------------------------------------------------------- 1 | function varargout = get(tpl,action,varargin) 2 | %TEMPLATE/GET Access data stored in a Template object 3 | % TPL = GET(TPL,ACTION,VARARGIN) 4 | % ACTION 'var' 5 | % ACTION 'undefined' 6 | 7 | % Copyright (C) 2003 Guillaume Flandin 8 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 9 | 10 | narginchk(2,3); 11 | 12 | switch lower(action) 13 | case 'var' 14 | narginchk(2,3); 15 | if nargin == 2 16 | varargout{1} = tpl.varvals; 17 | elseif iscellstr(varargin{1}) 18 | varargout{1} = {}; 19 | for i=1:length(varargin{1}) 20 | key = find(ismember(tpl.varkeys,varargin{1}{i})); 21 | if isempty(key) 22 | %error('[Template] No such variable name.'); 23 | varargout{1}{end+1} = ''; 24 | else 25 | varargout{1}{end+1} = tpl.varvals{key}; 26 | end 27 | end 28 | elseif ischar(varargin{1}) 29 | varargout{1} = char(get(tpl,'var',cellstr(varargin{1}))); 30 | else 31 | varargout{1} = ''; 32 | end 33 | case 'undefined' 34 | narginchk(3,3); 35 | tpl = loadtpl(tpl,varargin{1}); 36 | str = get(tpl,'var',varargin{1}); 37 | varargout{1} = {}; 38 | 39 | %%%%%%%%%%%%%%%%%%%%%%%% WIH REGEXP ONLY %%%%%%%%%%%%%%%%%%%% 40 | % [b, e] = regexp(str,'{[^ \t\r\n}]+}'); 41 | % for i=1:length(b) 42 | % if ~any(ismember(tpl.varkeys,str(b(i)+1:e(i)-1))) 43 | % varargout{1}{end+1} = str(b(i)+1:e(i)-1); 44 | % end 45 | % end 46 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 47 | 48 | otherwise 49 | varargout{1} = finish(get(tpl,'var',action),tpl.unknowns); 50 | end 51 | -------------------------------------------------------------------------------- /external/m2html/@template/parse.m: -------------------------------------------------------------------------------- 1 | function [tpl, str] = parse(tpl,target,handle,append) 2 | %TEMPLATE/PARSE Fill in replacement fields with the class properties 3 | % [TPL, STR] = PARSE(TPL,TARGET,HANDLE) fills in the replacement field 4 | % HANDLE using previously defined variables of template TPL and store 5 | % it in field TARGET. HANDLE can also be a cell array of field names. 6 | % Output is also provided in output STR (content of TARGET). 7 | % [TPL, STR] = PARSE(TPL,TARGET,HANDLE,APPEND) allows to specify if 8 | % TARGET field is reseted before being filled or if new content is 9 | % appended to the previous one. 10 | 11 | % Copyright (C) 2003 Guillaume Flandin 12 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 13 | 14 | narginchk(3,4); 15 | if nargin == 3 16 | append = 0; 17 | end 18 | 19 | if iscellstr(handle) 20 | for i=1:length(handle) 21 | [tpl, str] = subst(tpl,handle{i}); 22 | tpl = set(tpl,'var',target,str); 23 | end 24 | elseif ischar(handle) 25 | [tpl, str] = subst(tpl,handle); 26 | if append 27 | tpl = set(tpl,'var',target,[get(tpl,'var',target) str]); 28 | else 29 | tpl = set(tpl,'var',target,str); 30 | end 31 | else 32 | error('[Template] Badly formed handle.'); 33 | end 34 | -------------------------------------------------------------------------------- /external/m2html/@template/private/finish.m: -------------------------------------------------------------------------------- 1 | function str = finish(str,unknowns) 2 | %TEMPLATE/FINISH Apply given strategy to unknown fields in a string 3 | % STR = FINISH(STR,UNKNOWNS) applies on string STR the strategy defined 4 | % in UNKNOWNS to unknowns fields '{UNKNOWNS_FIELDS}'. 5 | % UNKNOWNS may be: 6 | % * 'keep' to do nothing 7 | % * 'remove' to remove all undefined fields 8 | % * 'comment' to replace undefined fields by a warning HTML comment. 9 | % This function uses Matlab REGEXPREP function coming with R13. If you 10 | % hold an older version, please comment lines 38 and 42: then you can 11 | % only apply the 'keep' strategy. 12 | 13 | % Copyright (C) 2003 Guillaume Flandin 14 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 15 | 16 | narginchk(2,2); 17 | 18 | switch lower(unknowns) 19 | case 'keep' 20 | %- do nothing 21 | case 'remove' 22 | %%%%%%%%%%%%%%%%%%%%%%%% WIH REGEXP ONLY %%%%%%%%%%%%%%%%%%%% 23 | % str = regexprep(str,'{[^ \t\r\n}]+}',''); 24 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 25 | case 'comment' 26 | %%%%%%%%%%%%%%%%%%%%%%%% WIH REGEXP ONLY %%%%%%%%%%%%%%%%%%%% 27 | % str = regexprep(str,'{[^ \t\r\n}]+}',''); 28 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 29 | otherwise 30 | error('[Template] Unknown action.'); 31 | end 32 | -------------------------------------------------------------------------------- /external/m2html/@template/private/loadtpl.m: -------------------------------------------------------------------------------- 1 | function tpl = loadtpl(tpl,handle) 2 | %TEMPLATE/LOADTPL Read a template from file 3 | % TPL = LOADTPL(TPL,HANDLE) read the template file associated with the 4 | % handle HANDLE in the template TPL and store it in the variable HANDLE. 5 | 6 | % Copyright (C) 2003 Guillaume Flandin 7 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 8 | 9 | if ~isempty(get(tpl,'var',handle)) 10 | return; 11 | else 12 | ind = find(ismember(tpl.handles,handle)); 13 | if isempty(ind) 14 | error('[Template] No such template handle.'); 15 | else 16 | filename = tpl.file{ind}; 17 | [fid, errmsg] = fopen(filename,'rt'); 18 | if ~isempty(errmsg) 19 | error(sprintf('Cannot open template file %s.',filename)); 20 | end 21 | tpl = set(tpl,'var',handle,fscanf(fid,'%c')); 22 | fclose(fid); 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /external/m2html/@template/private/subst.m: -------------------------------------------------------------------------------- 1 | function [tpl, str] = subst(tpl,handle) 2 | %TEMPLATE/SUBST Substitute a replacement field by its value 3 | % STR = SUBST(TPL,HANDLE) substitute all the known fields of variable HANDLE 4 | % in the template TPL. 5 | 6 | % Copyright (C) 2003 Guillaume Flandin 7 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 8 | 9 | tpl = loadtpl(tpl,handle); 10 | 11 | str = get(tpl,'var',handle); 12 | for i=1:length(tpl.varkeys) 13 | str = strrep(str, strcat('{',tpl.varkeys{i},'}'), tpl.varvals{i}); 14 | end 15 | -------------------------------------------------------------------------------- /external/m2html/@template/template.m: -------------------------------------------------------------------------------- 1 | function tpl = template(root,unknowns) 2 | %TEMPLATE HTML Template Toolbox Constructor 3 | % TPL = TEMPLATE returns a template object using default values for the 4 | % root path of the template files ('.') and for the way of handling unknown 5 | % replacement fields (default is 'remove'). 6 | % TPL = TEMPLATE(ROOT) allows to specify the root path of the template files 7 | % that will then be provided relative to this path. 8 | % TPL = TEMPLATE(ROOT,UNKNOWNS) also allows to specify the strategy to apply 9 | % to unkown fields. UNKNOWNS may be: 10 | % * 'keep' to do nothing 11 | % * 'remove' to remove all undefined fields 12 | % * 'comment' to replace undefined fields by a warning HTML comment. 13 | % 14 | % The template class allows you to keep your HTML code in some external 15 | % files which are completely free of Matlab code, but contain replacement 16 | % fields. The class provides you with functions which can fill in the 17 | % replacement fields with arbitrary strings. These strings can become very 18 | % large, e.g. entire tables. 19 | % See the PHPLib: 20 | % See also GET, SET, PARSE 21 | 22 | % Copyright (C) 2003 Guillaume Flandin 23 | % $Revision: 1.0 $Date: 2003/05/05 22:19:51 $ 24 | 25 | narginchk(0,2); 26 | 27 | switch nargin 28 | case 0 29 | tpl = struct('root','.',... 30 | 'file',{{}},... 31 | 'handles',{{}},... 32 | 'varkeys',{{}},... 33 | 'varvals',{{}},... 34 | 'unknowns','remove'); 35 | tpl = class(tpl,'template'); 36 | case 1 37 | if isa(root,'template') 38 | tpl = root; 39 | else 40 | tpl = template; 41 | tpl = set(tpl,'root',root); 42 | end 43 | case 2 44 | tpl = template; 45 | tpl = set(tpl,'root',root); 46 | tpl = set(tpl,'unknowns',unknowns); 47 | end 48 | -------------------------------------------------------------------------------- /external/m2html/Contents.m: -------------------------------------------------------------------------------- 1 | % M2HTML Toolbox - A Documentation Generator for Matlab in HTML 2 | % Version 1.4 16-Jun-2004 3 | % 4 | % M2HTML main functions. 5 | % m2html - Documentation System for Matlab M-files in HTML. 6 | % mdot - Wrapper to GraphViz's for dependency graphs. 7 | % mwizard - Graphical user interface for m2html. 8 | % private - Internal functions. 9 | % 10 | % Template toolbox. 11 | % @template - HTML template class 12 | % 13 | % Templates files. 14 | % templates/blue - Default HTML template. 15 | % templates/frame - Identical to but using frames. 16 | % 17 | % Others. 18 | % Changelog, GPL, INSTALL, LICENSE, README, TODO. 19 | 20 | % Copyright (C) 2003-2005 Guillaume Flandin 21 | % $Revision: 1.4 $Date: 2004/06/16 12:45:24 $ 22 | -------------------------------------------------------------------------------- /external/m2html/INSTALL: -------------------------------------------------------------------------------- 1 | M2HTML - Documentation System for Matlab .m files in HTML 2 | ========================================================= 3 | 4 | 0/ Requirements: 5 | - Matlab 5.3 or above 6 | - Operating system: any. 7 | 8 | 1/ Download the latest m2html.zip on this website: 9 | 10 | 11 | 2/ Extract files in your Matlab Repository /home/foo/matlab/ : 12 | unzip m2html.zip 13 | 14 | 3/ Add the m2html directory in your Matlab path: 15 | addpath /home/foo/matlab/m2html/ 16 | 17 | 5/ Ready to use ! 18 | help m2html 19 | 20 | Please read the README file. 21 | A tutorial and a FAQ (Frequently Asked Questions) are available online at: 22 | 23 | 24 | 25 | If you want to generate dependency graphs, you need to install GraphViz (a 26 | graph visualization software), free and cross-platform, from: 27 | 28 | 29 | ------------------------------------------------------------------------------- 30 | Matlab is a Registered Trademark of The Mathworks, Inc. 31 | 32 | Copyright (C) 2003-2005 Guillaume Flandin 33 | -------------------------------------------------------------------------------- /external/m2html/LICENSE: -------------------------------------------------------------------------------- 1 | M2HTML - Documentation System for Matlab .m files in HTML 2 | Copyright (C) 2003-2005 Guillaume Flandin 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA. 17 | -------------------------------------------------------------------------------- /external/m2html/mwizard.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/mwizard.m -------------------------------------------------------------------------------- /external/m2html/mwizard2.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/mwizard2.m -------------------------------------------------------------------------------- /external/m2html/private/m2htmltoolbarimages.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/private/m2htmltoolbarimages.mat -------------------------------------------------------------------------------- /external/m2html/private/mexexts.m: -------------------------------------------------------------------------------- 1 | function [ext, platform] = mexexts 2 | %MEXEXTS List of Mex files extensions 3 | % MEXEXTS returns a cell array containing the Mex files platform 4 | % dependent extensions and another cell array containing the full names 5 | % of the corresponding platforms. 6 | % 7 | % See also MEX, MEXEXT 8 | 9 | % Copyright (C) 2003 Guillaume Flandin 10 | % $Revision: 1.0 $Date: 2003/29/04 17:33:43 $ 11 | 12 | ext = {'.mexsol' '.mexhpux' '.mexhp7' '.mexrs6' '.mexsg' '.mexaxp' '.mexglx' ... 13 | '.mexlx' '.dll'}; 14 | 15 | platform = {'SunOS' 'HP' 'HP700' 'IBM' 'SGI' 'Alpha' 'Linux x86' 'Linux' 'Windows'}; 16 | -------------------------------------------------------------------------------- /external/m2html/private/openfile.m: -------------------------------------------------------------------------------- 1 | function fid = openfile(filename,permission) 2 | %OPENFILE Open a file in read/write mode, catching errors 3 | % FID = OPENFILE(FILENAME,PERMISSION) opens file FILENAME 4 | % in PERMISSION mode ('r' or 'w') and return a file identifier FID. 5 | % File is opened in text mode: no effect on Unix but useful on Windows. 6 | 7 | % Copyright (C) 2004 Guillaume Flandin 8 | % $Revision: 1.1 $Date: 2004/05/05 17:14:09 $ 9 | 10 | [fid, errmsg] = fopen(filename,[permission 't']); 11 | if ~isempty(errmsg) 12 | switch permission 13 | case 'r' 14 | error(sprintf('Cannot open %s in read mode.',filename)); 15 | case 'w' 16 | error(sprintf('Cannot open %s in write mode.',filename)); 17 | otherwise 18 | error(errmsg); 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /external/m2html/private/searchindex.m: -------------------------------------------------------------------------------- 1 | function [s, freq] = searchindex(mfile, szmin) 2 | %SEARCHINDEX Compute keywords statistics of an M-file 3 | % S = SEARCHINDEX(MFILE) returns a cell array of char S containing 4 | % all the keywords (variables, function names, words in comments or 5 | % char arrays) found in M-file MFILE, of more than 2 characters. 6 | % S = SEARCHINDEX(MFILE, SZMIN) allows to specify the minimum size 7 | % SZMIN of the keywords. 8 | % [S, FREQ] = SEARCHINDEX(...) also returns the occurency frequence 9 | % of each keyword in the M-file. 10 | % 11 | % See also M2HTML 12 | 13 | % Copyright (C) 2003 Guillaume Flandin 14 | % $Revision: 1.0 $Date: 2003/04/10 18:32:48 $ 15 | 16 | error(nargchk(1,2,nargin)); 17 | if nargin == 1, szmin = 2; end 18 | 19 | %- Delimiters used in strtok 20 | strtok_delim = sprintf(' \t\n\r(){}[]<>+-*^$~#!|\\@&/.,:;="''%%'); 21 | 22 | %- Open for reading the M-file 23 | fid = openfile(mfile,'r'); 24 | 25 | %- Initialize keywords list 26 | s = {}; 27 | 28 | %- Loop over lines 29 | while 1 30 | tline = fgetl(fid); 31 | if ~ischar(tline), break, end 32 | 33 | %- Extract keywords in each line 34 | while 1 35 | [w, tline] = strtok(tline,strtok_delim); 36 | if isempty(w), break, end; 37 | %- Check the length of the keyword 38 | if length(w) > szmin 39 | s{end+1} = w; 40 | end 41 | end 42 | end 43 | 44 | %- Close the M-file 45 | fclose(fid); 46 | 47 | %- Remove repeted keywords 48 | [s, i, j] = unique(s); 49 | 50 | %- Compute occurency frenquency if required 51 | if nargout == 2, 52 | if ~isempty(s) 53 | freq = histc(j,1:length(i)); 54 | else 55 | freq = []; 56 | end 57 | end 58 | -------------------------------------------------------------------------------- /external/m2html/private/strtok.m: -------------------------------------------------------------------------------- 1 | function [token, remainder, quotient] = strtok(string, delimiters) 2 | %Modified version of STRTOK to also return the quotient 3 | % string = [quotient token remainder] 4 | %STRTOK Find token in string. 5 | % STRTOK(S) returns the first token in the string S delimited 6 | % by "white space". Any leading white space characters are ignored. 7 | % 8 | % STRTOK(S,D) returns the first token delimited by one of the 9 | % characters in D. Any leading delimiter characters are ignored. 10 | % 11 | % [T,R] = STRTOK(...) also returns the remainder of the original 12 | % string. 13 | % If the token is not found in S then R is an empty string and T 14 | % is same as S. 15 | % 16 | % Copyright 1984-2002 The MathWorks, Inc. 17 | % $Revision: 5.14 $ $Date: 2002/04/09 00:33:38 $ 18 | 19 | token = []; remainder = []; quotient = string; 20 | 21 | len = length(string); 22 | if len == 0 23 | return 24 | end 25 | 26 | if (nargin == 1) 27 | delimiters = [9:13 32]; % White space characters 28 | end 29 | 30 | i = 1; 31 | while (any(string(i) == delimiters)) 32 | i = i + 1; 33 | if (i > len), return, end 34 | end 35 | start = i; 36 | while (~any(string(i) == delimiters)) 37 | i = i + 1; 38 | if (i > len), break, end 39 | end 40 | sfinish = i - 1; 41 | 42 | token = string(start:sfinish); 43 | 44 | if (nargout >= 2) 45 | remainder = string(sfinish + 1:length(string)); 46 | end 47 | 48 | if (nargout == 3 & start > 1) 49 | quotient = string(1:start-1); 50 | else 51 | quotient = []; 52 | end 53 | -------------------------------------------------------------------------------- /external/m2html/templates/blue/Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/Thumbs.db -------------------------------------------------------------------------------- /external/m2html/templates/blue/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/alpha.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/c++.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/c++.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/c.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/demoicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/demoicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/blue/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/down.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/fortran.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/graph.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Dependency Graph for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
< Master indexIndex for {MDIR} >
17 |

Dependency Graph for {MDIR}

18 | 19 |
20 | Dependency Graph for {MDIR} 21 | 22 | {GRAPH_MAP} 23 | 24 |
25 | 26 |
Generated on {DATE} by m2html © 2005
27 | 28 | 29 | -------------------------------------------------------------------------------- /external/m2html/templates/blue/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/hp.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/left.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/linux.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/m2html.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: white; 3 | color: black; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | div.fragment { 10 | width: 98%; 11 | border: 1px solid #CCCCCC; 12 | background-color: #f5f5f5; 13 | padding-left: 4px; 14 | margin: 4px; 15 | } 16 | 17 | div.box { 18 | width: 98%; 19 | background-color: #f5f5f5; 20 | border: 1px solid #CCCCCC; 21 | color: black; 22 | padding: 4px; 23 | } 24 | 25 | .comment { 26 | color: #228B22; 27 | } 28 | .string { 29 | color: #B20000; 30 | } 31 | .keyword { 32 | color: #0000FF; 33 | } 34 | 35 | .keywordtype { color: #604020; } 36 | .keywordflow { color: #e08000; } 37 | .preprocessor { color: #806020; } 38 | .stringliteral { color: #002080; } 39 | .charliteral { color: #008080; } 40 | 41 | a { 42 | text-decoration: none; 43 | } 44 | 45 | a:hover { 46 | background-color: #006699; 47 | color:#FFFFFF; 48 | } 49 | 50 | a.code { 51 | font-weight: normal; 52 | color: #A020F0; 53 | } 54 | 55 | a.code:hover { 56 | background-color: #FF0000; 57 | color: #FFFFFF; 58 | } 59 | 60 | h1 { 61 | background: transparent; 62 | color: #006699; 63 | font-size: x-large; 64 | text-align: center; 65 | } 66 | 67 | h2 { 68 | background: transparent; 69 | color: #006699; 70 | font-size: large; 71 | } 72 | 73 | address { 74 | font-size:small; 75 | } 76 | 77 | form.search { 78 | margin-bottom: 0px; 79 | margin-top: 0px; 80 | } 81 | input.search { 82 | font-size: 75%; 83 | color: #000080; 84 | font-weight: normal; 85 | background-color: #eeeeff; 86 | } 87 | 88 | li { 89 | padding-left:5px; 90 | } -------------------------------------------------------------------------------- /external/m2html/templates/blue/master.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Index 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Matlab Index

16 |

Matlab Directories

17 |
    18 | 19 |
  • {DIR}
  • 20 | 21 |
22 |

Matlab Files found in these Directories

23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
{IDNAME}
32 | 33 | 34 |

Search Engine

35 | 39 | 40 | 41 | 42 |

Dependency Graph

43 |
    44 |
  • View the Graph.
  • 45 |
46 | 47 |
Generated on {DATE} by m2html © 2005
48 | 49 | 50 | -------------------------------------------------------------------------------- /external/m2html/templates/blue/matlabicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/matlabicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/blue/mex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/mex.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/pcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/pcode.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/right.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/search.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Search Engine 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Search Engine

16 | 17 | 21 | 22 | 26 | 27 |
Generated on {DATE} by m2html © 2005
28 | 29 | 30 | -------------------------------------------------------------------------------- /external/m2html/templates/blue/sgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/sgi.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/simulinkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/simulinkicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/blue/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/solaris.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/todo.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | To Do List for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
< Master indexIndex for {MDIR} >
17 |

To Do List for {MDIR}

18 | 19 |

{MFILE}:

20 | 25 | 26 |
Generated on {DATE} by m2html © 2005
27 | 28 | 29 | -------------------------------------------------------------------------------- /external/m2html/templates/blue/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/up.png -------------------------------------------------------------------------------- /external/m2html/templates/blue/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/blue/windows.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/alpha.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/brain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/brain.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/c++.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/c++.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/c.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/demoicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/demoicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/brain/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/down.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/fortran.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/graph.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Dependency Graph for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Dependency Graph for {MDIR}

16 | 17 |
18 | Dependency Graph for {MDIR} 19 | 20 | {GRAPH_MAP} 21 | 22 |
23 | 24 |
Generated by m2html © 2005
25 | 26 | 27 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/hp.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Documentation by M2HTML 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | This is a Matlab Documentation by M2HTML.
19 | Go to menu.html for the documentation of all 20 | the Matlab functions. 21 |
22 | 23 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/left.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/linux.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/m2html.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #f5f5f5; 3 | color: black; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | div.fragment { 10 | width: 98%; 11 | border: 1px solid #CCCCCC; 12 | background-color: #FFFFFF; 13 | padding-left: 4px; 14 | margin: 4px; 15 | background-repeat: no-repeat; 16 | background-position: -15% 0%; 17 | } 18 | 19 | div.box { 20 | width: 98%; 21 | background-color: #FFFFFF; 22 | border: 1px solid #CCCCCC; 23 | color: black; 24 | padding: 4px; 25 | } 26 | 27 | .comment { 28 | color: #228B22; 29 | } 30 | .string { 31 | color: #B20000; 32 | } 33 | .keyword { 34 | color: #0000FF; 35 | } 36 | 37 | .keywordtype { color: #604020; } 38 | .keywordflow { color: #e08000; } 39 | .preprocessor { color: #806020; } 40 | .stringliteral { color: #002080; } 41 | .charliteral { color: #008080; } 42 | 43 | a { 44 | text-decoration: none; 45 | } 46 | 47 | a:hover { 48 | background-color: #006699; 49 | color:#FFFFFF; 50 | } 51 | 52 | a.code { 53 | font-weight: normal; 54 | color: #A020F0; 55 | } 56 | 57 | a.code:hover { 58 | background-color: #FF0000; 59 | color: #FFFFFF; 60 | } 61 | 62 | h1 { 63 | background: transparent; 64 | color: #006699; 65 | font-size: x-large; 66 | text-align: center; 67 | } 68 | 69 | h2 { 70 | background: transparent; 71 | color: #006699; 72 | font-size: large; 73 | } 74 | 75 | address { 76 | font-size:small; 77 | } 78 | 79 | form.search { 80 | margin-bottom: 0px; 81 | margin-top: 0px; 82 | } 83 | input.search { 84 | font-size: 75%; 85 | color: #000080; 86 | font-weight: normal; 87 | background-color: #eeeeff; 88 | } 89 | 90 | li { 91 | padding-left:5px; 92 | } 93 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/master.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Index 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Matlab Index

16 |

Matlab Directories

17 |
    18 | 19 |
  • {DIR}
  • 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

Search Engine

30 | 34 | 35 | 36 | 37 |

Dependency Graph

38 |
    39 |
  • View the Graph.
  • 40 |
41 | 42 |
Generated by m2html © 2005
43 | 44 | 45 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/matlabicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/matlabicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/brain/menu.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: #006699; 3 | color: white; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | :link { color: white } /* for unvisited links */ 10 | :visited { color: white } /* for visited links */ 11 | 12 | div.fragment { 13 | width: 98%; 14 | border: 1px solid #CCCCCC; 15 | background-color: #f5f5f5; 16 | padding-left: 4px; 17 | margin: 4px; 18 | } 19 | 20 | div.box { 21 | width: 98%; 22 | background-color: #f5f5f5; 23 | border: 1px solid #CCCCCC; 24 | color: black; 25 | padding: 4px; 26 | } 27 | 28 | .comment { 29 | color: #228B22; 30 | } 31 | .string { 32 | color: #B20000; 33 | } 34 | .keyword { 35 | color: #0000FF; 36 | } 37 | 38 | .keywordtype { color: #604020; } 39 | .keywordflow { color: #e08000; } 40 | .preprocessor { color: #806020; } 41 | .stringliteral { color: #002080; } 42 | .charliteral { color: #008080; } 43 | 44 | a { 45 | text-decoration: none; 46 | } 47 | 48 | a:hover { 49 | background-color: #006699; 50 | color:#66CCFF; 51 | } 52 | 53 | a.code { 54 | font-weight: normal; 55 | color: #A020F0; 56 | } 57 | 58 | a.code:hover { 59 | background-color: #FF0000; 60 | color: #FFFFFF; 61 | } 62 | 63 | h1 { 64 | background: transparent; 65 | color: white; 66 | font-size: x-large; 67 | text-align: center; 68 | } 69 | 70 | h2 { 71 | background: transparent; 72 | color: white; 73 | font-size: large; 74 | } 75 | 76 | address { 77 | font-size:small; 78 | } 79 | 80 | form.search { 81 | margin-bottom: 0px; 82 | margin-top: 0px; 83 | } 84 | input.search { 85 | font-size: 75%; 86 | color: #000080; 87 | font-weight: normal; 88 | background-color: #eeeeff; 89 | } 90 | 91 | li { 92 | padding-left:5px; 93 | } 94 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/mex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/mex.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/pcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/pcode.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/right.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/search.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Search Engine 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Search Engine

16 | 17 | 21 | 22 | 26 | 27 |
Generated on {DATE} by m2html © 2005
28 | 29 | 30 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/sgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/sgi.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/simulinkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/simulinkicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/brain/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/solaris.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/todo.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | To Do List for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
^ Master index ^
16 |

TODO list for {MDIR}

17 | 18 |

{MFILE}:

19 | 24 | 25 |
Generated by m2html © 2005
26 | 27 | 28 | -------------------------------------------------------------------------------- /external/m2html/templates/brain/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/up.png -------------------------------------------------------------------------------- /external/m2html/templates/brain/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/brain/windows.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/alpha.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/c++.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/c++.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/c.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/demoicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/demoicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/down.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/favicon.ico -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/fortran.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/graph.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Dependency Graph for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Dependency Graph for {MDIR}

16 | 17 |
18 | Dependency Graph for {MDIR} 19 | 20 | {GRAPH_MAP} 21 | 22 |
23 | 24 |
Generated by m2html © 2003
25 | 26 | 27 | -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/hp.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Piotr's Matlab Toolbox 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | Sorry, your browser doesn't support frames. 20 | Go to menu.html for the documentation of all 21 | the Matlab functions. 22 | 23 | 24 | -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/left.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/linux.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/m2html.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: white; 3 | color: black; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | div.fragment { 10 | width: 98%; 11 | border: 1px solid #CCCCCC; 12 | background-color: #f5f5f5; 13 | padding-left: 4px; 14 | margin: 4px; 15 | } 16 | 17 | div.box { 18 | width: 98%; 19 | background-color: #f5f5f5; 20 | border: 1px solid #CCCCCC; 21 | color: black; 22 | padding: 4px; 23 | } 24 | 25 | .comment { 26 | color: #228B22; 27 | } 28 | .string { 29 | color: #B20000; 30 | } 31 | .keyword { 32 | color: #0000FF; 33 | } 34 | 35 | .keywordtype { color: #604020; } 36 | .keywordflow { color: #e08000; } 37 | .preprocessor { color: #806020; } 38 | .stringliteral { color: #002080; } 39 | .charliteral { color: #008080; } 40 | 41 | a { 42 | text-decoration: none; 43 | } 44 | 45 | a:hover { 46 | background-color: #006699; 47 | color:#FFFFFF; 48 | } 49 | 50 | a.code { 51 | font-weight: normal; 52 | color: #A020F0; 53 | } 54 | 55 | a.code:hover { 56 | background-color: #FF0000; 57 | color: #FFFFFF; 58 | } 59 | 60 | h1 { 61 | background: transparent; 62 | color: #006699; 63 | font-size: x-large; 64 | text-align: center; 65 | } 66 | 67 | h2 { 68 | background: transparent; 69 | color: #006699; 70 | font-size: large; 71 | } 72 | 73 | address { 74 | font-size:small; 75 | } 76 | -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/master.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Piotr's Image & Video Toolbox for Matlab 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Piotr's Image & Video Toolbox for Matlab

16 |

Download & Description

17 |

Matlab Directories

18 |
    19 | 20 |
  • {DIR}
  • 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Generated by m2html © 2003
29 | 30 | 31 | -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/matlabicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/matlabicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/mex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/mex.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/new.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/right.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/sgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/sgi.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/simulinkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/simulinkicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/solaris.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/todo.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | To Do List for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
^ Master index ^
16 |

TODO list for {MDIR}

17 | 18 |

{MFILE}:

19 | 24 | 25 |
Generated by m2html © 2003
26 | 27 | 28 | -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/up.png -------------------------------------------------------------------------------- /external/m2html/templates/frame-piotr/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame-piotr/windows.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/alpha.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/c++.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/c++.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/c.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/demoicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/demoicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/down.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/fortran.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/fortran.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/graph.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Dependency Graph for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Dependency Graph for {MDIR}

16 | 17 |
18 | Dependency Graph for {MDIR} 19 | 20 | {GRAPH_MAP} 21 | 22 |
23 | 24 |
Generated by m2html © 2005
25 | 26 | 27 | -------------------------------------------------------------------------------- /external/m2html/templates/frame/hp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/hp.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/index.html: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Documentation by M2HTML 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | This is a Matlab Documentation by M2HTML.
19 | Go to menu.html for the documentation of all 20 | the Matlab functions. 21 |
22 | 23 | -------------------------------------------------------------------------------- /external/m2html/templates/frame/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/left.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/linux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/linux.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/m2html.css: -------------------------------------------------------------------------------- 1 | body { 2 | background: white; 3 | color: black; 4 | font-family: arial,sans-serif; 5 | margin: 0; 6 | padding: 1ex; 7 | } 8 | 9 | div.fragment { 10 | width: 98%; 11 | border: 1px solid #CCCCCC; 12 | background-color: #f5f5f5; 13 | padding-left: 4px; 14 | margin: 4px; 15 | } 16 | 17 | div.box { 18 | width: 98%; 19 | background-color: #f5f5f5; 20 | border: 1px solid #CCCCCC; 21 | color: black; 22 | padding: 4px; 23 | } 24 | 25 | .comment { 26 | color: #228B22; 27 | } 28 | .string { 29 | color: #B20000; 30 | } 31 | .keyword { 32 | color: #0000FF; 33 | } 34 | 35 | .keywordtype { color: #604020; } 36 | .keywordflow { color: #e08000; } 37 | .preprocessor { color: #806020; } 38 | .stringliteral { color: #002080; } 39 | .charliteral { color: #008080; } 40 | 41 | a { 42 | text-decoration: none; 43 | } 44 | 45 | a:hover { 46 | background-color: #006699; 47 | color:#FFFFFF; 48 | } 49 | 50 | a.code { 51 | font-weight: normal; 52 | color: #A020F0; 53 | } 54 | 55 | a.code:hover { 56 | background-color: #FF0000; 57 | color: #FFFFFF; 58 | } 59 | 60 | h1 { 61 | background: transparent; 62 | color: #006699; 63 | font-size: x-large; 64 | text-align: center; 65 | } 66 | 67 | h2 { 68 | background: transparent; 69 | color: #006699; 70 | font-size: large; 71 | } 72 | 73 | address { 74 | font-size:small; 75 | } 76 | 77 | form.search { 78 | margin-bottom: 0px; 79 | margin-top: 0px; 80 | } 81 | input.search { 82 | font-size: 75%; 83 | color: #000080; 84 | font-weight: normal; 85 | background-color: #eeeeff; 86 | } 87 | 88 | li { 89 | padding-left:5px; 90 | } -------------------------------------------------------------------------------- /external/m2html/templates/frame/master.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Index 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Matlab Index

16 |

Matlab Directories

17 |
    18 | 19 |
  • {DIR}
  • 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 |

Search Engine

30 | 34 | 35 | 36 | 37 |

Dependency Graph

38 |
    39 |
  • View the Graph.
  • 40 |
41 | 42 |
Generated by m2html © 2005
43 | 44 | 45 | -------------------------------------------------------------------------------- /external/m2html/templates/frame/matlabicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/matlabicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame/mex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/mex.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/pcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/pcode.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/right.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/search.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | Matlab Search Engine 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |

Search Engine

16 | 17 | 21 | 22 | 26 | 27 |
Generated on {DATE} by m2html © 2005
28 | 29 | 30 | -------------------------------------------------------------------------------- /external/m2html/templates/frame/sgi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/sgi.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/simulinkicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/simulinkicon.gif -------------------------------------------------------------------------------- /external/m2html/templates/frame/solaris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/solaris.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/todo.tpl: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | To Do List for {MDIR} 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
^ Master index ^
16 |

TODO list for {MDIR}

17 | 18 |

{MFILE}:

19 | 24 | 25 |
Generated by m2html © 2005
26 | 27 | 28 | -------------------------------------------------------------------------------- /external/m2html/templates/frame/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/up.png -------------------------------------------------------------------------------- /external/m2html/templates/frame/windows.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/m2html/templates/frame/windows.png -------------------------------------------------------------------------------- /external/other/multiprod.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/external/other/multiprod.m -------------------------------------------------------------------------------- /filters/Contents.m: -------------------------------------------------------------------------------- 1 | % FILTERS 2 | % See also 3 | % 4 | % Filters: 5 | % filterBinomial1d - 1D binomial filter (approximation to Gaussian filter) 6 | % filterDog2d - Difference of Gaussian (Dog) Filter. 7 | % filterDoog - n-dim difference of offset Gaussian DooG filter (Gaussian derivative). 8 | % filterGabor1d - Creates an even/odd pair of 1D Gabor filters. 9 | % filterGabor2d - Creates an even/odd pair of 2D Gabor filters. 10 | % filterGauss - n-dimensional Gaussian filter. 11 | % filterSteerable - Steerable 2D Gaussian derivative filter (for visualization). 12 | % filterVisualize - Used to visualize a 1D/2D/3D filter. 13 | % 14 | % Operations involving a set of filters (a filter bank or FB): 15 | % FbApply2d - Applies each of the filters in the filterbank FB to the image I. 16 | % FbCrop - Crop a 2D filterbank (adjusting filter norms). 17 | % FbMake - Various 1D/2D/3D filterbanks (hardcoded). 18 | % FbReconstruct2d - Use to see how much image information is preserved in filter outputs. 19 | % FbVisualize - Used to visualize a series of 1D/2D/3D filters. 20 | % 21 | % Simple nonlinear filters: 22 | % medfilt1m - One-dimensional adaptive median filtering with missing values. 23 | % modefilt1 - One-dimensional mode filtering. 24 | -------------------------------------------------------------------------------- /filters/FbApply2d.m: -------------------------------------------------------------------------------- 1 | function FR = FbApply2d( I, FB, shape, show ) 2 | % Applies each of the filters in the filterbank FB to the image I. 3 | % 4 | % To apply to a stack of images: 5 | % IFS = fevalArrays( images, @FbApply2d, FB, 'valid' ); 6 | % 7 | % USAGE 8 | % FR = FbApply2d( I, FB, [shape], [show] ) 9 | % 10 | % INPUTS 11 | % I - 2D input array 12 | % FB - filterbank - MxNxK set of K filters each of size MxN 13 | % shape - ['full'] option for conv2 'full', 'same', 'valid' 14 | % show - [0] first figure to use for optional display 15 | % 16 | % OUTPUTS 17 | % FR - 3D set of filtered images 18 | % 19 | % EXAMPLE 20 | % load trees; X=imresize(X,.5); load FbDoG.mat; 21 | % FR = FbApply2d( X, FB, 'same', 1 ); 22 | % 23 | % See also CONV2, FBMAKE 24 | % 25 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 26 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 27 | % Licensed under the Simplified BSD License [see external/bsd.txt] 28 | 29 | if( nargin<3 || isempty(shape)); shape = 'full'; end 30 | if( nargin<4 || isempty(show)); show=0; end 31 | 32 | nd=ndims(I); ndf=ndims(FB); nf=size(FB,3); 33 | if( nd~=2 ); error('I must be an MxN array'); end 34 | if( ndf~=2 && ndf~=3 ); error('FB must be an MxN or MxNxK array'); end 35 | if( ~isa(I,'double')); I = double(I); end 36 | 37 | % apply each filter to image 38 | if( ndf==2 ) 39 | FR = conv2( I, FB, shape ); 40 | else 41 | FR = repmat( conv2(I,FB(:,:,1),shape), [1 1 nf] ); 42 | for i=2:nf; FR(:,:,i)=conv2(I,FB(:,:,i),shape); end 43 | end 44 | 45 | % optionally display 46 | if( show ) 47 | figure(show); im(I); 48 | figure(show+1); montage2(FB,struct('extraInfo',1)); 49 | figure(show+2); montage2(FR,struct('extraInfo',1)); 50 | end 51 | -------------------------------------------------------------------------------- /filters/FbCrop.m: -------------------------------------------------------------------------------- 1 | function FBC = FbCrop( FB, delta ) 2 | % Crop a 2D filterbank (adjusting filter norms). 3 | % 4 | % Takes a filter bank and crops it by cropping off delta pixels from each 5 | % side. Ensures that the mean response of each filter is 0 and that the L1 6 | % norm is 1, i.e. sum(sum(abs(F)))==1. 7 | % 8 | % USAGE 9 | % FBC = FbCrop( FB, delta ) 10 | % 11 | % INPUTS 12 | % FB - original filterbank 13 | % delta - amount to crop by 14 | % 15 | % OUTPUTS 16 | % FBC - cropped filterbank 17 | % 18 | % EXAMPLE 19 | % load FbDoG.mat; FBC=FbCrop(FB,4); 20 | % figure(1); montage2(FB,struct('extraInfo',1)); 21 | % figure(2); montage2(FBC,struct('extraInfo',1)); 22 | % 23 | % See also FBAPPLY2D 24 | % 25 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 26 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 27 | % Licensed under the Simplified BSD License [see external/bsd.txt] 28 | 29 | nd = ndims(FB); 30 | if( nd~=2 && nd~=3 ); error('I must an MxNxK array'); end 31 | 32 | cropsiz = size(FB); 33 | cropsiz = [cropsiz(1:2)-2*delta, cropsiz(3)]; 34 | FBC = arrayToDims( FB, cropsiz ); 35 | 36 | for f=1:size(FB,3) 37 | FC = FBC(:,:,f); 38 | FC = FC - sum(sum(FC)) / numel(FC); % 0 mean 39 | FC = FC / sum(sum(abs(FC))); % L1 norm == 1 40 | FBC(:,:,f) = FC; 41 | end 42 | -------------------------------------------------------------------------------- /filters/FbDoG.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/filters/FbDoG.mat -------------------------------------------------------------------------------- /filters/FbGabor.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/filters/FbGabor.mat -------------------------------------------------------------------------------- /filters/filterBinomial1d.m: -------------------------------------------------------------------------------- 1 | function f = filterBinomial1d( r, show ) 2 | % 1D binomial filter (approximation to Gaussian filter) 3 | % 4 | % Creates a binomial filter of size 2*r+1 x 1. This can be used to 5 | % approximate the Gaussian distribution with sigma=sqrt((2*r+1)/4). For 6 | % large r, should give same output as: 7 | % g = fspecial( 'Gaussian', [2*r+1,1],sqrt((2*r+1)/4) ); 8 | % Given sigma, use r ~= 2*sigma^2. 9 | % 10 | % Use F = f*f' to get the equivalent 2d filter. 11 | % 12 | % USAGE 13 | % f = filterBinomial1d( r, [show] ) 14 | % 15 | % INPUTS 16 | % r - mask will have length 2r+1 and var=(2*r+1)/4 17 | % show - [0] figure to use for optional display 18 | % 19 | % OUTPUTS 20 | % f - 1D binomial filter 21 | % 22 | % EXAMPLE 23 | % r = 10; 24 | % fbinom = filterBinomial1d( r, 1 ); 25 | % fgauss = filterGauss( 2*r+1, [], (2*r+1)/4, 2); 26 | % 27 | % See also FILTERGAUSS 28 | % 29 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 30 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 31 | % Licensed under the Simplified BSD License [see external/bsd.txt] 32 | 33 | if( nargin<2 ); show=0; end; 34 | if( mod(r,1)~=0 ); error( 'r must be an integer'); end; 35 | 36 | f = diag(fliplr(pascal(2*r+1))) / 4^r; 37 | 38 | % display 39 | if(show); filterVisualize( f, show ); end; 40 | -------------------------------------------------------------------------------- /filters/filterDog2d.m: -------------------------------------------------------------------------------- 1 | function G = filterDog2d( r, var, order, show ) 2 | % Difference of Gaussian (Dog) Filter. 3 | % 4 | % Adapted from code by Serge Belongie. Takes a "Difference of Gaussian" - 5 | % all centered on the same point but with different values for sigma. Also 6 | % serves as an approximation to an Laplacian of Gaussian (LoG) filter (if 7 | % order==1). 8 | % 9 | % USAGE 10 | % G = filterDog2d( r, var, order, [show] ) 11 | % 12 | % INPUTS 13 | % r - Final filter will be 2*r+1 on each side 14 | % var - variance of central Gaussian 15 | % order - should be either 1-LoG or 2-difference of 3 Gaussians 16 | % show - [0] figure to use for optional display 17 | % 18 | % OUTPUTS 19 | % G - filter 20 | % 21 | % EXAMPLE 22 | % G = filterDog2d( 40, 40, 1, 1 ); %order=1 (LoG) 23 | % G = filterDog2d( 40, 40, 2, 3 ); %order=2 24 | % 25 | % See also FILTERDOOG, FILTERGAUSS 26 | % 27 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 28 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 29 | % Licensed under the Simplified BSD License [see external/bsd.txt] 30 | 31 | if( nargin<4 || isempty(show) ); show=0; end 32 | 33 | % create filter 34 | N = 2*r+1; 35 | if (order==1) 36 | Ga = filterGauss( [N N], [], .71*var ); 37 | Gb = filterGauss( [N N], [], 1.14*var ); 38 | a=1; b=-1; G = a*Ga + b*Gb; 39 | 40 | elseif (order==2) 41 | Ga = filterGauss( [N N], [], 0.62*var ); 42 | Gb = filterGauss( [N N], [], var ); 43 | Gc = filterGauss( [N N], [], 1.6*var ); 44 | a=-1; b=2; c=-1; G = a*Ga + b*Gb + c*Gc; 45 | 46 | else 47 | error('order must be 1 or 2'); 48 | end 49 | 50 | % normalize 51 | G=G-mean(G(:)); 52 | G=G/norm(G(:),1); 53 | 54 | % display 55 | if(show); filterVisualize( G, show, 'row' ); end 56 | -------------------------------------------------------------------------------- /filters/filterGabor1d.m: -------------------------------------------------------------------------------- 1 | function [feven,fodd] = filterGabor1d( r, sig, omega, show ) 2 | % Creates an even/odd pair of 1D Gabor filters. 3 | % 4 | % USAGE 5 | % [feven,fodd] = filterGabor1d( r, sig, omega, [show] ) 6 | % 7 | % INPUTS 8 | % r - final filter will be 2r+1 (good choice for r is r=2*sig) 9 | % sig - standard deviation of Gaussian mask 10 | % omega - frequency of underlying sine/cosine in [1/(2r+1) r/(2r+1)] 11 | % show - [0] figure to use for optional display 12 | % 13 | % OUTPUTS 14 | % feven - even symmetric filter (-cosine masked with Gaussian) 15 | % fodd - odd symmetric filter (-sine masked with Gaussian) 16 | % 17 | % EXAMPLE 18 | % sig = 15; f=filterGabor1d(2*sig,sig,1/sig,1); 19 | % 20 | % See also FILTERGABOR2D 21 | % 22 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 23 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 24 | % Licensed under the Simplified BSD License [see external/bsd.txt] 25 | 26 | if( nargin<4 || isempty(show) ); show=0; end; 27 | 28 | r = ceil(r); n=2*r+1; 29 | if( omega<1/(n) || omega>r/(n) ) 30 | error(['omega=' num2str(omega) ' out of range =[' num2str([1 r]/n) ']']); 31 | end; 32 | 33 | % create even and odd pair 34 | x = -r:r; 35 | feven = -cos(2*pi*x*omega) .* exp(-(x.^2)/sig^2); 36 | fodd = -sin(2*pi*x*omega) .* exp(-(x.^2)/sig^2); %=imag(hilbert(feven)); 37 | 38 | % normalize to mean==0, but only in locs that are nonzero 39 | inds = abs(feven)>.00001; feven(inds) = feven(inds) - mean(feven(inds)); 40 | inds = abs(fodd)>.00001; fodd(inds) = fodd(inds) - mean(fodd(inds)); 41 | 42 | % set L1norm to 0 43 | feven = feven/norm(feven(:),1); 44 | fodd = fodd/norm(fodd(:),1); 45 | 46 | % visualization 47 | if( show ) 48 | filterVisualize( feven, show ); 49 | filterVisualize( fodd, show+1 ); 50 | end 51 | -------------------------------------------------------------------------------- /filters/filterSteerable.m: -------------------------------------------------------------------------------- 1 | function filterSteerable( theta ) 2 | % Steerable 2D Gaussian derivative filter (for visualization). 3 | % 4 | % This function is a demonstration of steerable filters. The directional 5 | % derivative of G in an arbitrary direction theta can be found by taking a 6 | % linear combination of the directional derivatives dxG and dyG. 7 | % 8 | % USAGE 9 | % filterSteerable( theta ) 10 | % 11 | % INPUTS 12 | % theta - orientation in radians 13 | % 14 | % OUTPUTS 15 | % 16 | % EXAMPLE 17 | % filterSteerable( pi/4 ); 18 | % 19 | % See also filterGauss 20 | % 21 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 22 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 23 | % Licensed under the Simplified BSD License [see external/bsd.txt] 24 | 25 | % Get G 26 | [x,y]=meshgrid(-1:.1:1, -1:.1:1 ); 27 | r = sqrt( x.^2 + y.^2 ); 28 | G = exp( -r .* r *2 ); 29 | 30 | % get first derivatives of G. note: d/dx(G)=-2x*G 31 | phi = atan2( y, x ); 32 | dxG = r .* cos(phi) .* G; 33 | dyG = r .* sin(phi) .* G; 34 | 35 | % get directional derivative by taking linear comb in theta 36 | Gtheta = cos(theta)*dxG + sin(theta)*dyG; 37 | 38 | % dislpay (scale for visualization purposes) 39 | GS = cat(3,G,dxG*2,dyG*2,Gtheta*2); 40 | figure(1); montage2( GS ); 41 | -------------------------------------------------------------------------------- /filters/modefilt1.m: -------------------------------------------------------------------------------- 1 | function y = modefilt1( x, s ) 2 | % One-dimensional mode filtering. 3 | % 4 | % Applies a width s one-dimensional mode filter to vector x. That is each 5 | % element of the output y(j) corresponds to the mode of x(j-r:j+r), where 6 | % r~s/2. At boundary regions, y is calculated on smaller windows, for 7 | % example y(1) is calculated over x(1:1+r). Note that for this function to 8 | % make sense x should take on only a small number of discrete values 9 | % (running time is actually proportional to number of unique values of x). 10 | % This function is modeled after medfilt1, which is part of Matlab's 11 | % 'Signal Processing Toolbox'. 12 | % 13 | % USAGE 14 | % y = modefilt1( x, s ) 15 | % 16 | % INPUTS 17 | % x - length n vector 18 | % s - filter size 19 | % 20 | % OUTPUTS 21 | % y - filtered vector x 22 | % 23 | % EXAMPLE 24 | % x=[0 1 0 0 0 3 0 1 3 1 2 2 0 1]; s=3; 25 | % xmedian = medfilt1( x, s ); % may not be available 26 | % xmode = modefilt1( x, s ); 27 | % [x; xmedian; xmode] 28 | % 29 | % See also MEDFILT1 30 | % 31 | % Piotr's Computer Vision Matlab Toolbox Version 2.35 32 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 33 | % Licensed under the Simplified BSD License [see external/bsd.txt] 34 | 35 | % get unique values in x 36 | [vals,~,inds]=unique(x(:)'); m=length(vals); n=length(x); 37 | if(m>256), warning('x takes on large number of diff vals'); end %#ok 38 | 39 | % create quantized representation [H(i,j)==1 iff x(j)==vals(i)] 40 | H=zeros(m,n); H(sub2ind2([m,n],[inds; 1:n]'))=1; 41 | 42 | % create histogram [H(i,j) is count of x(j-r:j+r)==vals(i)] 43 | H=localSum(H,[0 s],'same'); 44 | 45 | % compute mode for each j and map inds back to original vals 46 | [~,inds]=max(H,[],1); y=vals(inds); 47 | 48 | end 49 | -------------------------------------------------------------------------------- /images/assignToBins.m: -------------------------------------------------------------------------------- 1 | function B = assignToBins( A, edges ) 2 | % Quantizes A according to values in edges. 3 | % 4 | % assignToBins replaces each value in A with a value between [0,nBins] where 5 | % nBins=length(edges)-1. edges must be a vector of monotonically 6 | % increasing values. Each element v in A gets converted to a discrete 7 | % value q such that edges(q)<=v< edges(q+1). If v==edges(end) then q=nBins. 8 | % If v does not fall into any bin, then q=0. See histc2 for more details 9 | % about edges. For even spaced edges can get away with rounding A 10 | % appropriately, see example below. 11 | % 12 | % USAGE 13 | % B = assignToBins( A, edges ) 14 | % 15 | % INPUTS 16 | % A - numeric array of arbitrary dimension 17 | % edges - quantization bounds, see histc2 18 | % 19 | % OUTPUTS 20 | % B - size(A) array of quantization levels, ints between [0,nBins] 21 | % 22 | % EXAMPLE 23 | % A = rand(5,5); 24 | % B1 = assignToBins(A,[0:.1:1]); 25 | % B2 = ceil(A*10); B1-B2 26 | % 27 | % See also HISTC2 28 | % 29 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 30 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 31 | % Licensed under the Simplified BSD License [see external/bsd.txt] 32 | 33 | if(~isa(A,'double')); A = double(A); end; 34 | 35 | if( length(edges)==1 ) % if nBins given instead of edges calculate edges 36 | edges = linspace( min(A(:))-eps, max(A(:))+eps, edges+1 ); end; 37 | 38 | B = assignToBins1( A, edges ); % assign bin number 39 | B = B + 1; % convert to 1 indexed 40 | B = reshape( B, size(A) ); % resize B to have correct shape 41 | B( B==(length(edges)) ) = 0; % vals outside or range get bin 0 42 | -------------------------------------------------------------------------------- /images/histMontage.m: -------------------------------------------------------------------------------- 1 | function histMontage( HS, mm, nn ) 2 | % Used to display multiple 1D histograms. 3 | % 4 | % USAGE 5 | % histMontage( HS, mm, nn ) 6 | % 7 | % INPUTS 8 | % HS - HS(i,j) is the jth bin in the ith histogram 9 | % mm - [] #images/row (if [] then calculated based on nn) 10 | % nn - [] #images/col (if [] then calculated based on mm) 11 | % 12 | % OUTPUTS 13 | % 14 | % EXAMPLE 15 | % h = histc2( randn(2000,1), 20 )'; clf; histMontage([h; h]); 16 | % 17 | % See also HISTC, HISTC2 18 | % 19 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 20 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 21 | % Licensed under the Simplified BSD License [see external/bsd.txt] 22 | 23 | [nhist, nbins] = size(HS); 24 | if( nhist>100 || nhist*nbins>10000 ) 25 | error('Too much histogram data to display!'); end; 26 | 27 | % get layout of images (mm=#images/row, nn=#images/col) 28 | if (nargin<3 || isempty(mm) || isempty(nn)) 29 | if (nargin==1 || (nargin==2 && isempty(mm)) || (nargin==3 && ... 30 | isempty(mm) && isempty(nn)) ) 31 | nn = round(sqrt(nhist)); 32 | mm = ceil( nhist / nn ); 33 | elseif (isempty(mm)) 34 | mm = ceil( nhist / nn ); 35 | else 36 | nn = ceil( nhist / mm ); 37 | end; 38 | end; 39 | 40 | % plot each histogram 41 | clf; 42 | for q=1:nhist 43 | if( nhist>1 ); subplot( mm, nn, q ); end; 44 | bar( HS(q,:), 1 ); shading('flat'); 45 | ylim( [0,1] ); set( gca, 'YTick', [] ); 46 | xlim( [.5, nbins+.5] ); set( gca, 'XTick', [] ); 47 | end; 48 | -------------------------------------------------------------------------------- /images/im.m: -------------------------------------------------------------------------------- 1 | function varargout = im( I, range, extraInf ) 2 | % Function for displaying grayscale images. 3 | % 4 | % Handy function for showing a grayscale or color image with a colorbar. 5 | % 6 | % USAGE 7 | % h = im( I, [range], [extraInf] ) 8 | % 9 | % INPUTS 10 | % I - image in a valid format for imagesc 11 | % range - [] minval/maxval for imagesc 12 | % extraInf - [1] if 1 then colorbar is shown as well as tick marks 13 | % 14 | % OUTPUTS 15 | % h - handle for image graphics object 16 | % 17 | % EXAMPLE 18 | % load clown; im( X ) 19 | % 20 | % See also imshow, imview, impixelinfo, imtool, imagesc 21 | % 22 | % Piotr's Computer Vision Matlab Toolbox Version 2.41 23 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 24 | % Licensed under the Simplified BSD License [see external/bsd.txt] 25 | if( nargin<1 || isempty(I)); I=0; end; 26 | if( nargin<2 || isempty(range)), range=[]; end 27 | if( nargin<3 || isempty(extraInf)); extraInf=1; end; 28 | % display image using imagesc 29 | if(isempty(range)), h=imagesc(I); else h=imagesc(I,range); end 30 | % set basic and optional properties 31 | colormap(gray); title(inputname(1)); axis('image'); 32 | if( extraInf ), colorbar; else set(gca,'XTick',[],'YTick',[]); end 33 | % output h only if output argument explicitly requested 34 | if(nargout>0), varargout={h}; end 35 | end 36 | 37 | % whitebg('black'); set(gcf,'color', [0 0 0]); %black background 38 | % set(gcf,'menubar','none'); % no menu 39 | -------------------------------------------------------------------------------- /images/images.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/images.mat -------------------------------------------------------------------------------- /images/makeGif.m: -------------------------------------------------------------------------------- 1 | function makeGif( M, fileName, prm ) 2 | % Writes a matlab movie to an animated GIF. 3 | % 4 | % USAGE 5 | % makeGif( M, fileName, prm ) 6 | % 7 | % INPUTS 8 | % M - Matlab movie 9 | % fileName - file name of the output gif file 10 | % prm 11 | % .fps - number of frames per second 12 | % .nColor - number of indexes colors 13 | % .scale - scale to resize the frames at 14 | % .loop - number of times to repeat the movie (Inf possible) 15 | % 16 | % OUTPUTS 17 | % 18 | % EXAMPLE 19 | % load( 'images.mat' ); 20 | % M = playMovie( video, [], 1 ); 21 | % makeGif( M, 'mouse.gif', struct('scale',0.5) ); 22 | % 23 | % See also PLAYMOVIE, MONTAGE2 24 | % 25 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 26 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 27 | % Licensed under the Simplified BSD License [see external/bsd.txt] 28 | 29 | dfs = {'fps',30, 'nColor',256, 'scale',1, 'loop', 0}; 30 | prm = getPrmDflt( prm, dfs ); 31 | fps=prm.fps; nColor=prm.nColor; scale=prm.scale; loop=prm.loop; 32 | 33 | if scale~=1 34 | for i=1:length(M); M(i).cdata=imresize(M(i).cdata,scale, 'bicubic'); end 35 | end 36 | 37 | if ndims(M(1).cdata)==3 38 | for i=1:length(M) 39 | [M(i).cdata,M(i).colormap] = rgb2ind(M(i).cdata, nColor); 40 | end 41 | else 42 | for i=1:length(M) 43 | M(i).colormap = repmat(0:1/256:1,[3 1])'; 44 | end 45 | end 46 | 47 | imwrite(M(1).cdata,M(1).colormap,fileName,'gif','LoopCount',loop); 48 | for i=2:length(M) 49 | imwrite(M(i).cdata,M(i).colormap,fileName,'gif','DelayTime',1/fps,... 50 | 'WriteMode','append'); 51 | end 52 | -------------------------------------------------------------------------------- /images/maskSphere.m: -------------------------------------------------------------------------------- 1 | function mask = maskSphere( d, r, show ) 2 | % Creates an 'image' of a n-dimensional hypersphere. 3 | % 4 | % Useful for testing visualization procedures. 5 | % 6 | % Create a d-dimensional matrix mask of dimensions [s x s x s x ... x s] 7 | % where s=2r+1. Each element mask(x1,x2...,xd) is 1 if (x1,...xd) falls 8 | % inside the centered hypersphere of rad r. 9 | % 10 | % In 1d this corresponds to a vector of the form [.. 0 1 1 1 1 1 0 ..] 11 | % In 2d this corresponds to an image of a white circle. 12 | % In 3d and 4d, well try it and 'see' what it looks like. 13 | % 14 | % USAGE 15 | % mask = maskSphere( d, r, [show] ) 16 | % 17 | % INPUTS 18 | % d - dimension (any positive integer) 19 | % r - sphere integer radius 20 | % show - [] figure in which to display results 21 | % 22 | % OUTPUTS 23 | % mask - [s x s x s x ... x s] hypersphere image 24 | % 25 | % EXAMPLE 26 | % mcircle = maskSphere( 2, 20, 1 ); 27 | % msphere = maskSphere( 3, 10, 2 ); 28 | % msphere = maskSphere( 4, 10, 3 ); 29 | % 30 | % See also MASKCIRCLE, MONTAGE2 31 | % 32 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 33 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 34 | % Licensed under the Simplified BSD License [see external/bsd.txt] 35 | 36 | if( nargin<3 || isempty(show) ); show = 1; end 37 | 38 | xs=cell(1,d); 39 | for i=1:d; xs{i}=-r:r; end 40 | if( d>1 ); [xs{:}] = ndgrid(xs{:}); else xs{1}=xs{1}'; end 41 | mask=xs{1}.^2; 42 | for i=2:d; mask=mask+xs{i}.^2; end 43 | mask = double( mask < (r+1)^2 ); 44 | 45 | if( show ) 46 | figure(show); clf; 47 | if( d<=2 ) 48 | im( mask ); 49 | elseif any(d==3:4) 50 | montage2( mask ); 51 | else 52 | disp('no visualization available for d>4'); 53 | end 54 | end 55 | -------------------------------------------------------------------------------- /images/movieToImages.m: -------------------------------------------------------------------------------- 1 | function I = movieToImages( M ) 2 | % Creates a stack of images from a matlab movie M. 3 | % 4 | % Repeatedly calls frame2im. Useful for playback with playMovie. 5 | % 6 | % USAGE 7 | % I = movieToImages( M ) 8 | % 9 | % INPUTS 10 | % M - a matlab movie 11 | % 12 | % OUTPUTS 13 | % I - MxNxT array (of images) 14 | % 15 | % EXAMPLE 16 | % load( 'images.mat' ); [X,map]=gray2ind(video(:,:,1)); 17 | % M = fevalArrays( video, @(x) im2frame(gray2ind(x),map) ); 18 | % I = movieToImages(M); playMovie(I); 19 | % 20 | % See also PLAYMOVIE 21 | % 22 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 23 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 24 | % Licensed under the Simplified BSD License [see external/bsd.txt] 25 | 26 | I = fevalArrays( M, @frame2Ii ); 27 | 28 | function I = frame2Ii( F ) 29 | 30 | [I,map] = frame2im( F ); 31 | if( isempty(map) ) 32 | if( size(I,3)==3 ) 33 | classname = class( I ); 34 | I = sum(I,3)/3; 35 | I = feval( classname, I ); 36 | end 37 | else 38 | I = ind2gray( I, map ); 39 | end 40 | -------------------------------------------------------------------------------- /images/private/assignToBins1.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/assignToBins1.mexa64 -------------------------------------------------------------------------------- /images/private/assignToBins1.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/assignToBins1.mexmaci64 -------------------------------------------------------------------------------- /images/private/assignToBins1.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/assignToBins1.mexw64 -------------------------------------------------------------------------------- /images/private/histc2c.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/histc2c.mexa64 -------------------------------------------------------------------------------- /images/private/histc2c.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/histc2c.mexmaci64 -------------------------------------------------------------------------------- /images/private/histc2c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/histc2c.mexw64 -------------------------------------------------------------------------------- /images/private/imtransform2_c.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/imtransform2_c.mexa64 -------------------------------------------------------------------------------- /images/private/imtransform2_c.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/imtransform2_c.mexmaci64 -------------------------------------------------------------------------------- /images/private/imtransform2_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/imtransform2_c.mexw64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_max.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_max.mexa64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_max.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_max.mexmaci64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_max.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_max.mexw64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_sum.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_sum.mexa64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_sum.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_sum.mexmaci64 -------------------------------------------------------------------------------- /images/private/nlfiltersep_sum.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/images/private/nlfiltersep_sum.mexw64 -------------------------------------------------------------------------------- /images/xcorrn.m: -------------------------------------------------------------------------------- 1 | function C = xcorrn( A, T, shape ) 2 | % n-dimensional cross-correlation. Generalized version of xcorr2. 3 | % 4 | % For 2 dimensional inputs this function is exactly the same as xcorr2, but 5 | % also works in higher dimensions. Can also be more efficient because it 6 | % performs convolution using convnFast. Note that xcorr2 is part of the 7 | % 'Signal Processing Toolbox' and may not be available on all systems. 8 | % 9 | % The order of parameters is reversed from normxcorrn. This is to be 10 | % compatible with the matlab functions normxcorr2 and xcorr2 (which take 11 | % parameters in different orders). 12 | % 13 | % USAGE 14 | % C = xcorrn( A, T, [shape] ) 15 | % 16 | % INPUTS 17 | % A - first d-dimensional matrix 18 | % T - second d-dimensional matrix 19 | % shape - ['full'] 'valid', or 'same' (see convn) 20 | % 21 | % OUTPUTS 22 | % C - correlation matrix 23 | % 24 | % EXAMPLE 25 | % T=gaussSmooth(rand(20),2); A=repmat(T,[3 3]); 26 | % C1=xcorr2(A,T); C2=xcorrn(A,T); C3=rot90(xcorrn(T,A),2); 27 | % figure(1); im(C1); figure(2); im(C2); figure(3); im(C3); 28 | % 29 | % See also XCORR2, NORMXCORRN, XEUCN, CONVNFAST 30 | % 31 | % Piotr's Computer Vision Matlab Toolbox Version 2.12 32 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 33 | % Licensed under the Simplified BSD License [see external/bsd.txt] 34 | 35 | if( nargin<3 || isempty(shape)); shape='full'; end 36 | nd = ndims(A); 37 | if(nd~=ndims(A)); error('xcorrn: T and A must have same ndims'); end; 38 | 39 | % flip for conv purposes 40 | if(nd==2); T=rot90(T,2); else for d=1:nd; T=flipdim(T,d); end; end 41 | 42 | % convolve [in frequency or spatial domain] 43 | C = convnFast( A, T, shape ); 44 | -------------------------------------------------------------------------------- /images/xeucn.m: -------------------------------------------------------------------------------- 1 | function C = xeucn( A, T, shape ) 2 | % n-dimensional euclidean distance between each window in A and template T. 3 | % 4 | % Similar to normxcorrn, except at each point (i,j) calculates the 5 | % euclidean distance between the T and the window in A surrounding the 6 | % point, storing the result in C(i,j). 7 | % 8 | % USAGE 9 | % C = xeucn( A, T, [shape] ) 10 | % 11 | % INPUTS 12 | % A - first d-dimensional matrix 13 | % T - second d-dimensional matrix 14 | % shape - ['full'] 'valid', or 'same' (see convn) 15 | % 16 | % OUTPUTS 17 | % C - correlation matrix 18 | % 19 | % EXAMPLE 20 | % T=gaussSmooth(rand(20),2); A=repmat(T,[3 3]); 21 | % C1=normxcorrn(T,A); C2=xcorrn(A,T); C3=xeucn(A,T); 22 | % figure(1); im(C1); figure(2); im(C2); figure(3); im(-C3); 23 | % 24 | % See also XCORRN, CONVNFAST 25 | % 26 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 27 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 28 | % Licensed under the Simplified BSD License [see external/bsd.txt] 29 | 30 | if( nargin<3 || isempty(shape)); shape='full'; end 31 | nd = ndims(T); 32 | if(nd~=ndims(A)); error('xeucn: T and A must have same ndims'); end; 33 | 34 | % flip for conv purposes 35 | if(nd==2); T=rot90(T,2); else for d=1:nd; T=flipdim(T,d); end; end 36 | 37 | % The expression for euclidean distance can be rewritten as: 38 | % D(k,l) = sumj( (Akj - Tlj).^2 ) 39 | % = sumj( Akj.^2 ) + sumj( Tlj.^2 ) - 2*sumj(Akj.*Tlj); 40 | % T is constant. Hence simply need square of A in each window, as 41 | % well as each dot product between A and T. 42 | Amag = localSum( A.*A, size(T), shape ); % sum of squares per window 43 | Tmag = T.^2; Tmag = sum( Tmag(:) ); % sum of squares of T 44 | C = Amag + Tmag - 2 * convnFast(A,T,shape); % distance squared 45 | % C( Amag<.01 ) = Tmag; % prevent numerical errors 46 | C = real(sqrt(real(C))); 47 | -------------------------------------------------------------------------------- /matlab/arrayToDims.m: -------------------------------------------------------------------------------- 1 | function IC = arrayToDims( I, dims, padEl ) 2 | % Pads or crops I appropriately so that size(IC)==dims. 3 | % 4 | % For each dimension d, if size(I,d) is larger then dims(d) then 5 | % symmetrically crops along d (if cropping amount is odd crops one more 6 | % unit from the start of the dimension). If size(I,d) is smaller then 7 | % dims(d) then symmetrically pads along d with padEl (if padding amount is 8 | % even then pads one more unit along the start of the dimension). 9 | % 10 | % USAGE 11 | % IC = arrayToDims( I, dims, [padEl] ) 12 | % 13 | % INPUTS 14 | % I - n dim array to crop window from (for arrays can only crop) 15 | % dims - dimensions to make I 16 | % padEl - [0] element with which to pad 17 | % 18 | % OUTPUTS 19 | % IC - cropped array 20 | % 21 | % EXAMPLE 22 | % I=randn(10); delta=1; IC=arrayToDims(I,size(I)-2*delta); 23 | % 24 | % See also ARRAYCROP, PADARRAY 25 | % 26 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 27 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 28 | % Licensed under the Simplified BSD License [see external/bsd.txt] 29 | 30 | if( nargin<3 || isempty(padEl)); padEl=0; end 31 | nd = ndims(I); siz = size(I); 32 | [dims,er] = checkNumArgs( dims, size(siz), 0, 1 ); error(er); 33 | if(any(dims==0)); IC=[]; return; end 34 | 35 | % get start and end locations for cropping 36 | strLocs = ones( 1, nd ); endLocs = siz; 37 | for d=1:nd 38 | delta = siz(d) - dims(d); 39 | if ( delta~=0 ) 40 | deltaHalf = floor( delta / 2 ); 41 | deltaRem = delta - 2*deltaHalf; 42 | strLocs(d) = 1 + (deltaHalf + deltaRem); 43 | endLocs(d) = siz(d) - deltaHalf; 44 | end 45 | end 46 | 47 | % call arrayCrop 48 | IC = arrayCrop( I, strLocs, endLocs, padEl ); 49 | -------------------------------------------------------------------------------- /matlab/c.m: -------------------------------------------------------------------------------- 1 | % clc - clear command window. 2 | % 3 | % USAGE 4 | % c 5 | % 6 | % INPUTS 7 | % 8 | % OUTPUTS 9 | % 10 | % EXAMPLE 11 | % 12 | % See also CLC, CC, CCC 13 | % 14 | % Piotr's Computer Vision Matlab Toolbox Version 1.5 15 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 16 | % Licensed under the Simplified BSD License [see external/bsd.txt] 17 | 18 | clc 19 | -------------------------------------------------------------------------------- /matlab/cc.m: -------------------------------------------------------------------------------- 1 | % close all, clc 2 | % 3 | % USAGE 4 | % cc 5 | % 6 | % INPUTS 7 | % 8 | % OUTPUTS 9 | % 10 | % EXAMPLE 11 | % 12 | % See also C, CCC 13 | % 14 | % Piotr's Computer Vision Matlab Toolbox Version 1.5 15 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 16 | % Licensed under the Simplified BSD License [see external/bsd.txt] 17 | 18 | close all; clc 19 | -------------------------------------------------------------------------------- /matlab/ccc.m: -------------------------------------------------------------------------------- 1 | % clear, close all, clc, clear global 2 | % 3 | % USAGE 4 | % ccc 5 | % 6 | % INPUTS 7 | % 8 | % OUTPUTS 9 | % 10 | % EXAMPLE 11 | % 12 | % See also C, CC 13 | % 14 | % Piotr's Computer Vision Matlab Toolbox Version 1.5 15 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 16 | % Licensed under the Simplified BSD License [see external/bsd.txt] 17 | 18 | clear; close all; clc; clear all; 19 | -------------------------------------------------------------------------------- /matlab/dijkstra.m: -------------------------------------------------------------------------------- 1 | function [D,P] = dijkstra( G, varargin ) 2 | % Runs Dijkstra's shortest path algorithm on a distance matrix. 3 | % 4 | % Runs Dijkstra's on the given SPARSE nxn distance matrix G, where missing 5 | % values mean no edge (infinite distance). Uses a Finonacci heap resulting 6 | % in fast computation. Finds the shortest path distance from every point 7 | % S(i) in the 1xp source vector S to every other point j, resulting in a 8 | % pxn distance matrix D. P(i,j) contains the second to last node on the 9 | % path from S(i) to j. If point j is not reachable from point S(i) then 10 | % D(i,j)=inf and P(i,j)=-1. 11 | % 12 | % USAGE 13 | % [D P] = dijkstra( G, [S] ) 14 | % 15 | % INPUT 16 | % G - sparse nxn distance matrix 17 | % S - 1xp array of source indices i 18 | % 19 | % OUPUT 20 | % D - pxn - shortest path lengths from S(i) to j 21 | % P - pxn - indicies of second to last node on path from S(i) to j 22 | % 23 | % EXAMPLE 24 | % n=11; G=sparse(n,n); for i=1:n-1, G(i,i+1)=1; end; G=G+G'; 25 | % [D,P] = dijkstra(G,5), % D=[4:-1:0 1:6]; P=[2:5 -1 5:10]; 26 | % 27 | % See also 28 | % 29 | % Piotr's Computer Vision Matlab Toolbox Version 3.20 30 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 31 | % Licensed under the Simplified BSD License [see external/bsd.txt] 32 | 33 | [D,P] = dijkstra1( G, varargin{:} ); 34 | -------------------------------------------------------------------------------- /matlab/diskFill.m: -------------------------------------------------------------------------------- 1 | function diskFill( tDir, nGig ) 2 | % Fill a harddisk with garbage files (useful before discarding disk). 3 | % 4 | % USAGE 5 | % diskFill( tDir, nGig ) 6 | % 7 | % INPUTS 8 | % tDir - target directory to fill with garbage 9 | % nGig - maximum number of gigabytes to write to disk 10 | % 11 | % OUTPUTS 12 | % 13 | % EXAMPLE 14 | % diskFill( 'k:', 500 ) 15 | % 16 | % See also 17 | % 18 | % Piotr's Computer Vision Matlab Toolbox Version 2.61 19 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 20 | % Licensed under the Simplified BSD License [see external/bsd.txt] 21 | 22 | nm = sprintf('%s/garbage_%s_%05i_%%05i.mat',tDir,date,round(rand*10^5)); 23 | tid = ticStatus(); 24 | for i=1:nGig 25 | % write up to 1 GB of garbage bytes in chunks of 1 MB 26 | fid=fopen(sprintf(nm,i),'w'); mb=2^20; n=0; o=mb; 27 | while(n<2^30 && o==mb), o=fwrite(fid,rand(mb,1)); n=n+o; end 28 | try fclose(fid); catch, end; tocStatus( tid, i/nGig ); %#ok 29 | % if write failed (k<1), disk is presumably full 30 | if( o 22 | f=fopen([jobId '-done'],'w'); fclose(f); 23 | end 24 | -------------------------------------------------------------------------------- /matlab/figureResized.m: -------------------------------------------------------------------------------- 1 | function varargout = figureResized( screenratio, varargin ) 2 | % Creates a figures that takes up certain area of screen. 3 | % 4 | % Almost same as figure, except get to specify what fraction of available 5 | % screen space figure should take up. Figure appears in center of screen. 6 | % 7 | % USAGE 8 | % varargout = figureResized( screenratio, varargin ) 9 | % 10 | % INPUTS 11 | % screenratio - controls fraction of screen image takes out (<=.8) 12 | % varargin - parameters to figure 13 | % 14 | % OUTPUTS 15 | % varargout - out from figure 16 | % 17 | % EXAMPLE 18 | % figureResized( .75 ) 19 | % 20 | % See also FIGURE 21 | % 22 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 23 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 24 | % Licensed under the Simplified BSD License [see external/bsd.txt] 25 | 26 | if( nargin<1 ); screenratio=.3; end 27 | if( screenratio>1 ); error('screenratio must be <= 1'); end 28 | 29 | % call figure 30 | h = figure( varargin{:} ); 31 | if( nargout ); varargout = {h}; end; 32 | 33 | % get dimensions of screen and what want figure to be 34 | units = get(0,'Units'); 35 | ss = get(0,'ScreenSize'); 36 | st = (1 - screenratio)/2; 37 | pos = [st*ss(3), st*ss(4), screenratio*ss(3), screenratio*ss(4)]; 38 | 39 | % set dimensions of figure 40 | set( h, 'Units', units ); 41 | set( h, 'Position', pos ); 42 | -------------------------------------------------------------------------------- /matlab/gauss2ellipse.m: -------------------------------------------------------------------------------- 1 | function [cRow, cCol, ra, rb, phi] = gauss2ellipse( mu, C, rad ) 2 | % Creates an ellipse representing the 2D Gaussian distribution. 3 | % 4 | % Creates an ellipse representing the 2D Gaussian distribution with mean mu 5 | % and covariance matrix C. Returns 5 parameters that specify the ellipse. 6 | % 7 | % USAGE 8 | % [cRow, cCol, ra, rb, phi] = gauss2ellipse( mu, C, [rad] ) 9 | % 10 | % INPUTS 11 | % mu - 1x2 vector representing the center of the ellipse 12 | % C - 2x2 cov matrix 13 | % rad - [2] Number of std to create the ellipse to 14 | % 15 | % OUTPUTS 16 | % cRow - the row location of the center of the ellipse 17 | % cCol - the column location of the center of the ellipse 18 | % ra - semi-major axis length (in pixels) of the ellipse 19 | % rb - semi-minor axis length (in pixels) of the ellipse 20 | % phi - rotation angle (radians) of semimajor axis from x-axis 21 | % 22 | % EXAMPLE 23 | % [cRow, cCol, ra, rb, phi] = gauss2ellipse( [5 5], [1 0; .5 2] ) 24 | % plotEllipse( cRow, cCol, ra, rb, phi ); 25 | % 26 | % See also PLOTELLIPSE, PLOTGAUSSELLIPSES, MASKELLIPSE 27 | % 28 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 29 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 30 | % Licensed under the Simplified BSD License [see external/bsd.txt] 31 | 32 | if (nargin<3 || isempty(rad) ); rad=2; end; 33 | 34 | % error check 35 | if (~all(size(mu)==[1,2]) || ~all(size(C)==[2,2])) 36 | error('Works only for 2D Gaussians'); end 37 | 38 | % decompose using SVD 39 | [~,D,R] = svd(C); 40 | normstd = sqrt( diag( D ) ); 41 | 42 | % get angle of rotation (in row/column format) 43 | phi = acos(R(1,1)); 44 | if (R(2,1) < 0); phi = 2*pi - phi; end 45 | phi = pi/2 - phi; 46 | 47 | % get ellipse radii 48 | ra = rad*normstd(1); 49 | rb = rad*normstd(2); 50 | 51 | % center of ellipse 52 | cRow = mu(1); 53 | cCol = mu(2); 54 | -------------------------------------------------------------------------------- /matlab/ind2sub2.m: -------------------------------------------------------------------------------- 1 | function sub = ind2sub2( siz, ind ) 2 | % Improved version of ind2sub. 3 | % 4 | % Almost the same as ind2sub, except always returns only a single output 5 | % that contains all the index locations. Also handles multiple linear 6 | % indicies at the same time. See help for ind2sub for more info. 7 | % 8 | % USAGE 9 | % sub = ind2sub2( siz, ind ) 10 | % 11 | % INPUTS 12 | % siz - size of array into which ind is an index 13 | % ind - linear index (or vector of indicies) into given array 14 | % 15 | % OUTPUTS 16 | % sub - sub(i,:) is the ith set of subscripts into the array. 17 | % 18 | % EXAMPLE 19 | % sub = ind2sub2( [10,10], 20 ) % 10 2 20 | % sub = ind2sub2( [10,10], [20 19] ) % 10 2; 9 2 21 | % 22 | % See also IND2SUB, SUB2IND2 23 | % 24 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 25 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 26 | % Licensed under the Simplified BSD License [see external/bsd.txt] 27 | 28 | if( any(ind>prod(siz)) ); error('index out of range'); end 29 | 30 | % taken almost directly from ind2sub.m 31 | ind = ind(:); 32 | nd = length(siz); 33 | k = [1 cumprod(siz(1:end-1))]; 34 | ind = ind - 1; 35 | sub = zeros(length(ind),nd); 36 | for i = nd:-1:1 37 | sub(:,i) = floor(ind/k(i))+1; 38 | ind = rem(ind,k(i)); 39 | end 40 | -------------------------------------------------------------------------------- /matlab/int2str2.m: -------------------------------------------------------------------------------- 1 | function nstr = int2str2( n, nDigits ) 2 | % Convert integer to string of given length; improved version of int2str. 3 | % 4 | % Pads string with zeros on the left. For integers similar to 5 | % sprintf( '%03i', n ); %for nDigits=3 6 | % If input n is an array, output is a cell array of strings of the same 7 | % dimension as n. Works also for non integers (pads to given length). 8 | % 9 | % USAGE 10 | % nstr = int2str2( n, [nDigits] ) 11 | % 12 | % INPUTS 13 | % n - integer to convert to string 14 | % nDigits - [0] minimum number of digits to use 15 | % 16 | % OUTPUTS 17 | % nstr - string repr. of n (or cell array of strings if n is array) 18 | % 19 | % EXAMPLE 20 | % s = int2str2( 3, 3 ) % s='003' 21 | % 22 | % See also INT2STR 23 | % 24 | % Piotr's Computer Vision Matlab Toolbox Version 1.5 25 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 26 | % Licensed under the Simplified BSD License [see external/bsd.txt] 27 | 28 | if( nargin<2 ); nDigits=0; end 29 | 30 | nel = numel( n ); 31 | negvals=(n<0); n=abs(n); 32 | if( nel==1 ) % for a single int 33 | nstr = num2str( n ); 34 | if( nDigits > size(nstr,2) ) 35 | nstr = [repmat( '0', 1, nDigits-size(nstr,2) ), nstr]; 36 | end; 37 | if(negvals); nstr=['-' nstr]; end 38 | 39 | else % for array of ints 40 | nstr = cell(size(n)); 41 | for i=1:nel 42 | nstr{i} = num2str( n(i) ); 43 | if( nDigits > size(nstr{i},2) ) 44 | nstr{i} = [repmat( '0', 1, nDigits-size(nstr{i},2) ), nstr{i}]; 45 | end; 46 | if(negvals(i)); nstr{i}=['-' nstr{i}]; end 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /matlab/isfield2.m: -------------------------------------------------------------------------------- 1 | function tf = isfield2( S, fs, isinit ) 2 | % Similar to isfield but also test whether fields are initialized. 3 | % 4 | % A more comprehensive test of what fields are present [and optionally 5 | % initialized] in a stuct S. fs is either a single field name or a cell 6 | % array of field names. The presence of all fields in fs are tested for in 7 | % S, tf is true iif all fs are present. Additionally, if isinit==1, then tf 8 | % is true iff every field fs of every element of S is nonempty (test done 9 | % using isempty). 10 | % 11 | % USAGE 12 | % tf = isfield2( S, fs, [isinit] ) 13 | % 14 | % INPUTS 15 | % S - struct array 16 | % fs - cell of string name or string 17 | % isinit - [0] if true additionally test if all fields are initialized 18 | % 19 | % OUTPUTS 20 | % tf - true or false, depending on results of above tests 21 | % 22 | % EXAMPLE 23 | % isfield2( struct('a',1,'b',2), {'a','b'}, 1 ) 24 | % 25 | % See also ISFIELD 26 | % 27 | % Piotr's Computer Vision Matlab Toolbox Version 2.10 28 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 29 | % Licensed under the Simplified BSD License [see external/bsd.txt] 30 | 31 | tf = all( isfield(S,fs) ); 32 | if( ~tf || nargin<3 || ~isinit ); return; end 33 | 34 | % now optionally check if fields are initialized 35 | if( iscell(fs) ) 36 | for i=1:length(fs) 37 | for j=1:numel(S) 38 | if( isempty(S(j).(fs{i})) ); tf=false; return; end; 39 | end; 40 | end; 41 | else 42 | for j=1:numel(S) 43 | if( isempty(S(j).(fs)) ); tf=false; return; end; 44 | end; 45 | end 46 | -------------------------------------------------------------------------------- /matlab/mat2cell2.m: -------------------------------------------------------------------------------- 1 | function C = mat2cell2( X, parts ) 2 | % Break matrix up into a cell array of same sized matrices. 3 | % 4 | % Useful wrapper for matlab function mat2cell. Instead of specifying 5 | % locations along each dimension at which to split the matrix, this 6 | % function takes the number of parts along each dimension to break X into. 7 | % That is if X is d1xd2x...xdk and parts=[p1 p2 ... pk]; then X is split 8 | % into p1*p2*...*pk matricies of dimension d1/p1 x d2/p2 x ... x dk/pk. If 9 | % di/pi is not an integer, floor(di/pi) is used. Leftover chunks of X are 10 | % discarded. Using a scalar p for parts is equivalent to using [p p ... p]. 11 | % 12 | % So for example if X is 10*16, mat2cell2( X, [2 3] ) breaks X into 2*3 13 | % parts, each of size 5x5, and the last column of X is discarded. 14 | % 15 | % USAGE 16 | % C = mat2cell2( X, parts ) 17 | % 18 | % INPUTS 19 | % X - matrix to split 20 | % parts - see above 21 | % 22 | % OUTPUTS 23 | % C - cell array adjacent submatrices of X 24 | % 25 | % EXAMPLE 26 | % A=rand(6,10); B = mat2cell2(A,[3 3]), 27 | % 28 | % See also MAT2CELL, CELL2ARRAY, CELL2MAT 29 | % 30 | % Piotr's Computer Vision Matlab Toolbox Version 3.02 31 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 32 | % Licensed under the Simplified BSD License [see external/bsd.txt] 33 | 34 | siz = size(X); nd = ndims(X); 35 | if(length(parts)>nd && all(parts(nd+1:end)==1)), parts=parts(1:nd); end 36 | [parts,er] = checkNumArgs( parts, size(siz), 0, 2 ); error(er); 37 | 38 | % crop border areas so as to make dims of X divisible by parts 39 | parts = min(siz,parts); siz = siz - mod( siz, parts ); 40 | if (~all( siz==size(X))); X = arrayCrop( X, ones(1,nd), siz ); end 41 | 42 | % Convert to cell array by calling mat2cell 43 | bounds = cell(1,nd); 44 | for d=1:nd; bounds{d} = repmat( siz(d)/parts(d), [1 parts(d)] ); end 45 | C=mat2cell( X, bounds{:}); 46 | -------------------------------------------------------------------------------- /matlab/normpdf2.m: -------------------------------------------------------------------------------- 1 | function ps = normpdf2( xs, m, C ) 2 | % Normal prob. density function (pdf) with arbitrary covariance matrix. 3 | % 4 | % Evaluate the multi-variate density with mean vector m and covariance 5 | % matrix C for the input vector xs. Assumes that the N datapoints are d 6 | % dimensional. Then m is dx1 or 1xd, C is dxd, and xs is dxN or NxD where 7 | % N is the number of samples to be evaluated. 8 | % 9 | % USAGE 10 | % ps = normpdf2( xs, m, C ) 11 | % 12 | % INPUTS 13 | % xs - points to evaluated (Nxd or dxN) 14 | % m - mean vector (dx1 or 1xd) 15 | % C - Covariance matrix (dxd) 16 | % 17 | % OUTPUTS 18 | % ps - probability density at each x (Nx1) 19 | % 20 | % EXAMPLE 21 | % ps = normpdf2( randn(10,2), [0 0], eye(2) ) 22 | % 23 | % See also NORMPDF 24 | % 25 | % Piotr's Computer Vision Matlab Toolbox Version 2.30 26 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 27 | % Licensed under the Simplified BSD License [see external/bsd.txt] 28 | 29 | % get dimensions of data 30 | d=length(m); 31 | if( size(xs,1)~=d ); xs=xs'; end 32 | N=size(xs,2); 33 | 34 | if( d==1 ) % fast special case 35 | ps = 1/sqrt(2*pi*C) * exp(-(xs-m).*(xs-m)/(2*C))'; 36 | 37 | elseif( rcond(C) 39 | ps = zeros(N,1); 40 | 41 | else % get probabilities 42 | xs = (xs-m(:)*ones(1,N))'; 43 | denom = (2*pi)^(d/2)*sqrt(abs(det(C))); 44 | mahal = sum( (xs/C).*xs, 2 ); 45 | numer = exp(-0.5*mahal); 46 | ps = numer/denom; 47 | end 48 | -------------------------------------------------------------------------------- /matlab/num2strs.m: -------------------------------------------------------------------------------- 1 | function Y = num2strs( X, varargin ) 2 | % Applies num2str to each element of an array X. 3 | % 4 | % USAGE 5 | % Y = num2strs( X, [varargin] ) 6 | % 7 | % INPUTS 8 | % X - array of number to convert to strings 9 | % varargin - [] additional input to num2str 10 | % 11 | % OUTPUTS 12 | % Y - cell array of strings 13 | % 14 | % EXAMPLE 15 | % Y = num2strs( [1.3 2.6; 3 11] ) 16 | % 17 | % See also NUM2STR 18 | % 19 | % Piotr's Computer Vision Matlab Toolbox Version 1.5 20 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 21 | % Licensed under the Simplified BSD License [see external/bsd.txt] 22 | 23 | Y = cell(size(X)); 24 | for i=1:numel(X) 25 | Y{i} = num2str( X(i), varargin{:} ); 26 | end 27 | -------------------------------------------------------------------------------- /matlab/plotGaussEllipses.m: -------------------------------------------------------------------------------- 1 | function hs = plotGaussEllipses( mus, Cs, rad ) 2 | % Plots 2D ellipses derived from 2D Gaussians specified by mus & Cs. 3 | % 4 | % USAGE 5 | % hs = plotGaussEllipses( mus, Cs, [rad] ) 6 | % 7 | % INPUTS 8 | % mus - k x 2 matrix of means 9 | % Cs - 2 x 2 x k covariance matricies 10 | % rad - [2] Number of std to create the ellipse to 11 | % 12 | % OUTPUTS 13 | % hs - handles to ellipses 14 | % 15 | % EXAMPLE 16 | % plotGaussEllipses( [ 10 10; 10 10 ], cat(3,eye(2),eye(2)*2) ); 17 | % 18 | % See also PLOTELLIPSE, GAUSS2ELLIPSE 19 | % 20 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 21 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 22 | % Licensed under the Simplified BSD License [see external/bsd.txt] 23 | 24 | if (nargin<3 || isempty(rad) ); rad=2; end 25 | colors = ['b', 'g', 'r', 'c', 'm', 'y', 'k']; nc = length(colors); 26 | 27 | washeld = ishold; if (~washeld); hold('on'); end 28 | hs = zeros( size(mus,1),1 ); 29 | for i=1:size( mus,1) 30 | [ cRow, ccol, ra, rb, phi ] = gauss2ellipse( mus(i,:), Cs(:,:,i), rad ); 31 | hs(i)=plotEllipse( cRow, ccol, ra, rb, phi, colors( mod(i-1,nc)+1) ); 32 | end 33 | if (~washeld); hold('off'); end 34 | -------------------------------------------------------------------------------- /matlab/private/char2img_h015.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h015.mat -------------------------------------------------------------------------------- /matlab/private/char2img_h020.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h020.mat -------------------------------------------------------------------------------- /matlab/private/char2img_h025.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h025.mat -------------------------------------------------------------------------------- /matlab/private/char2img_h030.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h030.mat -------------------------------------------------------------------------------- /matlab/private/char2img_h035.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h035.mat -------------------------------------------------------------------------------- /matlab/private/char2img_h050.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/char2img_h050.mat -------------------------------------------------------------------------------- /matlab/private/dijkstra1.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/dijkstra1.mexa64 -------------------------------------------------------------------------------- /matlab/private/dijkstra1.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/dijkstra1.mexmaci64 -------------------------------------------------------------------------------- /matlab/private/dijkstra1.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/matlab/private/dijkstra1.mexw64 -------------------------------------------------------------------------------- /matlab/randSample.m: -------------------------------------------------------------------------------- 1 | function r = randSample( n, k, isArray ) 2 | % Generate values sampled uniformly without replacement from 1:n. 3 | % 4 | % If n is an integer, samples k values from 1:n without replacement. If n 5 | % is an array, samples k values without replacement from n. This function 6 | % implements much of the same functionality as randsample.m in the 7 | % Statistics Toolbox. 8 | % 9 | % USAGE 10 | % r = randSample( n, k, [isArray] ) 11 | % 12 | % INPUTS 13 | % n - specifies sampling source (if array) or range (if scalar) 14 | % k - the number of samples to draw 15 | % isArray - [0] if true treat n as an array (even if has single elt) 16 | % 17 | % OUTPUTS 18 | % r - k uniformly generated random samples 19 | % 20 | % EXAMPLE 21 | % r = randSample( 10, 5 ) 22 | % r = randSample( [ 5 6 8 9 32 45 ], 2 ) 23 | % 24 | % See also randperm 25 | % 26 | % Piotr's Computer Vision Matlab Toolbox Version 2.50 27 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 28 | % Licensed under the Simplified BSD License [see external/bsd.txt] 29 | 30 | if( nargin<3 ), isArray=0; end 31 | m=length(n); if(m>1), isArray=1; elseif(isArray==0), m=n; end 32 | if(k>m), error('Too many samples requested.'); end 33 | if(k==1), r=1+floor(m*rand); else r=randperm(m); r=r(1:k); end 34 | if(isArray), r=n(r); end 35 | 36 | end 37 | -------------------------------------------------------------------------------- /matlab/randint2.m: -------------------------------------------------------------------------------- 1 | function R = randint2( m, n, range ) 2 | % Faster but restricted version of randint. 3 | % 4 | % Generate matrix of uniformly distributed random integers. 5 | % R=randint2(m,n,range) generates an m-by-n matrix of random integers 6 | % between [range(1), range(2)]. Note that randint is part of the 7 | % 'Communications Toolbox' and may not be available on all systems. 8 | % 9 | % To test speed: 10 | % tic, for i=1:1000; R = randint( 100, 10, [0 10] ); end; toc 11 | % tic, for i=1:1000; R = randint2( 100, 10, [0 10] ); end; toc 12 | % 13 | % USAGE 14 | % R = randint2( m, n, range ) 15 | % 16 | % INPUTS 17 | % m - m rows 18 | % n - n cols 19 | % range - range of ints 20 | % 21 | % OUTPUTS 22 | % R - mxn matrix of integers 23 | % 24 | % EXAMPLE 25 | % R = randint2( 2, 5, [0 1] ) 26 | % 27 | % See also RANDINT 28 | % 29 | % Piotr's Computer Vision Matlab Toolbox Version 2.12 30 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 31 | % Licensed under the Simplified BSD License [see external/bsd.txt] 32 | 33 | R = rand( m, n ); 34 | R = range(1) + floor( (range(2)-range(1)+1)*R ); 35 | -------------------------------------------------------------------------------- /matlab/spBlkDiag.m: -------------------------------------------------------------------------------- 1 | function [B,inds] = spBlkDiag( A, inds ) 2 | % Creates a sparse block diagonal matrix from a 3D array. 3 | % 4 | % Given an [mxnxk] matrix A, construct a sparse block diagonal matrix B of 5 | % dims [m*k x n*k], containing k blocks of size mxn each, where each block 6 | % i is taken from A(:,:,i). 7 | % 8 | % When computing B, a time consuming step is to compute a series of 9 | % indices. These indices are fixed for given dims of A and can be re-used. 10 | % spBlkDiag's additional input/output can be used to cache these indices. 11 | % 12 | % USAGE 13 | % [B, inds] = spBlkDiag( A, [inds] ) 14 | % 15 | % INPUTS 16 | % A - [m x n x k] input matrix of k mxn blocks 17 | % inds - cached indices for faster computation 18 | % 19 | % OUTPUT 20 | % B - [m*k x n*k] sparse block diagonal matrix with k mxn blocks 21 | % inds - cached indices for faster computation 22 | % 23 | % EXAMPLE 24 | % A=rand(3,4,2); B=spBlkDiag(A); full(B) 25 | % 26 | % See also SPARSE, BLKDIAG 27 | % 28 | % Piotr's Computer Vision Matlab Toolbox Version 2.35 29 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 30 | % Licensed under the Simplified BSD License [see external/bsd.txt] 31 | 32 | [m,n,k]=size(A); 33 | 34 | % compute the indices of the elements in the sparse matrix 35 | if( nargin<2 || isempty(inds) || m~=inds.m || n~=inds.n || k~=inds.k ) 36 | ds=(1:m)'; rs=reshape(1:m*k,m,k); rs=rs(ds(:,ones(1,n)),:); rs=rs(:); 37 | cs=1:n*k; cs=cs(ones(m,1),:); cs=cs(:); 38 | inds=struct('m',m,'n',n,'k',k,'rs',rs,'cs',cs); 39 | else 40 | rs=inds.rs; cs=inds.cs; 41 | end 42 | 43 | % finally generate the sparse matrix 44 | B=sparse(rs,cs,A(:),m*k,n*k); 45 | -------------------------------------------------------------------------------- /matlab/sub2ind2.m: -------------------------------------------------------------------------------- 1 | function ind = sub2ind2( siz, sub ) 2 | % Improved version of sub2ind. 3 | % 4 | % Almost the same as sub2ind, except always returns only a single output 5 | % that contains all the subscript locations. Also handles multiple linear 6 | % subscripts at the same time more conveniently then matlab's version. See 7 | % help for sub2ind for more info. 8 | % 9 | % USAGE 10 | % ind = sub2ind2( siz, sub ) 11 | % 12 | % INPUTS 13 | % siz - size of array into which sub is an index 14 | % sub - sub(i,:) is the ith set of subscripts into the array. 15 | % 16 | % OUTPUTS 17 | % ind - linear index (or vector of indicies) into given array 18 | % 19 | % EXAMPLE 20 | % ind = sub2ind2( [10,10], [10 2] ) % 20 21 | % ind = sub2ind2( [10,10], [9 2; 10 2] ) % 19, 20 22 | % 23 | % See also SUB2IND, IND2SUB2, SUBSTOARRAY 24 | % 25 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 26 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 27 | % Licensed under the Simplified BSD License [see external/bsd.txt] 28 | 29 | if(isempty(sub)); ind=[]; return; end; 30 | n = length(siz); 31 | 32 | % error check (commented out to speed up substantially) 33 | if( size(sub,2)~=n ) 34 | error('Incorrect dimension for sub'); 35 | % for i = 1:n; if( any( sub(:,i)<1 ) || any( sub(:,i)>siz(i) ) ) 36 | % error('subscript out of range'); end; 37 | end 38 | 39 | k = [1 cumprod(siz(1:end-1))]; 40 | ind = 1; 41 | for i = 1:n; ind = ind + (sub(:,i)-1)*k(i); end 42 | -------------------------------------------------------------------------------- /matlab/subsToArray.m: -------------------------------------------------------------------------------- 1 | function I = subsToArray( subs, vals, siz, fillVal ) 2 | % Converts subs/vals image representation to array representation. 3 | % 4 | % Constructs array from subs/vals representation. Similar to Matlab's 5 | % sparse command, except doesn't actually produce a sparse matrix. Uses 6 | % different conventions as well. 7 | % 8 | % USAGE 9 | % I = subsToArray( subs, vals, siz, [fillVal] ) 10 | % 11 | % INPUTS 12 | % subs - subscripts of point locations (n x d) 13 | % vals - values at point locations (n x 1) 14 | % siz - image size vector (1xd) - must fully contain subs 15 | % fillVal - [0] value to fill array with at nonspecified locs 16 | % 17 | % OUTPUTS 18 | % I - array of size siz 19 | % 20 | % EXAMPLE 21 | % 22 | % See also SUB2IND2, SPARSE 23 | % 24 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 25 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 26 | % Licensed under the Simplified BSD License [see external/bsd.txt] 27 | 28 | if( nargin<4 || isempty(fillVal) ); fillVal=0; end 29 | 30 | inds = sub2ind2( siz, subs ); 31 | I = repmat( fillVal, siz ); 32 | I(inds) = vals; 33 | -------------------------------------------------------------------------------- /matlab/tpsInterpolate.m: -------------------------------------------------------------------------------- 1 | function [xsR,ysR] = tpsInterpolate( warp, xs, ys, show ) 2 | % Apply warp (obtained by tpsGetWarp) to a set of new points. 3 | % 4 | % USAGE 5 | % [xsR,ysR] = tpsInterpolate( warp, xs, ys, [show] ) 6 | % 7 | % INPUTS 8 | % warp - [see tpsGetWarp] bookstein warping parameters 9 | % xs, ys - points to apply warp to 10 | % show - [1] will display results in figure(show) 11 | % 12 | % OUTPUTS 13 | % xsR, ysR - result of warp applied to xs, ys 14 | % 15 | % EXAMPLE 16 | % 17 | % See also TPSGETWARP 18 | % 19 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 20 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 21 | % Licensed under the Simplified BSD License [see external/bsd.txt] 22 | 23 | if( nargin<4 || isempty(show)); show = 1; end 24 | 25 | wx = warp.wx; affinex = warp.affinex; 26 | wy = warp.wy; affiney = warp.affiney; 27 | xsS = warp.xsS; ysS = warp.ysS; 28 | xsD = warp.xsD; ysD = warp.ysD; 29 | 30 | % interpolate points (xs,ys) 31 | xsR = f( wx, affinex, xsS, ysS, xs(:)', ys(:)' ); 32 | ysR = f( wy, affiney, xsS, ysS, xs(:)', ys(:)' ); 33 | 34 | % optionally show points (xsR, ysR) 35 | if( show ) 36 | figure(show); 37 | subplot(2,1,1); plot( xs, ys, '.', 'color', [0 0 1] ); 38 | hold('on'); plot( xsS, ysS, '+' ); hold('off'); 39 | subplot(2,1,2); plot( xsR, ysR, '.' ); 40 | hold('on'); plot( xsD, ysD, '+' ); hold('off'); 41 | end 42 | 43 | function zs = f( w, aff, xsS, ysS, xs, ys ) 44 | % find f(x,y) for xs and ys given W and original points 45 | n = size(w,1); ns = size(xs,2); 46 | delXs = xs'*ones(1,n) - ones(ns,1)*xsS; 47 | delYs = ys'*ones(1,n) - ones(ns,1)*ysS; 48 | distSq = (delXs .* delXs + delYs .* delYs); 49 | distSq = distSq + eye(size(distSq)) + eps; 50 | U = distSq .* log( distSq ); U( isnan(U) )=0; 51 | zs = aff(1)*ones(ns,1)+aff(2)*xs'+aff(3)*ys'; 52 | zs = zs + sum((U.*(ones(ns,1)*w')),2); 53 | -------------------------------------------------------------------------------- /matlab/tpsInterpolateIm.m: -------------------------------------------------------------------------------- 1 | function [IR,boundX,boundY] = tpsInterpolateIm( Isrc, warp, holeVal ) 2 | % Interpolate Isrc according to the warp from Isrc->Idst. 3 | % 4 | % Use tpsGetWarp to obtain the warp. 5 | % 6 | % USAGE 7 | % IR = tpsInterpolateIm( Isrc, warp, [holeVal] ) 8 | % 9 | % INPUTS 10 | % Isrc - image to interpolate 11 | % warp - [see tpsGetWarp] bookstein warping parameters 12 | % holeVal - [0] Value of the empty warps 13 | % 14 | % OUTPUTS 15 | % IR - warped image 16 | % 17 | % EXAMPLE 18 | % xsS=[0 0 1 1 2 2]; ysS=[0 2 0 2 0 2]; ysD=[0 2 .5 1.5 0 2]; 19 | % warp = tpsGetWarp(0,xsS*100,ysS*100,xsS*100,ysD*100); 20 | % load clown; I=padarray(X,[1 1],0,'both'); clear X caption map; 21 | % IR = tpsInterpolateIm( I, warp ); 22 | % figure(1); clf; im(I); figure(2); clf; im(IR); 23 | % 24 | % See also TPSGETWARP, TEXTUREMAP 25 | % 26 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 27 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 28 | % Licensed under the Simplified BSD License [see external/bsd.txt] 29 | 30 | if( nargin<3 || isempty(holeVal) ); holeVal=0; end 31 | 32 | % warp grid points 33 | [ gxs, gys ] = meshgrid( 1:size(Isrc,2), 1:size(Isrc,1) ); 34 | [ gxsTar, gysTar ] = tpsInterpolate( warp, gxs(:), gys(:), 0 ); 35 | gxsTar = reshape( gxsTar, size(Isrc) ); 36 | gysTar = reshape( gysTar, size(Isrc) ); 37 | 38 | % use texture mapping to generate target image 39 | [IR,boundX,boundY]=textureMap(double(Isrc),gysTar,gxsTar,'loose',holeVal); 40 | -------------------------------------------------------------------------------- /matlab/tpsRandom.m: -------------------------------------------------------------------------------- 1 | function w = tpsRandom( LnInv, bendE ) 2 | % Obtain a random warp with the same bending energy as the original. 3 | % 4 | % USAGE 5 | % w = tpsRandom( LnInv, bendE ) 6 | % 7 | % INPUTS 8 | % LnInv - [see tpsGetWarp] bookstein warping parameters 9 | % bendE - amount of bening energy for random warp to have 10 | % 11 | % OUTPUTS 12 | % w - nonlinear component of warp for use in tpsInterpolate 13 | % 14 | % EXAMPLE 15 | % 16 | % See also TPSGETWARP 17 | % 18 | % Piotr's Computer Vision Matlab Toolbox Version 2.0 19 | % Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 20 | % Licensed under the Simplified BSD License [see external/bsd.txt] 21 | 22 | n = size(LnInv,1); 23 | u = rand(n-3,1) - .5; 24 | u = u / norm(u); 25 | u = [u; 0; 0; 0]; 26 | 27 | % get U, sig, sigInv, requires some fanangling 28 | [U,sig] = eig(LnInv); 29 | U = real(U); sig=real(sig); 30 | sig( abs(sig)<.000001)=0; 31 | %sigInv = sig; 32 | %sigInv(abs(sig)>.000001) = 1./sigInv(abs(sig)>.000001); 33 | 34 | % get w (and v?) 35 | %v = sqrt(bendE)* U * sqrt(sigInv) * u; 36 | w = sqrt(bendE)* U * sqrt(sig) * u; 37 | 38 | % % should be eye(N) with 3 0's 39 | % sqrt(sigInv) * U' * LnInv * U * sqrt(sigInv) 40 | % % should be equal 41 | % v' * LnInv * v, bendE 42 | -------------------------------------------------------------------------------- /videos/Contents.m: -------------------------------------------------------------------------------- 1 | % VIDEOS 2 | % See also 3 | % 4 | % Behavior annotation for seq files: 5 | % behaviorAnnotator - Caltech Behavior Annotator. 6 | % behaviorData - Retrieve and manipulate behavior annotation of a video. 7 | % 8 | % Seq files [custom codec free video format]: 9 | % seqIo - Utilities for reading and writing seq files. 10 | % seqReaderPlugin - Plugin for seqIo and videoIO to allow reading of seq files. 11 | % seqWriterPlugin - Plugin for seqIo and videoIO to allow writing of seq files. 12 | % seqPlayer - Simple GUI to play seq files. 13 | % 14 | % Image and sequence alignment: 15 | % imagesAlign - Fast and robust estimation of homography relating two images. 16 | % imagesAlignSeq - Stabilize image sequence using coarse optical flow estimation. 17 | % 18 | % Miscellaneous: 19 | % kernelTracker - Kernel Tracker from Comaniciu, Ramesh and Meer PAMI 2003. 20 | % opticalFlow - Coarse-to-fine optical flow using Lucas&Kanade or Horn&Schunck. 21 | -------------------------------------------------------------------------------- /videos/imagesAlignSeq.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/imagesAlignSeq.m -------------------------------------------------------------------------------- /videos/opticalFlowTest.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/opticalFlowTest.mat -------------------------------------------------------------------------------- /videos/peds30-seek.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/peds30-seek.mat -------------------------------------------------------------------------------- /videos/peds30.seq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/peds30.seq -------------------------------------------------------------------------------- /videos/private/ktComputeW_c.c: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Piotr's Computer Vision Matlab Toolbox Version 2.2 3 | * Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 4 | * Licensed under the Simplified BSD License [see external/bsd.txt] 5 | **************************************************************************/ 6 | #include "mex.h" 7 | #include "math.h" 8 | typedef unsigned char uchar; 9 | 10 | /* Construct W for kernel tracker. */ 11 | void ktComputeW( double* w, uchar* B, double* q, double *p, int n, int nBits ) { 12 | int i, indFlat, nBits2=nBits+nBits, nBins=1<0 ) ? sqrt(q[i]/p[i]) : 0.0; 17 | for( i=0; i 1) mexErrMsgTxt("Too many output arguments."); 32 | 33 | /* extract inputs */ 34 | n = mxGetM( prhs[0] ); 35 | B = (uchar*) mxGetData(prhs[0]); 36 | q = mxGetPr(prhs[1]); 37 | p = mxGetPr(prhs[2]); 38 | nBits = (int) mxGetScalar(prhs[3]); 39 | 40 | /* create outputs */ 41 | dims[0]=n; dims[1]=1; 42 | plhs[0] = mxCreateNumericArray(1, dims, mxDOUBLE_CLASS, mxREAL); 43 | w = mxGetPr( plhs[0] ); 44 | 45 | /* call main function */ 46 | ktComputeW( w, B, q, p, n, nBits ); 47 | } 48 | -------------------------------------------------------------------------------- /videos/private/ktComputeW_c.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktComputeW_c.mexa64 -------------------------------------------------------------------------------- /videos/private/ktComputeW_c.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktComputeW_c.mexmaci64 -------------------------------------------------------------------------------- /videos/private/ktComputeW_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktComputeW_c.mexw64 -------------------------------------------------------------------------------- /videos/private/ktHistcRgb_c.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktHistcRgb_c.mexa64 -------------------------------------------------------------------------------- /videos/private/ktHistcRgb_c.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktHistcRgb_c.mexmaci64 -------------------------------------------------------------------------------- /videos/private/ktHistcRgb_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/ktHistcRgb_c.mexw64 -------------------------------------------------------------------------------- /videos/private/opticalFlowHsMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/opticalFlowHsMex.mexa64 -------------------------------------------------------------------------------- /videos/private/opticalFlowHsMex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/opticalFlowHsMex.mexmaci64 -------------------------------------------------------------------------------- /videos/private/opticalFlowHsMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pdollar/toolbox/e87332637bbe8e8b92dd487c87567d9628404523/videos/private/opticalFlowHsMex.mexw64 --------------------------------------------------------------------------------