├── LICENSE ├── README.md ├── anno-TNNLS.zip ├── anno ├── airplane_H_001.txt ├── airplane_H_002.txt ├── att │ ├── airplane_H_001.txt │ ├── airplane_H_002.txt │ ├── badger_H_001.txt │ ├── bat_H_001.txt │ ├── bird_H_001.txt │ ├── bird_H_002.txt │ ├── bird_H_003.txt │ ├── boat_D_001.txt │ ├── boat_H_001.txt │ ├── boy_S_001.txt │ ├── boy_S_002.txt │ ├── bus_S_004.txt │ ├── bus_V_001.txt │ ├── bus_V_002.txt │ ├── bus_V_003.txt │ ├── bus_V_004.txt │ ├── bus_V_005.txt │ ├── car_D_002.txt │ ├── car_D_004.txt │ ├── car_D_005.txt │ ├── car_D_007.txt │ ├── car_D_009.txt │ ├── car_S_001.txt │ ├── car_S_002.txt │ ├── car_S_003.txt │ ├── car_V_001.txt │ ├── car_V_003.txt │ ├── car_V_004.txt │ ├── car_V_006.txt │ ├── car_V_007.txt │ ├── car_V_008.txt │ ├── car_V_009.txt │ ├── car_V_010.txt │ ├── car_V_011.txt │ ├── car_V_013.txt │ ├── car_V_014.txt │ ├── cat_D_001.txt │ ├── cat_H_001.txt │ ├── cat_H_002.txt │ ├── couple_S_001.txt │ ├── cow_H_001.txt │ ├── coyote_S_001.txt │ ├── crowd_S_001.txt │ ├── crowd_S_002.txt │ ├── deer_H_001.txt │ ├── dog_D_001.txt │ ├── dog_D_002.txt │ ├── dog_H_001.txt │ ├── drone_D_001.txt │ ├── face_H_001.txt │ ├── face_S_001.txt │ ├── fox_H_001.txt │ ├── head_H_001.txt │ ├── head_S_001.txt │ ├── helicopter_H_001.txt │ ├── helicopter_H_002.txt │ ├── helicopter_S_001.txt │ ├── hog_D_001.txt │ ├── hog_H_001.txt │ ├── hog_H_002.txt │ ├── hog_H_003.txt │ ├── hog_H_004.txt │ ├── hog_S_001.txt │ ├── leopard_H_001.txt │ ├── motobiker_D_001.txt │ ├── motobiker_V_001.txt │ ├── person_D_003.txt │ ├── person_D_004.txt │ ├── person_D_006.txt │ ├── person_D_009.txt │ ├── person_D_011.txt │ ├── person_D_014.txt │ ├── person_D_015.txt │ ├── person_D_016.txt │ ├── person_D_019.txt │ ├── person_D_020.txt │ ├── person_D_021.txt │ ├── person_D_022.txt │ ├── person_D_023.txt │ ├── person_H_001.txt │ ├── person_H_002.txt │ ├── person_H_003.txt │ ├── person_H_004.txt │ ├── person_H_006.txt │ ├── person_H_008.txt │ ├── person_H_009.txt │ ├── person_H_011.txt │ ├── person_H_012.txt │ ├── person_H_013.txt │ ├── person_H_014.txt │ ├── person_S_001.txt │ ├── person_S_002.txt │ ├── person_S_003.txt │ ├── person_S_004.txt │ ├── person_S_005.txt │ ├── person_S_006.txt │ ├── person_S_007.txt │ ├── person_S_008.txt │ ├── person_S_009.txt │ ├── person_S_010.txt │ ├── person_S_011.txt │ ├── person_S_012.txt │ ├── person_S_013.txt │ ├── person_S_014.txt │ ├── person_S_015.txt │ ├── person_S_016.txt │ ├── person_S_017.txt │ ├── person_S_018.txt │ ├── person_S_019.txt │ ├── person_V_002.txt │ ├── person_V_007.txt │ ├── person_V_008.txt │ ├── pickup_S_001.txt │ ├── street_S_001.txt │ ├── street_S_002.txt │ ├── street_S_003.txt │ ├── street_S_004.txt │ ├── street_S_005.txt │ ├── truck_S_001.txt │ └── woman_H_001.txt ├── badger_H_001.txt ├── bat_H_001.txt ├── bird_H_001.txt ├── bird_H_002.txt ├── bird_H_003.txt ├── boat_D_001.txt ├── boat_H_001.txt ├── boy_S_001.txt ├── boy_S_002.txt ├── bus_S_004.txt ├── bus_V_001.txt ├── bus_V_002.txt ├── bus_V_003.txt ├── bus_V_004.txt ├── bus_V_005.txt ├── car_D_002.txt ├── car_D_004.txt ├── car_D_005.txt ├── car_D_007.txt ├── car_D_009.txt ├── car_S_001.txt ├── car_S_002.txt ├── car_S_003.txt ├── car_V_001.txt ├── car_V_003.txt ├── car_V_004.txt ├── car_V_006.txt ├── car_V_007.txt ├── car_V_008.txt ├── car_V_009.txt ├── car_V_010.txt ├── car_V_011.txt ├── car_V_013.txt ├── car_V_014.txt ├── cat_D_001.txt ├── cat_H_001.txt ├── cat_H_002.txt ├── couple_S_001.txt ├── cow_H_001.txt ├── coyote_S_001.txt ├── crowd_S_001.txt ├── crowd_S_002.txt ├── deer_H_001.txt ├── dog_D_001.txt ├── dog_D_002.txt ├── dog_H_001.txt ├── drone_D_001.txt ├── face_H_001.txt ├── face_S_001.txt ├── fox_H_001.txt ├── head_H_001.txt ├── head_S_001.txt ├── helicopter_H_001.txt ├── helicopter_H_002.txt ├── helicopter_S_001.txt ├── hog_D_001.txt ├── hog_H_001.txt ├── hog_H_002.txt ├── hog_H_003.txt ├── hog_H_004.txt ├── hog_S_001.txt ├── leopard_H_001.txt ├── motobiker_D_001.txt ├── motobiker_V_001.txt ├── person_D_003.txt ├── person_D_004.txt ├── person_D_006.txt ├── person_D_009.txt ├── person_D_011.txt ├── person_D_014.txt ├── person_D_015.txt ├── person_D_016.txt ├── person_D_019.txt ├── person_D_020.txt ├── person_D_021.txt ├── person_D_022.txt ├── person_D_023.txt ├── person_H_001.txt ├── person_H_002.txt ├── person_H_003.txt ├── person_H_004.txt ├── person_H_006.txt ├── person_H_008.txt ├── person_H_009.txt ├── person_H_011.txt ├── person_H_012.txt ├── person_H_013.txt ├── person_H_014.txt ├── person_S_001.txt ├── person_S_002.txt ├── person_S_003.txt ├── person_S_004.txt ├── person_S_005.txt ├── person_S_006.txt ├── person_S_007.txt ├── person_S_008.txt ├── person_S_009.txt ├── person_S_010.txt ├── person_S_011.txt ├── person_S_012.txt ├── person_S_013.txt ├── person_S_014.txt ├── person_S_015.txt ├── person_S_016.txt ├── person_S_017.txt ├── person_S_018.txt ├── person_S_019.txt ├── person_V_002.txt ├── person_V_007.txt ├── person_V_008.txt ├── pickup_S_001.txt ├── street_S_001.txt ├── street_S_002.txt ├── street_S_003.txt ├── street_S_004.txt ├── street_S_005.txt ├── truck_S_001.txt └── woman_H_001.txt ├── configSeqs.m ├── configSeqs_100.m ├── configTrackers.m ├── drawResultBB.m ├── example.png ├── figs └── results_OPE_all │ ├── quality_plot_error_OPE_threshold.pdf │ ├── quality_plot_norm_error_OPE_norm_threshold.pdf │ ├── quality_plot_overlap_OPE_AUC.pdf │ └── results.png ├── genPerfMat.m ├── main_running_one.m ├── main_running_repeat.m ├── perfMat └── Overall │ ├── aveSuccessRatePlot_37alg_error_OPE.mat │ ├── aveSuccessRatePlot_37alg_norm_error_OPE.mat │ ├── aveSuccessRatePlot_37alg_overlap_OPE.mat │ └── overlap50andcentererror20_37.mat ├── results └── readme.md ├── run_evaluation.m ├── run_speed.m ├── sequences └── readme.md ├── trackers └── readme.md ├── utils ├── aff2image.m ├── calcCenter_L1.m ├── calcPlotErr.m ├── calcRectCenter.m ├── calcRectInt.m ├── calcSeqErr.m ├── calcSeqErrRobust.m ├── calcSeqErrRobust_norm.m ├── checkResult.m ├── corner2rect.m ├── drawAffine.m ├── drawbox.m ├── getLKcorner.m ├── getORIAcorner.m ├── parameters_to_projective_matrix.m ├── plotDrawSave.m ├── plotSetting.m ├── shiftInitBB.m └── splitSeqTRE.m └── vlfeat-0.9.19 ├── .gitattributes ├── .gitignore ├── COPYING ├── Makefile ├── Makefile.mak ├── README.md ├── apps ├── phow_caltech101.m ├── recognition │ ├── encodeImage.m │ ├── experiments.m │ ├── extendDescriptorsWithGeometry.m │ ├── getDenseSIFT.m │ ├── readImage.m │ ├── setupCaltech256.m │ ├── setupFMD.m │ ├── setupGeneric.m │ ├── setupScene67.m │ ├── setupVoc.m │ ├── trainEncoder.m │ └── traintest.m └── sift_mosaic.m ├── data ├── box.pgm ├── box.sift ├── river1.jpg ├── river2.jpg ├── roofs1.jpg ├── roofs2.jpg └── spots.jpg ├── docsrc ├── about.html ├── api.html ├── apps.html ├── compiling.html ├── doc.html ├── download.html ├── doxygen.conf ├── doxygen.css ├── doxytag.py ├── dtd │ └── xhtml1 │ │ ├── xhtml-lat1.ent │ │ ├── xhtml-special.ent │ │ ├── xhtml-symbol.ent │ │ ├── xhtml.soc │ │ ├── xhtml1-frameset.dtd │ │ ├── xhtml1-strict.dtd │ │ ├── xhtml1-transitional.dtd │ │ └── xhtml1.dcl ├── figures │ ├── cell-bins.fig │ ├── covdet-normalization.svg │ ├── covdet.svg │ ├── dhog-bins.fig │ ├── dsift-geom.svg │ ├── frame-canonical.svg │ ├── frame-types.svg │ ├── frames.svg │ ├── lbp.svg │ ├── liop.svg │ ├── mser-er-step.svg │ ├── mser-er.svg │ ├── mser-tree.svg │ ├── scalespace-basic.svg │ ├── scalespace.svg │ ├── sift-angle.fig │ ├── sift-bins.fig │ ├── sift-can.fig │ ├── sift-conv-vlfeat.fig │ ├── sift-conv.fig │ ├── sift-descr-easy.fig │ ├── sift-frame.fig │ ├── sift-image-frame.fig │ ├── sift-orient.fig │ └── sift-ss.svg ├── formatter.py ├── images │ ├── PASCAL2.png │ ├── caltech-collage.jpg │ ├── down.png │ ├── fulkerson.jpg │ ├── git.png │ ├── help.png │ ├── lenc.jpg │ ├── liop-neighbours-sampling.png │ ├── liop-patch-layout.png │ ├── perdoch.jpg │ ├── perrone.jpg │ ├── placeholder.jpg │ ├── sarbortova.jpg │ ├── sift-mosaic.jpg │ ├── sulc.jpg │ ├── using-vs-additional-deps.png │ ├── using-vs-additional-include.png │ ├── using-vs-additional-libdir.png │ ├── using-vs-all-configurations.png │ ├── using-vs-empty-project.png │ ├── using-vs-new-project.png │ ├── using-vs-nodll.png │ ├── using-vs-ok.png │ ├── using-vs-post-step.png │ ├── using-vs-project-properties.png │ ├── using-xcode-copy-2.png │ ├── using-xcode-copy.png │ ├── using-xcode-dylib.png │ ├── using-xcode-edit.png │ ├── using-xcode-err.png │ ├── using-xcode-info.png │ ├── using-xcode-new.png │ ├── using-xcode-ok.png │ ├── vedaldi.jpg │ ├── vl_blue.ico │ ├── vl_blue.png │ ├── vl_blue.pxm │ ├── vl_blue_large.pxm │ └── yandex.png ├── index.html ├── install-c.html ├── install-matlab.html ├── install-octave.html ├── install-shell.html ├── license.html ├── mdoc.py ├── notfound.html ├── pygmentize.css ├── roadmap.html ├── tutorials.html ├── tutorials │ ├── aib.html │ ├── covdet.html │ ├── dsift.html │ ├── encode.html │ ├── frame.html │ ├── gmm.html │ ├── hikm.html │ ├── hog.html │ ├── ikm.html │ ├── imdisttf.html │ ├── kdtree.html │ ├── kmeans.html │ ├── liop.html │ ├── mser.html │ ├── plots-rank.html │ ├── quickshift.html │ ├── sift.html │ ├── slic.html │ ├── svm.html │ └── utils.html ├── using-gcc.html ├── using-vsexpress.html ├── using-xcode.html ├── vlfeat-website-main-content.xml ├── vlfeat-website-preproc.xml ├── vlfeat-website-template.xml ├── vlfeat-website.xml ├── vlfeat.bib ├── vlfeat.css ├── webdoc.py └── wikidoc.py ├── draw_performance.m ├── make ├── bin.mak ├── dist.mak ├── dll.mak ├── doc.mak ├── matlab.mak ├── nmake_helper.mak ├── octave.mak └── update-mak.sh ├── src ├── aib.c ├── check.h ├── generic-driver.h ├── mser.1 ├── mser.c ├── sift.1 ├── sift.c ├── test_gauss_elimination.c ├── test_getopt_long.c ├── test_gmm.c ├── test_heap-def.c ├── test_host.c ├── test_imopv.c ├── test_kmeans.c ├── test_liop.c ├── test_mathop.c ├── test_mathop_abs.c ├── test_mathop_fast_resqrt.tc ├── test_mathop_fast_sqrt_ui.tc ├── test_nan.c ├── test_qsort-def.c ├── test_rand.c ├── test_sqrti.c ├── test_stringop.c ├── test_svd2.c ├── test_threads.c ├── test_vec_comp.c └── vlfeat.7 ├── toolbox ├── aib │ ├── vl_aib.c │ ├── vl_aib.m │ ├── vl_aibcut.m │ ├── vl_aibcuthist.m │ ├── vl_aibcutpush.m │ ├── vl_aibhist.c │ └── vl_aibhist.m ├── demo │ ├── vl_demo_aib.m │ ├── vl_demo_alldist.m │ ├── vl_demo_cmd.m │ ├── vl_demo_covdet.m │ ├── vl_demo_dsift.m │ ├── vl_demo_frame.m │ ├── vl_demo_gmm_2d_rand.m │ ├── vl_demo_gmm_2d_twist.m │ ├── vl_demo_gmm_3d.m │ ├── vl_demo_gmm_convergence.m │ ├── vl_demo_hog.m │ ├── vl_demo_ikmeans.m │ ├── vl_demo_imdisttf.m │ ├── vl_demo_kdtree.m │ ├── vl_demo_kdtree_ann.m │ ├── vl_demo_kdtree_forest.m │ ├── vl_demo_kdtree_plot.m │ ├── vl_demo_kdtree_self.m │ ├── vl_demo_kdtree_sift.m │ ├── vl_demo_kmeans_2d.m │ ├── vl_demo_kmeans_ann_speed.m │ ├── vl_demo_kmeans_init.m │ ├── vl_demo_kmeans_vs_builtin.m │ ├── vl_demo_mser_basic.m │ ├── vl_demo_mser_cmd.m │ ├── vl_demo_mser_delta.m │ ├── vl_demo_plots_rank.m │ ├── vl_demo_print.m │ ├── vl_demo_quickshift.m │ ├── vl_demo_sift_basic.m │ ├── vl_demo_sift_cmd.m │ ├── vl_demo_sift_edge.m │ ├── vl_demo_sift_match.m │ ├── vl_demo_sift_or.m │ ├── vl_demo_sift_peak.m │ ├── vl_demo_sift_vs_ubc.m │ ├── vl_demo_slic.m │ ├── vl_demo_svm.m │ └── vl_demo_svm_data.mat ├── fisher │ ├── vl_fisher.c │ └── vl_fisher.m ├── geometry │ ├── vl_hat.m │ ├── vl_ihat.m │ ├── vl_irodr.c │ ├── vl_irodr.m │ ├── vl_rodr.c │ └── vl_rodr.m ├── gmm │ ├── vl_gmm.c │ └── vl_gmm.m ├── imop │ ├── vl_dwaffine.m │ ├── vl_imarray.m │ ├── vl_imarraysc.m │ ├── vl_imdisttf.c │ ├── vl_imdisttf.m │ ├── vl_imdown.m │ ├── vl_imgrad.m │ ├── vl_imintegral.c │ ├── vl_imintegral.m │ ├── vl_impattern.m │ ├── vl_imreadbw.m │ ├── vl_imreadgray.m │ ├── vl_imsc.m │ ├── vl_imsmooth.c │ ├── vl_imsmooth.m │ ├── vl_imup.m │ ├── vl_imwbackward.m │ ├── vl_imwbackwardmx.c │ ├── vl_imwhiten.m │ ├── vl_rgb2xyz.m │ ├── vl_tps.m │ ├── vl_tpsu.m │ ├── vl_tpsumx.c │ ├── vl_waffine.m │ ├── vl_witps.m │ ├── vl_wtps.m │ ├── vl_xyz2lab.m │ ├── vl_xyz2luv.m │ └── vl_xyz2rgb.m ├── info.xml ├── kmeans │ ├── vl_hikmeans.c │ ├── vl_hikmeans.m │ ├── vl_hikmeanshist.m │ ├── vl_hikmeanspush.c │ ├── vl_hikmeanspush.m │ ├── vl_ikmeans.c │ ├── vl_ikmeans.m │ ├── vl_ikmeanshist.m │ ├── vl_ikmeanspush.c │ ├── vl_ikmeanspush.m │ ├── vl_kmeans.c │ └── vl_kmeans.m ├── mexutils.h ├── misc │ ├── inthist.tc │ ├── kdtree.h │ ├── samplinthist.tc │ ├── svms_common.h │ ├── vl_alldist.c │ ├── vl_alldist2.c │ ├── vl_alldist2.m │ ├── vl_alphanum.m │ ├── vl_argparse.m │ ├── vl_binsearch.c │ ├── vl_binsearch.m │ ├── vl_binsum.c │ ├── vl_binsum.def │ ├── vl_binsum.m │ ├── vl_colsubset.m │ ├── vl_cummax.c │ ├── vl_cummax.def │ ├── vl_cummax.m │ ├── vl_getpid.c │ ├── vl_getpid.m │ ├── vl_grad.m │ ├── vl_histmarg.m │ ├── vl_hog.c │ ├── vl_hog.m │ ├── vl_homkermap.c │ ├── vl_homkermap.m │ ├── vl_ihashfind.c │ ├── vl_ihashfind.m │ ├── vl_ihashsum.c │ ├── vl_ihashsum.m │ ├── vl_inthist.c │ ├── vl_inthist.m │ ├── vl_isoctave.m │ ├── vl_kdtreebuild.c │ ├── vl_kdtreebuild.m │ ├── vl_kdtreequery.c │ ├── vl_kdtreequery.m │ ├── vl_lbp.c │ ├── vl_lbp.m │ ├── vl_lbpfliplr.m │ ├── vl_localmax.c │ ├── vl_localmax.m │ ├── vl_matlabversion.m │ ├── vl_numder.m │ ├── vl_numder2.m │ ├── vl_override.m │ ├── vl_pegasos.m │ ├── vl_sampleinthist.c │ ├── vl_sampleinthist.m │ ├── vl_simdctrl.c │ ├── vl_simdctrl.m │ ├── vl_svmdataset.m │ ├── vl_svmpegasos.m │ ├── vl_svmtrain.c │ ├── vl_svmtrain.m │ ├── vl_threads.c │ ├── vl_threads.m │ ├── vl_twister.c │ ├── vl_twister.m │ ├── vl_version.c │ ├── vl_version.m │ ├── vl_whistc.m │ └── vl_xmkdir.m ├── mser │ ├── vl_erfill.c │ ├── vl_erfill.m │ ├── vl_ertr.m │ ├── vl_mser.c │ └── vl_mser.m ├── plotop │ ├── vl_cf.m │ ├── vl_click.m │ ├── vl_clickpoint.m │ ├── vl_clicksegment.m │ ├── vl_det.m │ ├── vl_figaspect.m │ ├── vl_linespec2prop.m │ ├── vl_plotbox.m │ ├── vl_plotframe.m │ ├── vl_plotgrid.m │ ├── vl_plotpoint.m │ ├── vl_plotstyle.m │ ├── vl_pr.m │ ├── vl_printsize.m │ ├── vl_roc.m │ ├── vl_tightsubplot.m │ └── vl_tpfp.m ├── quickshift │ ├── vl_flatmap.m │ ├── vl_imseg.m │ ├── vl_quickseg.m │ ├── vl_quickshift.c │ ├── vl_quickshift.m │ └── vl_quickvis.m ├── sift │ ├── vl_covdet.c │ ├── vl_covdet.m │ ├── vl_dsift.c │ ├── vl_dsift.m │ ├── vl_frame2oell.m │ ├── vl_liop.c │ ├── vl_liop.m │ ├── vl_phow.m │ ├── vl_plotsiftdescriptor.m │ ├── vl_plotss.m │ ├── vl_sift.c │ ├── vl_sift.m │ ├── vl_siftdescriptor.c │ ├── vl_siftdescriptor.m │ ├── vl_ubcmatch.c │ ├── vl_ubcmatch.m │ └── vl_ubcread.m ├── slic │ ├── vl_slic.c │ └── vl_slic.m ├── special │ ├── vl_ddgaussian.m │ ├── vl_dgaussian.m │ ├── vl_dsigmoid.m │ ├── vl_gaussian.m │ ├── vl_rcos.m │ └── vl_sigmoid.m ├── vl_compile.m ├── vl_demo.m ├── vl_harris.m ├── vl_help.m ├── vl_noprefix.m ├── vl_root.m ├── vl_setup.m ├── vlad │ ├── vl_vlad.c │ └── vl_vlad.m └── xtest │ ├── vl_assert_almost_equal.m │ ├── vl_assert_equal.m │ ├── vl_assert_exception.m │ ├── vl_test.m │ ├── vl_test_aib.m │ ├── vl_test_alldist.m │ ├── vl_test_alldist2.m │ ├── vl_test_alphanum.m │ ├── vl_test_argparse.m │ ├── vl_test_binsearch.m │ ├── vl_test_binsum.m │ ├── vl_test_colsubset.m │ ├── vl_test_cummax.m │ ├── vl_test_dsift.m │ ├── vl_test_fisher.m │ ├── vl_test_gmm.m │ ├── vl_test_grad.m │ ├── vl_test_hikmeans.m │ ├── vl_test_hog.m │ ├── vl_test_homkermap.m │ ├── vl_test_ihashsum.m │ ├── vl_test_ikmeans.m │ ├── vl_test_imarray.m │ ├── vl_test_imdisttf.m │ ├── vl_test_imintegral.m │ ├── vl_test_imsmooth.m │ ├── vl_test_imwbackward.m │ ├── vl_test_init.m │ ├── vl_test_inthist.m │ ├── vl_test_kdtree.m │ ├── vl_test_kmeans.m │ ├── vl_test_lbp.m │ ├── vl_test_liop.m │ ├── vl_test_mser.m │ ├── vl_test_phow.m │ ├── vl_test_plotbox.m │ ├── vl_test_pr.m │ ├── vl_test_printsize.m │ ├── vl_test_roc.m │ ├── vl_test_sift.m │ ├── vl_test_slic.m │ ├── vl_test_svmtrain.m │ ├── vl_test_twister.m │ ├── vl_test_vlad.m │ └── vl_test_whistc.m ├── vl ├── aib.c ├── aib.h ├── array.c ├── array.h ├── covdet.c ├── covdet.h ├── dsift.c ├── dsift.h ├── fisher.c ├── fisher.h ├── float.th ├── generic.c ├── generic.h ├── getopt_long.c ├── getopt_long.h ├── gmm.c ├── gmm.h ├── heap-def.h ├── hikmeans.c ├── hikmeans.h ├── hog.c ├── hog.h ├── homkermap.c ├── homkermap.h ├── host.c ├── host.h ├── ikmeans.c ├── ikmeans.h ├── ikmeans_elkan.tc ├── ikmeans_init.tc ├── ikmeans_lloyd.tc ├── imopv.c ├── imopv.h ├── imopv_sse2.c ├── imopv_sse2.h ├── kdtree.c ├── kdtree.h ├── kmeans.c ├── kmeans.h ├── lbp.c ├── lbp.h ├── liop.c ├── liop.h ├── mathop.c ├── mathop.h ├── mathop_avx.c ├── mathop_avx.h ├── mathop_sse2.c ├── mathop_sse2.h ├── mser.c ├── mser.h ├── pgm.c ├── pgm.h ├── qsort-def.h ├── quickshift.c ├── quickshift.h ├── random.c ├── random.h ├── rodrigues.c ├── rodrigues.h ├── scalespace.c ├── scalespace.h ├── shuffle-def.h ├── sift.c ├── sift.h ├── slic.c ├── slic.h ├── stringop.c ├── stringop.h ├── svm.c ├── svm.h ├── svmdataset.c ├── svmdataset.h ├── vlad.c └── vlad.h ├── vlfeat.sln ├── vlfeat.vcproj └── vlfeat.xcodeproj ├── project.pbxproj └── xcshareddata └── xcschemes ├── make doc-api.xcscheme ├── make info.xcscheme └── make.xcscheme /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Qiao Liu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /anno-TNNLS.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/anno-TNNLS.zip -------------------------------------------------------------------------------- /anno/att/airplane_H_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/airplane_H_002.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,1,0,0,1,0,0,1,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/badger_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,1,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/bat_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,1,1,1,1,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/bird_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,0,0,0,1,0,0,1,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/bird_H_002.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,1,0,1,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/bird_H_003.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,0,1,0,1,0,0,1,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/boat_D_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,0,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/boat_H_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,1,1,0,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/boy_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/boy_S_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,1,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/bus_S_004.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,1,0,1,0,0,0,0,1,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/bus_V_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/bus_V_002.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,1,0,0,1,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/bus_V_003.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,0,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/bus_V_004.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/bus_V_005.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,1,0,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_D_002.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/car_D_004.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,1,1,0,0,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/car_D_005.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,1,0,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/car_D_007.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/car_D_009.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,0,0,0,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/car_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,0,1,0,0,0,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/car_S_002.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,1,0,0,1,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/car_S_003.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/car_V_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_003.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,1,1,0,1,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_004.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_006.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,1,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_007.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,0,1,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_008.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_009.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,1,0,0,0,0,1,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_010.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,0,0,0,0,0,1,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_011.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_013.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,1,1,1,0,0,0,0,1,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/car_V_014.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,1,0,1,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/cat_D_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,0,0,1,0,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/cat_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,1,0,1,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/cat_H_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/couple_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,1,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/cow_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/coyote_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,0,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/crowd_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,1,0,1,1,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/crowd_S_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/deer_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,1,0,1,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/dog_D_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/dog_D_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,0,0,1,1,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/dog_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,1,0,0,0,0,1,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/drone_D_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,1,1,1,1,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/face_H_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/face_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,0,1,0,1,1,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/fox_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,0,1,1,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/head_H_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,0,1,0,1,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/head_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/helicopter_H_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/helicopter_H_002.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/helicopter_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,1,0,1,0,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/hog_D_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,0,0,0,0,0,1,0,1,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/hog_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,1,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/hog_H_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/hog_H_003.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,1,0,0,0,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/hog_H_004.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,0,1,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/hog_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/leopard_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,0,0,1,0,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/motobiker_D_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/motobiker_V_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,1,0,1,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_003.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,1,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_004.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,1,1,1,0,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_006.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,0,1,0,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_009.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_011.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_014.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_015.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_016.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_019.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,0,0,0,1,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_020.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_021.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_022.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,0,0,0,0,1,0,0,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_D_023.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,0,0,0,0,0,0,1,0,1,0,0 -------------------------------------------------------------------------------- /anno/att/person_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,1,0,1,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_003.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_004.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,0,1,0,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_006.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_008.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_009.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_011.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,1,1,1,0,0,0,0,1,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_012.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,1,0,0,1,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_013.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_H_014.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1 -------------------------------------------------------------------------------- /anno/att/person_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,1,0,1,0,0,0,0,1,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_003.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_004.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,1,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_005.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,1,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_006.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_007.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,1,1,0,0,0,1,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_008.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_009.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_010.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_011.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_012.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_013.txt: -------------------------------------------------------------------------------- 1 | 1,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_014.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_015.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_016.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_017.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,1,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_018.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_S_019.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,0,0,0,1,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/person_V_002.txt: -------------------------------------------------------------------------------- 1 | 0,0,1,0,0,1,1,1,0,0,1,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/person_V_007.txt: -------------------------------------------------------------------------------- 1 | 1,0,1,1,0,1,1,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/person_V_008.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0 -------------------------------------------------------------------------------- /anno/att/pickup_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/street_S_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,1,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/street_S_002.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/street_S_003.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/street_S_004.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/street_S_005.txt: -------------------------------------------------------------------------------- 1 | 1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/truck_S_001.txt: -------------------------------------------------------------------------------- 1 | 0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,0 -------------------------------------------------------------------------------- /anno/att/woman_H_001.txt: -------------------------------------------------------------------------------- 1 | 1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1 -------------------------------------------------------------------------------- /example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/example.png -------------------------------------------------------------------------------- /figs/results_OPE_all/quality_plot_error_OPE_threshold.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/figs/results_OPE_all/quality_plot_error_OPE_threshold.pdf -------------------------------------------------------------------------------- /figs/results_OPE_all/quality_plot_norm_error_OPE_norm_threshold.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/figs/results_OPE_all/quality_plot_norm_error_OPE_norm_threshold.pdf -------------------------------------------------------------------------------- /figs/results_OPE_all/quality_plot_overlap_OPE_AUC.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/figs/results_OPE_all/quality_plot_overlap_OPE_AUC.pdf -------------------------------------------------------------------------------- /figs/results_OPE_all/results.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/figs/results_OPE_all/results.png -------------------------------------------------------------------------------- /perfMat/Overall/aveSuccessRatePlot_37alg_error_OPE.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/perfMat/Overall/aveSuccessRatePlot_37alg_error_OPE.mat -------------------------------------------------------------------------------- /perfMat/Overall/aveSuccessRatePlot_37alg_norm_error_OPE.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/perfMat/Overall/aveSuccessRatePlot_37alg_norm_error_OPE.mat -------------------------------------------------------------------------------- /perfMat/Overall/aveSuccessRatePlot_37alg_overlap_OPE.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/perfMat/Overall/aveSuccessRatePlot_37alg_overlap_OPE.mat -------------------------------------------------------------------------------- /perfMat/Overall/overlap50andcentererror20_37.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/perfMat/Overall/overlap50andcentererror20_37.mat -------------------------------------------------------------------------------- /results/readme.md: -------------------------------------------------------------------------------- 1 | download the evalution raw results and put it into here. -------------------------------------------------------------------------------- /run_speed.m: -------------------------------------------------------------------------------- 1 | clear 2 | close all; 3 | clc 4 | warning off all; 5 | addpath('./utils'); 6 | addpath(genpath('./vlfeat-0.9.19')); 7 | 8 | seqs=configSeqs; 9 | trackers=configTrackers; 10 | numSeq=length(seqs); 11 | numTrk=length(trackers); 12 | evalType='OPE'; %'OPE' 13 | finalPath = ['./results/results_' evalType '_all/']; 14 | 15 | 16 | for idxTrk=1:numTrk 17 | fps=zeros(numSeq,1); 18 | t = trackers{idxTrk}; 19 | for idxSeq=1:length(seqs) 20 | s = seqs{idxSeq}; 21 | % validate the results 22 | if exist([finalPath s.name '_' t.name '.mat']) 23 | load([finalPath s.name '_' t.name '.mat']); 24 | 25 | for i=1:length(results) 26 | fps(idxSeq)=fps(idxSeq)+ results{1,i}.fps; 27 | end 28 | fps(idxSeq)=fps(idxSeq)/length(results); 29 | end 30 | end 31 | avgfps=round(mean(fps), 1); 32 | 33 | disp([trackers{idxTrk}.name ':' num2str(avgfps) ' fps']); 34 | end -------------------------------------------------------------------------------- /sequences/readme.md: -------------------------------------------------------------------------------- 1 | Download evluation dataset and put them in this folder. -------------------------------------------------------------------------------- /trackers/readme.md: -------------------------------------------------------------------------------- 1 | put your tracker in this folder to test it on the benchmark using main_running_one.m or main_running_repeat.m -------------------------------------------------------------------------------- /utils/aff2image.m: -------------------------------------------------------------------------------- 1 | function boxes = aff2image(aff_maps, T_sz) 2 | % Get the bounding "box" of the detected object in image 3 | % aff2image(aff_maps, T_sz) 4 | % Input: 5 | % aff_maps - 6xN matrix, containing N tracking results (N frames) in affine parameters, 6 | % each COLUMN is in the form of [a11 a12 a21 a22 t1 t2]' 7 | % T_sz - template size 8 | % Output: 9 | % boxes - 8xN matrix, containing N tracking boxes, each COLUMN 10 | % contains the coordinates of the four corner points. 11 | % 12 | 13 | r = T_sz(1); 14 | c = T_sz(2); % height and width of template 15 | n = size(aff_maps,2); % number of affine results 16 | boxes = zeros(8,n); 17 | for ii=1:n 18 | aff = aff_maps(:,ii); 19 | R = [ aff(1), aff(2), aff(5);... 20 | aff(3), aff(4), aff(6)]; 21 | 22 | P = [ 1, r, 1, r; ... 23 | 1, 1, c, c; ... 24 | 1, 1, 1, 1]; 25 | 26 | Q = R*P; 27 | boxes(:,ii) = Q(:); 28 | end 29 | -------------------------------------------------------------------------------- /utils/calcCenter_L1.m: -------------------------------------------------------------------------------- 1 | function [r center] = calcCenter_L1(afnv, tsize) 2 | 3 | rect= round(aff2image(afnv', tsize)); 4 | inp = reshape(rect,2,4); 5 | 6 | topleft_r = inp(1,1); 7 | topleft_c = inp(2,1); 8 | botleft_r = inp(1,2); 9 | botleft_c = inp(2,2); 10 | topright_r = inp(1,3); 11 | topright_c = inp(2,3); 12 | botright_r = inp(1,4); 13 | botright_c = inp(2,4); 14 | 15 | center=[(topleft_c + botright_c)/2, (topleft_r+botright_r)/2]; 16 | 17 | r = [topleft_c,topleft_r,botright_c-topleft_c+1,botright_r-topleft_r+1]; 18 | -------------------------------------------------------------------------------- /utils/calcRectCenter.m: -------------------------------------------------------------------------------- 1 | function [rect center corners]=calcRectCenter(varargin) 2 | % function drawbox(width,height, param, properties) 3 | % ([width,height], param, properties) 4 | % 5 | % param, properties are optional 6 | % 7 | 8 | %% Copyright (C) Jongwoo Lim and David Ross. 9 | %% All rights reserved. 10 | 11 | 12 | %---------------------------------------------------------- 13 | % Process the input. 14 | %---------------------------------------------------------- 15 | if (length(varargin{1}) == 2) 16 | w = varargin{1}(1); 17 | h = varargin{1}(2); 18 | varargin(1) = []; 19 | else 20 | [w,h] = deal(varargin{1:2}); 21 | varargin(1:2) = []; 22 | end 23 | 24 | if (length(varargin) < 1 || any(length(varargin{1}) ~= 6)) 25 | M = [0,1,0; 0,0,1]; 26 | else 27 | p = varargin{1}; 28 | if (length(varargin) > 1 && strcmp(varargin{2},'geom')) 29 | p = affparam2mat(p); 30 | varargin(1:2) = []; 31 | else 32 | varargin(1) = []; 33 | end 34 | M = [p(1) p(3) p(4); p(2) p(5) p(6)]; 35 | end 36 | 37 | %---------------------------------------------------------- 38 | % Draw the box. 39 | %---------------------------------------------------------- 40 | 41 | corners = [ 1,-w/2,-h/2; 1,w/2,-h/2; 1,w/2,h/2; 1,-w/2,h/2; 1,-w/2,-h/2 ]'; 42 | corners = M * corners; 43 | 44 | result_corners = floor(corners(:,1:4)); 45 | x=result_corners(1,1); 46 | y=result_corners(2,1); 47 | w=result_corners(1,3)-result_corners(1,1); 48 | h=result_corners(2,3)-result_corners(2,1); 49 | rect = [x y w h]; 50 | 51 | center = mean(corners(:,1:4),2); 52 | 53 | -------------------------------------------------------------------------------- /utils/calcRectInt.m: -------------------------------------------------------------------------------- 1 | function overlap = calcRectInt(A,B) 2 | % 3 | %each row is a rectangle. 4 | % A(i,:) = [x y w h] 5 | % B(j,:) = [x y w h] 6 | % overlap(i,j) = area of intersection 7 | % normoverlap(i,j) = overlap(i,j) / (area(i)+area(j)-overlap) 8 | % 9 | % Same as built-in rectint, but faster and uses less memory (since avoids repmat). 10 | 11 | 12 | leftA = A(:,1); 13 | bottomA = A(:,2); 14 | rightA = leftA + A(:,3) - 1; 15 | topA = bottomA + A(:,4) - 1; 16 | 17 | leftB = B(:,1); 18 | bottomB = B(:,2); 19 | rightB = leftB + B(:,3) - 1; 20 | topB = bottomB + B(:,4) - 1; 21 | 22 | tmp = (max(0, min(rightA, rightB) - max(leftA, leftB)+1 )) .* (max(0, min(topA, topB) - max(bottomA, bottomB)+1 )); 23 | areaA = A(:,3) .* A(:,4); 24 | areaB = B(:,3) .* B(:,4); 25 | overlap = tmp./(areaA+areaB-tmp); 26 | % if tmp > 0 27 | % 28 | % overlap = tmp; 29 | % 30 | % areaA = A(3) .* A(4); 31 | % areaB = B(3) .* B(4); 32 | % overlap = tmp./(areaA+areaB-tmp); 33 | % else 34 | % overlap = 0; 35 | % end -------------------------------------------------------------------------------- /utils/checkResult.m: -------------------------------------------------------------------------------- 1 | function [bfail, failed_idx]=checkResult(results, subAnno) 2 | % validate the results 3 | % 4 | % Some trackers may fail on some sequences so before evaulating the results 5 | % we have to check them. 6 | 7 | bfail=0; 8 | failed_idx = 0; 9 | if isempty(results) 10 | disp(['Empty all']) 11 | bfail=1; 12 | failed_idx = -1; 13 | else 14 | for i=1:length(results) 15 | if isempty(results{i}) 16 | disp(['Empty sub ' num2str(i)]) 17 | failed_idx = i; 18 | bfail=0; 19 | else 20 | if size(results{i}.res,1) 480) 33 | scale = 480 / size(im,1) ; 34 | im = imresize(im, scale) ; 35 | im = min(max(im,0),1) ; 36 | end 37 | 38 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/apps/recognition/setupFMD.m: -------------------------------------------------------------------------------- 1 | function imdb = setupFMD(datasetDir, varargin) 2 | % SETUPSCENE67 Setup Flickr Material Dataset 3 | % This is similar to SETUPCALTECH101(), with modifications to setup 4 | % the Flickr Material Dataset accroding to the standard 5 | % evaluation protocols. 6 | % 7 | % See: SETUPCALTECH101(). 8 | 9 | % Author: Andrea Vedaldi 10 | 11 | % Copyright (C) 2013 Andrea Vedaldi 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | opts.lite = false ; 18 | opts.seed = 1 ; 19 | opts.numTrain = 50 ; 20 | opts.numTest = 50 ; 21 | opts.autoDownload = true ; 22 | opts = vl_argparse(opts, varargin) ; 23 | 24 | % Download and unpack 25 | vl_xmkdir(datasetDir) ; 26 | if exist(fullfile(datasetDir, 'image', 'wood')) 27 | % ok 28 | elseif opts.autoDownload 29 | url = 'http://people.csail.mit.edu/celiu/CVPR2010/FMD/FMD.zip' ; 30 | fprintf('Downloading FMD data to ''%s''. This will take a while.', datasetDir) ; 31 | unzip(url, datasetDir) ; 32 | else 33 | error('FMD not found in %s', datasetDir) ; 34 | end 35 | 36 | imdb = setupGeneric(fullfile(datasetDir,'image'), ... 37 | 'numTrain', opts.numTrain, 'numVal', 0, 'numTest', opts.numTest, ... 38 | 'expectedNumClasses', 10, ... 39 | 'seed', opts.seed, 'lite', opts.lite) ; 40 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/box.pgm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/box.pgm -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/river1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/river1.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/river2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/river2.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/roofs1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/roofs1.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/roofs2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/roofs2.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/data/spots.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/data/spots.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/api.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

The VLFeat reference documentation has three parts:

5 | 6 | 7 | 8 | 14 | 21 | 28 | 29 |
9 |

MATLAB functions

10 |

The reference documentation of VLFeat MATLAB commands (this 11 | is an on-line version of the documentation built in the 12 | command themsevles).

13 |
15 |

C API 16 | reference

This documentation 17 | includes descriptions of all the algorithms and hence 18 | it is useful even if you do not plan to use the C library 19 | directly.

20 |
22 |

Man pages

23 |

The documentation of the command line 24 | utilities bundled with VLFeat (this is an on-line version 25 | of the Unix man found in the src/ 26 | subdirectory.

27 |
30 | 31 |

In addition to the documentation, there are also 32 | tutorials which introduce many of the 33 | algorithms contained in the library.

34 | 35 |
36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/dtd/xhtml1/xhtml.soc: -------------------------------------------------------------------------------- 1 | OVERRIDE YES 2 | -- Oasis entity catalog for Extensible HTML 1.0 -- 3 | 4 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "xhtml1-strict.dtd" 5 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd" 6 | PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "xhtml1-frameset.dtd" 7 | 8 | -- ISO latin 1 entity set for Extensible HTML (XML 1.0 format) -- 9 | 10 | PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN" "xhtml-lat1.ent" 11 | PUBLIC "-//W3C//ENTITIES Symbols for XHTML//EN" "xhtml-symbol.ent" 12 | PUBLIC "-//W3C//ENTITIES Special for XHTML//EN" "xhtml-special.ent" 13 | 14 | SGMLDECL "xhtml1.dcl" 15 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/figures/sift-angle.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5-alpha5 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 3105.263 1341.053 4125 1350 4066 1683 4050 1725 11 | 1 1 1.00 60.00 120.00 12 | 5 1 0 1 0 7 50 -1 -1 0.000 0 0 1 0 5805.263 1341.053 6825 1350 6766 1683 6750 1725 13 | 1 1 1.00 60.00 120.00 14 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 15 | 1 1 1.00 60.00 120.00 16 | 3150 1350 3150 2475 17 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 18 | 1 1 1.00 60.00 120.00 19 | 3150 1350 4350 1875 20 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 21 | 1 1 1.00 60.00 120.00 22 | 3150 1350 4350 1350 23 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 24 | 1 1 1.00 60.00 120.00 25 | 5850 1350 7050 1350 26 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 27 | 1 1 1.00 60.00 120.00 28 | 5850 1350 7050 1875 29 | 2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 30 | 1 1 1.00 60.00 120.00 31 | 5850 1350 5850 225 32 | 4 1 0 50 -1 0 12 0.0000 2 210 315 3150 2700 $y$\001 33 | 4 1 0 50 -1 0 12 0.0000 2 180 315 4350 1275 $x$\001 34 | 4 1 0 50 -1 0 12 0.0000 2 180 375 4275 1575 $th$\001 35 | 4 1 0 50 -1 0 12 0.0000 2 180 315 4200 2025 $v$\001 36 | 4 1 0 50 -1 0 12 0.0000 2 195 2205 3750 150 standar image convention\001 37 | 4 1 0 50 -1 0 12 0.0000 2 210 315 6000 375 $y$\001 38 | 4 1 0 50 -1 0 12 0.0000 2 180 315 7050 1275 $x$\001 39 | 4 1 0 50 -1 0 12 0.0000 2 180 315 6900 2025 $v$\001 40 | 4 1 0 50 -1 0 12 0.0000 2 150 1635 6525 150 Lowe's convention\001 41 | 4 1 0 50 -1 0 12 0.0000 2 180 435 7050 1575 $-th$\001 42 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/figures/sift-frame.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 5 1 0 2 0 7 50 -1 -1 0.000 0 0 1 0 2191.221 2007.241 3225 2025 3105 2491 3070 2552 11 | 2 1 4.00 60.00 60.00 12 | 6 1350 375 6225 4050 13 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 14 | 1 1 5.00 121.21 121.21 15 | 1451 476 1451 4011 16 | 2 1 0 3 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 17 | 1 1 5.00 121.21 121.21 18 | 1451 476 6199 476 19 | 2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 20 | 1451 476 5700 476 5700 3600 1451 3600 1451 476 21 | 4 0 0 50 -1 0 12 0.0000 2 210 315 1653 3910 $y$\001 22 | 4 0 0 50 -1 0 12 0.0000 2 180 315 5795 880 $x$\001 23 | -6 24 | 1 3 0 2 0 7 50 -1 -1 0.000 1 0.0000 2250 2025 382 382 2250 2025 2632 2025 25 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 26 | 2250 2025 3450 2850 27 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 28 | 2325 2025 3750 2025 29 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 30 | 2250 1350 2625 1350 31 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 32 | 2625 2025 2625 1200 33 | 2 1 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 2 34 | 2250 2025 2250 1200 35 | 3 0 0 4 0 7 50 -1 -1 0.000 0 1 0 2 36 | 2 1 4.00 60.00 45.00 37 | 2250 2025 2550 2250 38 | 0.000 0.000 39 | 4 0 0 50 -1 0 12 0.0000 2 195 465 3300 2400 angle\001 40 | 4 1 0 50 -1 0 12 0.0000 2 150 450 2475 1200 scale\001 41 | 4 1 0 50 -1 0 12 0.0000 2 195 525 3600 375 image\001 42 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/figures/sift-orient.fig: -------------------------------------------------------------------------------- 1 | #FIG 3.2 Produced by xfig version 3.2.5-alpha5 2 | Landscape 3 | Center 4 | Inches 5 | Letter 6 | 100.00 7 | Single 8 | -2 9 | 1200 2 10 | 1 3 0 1 0 7 48 -1 -1 3.000 1 0.0000 1650 2400 375 375 1650 2400 1950 2625 11 | 1 3 0 3 1 7 48 -1 -1 0.000 1 0.0000 1650 2400 212 212 1650 2400 1862 2400 12 | 2 1 0 1 0 7 48 -1 -1 3.000 0 0 -1 0 0 2 13 | 2250 2100 2700 2100 14 | 2 1 0 3 1 7 48 -1 -1 0.000 0 0 -1 0 0 2 15 | 2250 2400 2700 2400 16 | 2 1 0 2 0 7 48 -1 -1 0.000 0 0 -1 1 0 2 17 | 1 1 2.00 120.00 240.00 18 | 5100 2700 7950 2700 19 | 2 1 0 1 0 7 48 -1 -1 0.000 0 0 -1 0 0 2 20 | 5100 2700 5100 2550 21 | 2 1 0 1 0 7 48 -1 -1 3.000 0 0 -1 0 0 3 22 | 5100 2550 5250 2550 5250 2700 23 | 2 1 2 1 0 7 48 -1 -1 3.000 0 0 -1 0 0 2 24 | 5100 1950 7650 1950 25 | 2 1 2 1 0 7 48 -1 -1 3.000 0 0 -1 0 0 2 26 | 5550 1875 7650 1875 27 | 3 0 0 1 0 7 48 -1 -1 3.000 0 0 0 12 28 | 5100 2400 5325 2025 5550 1800 5925 2025 6225 2325 6375 2325 29 | 6450 2250 6600 2325 6750 2325 6975 1950 7200 1800 7650 2400 30 | 0.000 1.000 1.000 1.000 1.000 1.000 1.000 1.000 31 | 1.000 1.000 1.000 0.000 32 | 4 0 0 48 -1 0 12 0.0000 2 210 2100 2850 2475 Keypoint scale $\\sigma$\001 33 | 4 0 0 48 -1 0 12 0.0000 2 195 1155 2850 2175 Polling region\001 34 | 4 1 0 48 -1 0 12 0.0000 2 150 105 5100 3000 0\001 35 | 4 1 0 48 -1 0 12 0.0000 2 210 525 7500 3000 $2\\pi$\001 36 | 4 0 0 48 -1 0 12 0.0000 2 210 795 5250 3000 $2\\pi/36$\001 37 | 4 0 0 48 -1 0 12 0.0000 2 105 375 7800 1800 max\001 38 | 4 0 0 48 -1 0 12 0.0000 2 150 870 7800 2055 80\\% max\001 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/PASCAL2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/PASCAL2.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/caltech-collage.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/caltech-collage.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/down.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/fulkerson.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/fulkerson.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/git.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/git.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/help.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/lenc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/lenc.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/liop-neighbours-sampling.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/liop-neighbours-sampling.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/liop-patch-layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/liop-patch-layout.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/perdoch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/perdoch.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/perrone.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/perrone.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/placeholder.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/placeholder.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/sarbortova.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/sarbortova.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/sift-mosaic.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/sift-mosaic.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/sulc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/sulc.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-additional-deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-additional-deps.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-additional-include.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-additional-include.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-additional-libdir.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-additional-libdir.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-all-configurations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-all-configurations.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-empty-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-empty-project.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-new-project.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-new-project.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-nodll.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-nodll.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-ok.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-post-step.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-post-step.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-vs-project-properties.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-vs-project-properties.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-copy-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-copy-2.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-copy.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-dylib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-dylib.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-edit.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-err.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-err.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-info.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-new.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-new.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/using-xcode-ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/using-xcode-ok.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/vedaldi.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/vedaldi.jpg -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/vl_blue.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/vl_blue.ico -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/vl_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/vl_blue.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/vl_blue.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/vl_blue.pxm -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/vl_blue_large.pxm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/vl_blue_large.pxm -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/images/yandex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/docsrc/images/yandex.png -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/install-c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

These instructions explain how to use VLFeat in your C 5 | programs.

6 | 7 |

Download and unpack the latest 8 | VLFeat binary distribution in a directory of your choice 9 | (e.g. ~/src/vlfeat). The following tutorials provide 10 | step-by-step instructions for two typical use cases:

11 | 12 | 16 | 17 |

In general, let VLFEATROOT denote the path to the 18 | directory where you unpacked VLFeat. To compile and link your C 19 | program against VLFeat, include in your C source code the appropriate 20 | files from the VLFEATROOT/vl hierarchy and link against 21 | the library vl located in the appropriate 22 | subdirectory vlfeat/bin/ARCH, where ARCH 23 | depends on your architecture.

24 | 25 |

VLFeat is a C library. To use it from a C++ program, do not forget 26 | to enclose your #include statements in a extern 27 | "C" block.

28 | 29 |
30 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/license.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

VLFeat is distributed under the BSD license:

5 |
6 |
7 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/notfound.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

The page you attempted to view no longer exists, never existed, or 5 | is not currently available.

6 | 7 |

Try searching for what you need:

8 | 9 | 10 | 11 | 12 |
13 |
14 |
15 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/using-gcc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |

These instructions show how to setup a basic C++ project which uses the 5 | VLFeat library and the g++ compiler. Our project will consist 6 | of the following simple file, which we will refer to 7 | as main.cpp:

8 | 9 | 10 | extern "C" { 11 | #include <vl/generic.h> 12 | } 13 | 14 | int main (int argc, const char * argv[]) { 15 | VL_PRINT ("Hello world!") ; 16 | return 0; 17 | } 18 | 19 | 20 |

Notice that the extern "C" is required for C++ projects. 21 | Compiling the project is straightforward. From the command prompt type:

22 | 23 | 24 | $ g++ main.cpp -o vlfeat-test -IVLROOT -LVLROOT/bin/a64/ -lvl 25 | 26 | 27 |

In this example, replace VLROOT with the path to your VLFeat 28 | installation and replace a64 with your architecture 29 | (a64 for 64 bit linux, glx for 32 bit linux).

30 | 31 |
32 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/vlfeat-website-preproc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 |
29 |
30 |
31 | 32 | 33 | 34 | 35 | 36 |
37 | 38 |
39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/vlfeat-website.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 |
32 | 33 |
34 |
35 |
36 | 37 | 38 | 39 |

These man pages describe VLFeat command line utilities.

40 | 41 | 42 |
43 |
44 |
45 | 46 |
47 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/docsrc/wikidoc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys,os 4 | 5 | def usage(): 6 | print "Usage:", sys.argv[0], " " 7 | print "" 8 | print "Replaces wiki documentation with documentation from html files" 9 | 10 | def wikidoc(pagename, htmlfile): 11 | f = open(htmlfile) 12 | doclines = f.readlines() 13 | f.close() 14 | 15 | starttag = "" 16 | endtag = "" 17 | doclines.insert(0, starttag + '\n') 18 | doclines.append('\n' + endtag + '\n') 19 | 20 | wikilines = [] 21 | if os.path.exists(pagename): 22 | f = open(pagename) 23 | wikilines = f.readlines() 24 | f.close() 25 | 26 | startline = -1 27 | endline = -1 28 | for i in range(len(wikilines)): 29 | if wikilines[i].strip() == starttag and startline == -1: startline = i 30 | if wikilines[i].strip() == endtag and endline == -1: endline = i 31 | 32 | if startline == -1 or endline == -1 or startline >= endline: 33 | print "Wikidoc warning: Didn't find tags for", pagename 34 | startline = 0 35 | endline = 0 36 | 37 | wikilines = wikilines[:startline] + doclines + wikilines[endline+1:] 38 | f = open(pagename, 'w') 39 | f.writelines(wikilines) 40 | f.close() 41 | 42 | if __name__ == '__main__': 43 | if len(sys.argv) != 3: 44 | usage() 45 | sys.exit(2) 46 | 47 | print "wikidoc: using", sys.argv[1], "for page", sys.argv[2] 48 | wikidoc(sys.argv[1], sys.argv[2]) 49 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/aib.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 3 | All rights reserved. 4 | 5 | This file is part of the VLFeat library and is made available under 6 | the terms of the BSD license (see the COPYING file). 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | int main() 14 | { 15 | vl_uint32 nrows = 10; 16 | vl_uint32 ncols = 3; 17 | double Pic[3*10] = { 18 | 0.6813, 0.3028, 0.8216, 19 | 0.3795, 0.5417, 0.6449, 20 | 0.8318, 0.1509, 0.8180, 21 | 0.5028, 0.6979, 0.6602, 22 | 0.7095, 0.3784, 0.3420, 23 | 0.4289, 0.8600, 0.2897, 24 | 0.3046, 0.8537, 0.3412, 25 | 0.1897, 0.5936, 0.5341, 26 | 0.1934, 0.4966, 0.7271, 27 | 0.6822, 0.8998, 0.3093, 28 | }; 29 | 30 | vl_uint32 r,c; 31 | VlAIB * aib; 32 | vl_uint * parents; 33 | 34 | printf("Pic = ["); 35 | for(r=0; r %d\n", r, parents[r]); 52 | 53 | vl_aib_delete(aib); 54 | } 55 | /* free(Pic); */ 56 | 57 | printf("IB done\n"); 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/check.h: -------------------------------------------------------------------------------- 1 | /** @file check.h 2 | ** @brief Unit test utilties 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | #ifndef __CHECK_H__ 7 | #define __CHECK_H__ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | static void 14 | check_impl (int condition, 15 | const char * file, 16 | int line, 17 | const char * format, ...) 18 | { 19 | va_list args; 20 | va_start(args, format) ; 21 | if (! condition) { 22 | fprintf(stderr, "%s:%d: check failed: ", file, line) ; 23 | vfprintf(stderr, format, args) ; 24 | fprintf(stderr, "\n") ; 25 | exit (1) ; 26 | } 27 | va_end(args) ; 28 | } 29 | 30 | #define check(condition, ...) \ 31 | check_impl(condition, __FILE__, __LINE__, "" __VA_ARGS__) 32 | 33 | #define check_signoff() \ 34 | fprintf(stdout, "%s passed\n", __FILE__) 35 | 36 | /* __CHECK_H__ */ 37 | #endif 38 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_gauss_elimination.c: -------------------------------------------------------------------------------- 1 | /** file: test_gauss_elimination.cpp */ 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | int 9 | main(int argc VL_UNUSED, char**argv VL_UNUSED) 10 | { 11 | double A [] = { 1, 12, 3, 4 }; 12 | double b [] = { 1, -2 } ; 13 | double x [2] ; 14 | double c [2] ; 15 | int i ; 16 | 17 | vl_solve_linear_system_2 (x, A, b) ; 18 | 19 | c[0] = A[0] * x[0] + A[2] * x[1] ; 20 | c[1] = A[1] * x[0] + A[3] * x[1] ; 21 | 22 | for (i = 0 ; i < 2 ; ++i) { 23 | VL_PRINTF("[A x]_%-4d = %4g, b_%-4d = %4g\n", i+1, c[i], i+1, b[i]) ; 24 | } 25 | 26 | return 0 ; 27 | } 28 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_host.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 3 | All rights reserved. 4 | 5 | This file is part of the VLFeat library and is made available under 6 | the terms of the BSD license (see the COPYING file). 7 | */ 8 | 9 | #include 10 | 11 | int 12 | main(int argc VL_UNUSED, char ** argv VL_UNUSED) 13 | { 14 | char * string = vl_configuration_to_string_copy() ; 15 | assert (string) ; 16 | VL_PRINTF(string) ; 17 | vl_free(string) ; 18 | return 0 ; 19 | } 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_liop.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int main(){ 9 | vl_int i ; 10 | VlLiopDesc * liop ; 11 | vl_size size = 11*11 ; 12 | float mat[] = { 13 | 6,6,6,6,6,6,6,6,6,6,6, 14 | 6,6,6,5,4,4,4,5,6,6,6, 15 | 6,6,5,4,3,3,3,4,5,6,6, 16 | 6,5,4,3,2,2,2,3,4,5,6, 17 | 6,4,3,2,2,1,2,2,3,4,6, 18 | 6,4,3,2,1,1,1,2,3,4,6, 19 | 6,4,3,2,2,1,2,2,3,4,6, 20 | 6,5,4,3,2,2,2,3,4,5,6, 21 | 6,6,5,4,3,3,3,4,5,6,6, 22 | 6,6,6,5,4,4,4,5,6,6,6, 23 | 6,6,6,6,6,6,6,6,6,6,6}; 24 | float * patch = vl_malloc(sizeof(float)*size); 25 | 26 | for(i = 0; i < (signed)size; i++){ 27 | patch[i] = mat[i]; 28 | } 29 | 30 | liop = vl_liopdesc_new(4,6,2,11); 31 | 32 | vl_liopdesc_delete(liop) ; 33 | vl_free(patch) ; 34 | } 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_mathop_abs.c: -------------------------------------------------------------------------------- 1 | /* 2 | * test_mathop_abs.c 3 | * vlfeat 4 | * 5 | * Created by Andrea Vedaldi on 16/07/2009. 6 | * Copyright 2009 UCLA. All rights reserved. 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | int 16 | main(int argc VL_UNUSED, char**argv VL_UNUSED) 17 | { 18 | VlRand * rand = vl_get_rand() ; 19 | vl_size numData = 100000000 ; 20 | vl_size i ; 21 | float * X = vl_malloc(sizeof(float) * numData) ; 22 | float * Y = vl_malloc(sizeof(float) * numData) ; 23 | float * X_end = X + numData ; 24 | 25 | for (i = 0 ; i < numData ; ++ i) { 26 | X[i] = vl_rand_real1(rand) - .5 ; 27 | Y[i] = 0 ; 28 | } 29 | 30 | { 31 | float * Xi = X ; 32 | float * Yi = Y ; 33 | vl_tic() ; 34 | while (Xi < X_end) { 35 | *Yi++ = fabsf (*Xi++) ; 36 | } 37 | VL_PRINTF("fabsf: %.3f\n", vl_toc()) ; 38 | } 39 | 40 | for (i = 0 ; i < numData ; ++ i) { 41 | X[i] = vl_rand_real1(rand) - .5 ; 42 | X[i] = 0 ; 43 | } 44 | 45 | { 46 | float * Xi = X ; 47 | float * Yi = Y ; 48 | vl_tic() ; 49 | while (Xi < X_end) { 50 | *Yi++ = vl_abs_f (*Xi++) ; 51 | } 52 | VL_PRINTF("vl_abs_f: %.3f\n", vl_toc()) ; 53 | } 54 | 55 | vl_free (Y) ; 56 | vl_free (X) ; 57 | 58 | return 0 ; 59 | } 60 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_mathop_fast_resqrt.tc: -------------------------------------------------------------------------------- 1 | #define F_EPS VL_XCAT(SFX2, _EPSILON) 2 | #define F_MAX VL_XCAT(SFX2, _MAX) 3 | #define F_MIN VL_XCAT(SFX2, _MIN) 4 | 5 | { 6 | T x ; 7 | T dx ; 8 | T maxErr = 0 ; 9 | T acc ; 10 | int numEval = 0 ; 11 | double elaps ; 12 | 13 | char const* funcName = VL_XSTRINGIFY(VL_XCAT(vl_fast_resqrt_, SFX)) ; 14 | 15 | for (x = F_MIN, dx = F_EPS ; x < F_MAX ; x += dx, dx *= 1 + 1e-6 ) { 16 | T y = VL_XCAT(vl_fast_resqrt_, SFX)(x) ; 17 | T y_ = ONE / SQRT (x) ; 18 | T err = ABS (y_ - y) / y * 100 ; 19 | maxErr = VL_MAX(maxErr, err) ; 20 | } 21 | 22 | VL_PRINTF ("%20s (max relative error: %.6f%%)\n", funcName, maxErr) ; 23 | if (maxErr > 0.001) { 24 | VL_PRINTF ("error: %s: relative error is too large!\n", funcName) ; 25 | error = 1 ; 26 | } 27 | 28 | vl_tic() ; 29 | numEval = 0 ; 30 | acc = 0 ; 31 | for (x = F_MIN, dx = F_EPS ; x < F_MAX ; x += dx, dx *= 1 + 1e-6 ) { 32 | T y = VL_XCAT(vl_fast_resqrt_, SFX)(x) ; 33 | acc += y ; 34 | numEval += 1 ; 35 | } 36 | elaps = vl_toc() ; 37 | 38 | VL_PRINTF ("%20s %10.2g %10.2g\n", 39 | funcName, 40 | elaps, 41 | numEval / elaps) ; 42 | 43 | vl_tic() ; 44 | numEval = 0 ; 45 | acc = 0 ; 46 | for (x = F_MIN, dx = F_EPS ; x < F_MAX ; x += dx, dx *= 1 + 1e-6 ) { 47 | T y = ONE / SQRT (x) ; 48 | acc += y ; 49 | numEval += 1 ; 50 | } 51 | elaps = vl_toc() ; 52 | 53 | VL_PRINTF ("%20s %10.2g %10.2g\n", 54 | "baseline", 55 | elaps, 56 | numEval / elaps) ; 57 | } 58 | 59 | #undef F_MIN 60 | #undef F_MAX 61 | #undef F_EPS 62 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_mathop_fast_sqrt_ui.tc: -------------------------------------------------------------------------------- 1 | #define FL VL_XCAT(VL_FL_INT, SFX) 2 | 3 | { 4 | T x, acc, acc_ ; 5 | double elaps ; 6 | int neval ; 7 | 8 | vl_tic() ; 9 | neval = 0 ; 10 | x = 0 ; 11 | acc = 0 ; 12 | do { 13 | T y = VL_XCAT(vl_fast_sqrt_ui, SFX) (x) ; 14 | acc += y ; 15 | x += 1 << STEP ; 16 | neval += 1 ; 17 | } while (x > (1 << STEP) - 1) ; 18 | elaps = vl_toc() ; 19 | VL_PRINTF ("%20s", "vl_fast_sqrt_ui" VL_XSTRINGIFY(SFX)) ; 20 | VL_PRINTF (" %10.2f %10.2g %010" FL "x\n", elaps, (double) neval / elaps, acc) ; 21 | 22 | vl_tic() ; 23 | neval = 0 ; 24 | x = 0 ; 25 | acc_ = 0 ; 26 | do { 27 | vl_uint32 y = floor(sqrt((double) x)); 28 | acc_ += y ; 29 | x += 1 << STEP ; 30 | neval += 1 ; 31 | } while (x > (1 << STEP) - 1) ; 32 | elaps = vl_toc() ; 33 | VL_PRINTF ("%20s", "baseline") ; 34 | VL_PRINTF (" %10.2f %10.2g %010" FL "x\n", elaps, (double) neval / elaps, acc) ; 35 | 36 | 37 | if (acc != acc_) { 38 | VL_PRINTF ("error: vl_fast_sqrt_ui" VL_XSTRINGIFY(SFX) " != floor(sqrt((double) x))\n") ; 39 | error = 1 ; 40 | } 41 | } 42 | 43 | #undef FL 44 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_nan.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 3 | All rights reserved. 4 | 5 | This file is part of the VLFeat library and is made available under 6 | the terms of the BSD license (see the COPYING file). 7 | */ 8 | 9 | #include 10 | #include 11 | 12 | int 13 | main(int argc VL_UNUSED, char** argv VL_UNUSED) 14 | { 15 | VL_PRINTF ("Double NaN : `%g'\n", VL_NAN_D ) ; 16 | VL_PRINTF ("Double Inf : `%g'\n", VL_INFINITY_D) ; 17 | VL_PRINTF ("Double - Inf : `%g'\n", - VL_INFINITY_D) ; 18 | VL_PRINTF ("Single NaN : `%g'\n", VL_NAN_F ) ; 19 | VL_PRINTF ("Single Inf : `%g'\n", VL_INFINITY_F) ; 20 | VL_PRINTF ("Single - Inf : `%g'\n", - VL_INFINITY_F) ; 21 | 22 | VL_PRINTF ("Double: 0.0 < VL_INFINITY_D: %d\n", 0.0 < VL_INFINITY_D) ; 23 | VL_PRINTF ("Double: 0.0 > - VL_INFINITY_D: %d\n", 0.0 > - VL_INFINITY_D) ; 24 | 25 | return 0 ; 26 | } 27 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_qsort-def.c: -------------------------------------------------------------------------------- 1 | /** @file test_heap-def.c 2 | ** @brief Test heap-def.h 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #define VL_QSORT_prefix my_qsort 15 | #define VL_QSORT_type float 16 | #include 17 | 18 | #include 19 | 20 | int 21 | main (int argc VL_UNUSED, char ** argv VL_UNUSED) 22 | { 23 | float values [] = {.4, 12.3, 44.0, 1.2, 3.4, 5.6} ; 24 | vl_size n = sizeof(values) / sizeof(values[0]) ; 25 | vl_uindex i ; 26 | 27 | for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ; 28 | printf("\n") ; 29 | 30 | my_qsort_sort (values, n) ; 31 | 32 | for (i = 0 ; i < n ; ++i) printf("%5.2f ", values [i]) ; 33 | printf("\n") ; 34 | 35 | return 0 ; 36 | } 37 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_rand.c: -------------------------------------------------------------------------------- 1 | /** @file test_rand.c 2 | ** @author Andrea Vedaldi 3 | ** @breif Test vl/random.h 4 | **/ 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | int 12 | main (int argc VL_UNUSED, char *argv[] VL_UNUSED) 13 | { 14 | int i ; 15 | vl_uint32 init [4] = {0x123, 0x234, 0x345, 0x456} ; 16 | VlRand rand ; 17 | vl_rand_init (&rand) ; 18 | 19 | vl_rand_seed_by_array (&rand, init, sizeof(init)/sizeof(init[0])) ; 20 | 21 | printf("1000 outputs of vl_rand_uint32()\n"); 22 | for (i=0; i<1000; i++) { 23 | printf("%10" VL_FL_INT32 "u ", vl_rand_uint32(&rand)); 24 | if (i%5==4) printf("\n"); 25 | } 26 | 27 | printf("\n1000 outputs of vl_rand_real2()\n"); 28 | for (i=0; i<1000; i++) { 29 | printf("%10.8f ", vl_rand_real2(&rand)); 30 | if (i%5==4) printf("\n"); 31 | } 32 | 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/src/test_sqrti.c: -------------------------------------------------------------------------------- 1 | /** @file test_sqrti.c 2 | ** @brief Test integer square root algorithm 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2014 Andrea Vedaldi. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | int 19 | main (int argc VL_UNUSED, char** argv VL_UNUSED) 20 | { 21 | vl_index i ; 22 | for (i = 0 ; i < 0xff ; ++i) { 23 | vl_uint8 x = (vl_uint8)i ; 24 | vl_uint8 r = vl_fast_sqrt_ui8(x) ; 25 | vl_uint8 r_ = (vl_uint8) floor(sqrt((double)x)) ; 26 | if (r != r_) abort() ; 27 | /* printf("sqrt(%5d) = %5d -- %5d\n", i, r, r_) ; */ 28 | } 29 | 30 | for (i = 0 ; i < 0xffffffff ; ++i) { 31 | vl_uint16 x = (vl_uint16)i ; 32 | vl_uint16 r = vl_fast_sqrt_ui16(x) ; 33 | vl_uint16 r_ = (vl_uint8) floor(sqrt((double)x)) ; 34 | if (r != r_) abort() ; 35 | /* printf("sqrt(%5d) = %5d -- %5d\n", i, r, r_) ; */ 36 | } 37 | 38 | return 0 ; 39 | } 40 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/aib/vl_aibcutpush.m: -------------------------------------------------------------------------------- 1 | function y = vl_aibcutpush(map, x) 2 | % VL_AIBCUTPUSH Quantize based on VL_AIB cut 3 | % Y = VL_AIBCUTPUSH(MAP, X) maps the data X to elements of the AIB 4 | % cut specified by MAP. 5 | % 6 | % The function is equivalent to Y = MAP(X). 7 | % 8 | % See also: VL_HELP(), VL_AIB(). 9 | 10 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 11 | % All rights reserved. 12 | % 13 | % This file is part of the VLFeat library and is made available under 14 | % the terms of the BSD license (see the COPYING file). 15 | 16 | y = map(x) ; 17 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/aib/vl_aibhist.m: -------------------------------------------------------------------------------- 1 | % VL_AIBHIST Compute histogram over VL_AIB tree 2 | % H = VL_AIBHIST(PARENTS, DATA) computes the histogram of the data 3 | % points DATA on the VL_AIB tree defined by PARENTS. Each element of 4 | % DATA indexes one of the leaves of the VL_AIB tree. 5 | % 6 | % H = VL_AIBHIST(PARENTS, DATA, 'HIST') treats DATA as an histograms. 7 | % In this case each compoment of DATA is the number of occurences of 8 | % the VL_AIB leaves corresponding to that component. 9 | % 10 | % H has the same dimension of parents and counts how many data points 11 | % are descendent of the corresponding node of the VL_AIB tree. 12 | % 13 | % See also: VL_HELP(), VL_AIB(), VL_AIBCUTPUSH(). 14 | 15 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_cmd.m: -------------------------------------------------------------------------------- 1 | function [err,msg] = vl_demo_cmd(name, args) 2 | % DEMO_CMD: Demo: Command line utility 3 | 4 | ext = '' ; 5 | switch mexext 6 | case 'mexmac' 7 | arch = 'mac' ; 8 | case 'mexmaci' 9 | arch = 'maci' ; 10 | case 'mexmaci64' 11 | arch = 'maci64'; 12 | case 'mexglx' 13 | arch = 'glnx86' ; 14 | case 'mexa64' 15 | arch = 'glnxa64' ; 16 | case 'dll' 17 | arch = 'win32' ; 18 | ext = '.exe' ; 19 | case 'mexw32' 20 | arch = 'win32' ; 21 | ext ='.exe' ; 22 | case 'mexw64' 23 | arch = 'win64' ; 24 | ext ='.exe' ; 25 | end 26 | 27 | cmd = fullfile(vl_root,'bin',arch,[name ext]) ; 28 | str = ['"' cmd '" ' args] ; 29 | disp(str); 30 | [err,msg] = system(str) ; 31 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_gmm_2d_rand.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_GMM_2D_RAND Demonstrate clustering points with a GMM 2 | 3 | %% Create a random set of points 4 | numPoints = 5000 ; 5 | dimension = 2 ; 6 | numClusters = 20 ; 7 | data = rand(dimension, numPoints) ; 8 | 9 | %% Learn a GMM: fit the points at maximum likelihood 10 | vl_twister('state',0) ; 11 | [means, covariances, priors] = ... 12 | vl_gmm(data, numClusters, ... 13 | 'MaxNumIterations', 1000, ... 14 | 'Verbose') ; 15 | 16 | figure(1) ; clf ; hold on 17 | plot(data(1,:),data(2,:),'r.'); 18 | for i=1:numClusters 19 | vl_plotframe([means(:,i)' covariances(1,i) 0 covariances(2,i)], ... 20 | 'Color','blue','LineWidth',2); 21 | end 22 | 23 | title('GMM: Gaussian mixture initialized choosing random points') ; 24 | axis equal ; axis off ; 25 | vl_demo_print('gmm_2d_rand',0.6); 26 | 27 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_ikmeans.m: -------------------------------------------------------------------------------- 1 | function vl_demo_ikmeans() 2 | % VL_DEMO_IKMEANS 3 | 4 | numData = 10000 ; 5 | dimension = 2 ; 6 | data = uint8(255*rand(dimension,numData)) ; 7 | numClusters = 3^3 ; 8 | 9 | [centers, assignments] = vl_ikmeans(data, numClusters); 10 | 11 | figure(1) ; clf ; axis off ; 12 | plotClusters(data, centers, assignments) ; 13 | vl_demo_print('ikmeans_2d',0.6); 14 | 15 | [tree, assignments] = vl_hikmeans(data,3,numClusters) ; 16 | figure(2) ; clf ; axis off ; 17 | plotClusters(data, [], [4 2 1] * double(assignments)) ; 18 | vl_demo_print('hikmeans_2d',0.6); 19 | 20 | function plotClusters(data, centers, assignments) 21 | hold on ; 22 | cc=jet(double(max(assignments(:)))); 23 | for i=1:max(assignments(:)) 24 | plot(data(1,assignments == i),data(2,assignments == i),'.','color',cc(i,:)); 25 | end 26 | if ~isempty(centers) 27 | plot(centers(1,:),centers(2,:),'k.','MarkerSize',20) 28 | end 29 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_imdisttf.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_IMDISTTF Demonstrates image distance transform 2 | 3 | % load image 4 | im = imread(fullfile(vl_root, 'data', 'roofs1.jpg')) ; 5 | im = im(100:200,100:200,:) ; 6 | imSize = [size(im,1) size(im,2)] ; 7 | 8 | % creates an edge map 9 | edges = zeros(imSize) + inf; 10 | edges(edge(rgb2gray(im), 'canny')) = 0 ; 11 | 12 | % compute distance transform 13 | [distanceTransform, neighbors] = vl_imdisttf(single(edges)) ; 14 | 15 | % plot 16 | [u,v] = meshgrid(1:imSize(2),1:imSize(1)) ; 17 | [v_,u_] = ind2sub(imSize, neighbors) ; 18 | 19 | % avoid cluttering the plot too much 20 | u = u(1:3:end,1:3:end) ; 21 | v = v(1:3:end,1:3:end) ; 22 | u_ = u_(1:3:end,1:3:end) ; 23 | v_ = v_(1:3:end,1:3:end) ; 24 | 25 | figure(1) ; clf ; imagesc(im) ; axis off image ; 26 | figure(2) ; clf ; imagesc(edges) ; axis off image ; 27 | figure(3) ; clf ; imagesc(edges) ; axis off image ; 28 | hold on ; h = quiver(u,v,u_-u,v_-v,0) ; colormap gray ; 29 | figure(4) ; clf ; imagesc(sqrt(distanceTransform)) ; axis off image ; 30 | 31 | figure(1) ; vl_demo_print('imdisttf_src') ; 32 | figure(2) ; vl_demo_print('imdisttf_edge') ; 33 | figure(3) ; vl_demo_print('imdisttf_neigh') ; 34 | figure(4) ; vl_demo_print('imdisttf_dist') ; 35 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_kdtree_ann.m: -------------------------------------------------------------------------------- 1 | function vl_demo_kdtree_ann 2 | % VL_DEMO_KDTREE 3 | % Demonstrates the use of a kd-tree for approximate nearest neighbor 4 | % (ANN) queries. 5 | 6 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 7 | % All rights reserved. 8 | % 9 | % This file is part of the VLFeat library and is made available under 10 | % the terms of the BSD license (see the COPYING file). 11 | 12 | randn('state',0) ; 13 | rand('state',0) ; 14 | 15 | % Generate some 2D data and a query point 16 | X = rand(2, 100) ; 17 | Q = rand(2,1) ; 18 | 19 | % Buld a kd-tree 20 | kdtree = vl_kdtreebuild(X) ; 21 | 22 | % Query with increasing accuracy 23 | maxNumComparisonRange = [1 10 20 30] ; 24 | for t = [1 2 3 4] 25 | figure(t) ; clf ; 26 | vl_plotframe(X, 'ro') ; 27 | hold on ; 28 | xl = [.2, .8] ; 29 | yl = [.1, .7] ; 30 | xlim(xl) ; 31 | ylim(yl) ; 32 | 33 | % vl_demo_kdtree_plot(kdtree, 1, xl, yl) ; 34 | 35 | [i, d] = vl_kdtreequery (kdtree, X, Q, ... 36 | 'NumNeighbors', 10, ... 37 | 'MaxComparisons', maxNumComparisonRange(t), ... 38 | 'Verbose') ; 39 | 40 | vl_plotframe(Q,'b*','markersize',10) ; 41 | for k=1:length(i) 42 | if i(k) == 0, continue ; end 43 | vl_plotframe([Q ; sqrt(d(k))],'b-','linewidth',1) ; 44 | vl_plotframe(X(:, i(k)), 'bx','markersize',15) ; 45 | end 46 | title(sprintf('10 ANNs with at most %d comparisions', maxNumComparisonRange(t))) ; 47 | 48 | axis square ; 49 | set(gca,'xtick',[],'ytick',[]) ; 50 | vl_demo_print(t, sprintf('kdtree_ann_%d', t)) ; 51 | end 52 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_kdtree_plot.m: -------------------------------------------------------------------------------- 1 | function h = vl_demo_kdtree_plot(kdtree, nodeIndex, xlim, ylim) 2 | % VL_DEMO_KDTREE_PLOT 3 | 4 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 5 | % All rights reserved. 6 | % 7 | % This file is part of the VLFeat library and is made available under 8 | % the terms of the BSD license (see the COPYING file). 9 | 10 | dim = kdtree.nodes.splitDimension(nodeIndex) ; 11 | thresh = kdtree.nodes.splitThreshold(nodeIndex) ; 12 | lowerChild = kdtree.nodes.lowerChild(nodeIndex) ; 13 | upperChild = kdtree.nodes.upperChild(nodeIndex) ; 14 | 15 | if dim == 1 16 | xs = [thresh, thresh] ; 17 | ys = ylim ; 18 | ylimLower = ylim ; 19 | ylimUpper = ylim ; 20 | xlimLower = [xlim(1) thresh] ; 21 | xlimUpper = [thresh xlim(2)] ; 22 | else 23 | xs = xlim ; 24 | ys = [thresh, thresh] ; 25 | xlimLower = xlim ; 26 | xlimUpper = xlim ; 27 | ylimLower = [ylim(1) thresh] ; 28 | ylimUpper = [thresh ylim(2)] ; 29 | end 30 | h = line(xs,ys) ; 31 | 32 | if lowerChild > 1 33 | h = [h vl_demo_kdtree_plot(kdtree, lowerChild, xlimLower, ylimLower)] ; 34 | end 35 | 36 | if upperChild > 1 37 | h = [h vl_demo_kdtree_plot(kdtree, upperChild, xlimUpper, ylimUpper)] ; 38 | end 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_kdtree_self.m: -------------------------------------------------------------------------------- 1 | function vl_demo_kdtree_self 2 | % VL_DEMO_KDTREE_SELF 3 | % Demonstrates using a kd-tree to find the pairwise nearest 4 | % neighbors in a set of points. 5 | 6 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 7 | % All rights reserved. 8 | % 9 | % This file is part of the VLFeat library and is made available under 10 | % the terms of the BSD license (see the COPYING file). 11 | 12 | randn('state',0) ; 13 | rand('state',0) ; 14 | 15 | % a set of 2D pints 16 | X = single(rand(2, 100)) ; 17 | 18 | % build the kdtree 19 | kdtree = vl_kdtreebuild(X) ; 20 | 21 | % query the kdtree with X itself 22 | [i, d] = vl_kdtreequery(kdtree, X, X, 'numneighbors', 2, 'verbose') ; 23 | 24 | % plot 25 | figure(1) ; clf ; 26 | vl_plotframe(X, 'ro') ; 27 | hold on ; 28 | xl = [0, +1] ; 29 | yl = [0, +1] ; 30 | axis equal ; 31 | xlim(xl) ; 32 | ylim(yl) ; 33 | vl_demo_kdtree_plot(kdtree.trees(1), 1, xl, yl) ; 34 | line([X(1,:) ; X(1,i(2,:))], ... 35 | [X(2,:) ; X(2,i(2,:))], 'linewidth', 2) ; 36 | vl_demo_print('kdtree_self') ; 37 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_kmeans_2d.m: -------------------------------------------------------------------------------- 1 | N = 10000 ; 2 | dimension = 2 ; 3 | data = rand(dimension,N) ; 4 | numClusters = 20 ; 5 | cc=hsv(numClusters); 6 | 7 | [centers, assignments] = vl_kmeans(data, numClusters); 8 | 9 | figure 10 | hold on 11 | for i=1:numClusters 12 | plot(data(1,assignments == i),data(2,assignments == i),'.','color',cc(i,:)); 13 | end 14 | plot(centers(1,:),centers(2,:),'k.','MarkerSize',20) 15 | axis off 16 | vl_demo_print('kmeans_2d_rand',0.6); -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_kmeans_vs_builtin.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_KMEANS_VS_BUILTIN 2 | 3 | clear elaps energy ; 4 | 5 | dimension = 128 ; 6 | numData = 1000 ; 7 | numCenters = 10 ; 8 | numTrials = 10 ; 9 | 10 | for trial = 1:numTrials 11 | X = rand(dimension, numData) ; 12 | 13 | tic ; 14 | [idx, C, e] = kmeans(X', numCenters) ; 15 | e = sum(e) ; 16 | elaps.builtin(trial) = toc ; 17 | energy.builtin(trial) = e ; 18 | 19 | tic ; 20 | [idx_, C_, e] = vl_kmeans(X, numCenters, 'verbose') ; 21 | elaps.vl(trial) = toc ; 22 | energy.vl(trial) = e ; 23 | 24 | tic ; 25 | [idx_, C_, e] = vl_kmeans(X, numCenters, 'initialization', 'plusplus') ; 26 | elaps.vlpp(trial) = toc ; 27 | energy.vlpp(trial) = e ; 28 | end 29 | 30 | figure(1) ; clf ; 31 | subplot(1,2,1) ; title('Energy') ; 32 | mu = [mean(elaps.builtin) mean(elaps.vl) mean(elaps.vlpp)] ; 33 | st = [std(elaps.builtin) std(elaps.vl) std(elaps.vlpp)] ; 34 | bar(mu) ; hold on ; 35 | errorbar(mu, st, 'linestyle', 'none', 'color', 'r', 'linewidth', 4) ; 36 | 37 | subplot(1,2,2) ; 38 | mu = [mean(energy.builtin) mean(energy.vl) mean(energy.vlpp)] ; 39 | st = [std(energy.builtin) std(energy.vl) std(energy.vlpp)] ; 40 | bar(mu) ; hold on ; 41 | errorbar(mu, st, 'linestyle', 'none', 'color', 'r', 'linewidth', 4) ; 42 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_mser_cmd.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_MSER_CMD Demo: MSER: test command line utility 2 | 3 | pfx = fullfile(vl_root,'results') ; 4 | if ~ exist(pfx, 'dir') 5 | mkdir(pfx) ; 6 | end 7 | 8 | p_img = fullfile(vl_root,'data','spots.jpg') ; 9 | p_pgm = fullfile(pfx,'spots.pgm') ; 10 | p_sed = fullfile(pfx,'spots.mser') ; 11 | p_frm = fullfile(pfx,'spots.frame') ; 12 | p_tmp = fullfile(pfx,'spots.tmp') ; 13 | 14 | I = imread(p_img) ; 15 | I = uint8(rgb2gray(I)) ; 16 | imwrite(I,p_pgm,'pgm') ; 17 | 18 | % -------------------------------------------------------------------- 19 | % Test cmd 20 | % -------------------------------------------------------------------- 21 | 22 | [err,msg] = vl_demo_cmd('mser',[p_pgm ... 23 | ' --seeds=ascii://' p_sed ... 24 | ' --frames=ascii://' p_frm ... 25 | ' --max-variation=0.2 ' ... 26 | ' --min-diversity=0.7 ' ... 27 | ' --delta=10 ' ... 28 | ' --verbose '] ) ; 29 | 30 | r_ = load(p_sed,'-ASCII')'; 31 | % note: bright-on-dark region seeds are negative 32 | r_ = r_ + sign(r_); % add one for matlab indexing 33 | f_ = load(p_frm,'-ASCII')' ; f_(1:2,:) = f_(1:2,:) + 1 ; 34 | 35 | [r,f] = vl_mser(I','MinDiversity',0.7,'MaxVariation',0.2,'Delta',10) ; 36 | 37 | if(any(r ~= r_) | any(any(abs(f - f_)>1e-5))) 38 | warning('demo_mser_cmd: failed consistency test of commmand line and MATLAB drivers.') ; 39 | end 40 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_mser_delta.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_MSER_DELTA Demo: MSER: delta parameter 2 | 3 | randn('state',0) ; 4 | rand('state',0) ; 5 | 6 | I = zeros(100,500) + 255 ; 7 | for i=1:5 8 | I((1:50) + 25 - 1, ... 9 | (1:50) + 25 - 1 + 100 * (i-1)) = ... 10 | 255 - 32 * i ; 11 | end 12 | I = uint8(I) ; 13 | 14 | figure(1) ; clf ; 15 | axes('position',[0.05 0.05 1-.1 2*1/5-.1]) ; 16 | plot(I(end/2,:),'linewidth',3) ; 17 | hold on ; 18 | vl_demo_print('mser_delta_0') ; 19 | 20 | 21 | figure(2) ; clf ; 22 | imagesc(I) ; axis off ; axis equal ; axis tight ; 23 | colormap(gray(256)) ; 24 | set(gca,'fontsize',20) ; 25 | 26 | deltar = [1 32 159 160] ; 27 | clear h ; 28 | for delta=deltar 29 | [r,f] = vl_mser(I, 'Delta', delta, 'BrightOnDark', 0, 'verbose') ; 30 | 31 | if exist('h','var'), delete(h) ; end 32 | h = vl_plotframe(vl_ertr(f)) ; 33 | if ~isempty(h), set(h,'color','y','linewidth',1) ; end 34 | title(sprintf('delta = %g', delta)) ; 35 | drawnow ; 36 | 37 | vl_demo_print(sprintf('mser_delta_%d',find(delta==deltar))) ; 38 | end 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_plots_rank.m: -------------------------------------------------------------------------------- 1 | %VL_DEMO_PLOTS_RANK Demonstates VL_ROC, VL_DET, VL_PR 2 | 3 | randn('state',0) ; 4 | numPos = 20 ; 5 | numNeg = 100 ; 6 | labels = [ones(1, numPos) -ones(1,numNeg)] ; 7 | scores = randn(size(labels)) + labels ; 8 | 9 | figure(1) ; clf ; 10 | vl_roc(labels,scores) ; 11 | vl_demo_print(1,'plots_rank_roc', 0.5) ; 12 | 13 | figure(2) ; clf ; 14 | subplot(2,2,1) ; vl_roc(labels,scores, 'plot', 'tntp') ; 15 | subplot(2,2,2) ; vl_roc(labels,scores, 'plot', 'tptn') ; 16 | subplot(2,2,3) ; vl_roc(labels,scores, 'plot', 'fptp') ; 17 | subplot(2,2,4) ; vl_roc(labels,scores, 'plot', 'fpfn') ; 18 | vl_figaspect(1) ; 19 | vl_demo_print(2,'plots_rank_roc_variants', 1) ; 20 | 21 | figure(3) ; clf ; 22 | vl_det(labels,scores) ; 23 | vl_demo_print(3,'plots_rank_det', 0.5) ; 24 | 25 | figure(4) ; clf ; 26 | vl_pr(labels,scores) ; 27 | vl_demo_print(4,'plots_rank_pr', 0.5) ; 28 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_quickshift.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_QUICKSHIFT Demo: Quick shift: basic functionality 2 | 3 | pfx = fullfile(vl_root,'figures','demo') ; 4 | randn('state',0) ; 5 | rand('state',0) ; 6 | figure(1) ; clf ; 7 | 8 | % -------------------------------------------------------------------- 9 | % Load a figure 10 | % -------------------------------------------------------------------- 11 | I = imread(fullfile(vl_root,'data','roofs1.jpg')) ; 12 | 13 | image(I) ; 14 | axis equal off tight ; 15 | vl_demo_print('quickshift_image') ; 16 | 17 | % -------------------------------------------------------------------- 18 | % Create a quickshift segmentation 19 | % -------------------------------------------------------------------- 20 | 21 | ratio = 0.5; 22 | kernelsize = 2; 23 | maxdist = 10; 24 | 25 | Iseg = vl_quickseg(I, ratio, kernelsize, maxdist); 26 | image(Iseg); 27 | axis equal off tight; 28 | vl_demo_print('quickshift_qseg_1') ; 29 | 30 | kernelsize = 2; 31 | maxdist = 20; 32 | Iseg = vl_quickseg(I, ratio, kernelsize, maxdist); 33 | image(Iseg); 34 | axis equal off tight; 35 | vl_demo_print('quickshift_qseg_2') ; 36 | 37 | 38 | maxdist = 50; 39 | ndists = 10; 40 | Iedge = vl_quickvis(I, ratio, kernelsize, maxdist, ndists); 41 | imagesc(Iedge); 42 | axis equal off tight; 43 | colormap gray; 44 | vl_demo_print('quickshift_qvis') ; 45 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_sift_edge.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_SIFT_EDGE Demo: SIFT: edge treshold 2 | 3 | randn('state',0) ; 4 | rand('state',0) ; 5 | 6 | I = zeros(100,500) ; 7 | for i=[10 20 30 40 50 60 70 80 90] 8 | d = round(i/3) ; 9 | I(50-d:50+d,i*5) = 1 ; 10 | end 11 | I = 2*pi*8^2 * vl_imsmooth(I,8) ; 12 | I = single(255 * I) ; 13 | 14 | figure(1) ; clf ; 15 | imagesc(I) ; colormap gray ; 16 | axis equal ; axis off ; axis tight ; 17 | hold on ; 18 | 19 | vl_demo_print('sift_edge_0') ; 20 | 21 | ter=[3.5 5 7.5 10] ; 22 | for te=ter 23 | f = vl_sift(I, ... 24 | 'PeakThresh', 0, ... 25 | 'EdgeThresh', te, ... 26 | 'FirstOctave', -1 ) ; 27 | h1 = vl_plotframe(f) ; 28 | set(h1,'color','k','linewidth',3) ; 29 | h2 = vl_plotframe(f) ; 30 | set(h2,'color','y','linewidth',2) ; 31 | 32 | vl_demo_print(sprintf('sift_edge_%d', find(te==ter))) ; 33 | delete(h1) ; 34 | delete(h2) ; 35 | end 36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_sift_match.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_SIFT_MATCH Demo: SIFT: basic matching 2 | 3 | pfx = fullfile(vl_root,'figures','demo') ; 4 | randn('state',0) ; 5 | rand('state',0) ; 6 | figure(1) ; clf ; 7 | 8 | % -------------------------------------------------------------------- 9 | % Create image pair 10 | % -------------------------------------------------------------------- 11 | 12 | Ia = imread(fullfile(vl_root,'data','roofs1.jpg')) ; 13 | Ib = imread(fullfile(vl_root,'data','roofs2.jpg')) ; 14 | 15 | % -------------------------------------------------------------------- 16 | % Extract features and match 17 | % -------------------------------------------------------------------- 18 | 19 | [fa,da] = vl_sift(im2single(rgb2gray(Ia))) ; 20 | [fb,db] = vl_sift(im2single(rgb2gray(Ib))) ; 21 | 22 | [matches, scores] = vl_ubcmatch(da,db) ; 23 | 24 | [drop, perm] = sort(scores, 'descend') ; 25 | matches = matches(:, perm) ; 26 | scores = scores(perm) ; 27 | 28 | figure(1) ; clf ; 29 | imagesc(cat(2, Ia, Ib)) ; 30 | axis image off ; 31 | vl_demo_print('sift_match_1', 1) ; 32 | 33 | figure(2) ; clf ; 34 | imagesc(cat(2, Ia, Ib)) ; 35 | 36 | xa = fa(1,matches(1,:)) ; 37 | xb = fb(1,matches(2,:)) + size(Ia,2) ; 38 | ya = fa(2,matches(1,:)) ; 39 | yb = fb(2,matches(2,:)) ; 40 | 41 | hold on ; 42 | h = line([xa ; xb], [ya ; yb]) ; 43 | set(h,'linewidth', 1, 'color', 'b') ; 44 | 45 | vl_plotframe(fa(:,matches(1,:))) ; 46 | fb(1,:) = fb(1,:) + size(Ia,2) ; 47 | vl_plotframe(fb(:,matches(2,:))) ; 48 | axis image off ; 49 | 50 | vl_demo_print('sift_match_2', 1) ; 51 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_sift_or.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_SIFT_OR Demonstrates SIFT orientation detection 2 | 3 | I = vl_impattern('wedge') ; 4 | ur = 1:size(I,2) ; 5 | vr = 1:size(I,1) ; 6 | 7 | % distribute frames on a grid 8 | [u,v] = meshgrid(ur(5:10:end-4),vr(5:10:end-4)) ; 9 | f = [u(:)';v(:)'] ; 10 | K = size(f,2) ; 11 | f = [f ; 4 * ones(1,K) ; 0 * ones(1,K)] ; 12 | 13 | % detect orienntations 14 | f = vl_sift(single(I), 'frames', f, 'orientations') ; 15 | 16 | figure(1) ; clf ; 17 | imagesc(single(I)) ; colormap gray ; hold on ; 18 | vl_plotframe(f,'color','k','linewidth',3) ; 19 | vl_plotframe(f,'color','y','linewidth',2) ; 20 | axis equal ; axis off ; 21 | vl_demo_print('sift_or') ; 22 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_sift_peak.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_SIFT_PEAK Demo: SIFT: peak treshold 2 | 3 | randn('state',0) ; 4 | rand('state',0) ; 5 | 6 | I = double(rand(100,500) <= .005) ; 7 | I = (ones(100,1) * linspace(0,1,500)) .* I ; 8 | I(:,1) = 0 ; I(:,end) = 0 ; 9 | I(1,:) = 0 ; I(end,:) = 0 ; 10 | I = 2*pi*4^2 * vl_imsmooth(I,4) ; 11 | I = single(255 * I) ; 12 | 13 | figure(1) ; clf ; 14 | imagesc(I) ; colormap gray ; 15 | axis equal ; axis off; axis tight ; 16 | hold on ; 17 | 18 | vl_demo_print('sift_peak_0') ; 19 | 20 | tpr = [0 10 20 30] ; 21 | for tp=tpr 22 | f = vl_sift(I, ... 23 | 'PeakThresh', tp, ... 24 | 'EdgeThresh', 10000, ... 25 | 'FirstOctave', -1) ; 26 | 27 | h1 = vl_plotframe(f) ; 28 | set(h1,'color','k','linewidth',3) ; 29 | h2 = vl_plotframe(f) ; 30 | set(h2,'color','y','linewidth',2) ; 31 | 32 | vl_demo_print(sprintf('sift_peak_%d',find(tp==tpr))) ; 33 | delete(h1) ; 34 | delete(h2) ; 35 | end 36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_svm.m: -------------------------------------------------------------------------------- 1 | % VL_DEMO_SVM Demo: SVM: 2D linear learning 2 | function vl_demo_svm 3 | y=[];X=[]; 4 | 5 | % Load training data X and their labels y 6 | load('vl_demo_svm_data.mat') 7 | 8 | 9 | Xp = X(:,y==1); 10 | Xn = X(:,y==-1); 11 | 12 | figure 13 | plot(Xn(1,:),Xn(2,:),'*r') 14 | hold on 15 | plot(Xp(1,:),Xp(2,:),'*b') 16 | axis equal ; 17 | vl_demo_print('svm_training') ; 18 | % Parameters 19 | lambda = 0.01 ; % Regularization parameter 20 | maxIter = 1000 ; % Maximum number of iterations 21 | 22 | energy = [] ; 23 | % Diagnostic function 24 | function diagnostics(svm) 25 | energy = [energy [svm.objective ; svm.dualObjective ; svm.dualityGap ] ] ; 26 | end 27 | 28 | % Training the SVM 29 | energy = [] ; 30 | [w b info] = vl_svmtrain(X, y, lambda,... 31 | 'MaxNumIterations',maxIter,... 32 | 'DiagnosticFunction',@diagnostics,... 33 | 'DiagnosticFrequency',1) 34 | 35 | % Visualisation 36 | eq = [num2str(w(1)) '*x+' num2str(w(2)) '*y+' num2str(b)]; 37 | 38 | line = ezplot(eq, [-0.9 0.9 -0.9 0.9]); 39 | set(line, 'Color', [0 0.8 0],'linewidth', 2); 40 | 41 | vl_demo_print('svm_training_result') ; 42 | 43 | 44 | figure 45 | hold on 46 | plot(energy(1,:),'--b') ; 47 | plot(energy(2,:),'-.g') ; 48 | plot(energy(3,:),'r') ; 49 | legend('Primal objective','Dual objective','Duality gap') 50 | xlabel('Diagnostics iteration') 51 | ylabel('Energy') 52 | vl_demo_print('svm_energy') ; 53 | 54 | end -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/demo/vl_demo_svm_data.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/QiaoLiuHit/LSOTB-TIR/5f2cc9bd24dae44acf118c1713c05be7eff5f88b/vlfeat-0.9.19/toolbox/demo/vl_demo_svm_data.mat -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/geometry/vl_hat.m: -------------------------------------------------------------------------------- 1 | function H = vl_hat(om) 2 | % VL_HAT Hat operator 3 | % H = VL_HAT(OM) returns the skew symmetric matrix by taking the "hat" 4 | % of the 3D vector OM. 5 | % 6 | % See also: VL_IHAT(), VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | H = [0 -om(3) om(2) ; 15 | om(3) 0 -om(1) ; 16 | -om(2) om(1) 0 ] ; 17 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/geometry/vl_ihat.m: -------------------------------------------------------------------------------- 1 | function om = vl_ihat( H ) 2 | % VL_IHAT Inverse vl_hat operator 3 | % OM = VL_IHAT(H) returns a vector OM such that VL_HAT(OM) = H. 4 | % H hast to be 3x3 skew-symmetric. 5 | % 6 | % See also: VL_HAT(), VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | om = [H(3,2);H(1,3);H(2,1)] ; 15 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/geometry/vl_irodr.m: -------------------------------------------------------------------------------- 1 | % VL_IRODR Inverse Rodrigues' formula 2 | % OM = VL_IRODR(R) where R is a rotation matrix computes the the 3 | % inverse Rodrigues' formula of om, returning the rotation matrix R 4 | % = dehat(Logm(OM)). 5 | % 6 | % [OM,DOM] = VL_IRODR(R) computes also the derivative of the Rodrigues' 7 | % formula. In matrix notation this is the expression 8 | % 9 | % d( dehat logm(vl_hat(R)) ) 10 | % dom = ----------------------. 11 | % d(vec R)^T 12 | % 13 | % [OM,DOM] = VL_IRODR(R) when R is a 9xK matrix repeats the operation 14 | % for each column (or equivalently matrix with 9*K elements). In 15 | % this case OM and DOM are arrays with K slices, one per rotation. 16 | % 17 | % See also: VL_RODR(), VL_HELP(). 18 | 19 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 20 | % All rights reserved. 21 | % 22 | % This file is part of the VLFeat library and is made available under 23 | % the terms of the BSD license (see the COPYING file). 24 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/geometry/vl_rodr.m: -------------------------------------------------------------------------------- 1 | % VL_RODR Rodrigues' formula 2 | % R = VL_RODR(OM) where OM a 3-dimensional column vector computes the 3 | % Rodrigues' formula of OM, returning the rotation matrix R = 4 | % expm(vl_hat(OM)). 5 | % 6 | % [R,DR] = VL_RODR(OM) computes also the derivative of the Rodrigues 7 | % formula. In matrix notation this is the expression 8 | % 9 | % d(vec expm(vl_hat(OM)) ) 10 | % dR = ----------------------. 11 | % d om^T 12 | % 13 | % [R,DR]=VL_RODR(OM) when OM is a 3xK matrix repeats the operation for 14 | % each column (or equivalently matrix with 3*K elements). In this 15 | % case R and DR are arrays with K slices, one per rotation. 16 | % 17 | % See also: VL_IRODR(), VL_HELP(). 18 | 19 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 20 | % All rights reserved. 21 | % 22 | % This file is part of the VLFeat library and is made available under 23 | % the terms of the BSD license (see the COPYING file). 24 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_dwaffine.m: -------------------------------------------------------------------------------- 1 | function [dWx,dWy] = vl_dwaffine(x,y) 2 | % VL_DWAFFINE Derivative of an affine warp 3 | % [DWX,DWY]=VL_DWAFFINE(X,Y) returns the derivative of the 2-D affine 4 | % warp [WX; WY] = [A T] [X; Y] with respect to the parameters A,T 5 | % computed at points X,Y. 6 | % 7 | % See also: VL_WAFFINE(), VL_HELP(). 8 | 9 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 10 | % All rights reserved. 11 | % 12 | % This file is part of the VLFeat library and is made available under 13 | % the terms of the BSD license (see the COPYING file). 14 | 15 | % dW = [ kron(x',I) I ] 16 | % | 17 | % = [ x1 0 x2 0 1 0 ] 18 | % [ 0 x1 0 x2 0 1 ] 19 | 20 | z = zeros(length(x(:)),1) ; 21 | o = ones(length(x(:)),1) ; 22 | 23 | dWx = [ x(:) z y(:) z o z ] ; 24 | dWy = [ z x(:) z y(:) z o ] ; 25 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imdisttf.m: -------------------------------------------------------------------------------- 1 | % VL_IMDISTTF Image distance transform 2 | % DT = VL_IMDISTTF(I) computes the distance transform of image I. 3 | % The distance transform is defined as 4 | % 5 | % DT(x,y) = min_{u,v} I(u,v) + (u - x)^2 + (v - y)^2. 6 | % 7 | % [D, INDEXES] = VL_IMDISTTF(...) returns a matrix INDEXES that 8 | % contains for each pixel (x,y) the index of the pixel (u,v) which 9 | % is the minimizer of the distance transform objective. 10 | % 11 | % VL_IMDSITTF(I, PARAM) uses differenet parameters for the 12 | % transform: 13 | % 14 | % DT(u,v) = min_{u,v} I(u,v) + PARAM(1) (u - x - PARAM(2))^2 15 | % + PARAM(3) (v - y - PARAM(4))^2 16 | % 17 | % The function uses the fast algorithm from [1]. 18 | % 19 | % REFERENCES:: 20 | % [1] P. F. Felzenszwalb and D. P. Huttenlocher. Distance transforms 21 | % of sampled functions. Technical report, Cornell University, 2004. 22 | % 23 | % See also: VL_HELP(). 24 | 25 | % Author:: Andrea Vedaldi 26 | 27 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 28 | % All rights reserved. 29 | % 30 | % This file is part of the VLFeat library and is made available under 31 | % the terms of the BSD license (see the COPYING file). 32 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imdown.m: -------------------------------------------------------------------------------- 1 | function J = vl_imdown(I, varargin) 2 | % VL_IMDOWN Downsample an image by two 3 | % J = VL_IMDOWN(I) downsamples the image I by half by discarding 4 | % each other pixel. 5 | % 6 | % VL_IMDOWN() accepts the following options: 7 | % 8 | % Method:: Sample 9 | % 'Sample' downsamples the image by discarding 10 | % pixels. 'Average' instead averages groups of 2x2 pixels. 11 | % 12 | % See also: VL_IMUP(), VL_HELP(). 13 | 14 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 15 | % All rights reserved. 16 | % 17 | % This file is part of the VLFeat library and is made available under 18 | % the terms of the BSD license (see the COPYING file). 19 | 20 | opts.method = 'sample' ; 21 | opts = vl_argparse(opts, varargin) ; 22 | 23 | switch lower(opts.method) 24 | case 'sample' 25 | J = I(1:2:floor(end-.5),1:2:floor(end-.5),:) ; 26 | 27 | case 'average' 28 | Iclass = class(I); 29 | I = double(I); 30 | J = ... 31 | I(1:2:end-1,1:2:end-1,:) + ... 32 | I(2:2:end,1:2:end-1,:) + ... 33 | I(1:2:end-1,2:2:end,:) + ... 34 | I(2:2:end,2:2:end,:) ; 35 | J = J / 4 ; 36 | eval(sprintf('J=%s(J);', Iclass)); 37 | 38 | otherwise 39 | error('Unknown downsampling method ''%s''.', method) ; 40 | end 41 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imintegral.m: -------------------------------------------------------------------------------- 1 | % VL_IMINTEGRAL Compute integral image 2 | % J = VL_IMINTEGRAL(I) calculates the integral image J of the image 3 | % I. I must a matrix with DOUBLE, SINGLE, UINT32, or INT32 storage 4 | % class. J is given by 5 | % 6 | % J(i,j) = sum(I(1:i,1:j)). 7 | % 8 | % J has the same size as I and the same storage class. 9 | % 10 | % Example:: 11 | % The following identity holds: 12 | % VL_IMINTEGRAL(ONES(3)) = [ 1 2 3 ; 13 | % 2 4 6 ; 14 | % 3 6 9 ] 15 | % 16 | % See also: VL_HELP(). 17 | 18 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 19 | % All rights reserved. 20 | % 21 | % This file is part of the VLFeat library and is made available under 22 | % the terms of the BSD license (see the COPYING file). 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imreadbw.m: -------------------------------------------------------------------------------- 1 | function I = vl_imreadgray(file,varargin) 2 | % VL_IMREADGRAY Reads an image as gray-scale 3 | % I=VL_IMREADGRAY(FILE) reads the image from file FILE and converts the 4 | % result to a gray scale image (DOUBLE storage class ranging in 5 | % [0,1]). 6 | % 7 | % VL_IMREADGRAY(FILE,FMT) specifies the file format FMT (see IMREAD()). 8 | % 9 | % See also: RGB2DOUBLE(), VL_HELP(). 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | I = imread(file) ; 18 | I = im2double(I) ; 19 | 20 | if(size(I,3) > 1) 21 | I = rgb2gray(I) ; 22 | end 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imreadgray.m: -------------------------------------------------------------------------------- 1 | function I = vl_imreadgray(file,varargin) 2 | % VL_IMREADGRAY Reads an image as gray-scale 3 | % I=VL_IMREADGRAY(FILE) reads the image from file FILE and converts the 4 | % result to a gray scale image (DOUBLE storage class ranging in 5 | % [0,1]). 6 | % 7 | % VL_IMREADGRAY(FILE,FMT) specifies the file format FMT (see IMREAD()). 8 | % 9 | % See also: RGB2DOUBLE(), VL_HELP(). 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | I = imread(file) ; 18 | I = im2double(I) ; 19 | 20 | if(size(I,3) > 1) 21 | I = rgb2gray(I) ; 22 | end 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imsc.m: -------------------------------------------------------------------------------- 1 | function J=vl_imsc(I) 2 | % VL_IMSC Scale image 3 | % J=VL_IMSC(I) scales the range of the gray-scale or color image I to 4 | % fit in the interval [0,1]. 5 | % 6 | % See also: VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | if ~isfloat(I) 15 | I = im2double(I) ; 16 | end 17 | 18 | J = I - min(I(:)) ; 19 | J = J / max(J(:)) ; 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imsmooth.m: -------------------------------------------------------------------------------- 1 | % VL_IMSMOOTH Smooth image 2 | % J = VL_IMSMOOTH(I,SIGMA) convolves the image I by an isotropic 3 | % Gaussian kernel of standard deviation SIGMA. I must be an array 4 | % of doubles. IF the array is three dimensional, the third dimension 5 | % is assumed to span different channels (e.g. R,G,B). In this case, 6 | % each channel is convolved independently. 7 | % 8 | % VL_IMSMOOTH() accepts the following options: 9 | % 10 | % Kernel:: 11 | % Selects between GAUSSIAN and TRIANGULAR kernels. The triangular 12 | % kernel support has 2*SIGMA-1 sampels. Kernels have unit mass. 13 | % 14 | % Padding:: 15 | % Selects between ZERO or CONTINUITY padding method to handle the 16 | % image boundaries. ZERO extends the input image with zeroes 17 | % around the border, and CONTINUITY extends the image with 18 | % constant pixels. 19 | % 20 | % Step:: 21 | % Sets the subsampling step. A subsampling step of STEP pixels 22 | % causes J(1:STEPS:end, 1:STEPS:end, :) to be computed. This is 23 | % useful to downsample the image. 24 | % 25 | % See also: VL_HELP(). 26 | 27 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 28 | % All rights reserved. 29 | % 30 | % This file is part of the VLFeat library and is made available under 31 | % the terms of the BSD license (see the COPYING file). 32 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imup.m: -------------------------------------------------------------------------------- 1 | function J = vl_imup(I) 2 | % VL_IMUP Upsample an image by two 3 | % J=VL_IMUP(I) doubles the resolution of the image I by using 4 | % bilinear interpolation. 5 | % 6 | % See also: VL_IMDOWN(), VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | [M,N,K] = size(I) ; 15 | 16 | J = zeros(2*M,2*N,K) ; 17 | 18 | J(1:2:end,1:2:end,:) = I ; 19 | 20 | J(2:2:end,1:2:end,:) = 0.5*(I+[I(2:end,:,:);I(end,:,:)]) ; 21 | J(1:2:end,2:2:end,:) = 0.5*(I+[I(:,2:end,:),I(:,end,:)]) ; 22 | J(2:2:end,2:2:end,:) = ... 23 | 0.25*(... 24 | J(2:2:end,1:2:end-1,:)+... 25 | J(1:2:end-1,2:2:end,:)+... 26 | [J(2:2:end,3:2:end,:),J(2:2:end,end-1,:)]+... 27 | [J(3:2:end,2:2:end,:);J(end-1,2:2:end,:)]) ; 28 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_imwhiten.m: -------------------------------------------------------------------------------- 1 | function J=vl_imwhiten(I,alpha,cutoff) 2 | % VL_IMWHITEN Whiten an image 3 | % J = VL_IMWHITEN(I,ALPHA) approximatively whitens the power spectrum 4 | % of the natural image I. The algorithm assumes that the modulus of 5 | % the spectrum decays as 1/f^ALPHA (f is the frequency). 6 | % 7 | % VL_IMWHITEN(I) uses ALPHA=1 (a typical value for natural images). 8 | % 9 | % VL_IMWHITEN(I,ALPHA,CUTOFF) also applies a low-pass filter with 10 | % cutoff frequency equal to CUTOFF x FN, where FN is the Nyquist 11 | % frequency (half of the sampling frequency). 12 | % 13 | % See also: VL_HELP(). 14 | 15 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | 21 | if ~exist('alpha','var'), alpha = 1 ; end 22 | if ~exist('cutoff','var'), cutoff = [] ; end 23 | 24 | [M,N]=size(I) ; 25 | 26 | % Frequency domain 27 | fn = 0.5 ; % Nyquist freq (=1/2T, T=1) 28 | fx_range=linspace(-fn, fn, N) ; 29 | fy_range=linspace(-fn, fn, M) ; 30 | [fx fy]=meshgrid(fx_range, fy_range) ; 31 | 32 | % Whitening filter 33 | rho=sqrt(fx.*fx+fy.*fy); 34 | filt=rho.^alpha ; 35 | 36 | % Low-pass filter 37 | if ~isempty(cutoff) 38 | fcut = cutoff * fn ; 39 | filt = filt .* exp(-(rho/fcut).^4); 40 | %filt = filt .* exp( - 0.5 * (rho / fcut) .^ 2); 41 | end 42 | 43 | % Apply filter 44 | J = real(ifft2(fft2(I).*fftshift(filt))) ; 45 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_rgb2xyz.m: -------------------------------------------------------------------------------- 1 | function J=vl_rgb2xyz(I,ws) 2 | % VL_RGB2XYZ Convert RGB color space to XYZ 3 | % J=VL_RGB2XYZ(I) converts the CIE RGB image I to the image J in 4 | % CIE XYZ format. CIE RGB has a white point of R=G=B=1.0 5 | % 6 | % VL_RGB2XYZ(I,WS) uses the specified RGB working space WS. The 7 | % function supports the following RGB working spaces: 8 | % 9 | % * `CIE' E illuminant, gamma=2.2 10 | % * `Adobe' D65 illuminant, gamma=2.2 11 | % 12 | % The default workspace is CIE. 13 | % 14 | % See also: VL_XYZ2RGB(), VL_HELP(). 15 | 16 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | [M,N,K] = size(I) ; 23 | 24 | if K~=3 25 | error('I must be a MxNx3 array.') ; 26 | end 27 | 28 | I=im2double(I) ; 29 | 30 | if(nargin < 2) 31 | workspace = 'CIE' ; 32 | else 33 | workspace = ws ; 34 | end 35 | 36 | switch workspace 37 | case 'CIE' 38 | % CIE: E illuminant and 2.2 gamma 39 | A = [ 40 | 0.488718 0.176204 0.000000 41 | 0.310680 0.812985 0.0102048 42 | 0.200602 0.0108109 0.989795 ]' ; 43 | gamma = 2.2 ; 44 | 45 | case 'Adobe' 46 | % Adobe 1998: D65 illuminant and 2.2 gamma 47 | A = [ 48 | 0.576700 0.297361 0.0270328 49 | 0.185556 0.627355 0.0706879 50 | 0.188212 0.0752847 0.99124 ]' ; 51 | gamma = 2.2 ; 52 | end 53 | 54 | [M,N,K] = size(I) ; 55 | 56 | I = reshape(I.^gamma, M*N, K) ; 57 | J = A*I' ; 58 | J = reshape(J', M, N, K) ; 59 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_tps.m: -------------------------------------------------------------------------------- 1 | function [phi,S] = vl_tps(x1,x2,Y) 2 | % VL_TPS Compute the thin-plate spline basis 3 | % PHI=VL_TPS(X1,X2,Y) returns the basis PHI of a thin-plate spline 4 | % (TPS) defined on the domain X1,X2 with control points Y. 5 | % 6 | % X1 and X2 are MxN matrices specifying the grid vertices. When 7 | % warping images, these usually correspond to image pixels. 8 | % 9 | % Y is a 2xK matrix specifying the control points, one per 10 | % column. Ofthen Y is a subset of the domain X1,X2, but this is not 11 | % required. 12 | % 13 | % PHI is a (K+3)xNxM matrix, with one layer per basis element. Each 14 | % basis element is a function of the domain X1,X2. 15 | % 16 | % [PHI,S] = VL_TPS(X1,X2,Y) additionally returns the stiffness matrix S 17 | % of the TPS. 18 | % 19 | % See also: VL_WTPS(), VL_HELP(). 20 | 21 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 22 | % All rights reserved. 23 | % 24 | % This file is part of the VLFeat library and is made available under 25 | % the terms of the BSD license (see the COPYING file). 26 | 27 | X = [x1(:)';x2(:)'] ; 28 | 29 | K = size(Y,2) ; 30 | Q = size(X,2) ; 31 | U = vl_tpsu(Y,Y) ; 32 | L = [[ones(1,K); Y], zeros(3) ; U, ones(K,1), Y'] ; 33 | invL = inv(L) ; 34 | 35 | tmp = vl_tpsu(Y,X) ; 36 | phi = invL * [ ones(1,Q) ; X(1,:) ; X(2,:) ; tmp ] ; 37 | 38 | [M,N] = size(x1) ; 39 | phi = reshape(phi,K+3,M,N) ; 40 | 41 | if nargout > 1 42 | % See Bookstein; note that here the terms are re-arranged a bit 43 | invLn = invL(1:K, end-K+1:end) ; 44 | S = invLn * U * invLn ; 45 | end 46 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_wtps.m: -------------------------------------------------------------------------------- 1 | function [xp1,xp2]=vl_wtps(phi,Yp) 2 | % VL_WTPS Thin-plate spline warping 3 | % [XP1,XP2]=VL_WTPS(PHI,YP) computes the thin-plate spline (TPS) 4 | % specified by the basis PHI and the warped control point Yp. 5 | % 6 | % Yp is a 2xK matrix with one column per control point and the basis 7 | % PHI is calculated by means of the VL_TPS function. 8 | % 9 | % The thin-palte spline is defined on a domain X1,X2 and specified 10 | % by a set of points Y and their warp YP. The spline passes 11 | % interpolates exaclty the control points. 12 | % 13 | % The parameters X1,X2 and Y are used to compute the basis PHI. This 14 | % operation is fairily slow, but computing the spline for a given Yp 15 | % is then very quick, as the operation is just a linear combination 16 | % of the basis. 17 | % 18 | % Example:: 19 | % To calculate the warped grid [X1,X2] by moving the control points Y to 20 | % the control points YP use: 21 | % [xp1,xp2]=VL_WTPS(VL_TPS(x1,x2,Y),Yp). 22 | % 23 | % See also: VL_TPS(), VL_HELP(). 24 | 25 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 26 | % All rights reserved. 27 | % 28 | % This file is part of the VLFeat library and is made available under 29 | % the terms of the BSD license (see the COPYING file). 30 | 31 | [K,M,N] = size(phi) ; 32 | 33 | Xp=[Yp, zeros(2,3)]*reshape(phi,K,M*N) ; 34 | 35 | xp1 = reshape(Xp(1,:),M,N) ; 36 | xp2 = reshape(Xp(2,:),M,N) ; 37 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/imop/vl_xyz2rgb.m: -------------------------------------------------------------------------------- 1 | function J=vl_xyz2rgb(I,ws) 2 | % VL_XYZ2RGB Convert XYZ to RGB 3 | % J = VL_XYZ2RGB(I) the XYZ image I in RGB format. 4 | % 5 | % VL_XYZ2RGB(I,WS) uses the RGB workspace WS. WS is a string in 6 | % 7 | % - CIE: E illuminant and 2.2 gamma 8 | % - Adobe: D65 illuminant and 2.2 gamma 9 | % 10 | % The default workspace is CIE. 11 | % 12 | % See also: VL_RGB2XYZ(), VL_HELP(). 13 | 14 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 15 | % All rights reserved. 16 | % 17 | % This file is part of the VLFeat library and is made available under 18 | % the terms of the BSD license (see the COPYING file). 19 | 20 | if(nargin < 2) 21 | workspace = 'CIE' ; 22 | else 23 | workspace = ws ; 24 | end 25 | 26 | switch workspace 27 | case 'CIE' 28 | % CIE: E illuminant and 2.2 gamma 29 | A = [ 30 | 0.488718 0.176204 0.000000 31 | 0.310680 0.812985 0.0102048 32 | 0.200602 0.0108109 0.989795 ]' ; 33 | gamma = 2.2 ; 34 | 35 | case 'Adobe' 36 | % Adobe 1998: D65 illuminant and 2.2 gamma 37 | A = [ 38 | 0.576700 0.297361 0.0270328 39 | 0.185556 0.627355 0.0706879 40 | 0.188212 0.0752847 0.99124 ]' ; 41 | gamma = 2.2 ; 42 | end 43 | 44 | [M,N,K] = size(I) ; 45 | 46 | I = reshape(I, M*N, K) ; 47 | J = inv(A)*I' ; 48 | J = reshape(J'.^(1/gamma), M, N, K) ; 49 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/info.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 2012a 6 | VLFeat 7 | toolbox 8 | ../doc/images/vl_blue.png 9 | ../doc/matlab/ 10 | ../doc/images/vl_blue.png 11 | 12 | 13 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/kmeans/vl_hikmeanspush.m: -------------------------------------------------------------------------------- 1 | % VL_HIKMEANSPUSH Push data down an integer K-means tree 2 | % PATH = VL_HIKMEANSPUSH(TREE,X) quanizes the data X with the 3 | % hierachical integer K-means tree TREE. This is obtained by 4 | % calculating the path of each datum from the root of TREE down to a 5 | % leaf. Here X has a datum for each column and each column of PATH 6 | % represents the corresponding root-to-leaf path. 7 | % 8 | % Example:: 9 | % PATH(:,1) = [2 1 4] means that the first datum follows 10 | % the branches number 2, 1 and 4 starting from the root of the 11 | % HIKM tree ending to a leaf. 12 | % 13 | % See also: VL_HIKMEANS(), VL_HELP(). 14 | 15 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/kmeans/vl_ikmeans.m: -------------------------------------------------------------------------------- 1 | % VL_IKMEANS Integer K-means 2 | % C = VL_IKMEANS(X,K) returns the centers of a K-means paritioning of 3 | % the data space X. X must be of class UINT8. C is of class UINT32. 4 | % 5 | % [C, I] = VL_IKMEANS(...) returns the cluster associations I of the 6 | % data as well. 7 | % 8 | % VL_IKMEANS() accepts the following options: 9 | % 10 | % MaxIters:: 200 11 | % Maximum number of iterations before giving up (the algorithm 12 | % stops as soon as there is no change in the data to cluster 13 | % associations). 14 | % 15 | % Method:: Lloyd 16 | % Algorithm to use ('Lloyd', 'Elkan'). 17 | % 18 | % Verbose:: 19 | % Increase the verbosity level. 20 | % 21 | % See also: VL_IKMEANSPUSH(), VL_IKMEANSHIST(), VL_HIKMEANS(), VL_HELP(). 22 | 23 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 24 | % All rights reserved. 25 | % 26 | % This file is part of the VLFeat library and is made available under 27 | % the terms of the BSD license (see the COPYING file). 28 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/kmeans/vl_ikmeanshist.m: -------------------------------------------------------------------------------- 1 | function h = vl_ikmeanshist(K,asgn) 2 | % VL_IKMEANSHIST Compute histogram of quantized data 3 | % H = VL_IKMEANSHIST(K,ASGN) computes the histogram of the IKM clusters 4 | % activated by cluster assignments ASGN. 5 | % 6 | % See also: VL_IKMEANS(), VL_IKMEANSPUSH(), VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | h = zeros(K,1) ; 15 | h = vl_binsum(h, 1, double(asgn)) ; 16 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/kmeans/vl_ikmeanspush.m: -------------------------------------------------------------------------------- 1 | % VL_IKMEANSPUSH Project data on integer K-means paritions 2 | % I = VL_IKMEANSPUSH(X,C) projects the data X to the integer K-meanns 3 | % clusters of centers C returning the cluster indeces I. 4 | % 5 | % See also: VL_IKMEANS(), VL_HELP(). 6 | 7 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | % All rights reserved. 9 | % 10 | % This file is part of the VLFeat library and is made available under 11 | % the terms of the BSD license (see the COPYING file). 12 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/inthist.tc: -------------------------------------------------------------------------------- 1 | /** @file inthist.tc 2 | ** @brief vl_intist.c helper 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #define JOIN_(a,b) a ## b 15 | #define JOIN(a,b) JOIN_(a,b) 16 | 17 | #undef INTEGRAL 18 | #define INTEGRAL JOIN(integral_, SFX) 19 | 20 | /* 21 | This function is 'transpose safe': The integral histogram SRC can 22 | be either column major or row major, as long as WIDTH is the 23 | fastest varying dimension. 24 | */ 25 | void INTEGRAL (T* dst, 26 | int dstStride, 27 | T const* src, 28 | int srcWidth, int srcHeight, int srcStride) 29 | { 30 | int x, y ; 31 | *dst = *src ; 32 | dst += 1 ; 33 | src += 1 ; 34 | 35 | for (x = 1 ; x < srcWidth ; ++ x) { 36 | *dst = *(dst - 1) + *src ; 37 | dst += 1 ; 38 | src += 1 ; 39 | } 40 | 41 | for (y = 1 ; y < srcHeight ; ++ y) { 42 | dst += dstStride - srcWidth ; 43 | src += srcStride - srcWidth ; 44 | 45 | *dst = *(dst - dstStride) + *src ; 46 | dst += 1 ; 47 | src += 1 ; 48 | 49 | for (x = 1 ; x < srcWidth ; ++ x) { 50 | *dst = *(dst - dstStride) - *(dst - dstStride - 1) + *(dst - 1) + *src ; 51 | dst += 1 ; 52 | src += 1 ; 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_alphanum.m: -------------------------------------------------------------------------------- 1 | function [strings, perm] = vl_alphanum(strings) 2 | % VL_ALPHANUM Sort strings using the Alphanum algorithm 3 | % STRINGS = VL_ALPHANUM(STRINGS) sorts the cell array of strings 4 | % STRINGS by using the Alphanum algorithm [1]. [STRINGS,PERM] = 5 | % VL_ALPHANUM(...) returns the corresponding permutation PERM as 6 | % well. 7 | % 8 | % Example:: 9 | % Alphanum sorts strings in a way that 'makes sense'. For instance 10 | % 11 | % strings = {'B1', 'B2', 'B12', 'A12', 'A1', 'A2'} ; 12 | % sorted = vl_alphanum(strings) ; 13 | % 14 | % produces the sorted array {'A1', 'A2', 'A12', 'B1', B2', 15 | % 'B12'}. By contrast, SORT() produces the array {'A1', 'A12', 16 | % 'A2', 'B1', B12', 'B2'} (note the position of the elements 17 | % 'A12', 'B12'). 18 | % 19 | % References: 20 | % [1] Dave Koelle, 'The Alphanum Algorithm', 21 | % http://www.davekoelle.com/alphanum.html 22 | 23 | chunks = regexp(strings, '(\d+|\D+)', 'tokens') ; 24 | for i = 1:length(strings) 25 | chunks{i} = [chunks{i}{:}] ; 26 | for j = 1:length(chunks{i}) 27 | if isstrprop(chunks{i}{j},'digit') 28 | chunks{i}{j} = sprintf('%020.0f',sscanf(chunks{i}{j},'%d')) ; 29 | end 30 | end 31 | chunks{i} = [chunks{i}{:}] ; 32 | end 33 | 34 | [dorp,perm] = sort(chunks) ; 35 | strings = strings(perm) ; 36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_binsearch.m: -------------------------------------------------------------------------------- 1 | % VL_BINSEARCH Maps data to bins 2 | % IDX = VL_BINSEARCH(B, X) maps the elements of X to the bins 3 | % defined by B. B is a non-decreasing vector of M real numbers 4 | % defining bins [-inf, B(1)), [B(1), B(2)), ... [B(M) +inf] (note 5 | % that the last bin contains +inf). The bins are numbered from 0 to 6 | % M. X is a real (plain) array and IDX is an array with the same 7 | % dimensions of X, specifying the bin correpsonding to each element 8 | % of X. 9 | % 10 | % If B(1) = -inf the bin number 0 is removed and the bin number 1 is 11 | % [-inf B(2)). If B(M) = +inf, the last bin M is the singleton +inf. 12 | % 13 | % See also: VL_BINSUM(), VL_HELP(). 14 | 15 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_cummax.m: -------------------------------------------------------------------------------- 1 | % VL_CUMMAX Cumulative maximum 2 | % If X is a vector, VL_CUMMAX(X) is the vector with the cumulative 3 | % maximum of X. If X is a matrix, VL_CUMMAX(X) is the matrix of the 4 | % cumulative maximum of the columns of X. If X is a multi-dimensional 5 | % array, VL_CUMMAX(X) operates along the first non-singleton 6 | % dimension. 7 | % 8 | % The function is analogous to CUMSUM() and CUMPROD(), but it 9 | % computes the cumulative maximum rather than the cumulative sum or 10 | % product. 11 | % 12 | % The array X can be of any numeric class. 13 | % 14 | % Example:: 15 | % The cumulative maximum VL_CUMMAX([1 2 3 2 1]) is the vector 16 | % [1 2 3 3 3]. 17 | % 18 | % See also: CUMSUM(), CUMPROD(), VL_HELP(). 19 | 20 | % Author: Andrea Vedaldi 21 | 22 | % Copyright 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_getpid.c: -------------------------------------------------------------------------------- 1 | /** @internal 2 | ** @file vl_getpid.c 3 | ** @author Andrea Vedaldi 4 | ** @brief MEX implementation of VL_GETPID() 5 | **/ 6 | 7 | /* 8 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | All rights reserved. 10 | 11 | This file is part of the VLFeat library and is made available under 12 | the terms of the BSD license (see the COPYING file). 13 | */ 14 | 15 | #include 16 | 17 | #ifdef VL_OS_WIN 18 | #include 19 | #else 20 | #include 21 | #endif 22 | 23 | #include 24 | 25 | void 26 | mexFunction(int nout, mxArray *out[], 27 | int nin, const mxArray *in[] VL_UNUSED) 28 | { 29 | double pid ; 30 | 31 | if (nin > 0) { 32 | vlmxError(vlmxErrTooManyInputArguments, NULL) ; 33 | } 34 | if (nout > 1) { 35 | vlmxError(vlmxErrTooManyOutputArguments, NULL) ; 36 | } 37 | 38 | #ifdef VL_OS_WIN 39 | pid = (double) GetCurrentProcessId() ; 40 | #else 41 | pid = (double) getpid() ; 42 | #endif 43 | out[0] = vlmxCreatePlainScalar (pid) ; 44 | } 45 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_getpid.m: -------------------------------------------------------------------------------- 1 | % VL_GETPID Get MATLAB process ID 2 | % VL_GETPID() returns MATLAB process ID. 3 | % 4 | % Algorithm:: 5 | % VL_GETPID() returns the result of the getpid() system call on 6 | % UNIX-like operating systems and of GetCurrentProcessID() on 7 | % Windows. 8 | % 9 | % See also: VL_HELP(). 10 | 11 | % Authors: Andrea Vedaldi 12 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_histmarg.m: -------------------------------------------------------------------------------- 1 | function H = vl_histmarg(H, dims) 2 | % VL_HISTMARG Marginal of histogram 3 | % H = VL_HISTMARG(H, DIMS) marginalizes the historgram H w.r.t the 4 | % dimensions DIMS. This is done by summing out all dimensions not 5 | % listed in DIMS and deleting them. 6 | % 7 | % Remark:: 8 | % If DIMS lists only one dimension, the returned histogram H is a 9 | % column vector. Notice that this way of deleting dimensions is 10 | % not always consistent with the SQUEEZE function. 11 | % 12 | % See also: VL_HELP(). 13 | 14 | % Authors: Andrea Vedaldi 15 | 16 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | sz = size(H) ; 23 | 24 | for d=setdiff(1:length(sz), dims(:)) 25 | H = sum(H, d) ; 26 | end 27 | 28 | % Squeeze out marginalized dimensions 29 | sz = sz(dims(:)) ; 30 | sz = [sz ones(1,2-length(dims(:)))] ; 31 | H = reshape(H, sz) ; 32 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_ihashfind.m: -------------------------------------------------------------------------------- 1 | % VL_IHASHFIND Find labels in an integer hash table 2 | % SEL = VL_IHASHFIND(ID, NEXT, K, X) returns a vector SEL of the 3 | % entires in the hash table ID,NEXT,K corresponding to the labels 4 | % stored as columns of X. 5 | % 6 | % The format is the same as for the functino VL_IHASHSUM(). 7 | % 8 | % See also: VL_IHASHSUM(). 9 | 10 | % Author: Andrea Vedaldi 11 | 12 | % Copyright (C) 2008-12 Andrea Vedaldi. 13 | % All rights reserved. 14 | % 15 | % This file is part of the VLFeat library and is made available under 16 | % the terms of the BSD license (see the COPYING file). 17 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_inthist.m: -------------------------------------------------------------------------------- 1 | % VL_INTHIST Calculate Integral Histogram 2 | % INTHIST = VL_INTHIST(LABELS) computes the integral histogram for 3 | % the label map(s) LABELS. 4 | % 5 | % LABELS is a [M,N,L] UINT32 array containing L label maps (one for 6 | % each MxN layer). Each label map associates to each of the MxN 7 | % pixels one of K labels (a value of 0 denotes no association) with 8 | % unitary mass. 9 | % 10 | % INTHIST is the [M,N,K] integral histogram obtained by integrating 11 | % the label maps (an integral histogram is just an array of K 12 | % integral images, one for each of the K labels). All layers of 13 | % labels are accumulated to the same integral histogram. 14 | % 15 | % The total number of labels K is obtained as the maximum value of 16 | % LABELS. VL_INTHIST(..., 'NUMLABELS', K) specifies the number of 17 | % labels explicitly. 18 | % 19 | % VL_INTHIST(..., 'MASS', MASSES) specifies a mass MASSES for each 20 | % entry of LABELS. MASSES can be either of class UINT32 or DOUBLE, 21 | % and the class of INTHIST varies accordingly. 22 | % 23 | % See also: VL_IMINTEGRAL(), VL_SAMPLEINTHIST(), VL_HELP(). 24 | 25 | % Authors: Andrea Vedaldi 26 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_isoctave.m: -------------------------------------------------------------------------------- 1 | function x = vl_isoctave() 2 | % VL_ISOCTAVE Determines whether Octave is running 3 | % X = VL_ISOCTAVE() returns TRUE if the script is running in the 4 | % Octave environment (instead of MATLAB). 5 | 6 | persistent y ; 7 | 8 | if isempty(y) 9 | y = exist('OCTAVE_VERSION','builtin') ~= 0 ; 10 | end 11 | 12 | x = y ; 13 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_lbp.m: -------------------------------------------------------------------------------- 1 | % VL_LBP Local Binary Patterns 2 | % F = VL_LBP(IM, CELLSIZE) computes the Local Binary Pattern (LBP) 3 | % features for image I. 4 | % 5 | % IM is divided in cells of size CELLSIZE. F is a three-dimensional 6 | % array containing one histograms of quantized LBP features per 7 | % cell. The witdh of F is FLOOR(WIDTH/CELLSIZE), where WIDTH is the 8 | % width of the image. The same for the height. The third dimension 9 | % is 58. 10 | % 11 | % See also: LBP, VL_LBPFLIPLR(), 12 | % VL_HELP(). 13 | 14 | % Copyright (C) 2013 Andrea Vedaldi. 15 | % Copyright (C) 2010-11 Andrea Vedaldi. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_lbpfliplr.m: -------------------------------------------------------------------------------- 1 | function f = vl_lbpfliplr(f) 2 | % VL_LBPFLIPLR Flip LBP features left-right 3 | % F = VL_LBPFLIPLR(F) flips the LBP features F from left to 4 | % right. 5 | % 6 | % Example:: 7 | % The following instructions return results almost identical 8 | % assuming that the width of I is exactly divisible by the cell 9 | % size: 10 | % F = VL_LBP(FLIPLR(I), 8) 11 | % F_ = VL_LBPFLIPLR(VL_LBP(I), 8) 12 | % 13 | % See also: VL_LBP(), VL_HELP(). 14 | 15 | % Copyright (C) 2013 Andrea Vedaldi. 16 | % Copyright (C) 2010-11 Andrea Vedaldi. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | % Uniform patterns for a 8-neighbourhood: patterns 58 (generic) and 57 23 | % (constant) are invariant to an image warp. 24 | 25 | perm = zeros(1,58) ; 26 | perm(58) = 58 ; 27 | perm(57) = 57 ; 28 | 29 | % i is the start of the sequence of 1 and j its length 30 | % recall that i=0 -> E, i=1 -> SE, etc 31 | % the length j remains the same. 32 | % flipping the start gives the flipped end, and subtracting the length 33 | % gives the flipped start 34 | 35 | for i = 0:7 36 | for j = 1:7 37 | i_ = mod(4 - i - j + 1, 8) ; 38 | j_ = j ; 39 | perm(i * 7 + j) = i_ * 7 + j_ ; 40 | end 41 | end 42 | 43 | f = f(:, end:-1:1, perm) ; 44 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_matlabversion.m: -------------------------------------------------------------------------------- 1 | function v = vl_matlabversion 2 | % VL_MATLABVERSION Return MATLAB version as an integer 3 | % V = VL_MATLABVERSION() returns MATLAB version encoded as an 4 | % ingeger value. MATLAB version string has the format 5 | % 6 | % MAJOR.MINOR.SERVICEPACK 7 | % 8 | % The integer V has the value 9 | % 10 | % V = MAJOR * 10000 + MINOR * 100 + SERVICEPACK. 11 | % 12 | % For example, in MATLAB 7.10.0 (R2010a), V equals 70100. 13 | % 14 | % See also: VL_HELP(). 15 | 16 | v = [1e4 1e2 1e0] * sscanf(version, '%d.%d.%d') ; 17 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_numder.m: -------------------------------------------------------------------------------- 1 | function d = vl_numder(func, x, varargin) 2 | % VL_NUMDER Numerical derivative 3 | % D = VL_NUMDER(FUNC, X) computes the numerical derivative of the 4 | % function FUNC at point X. X is a real array and is passed as first 5 | % argument of FUNC. 6 | % 7 | % D = VL_NUMDER(FUNC, X, ARG1, ARG2, ...) passes ARG1, ARG2, ... as 8 | % additional arguments to the function FUNC. 9 | % 10 | % See also: VL_NUMDER2(), VL_HELP(). 11 | 12 | % TODO: uniform sacaling of axis is not a good idea 13 | 14 | dx = 1e-7 ; 15 | N = numel(x) ; 16 | fx = feval(func, x, varargin{:}) ; 17 | d = zeros(length(fx(:)),N) ; 18 | 19 | for n=1:N 20 | e = zeros(size(x)) ; e(n) = 1 ; 21 | fxn = feval(func, x+dx*e, varargin{:}) ; 22 | di = (fxn - fx) / dx ; 23 | d(:,n) = di(:) ; 24 | end 25 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_numder2.m: -------------------------------------------------------------------------------- 1 | function d = vl_numder2(func, x, varargin) 2 | % VL_NUMDER2 Numerical second derivative 3 | % D = VL_NUMDER2(FUNC, X) computes the numerical second derivative of 4 | % the function FUNC at point X. 5 | % 6 | % D = VL_NUMDER2(FUNC, X, ARG1, ARG2, ...) allow to pass extra 7 | % parameters to the function FUNC. 8 | % 9 | % See also: VL_NUMDER(), VL_HELP(). 10 | 11 | N=length(x(:)) ; 12 | f00 = feval(func, x, varargin{:}) ; 13 | d=zeros(length(f00),N,N) ; 14 | D=1e-5 ; 15 | D2=D*D ; 16 | 17 | for n=1:N 18 | en=zeros(size(x)) ; en(n)=1 ; 19 | for m=1:N 20 | em=zeros(size(x)) ; em(m)=1 ; 21 | 22 | if( n ~= m ) 23 | f10 = feval(func, x+en*D, varargin{:}) ; 24 | f01 = feval(func, x+em*D, varargin{:}) ; 25 | f11 = feval(func, x+en*D+em*D, varargin{:}) ; 26 | d(:,n,m) = (f11-f01+f00-f10)/D2 ; 27 | else 28 | fp = feval(func, x+en*D, varargin{:}) ; 29 | fm = feval(func, x-en*D, varargin{:}) ; 30 | d(:,n,m) = (fm+fp-2*f00)/D2 ; 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_sampleinthist.m: -------------------------------------------------------------------------------- 1 | % VL_SAMPLINTHIST Sample integral histogram 2 | % HISTS = VL_SAMPLINTHIST(INTHIST, BOXES) samples the integral 3 | % histogram INTHIST to obtain the histograms of the specified 4 | % BOXES. 5 | % 6 | % INTHIST is a MxNxK array, where M x N are ``spatial'' dimensions, 7 | % and K is the number of histogram bins. INTHIST may be of class 8 | % UINT32 or DOUBLE. 9 | % 10 | % Each box is a four dimensional vector [IMIN JMIN IMAX JMAX]' of 11 | % class UINT32 and correspond to the index set [IMIN, IMAX] x [JMIN, 12 | % JMAX]. To specify an empty box, let IMIN > IMAX. 13 | % 14 | % HISTS stores one histogram per column (one for each box) and has K 15 | % rows, one for each histogram bin. HIST is of the same class of 16 | % INTHIST. 17 | % 18 | % See also: VL_INTHIST(), VL_IMINTEGRAL(), VL_HELP(). 19 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_simdctrl.c: -------------------------------------------------------------------------------- 1 | /** @file vl_simdctlr.c 2 | ** @brief vl_simdctrl MEX definition 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #include "mexutils.h" 15 | 16 | void 17 | mexFunction(int nout, mxArray *out[], 18 | int nin, const mxArray *in[]) 19 | { 20 | enum {IN_ENABLED = 0} ; 21 | enum {OUT_ENABLED = 0} ; 22 | 23 | vl_bool wasEnabled = vl_get_simd_enabled() ; 24 | 25 | if (nout > 1) { 26 | vlmxError(vlmxErrInvalidArgument, 27 | "at most one output argument") ; 28 | } 29 | 30 | OUT(ENABLED) = vlmxCreatePlainScalar (wasEnabled) ; 31 | 32 | if (nin == 0) { 33 | return ; 34 | } 35 | if (nin > 1) { 36 | vlmxError(vlmxErrInvalidArgument, 37 | "At most one argument") ; 38 | } 39 | if (!vlmxIsScalar(IN(ENABLED))) { 40 | vlmxError(vlmxErrInvalidArgument, 41 | "ENABLED must be a scalar") ; 42 | } 43 | 44 | vl_set_simd_enabled ((vl_bool) mxGetScalar(IN(ENABLED))) ; 45 | } 46 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_simdctrl.m: -------------------------------------------------------------------------------- 1 | % VL_SIMDCTRL Toggle VLFeat SIMD optimizations 2 | % VL_SIMDCTRL() returns TRUE if VLFeat SIMD optimizations are enabled 3 | % and FALSE otherwise. 4 | % 5 | % VL_SIMDCTRL(TRUE) enables VLFeat SIMD optimizations. VL_SIMDCTRL(FALSE) 6 | % disables them. 7 | % 8 | % See also: VL_HELP(). 9 | 10 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 11 | % All rights reserved. 12 | % 13 | % This file is part of the VLFeat library and is made available under 14 | % the terms of the BSD license (see the COPYING file). 15 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_svmpegasos.m: -------------------------------------------------------------------------------- 1 | % VL_SVMPEGASOS [deprecated] 2 | % VL_SVMPEGASOS is deprecated. Please use VL_SVMTRAIN() instead. 3 | 4 | 5 | 6 | function [w b info] = vl_svmpegasos(DATA,LAMBDA, varargin) 7 | 8 | % Verbose not supported 9 | if (sum(strcmpi('Verbose',varargin))) 10 | varargin(find(strcmpi('Verbose',varargin),1))=[]; 11 | fprintf('Option VERBOSE is no longer supported.\n'); 12 | end 13 | 14 | % DiagnosticCallRef not supported 15 | if (sum(strcmpi('DiagnosticCallRef',varargin))) 16 | varargin(find(strcmpi('DiagnosticCallRef',varargin),1)+1)=[]; 17 | varargin(find(strcmpi('DiagnosticCallRef',varargin),1))=[]; 18 | fprintf('Option DIAGNOSTICCALLREF is no longer supported.\n Please follow the VLFeat tutorial on SVMs for more information on diagnostics\n'); 19 | end 20 | 21 | % different default value for MaxIterations 22 | if (sum(strcmpi('MaxIterations',varargin)) == 0) 23 | varargin{end+1} = 'MaxIterations'; 24 | varargin{end+1} = ceil(10/LAMBDA); 25 | end 26 | 27 | % different default value for BiasMultiplier 28 | if (sum(strcmpi('BiasMultiplier',varargin)) == 0) 29 | varargin{end+1} = 'BiasMultiplier'; 30 | varargin{end+1} = 0; 31 | end 32 | 33 | [w b info] = vl_svmtrain(DATA,LAMBDA,varargin{:}); 34 | 35 | fprintf('\n vl_svmpegasos is DEPRECATED. Please use vl_svmtrain instead. \n\n'); 36 | 37 | end 38 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_threads.c: -------------------------------------------------------------------------------- 1 | /** @file vl_threads.c 2 | ** @brief vl_threads MEX definition 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2013 Andrea Vedaldi 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #include "mexutils.h" 15 | 16 | void 17 | mexFunction(int nout VL_UNUSED, mxArray *out[], 18 | int nin, const mxArray *in[]) 19 | { 20 | enum {IN_NUM = 0} ; 21 | enum {OUT_NUM = 0} ; 22 | vl_size numThreads ; 23 | 24 | numThreads = vl_get_max_threads() ; 25 | 26 | if (nout > 1) { 27 | vlmxError(vlmxErrInvalidArgument, "More than one ouptut argumnets requested.") ; 28 | } 29 | if (nin > 1) { 30 | vlmxError(vlmxErrInvalidArgument, "More than one input argument specified.") ; 31 | } 32 | 33 | 34 | OUT(NUM) = vlmxCreatePlainScalar (numThreads) ; 35 | 36 | if (nin == 0) { 37 | return ; 38 | } 39 | 40 | if (!vlmxIsScalar(IN(NUM))) { 41 | vlmxError(vlmxErrInvalidArgument, "NUM is not a scalar.") ; 42 | } 43 | 44 | numThreads = (vl_size) mxGetScalar(IN(NUM)) ; 45 | vl_set_num_threads (numThreads) ; 46 | } 47 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_threads.m: -------------------------------------------------------------------------------- 1 | %VL_THREADS Control VLFeat computational threads 2 | % [NUM,MAXNUM] = VL_THREADS() returns the current number of 3 | % computational threads NUM and the maximum possible number MAXNUM. 4 | % 5 | % VL_THREADS(NUM) sets the current number of threads to the 6 | % specified value. NUM = VL_THREADS(NUM) does the same, but returns 7 | % the *previous* number of computational threads as well. 8 | % 9 | % See also: VL_HELP(). 10 | 11 | % Copyright (C) 2013 Andrea Vedaldi. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_twister.m: -------------------------------------------------------------------------------- 1 | % VL_TWISTER Random number generator 2 | % VL_TWISTER() is essentially equivalent to MATLAB native RAND() 3 | % when using the Twister random number generator. VL_TWISTER(), 4 | % VL_TWISTER(M,N,P,...) and VL_TWISTER([M N P ...]) are equivalent 5 | % to RAND(), RAND(M,N,P,...) and RAND([M N P ...]) respectively. 6 | % 7 | % The state of the random generator can be seeded by 8 | % VL_TWISTER('STATE', X), where X is a DOUBLE scalar (this is 9 | % equivalent to RAND('TWISTER', X)). The state can be read by 10 | % VL_TWISTER('STATE') (equivalent to RAND('TWISTER')) and set by 11 | % VL_TWISTER('STATE', STATE) (equivalent to RAND('TWISTER', 12 | % STATE)). Here STATE is a vector of 625 elements of class 13 | % UINT32. Finally VL_TWISTER('STATE',KEY) seeds the generator by a 14 | % vector of DOUBLE of length not greater than 624. 15 | % 16 | % VL_TWISTER() is slightly faster than RAND(). Moreover it can be 17 | % used to control the state of the random number generator used by 18 | % all VLFEAT functions. 19 | % 20 | % See also: VL_HELP(). 21 | 22 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 23 | % All rights reserved. 24 | % 25 | % This file is part of the VLFeat library and is made available under 26 | % the terms of the BSD license (see the COPYING file). 27 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_version.m: -------------------------------------------------------------------------------- 1 | % VL_VERSION Obtain VLFeat version information 2 | % VL_VERSION() prints VLFeat version number. VL_VERSION('VERBOSE') 3 | % prints additional information. 4 | % 5 | % STR = VL_VERSION(...) returns the ouptut in a string rather than 6 | % printing it. 7 | % 8 | % See also: VL_HELP(). 9 | 10 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 11 | % All rights reserved. 12 | % 13 | % This file is part of the VLFeat library and is made available under 14 | % the terms of the BSD license (see the COPYING file). 15 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/misc/vl_whistc.m: -------------------------------------------------------------------------------- 1 | function h = vl_whistc(x, w, edges, dim) 2 | % VL_WHISTC Weighted histogram 3 | % H = VL_WHISTC(X,W,EDGES) behaves exactly like HISTC(X,EDGES), but 4 | % weights the samples X by W. Samples that have NaN weight are 5 | % skipped. 6 | % 7 | % See also: HITSC(), VL_HELP(). 8 | 9 | % Authors: Andrea Vedladi 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | numEdges = numel(edges) ; 18 | 19 | % map x to the bins defined by edges 20 | binIndexes = vl_binsearch(edges, x) ; 21 | 22 | % binsearch last bin is [edges(end) +inf] but for histc it is the 23 | % signleton [edges(end)] 24 | if numEdges > 0 25 | binIndexes(binIndexes == numEdges & x > edges(end)) = 0 ; 26 | end 27 | 28 | % NaNs must be also removed 29 | binIndexes(isnan(x)) = 0 ; 30 | 31 | % find operating dimension 32 | dimensions = size(x) ; 33 | if nargin < 4 34 | nonSingletonDims = find(dimensions > 1) ; 35 | if ~ isempty(nonSingletonDims) 36 | dim = nonSingletonDims(1) ; 37 | else 38 | dim = 2 ; % assume row vector 39 | end 40 | end 41 | 42 | % accumulate 43 | dimensions(dim) = numEdges ; 44 | h = zeros(dimensions) ; 45 | h = vl_binsum(h, w, binIndexes, dim) ; 46 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/mser/vl_erfill.m: -------------------------------------------------------------------------------- 1 | % VL_ERFILL Fill extremal region 2 | % MEMBERS=VL_ERFILL(I,ER) returns the list MEMBERS of the pixels which 3 | % belongs to the extremal region represented by the pixel ER. 4 | % 5 | % The selected region is the one that contains pixel ER and of 6 | % intensity I(ER). 7 | % 8 | % I must be of class UINT8 and ER must be a (scalar) index of the 9 | % region representative point. 10 | % 11 | % See also: VL_MSER(), VL_HELP(). 12 | 13 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 14 | % All rights reserved. 15 | % 16 | % This file is part of the VLFeat library and is made available under 17 | % the terms of the BSD license (see the COPYING file). 18 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/mser/vl_ertr.m: -------------------------------------------------------------------------------- 1 | function f = vl_ertr(f) ; 2 | % VL_ERTR Transpose exremal regions frames 3 | % F = VL_ERTR(F) transposes the frames F as returned by VL_MSER(). This 4 | % conversion is required as the VL_MSER algorithm considers the column 5 | % index I as the frist image index, while according standard image 6 | % convention the first coordinate is the abscissa X. 7 | % 8 | % See also: VL_MSER(), VL_HELP(). 9 | 10 | if size(f,1) ~= 5 11 | error('F is not in the right format') ; 12 | end 13 | 14 | % adjust convention 15 | f = f([2 1 5 4 3],:) ; 16 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_cf.m: -------------------------------------------------------------------------------- 1 | function h = vl_cf(h0) 2 | % VL_CF Creates a copy of a figure 3 | % VL_CF() creates a copy of the current figure and returns VL_CF(H0) 4 | % creates a copy of the figure(s) whose handle is H0. H = 5 | % VL_CF(...) returns the handles of the copies. 6 | % 7 | % See also: VL_HELP(). 8 | 9 | % Authors: Andrea Vedaldi 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | if nargin < 1 18 | h0 = gcf ; 19 | end 20 | 21 | h=zeros(size(h0)) ; 22 | for i=1:numel(h0) 23 | h(i) = copyobj(h0(i),get(h0(i),'Parent')) ; 24 | end 25 | 26 | if nargout < 1 27 | clear h ; 28 | end 29 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_clicksegment.m: -------------------------------------------------------------------------------- 1 | function [P1,P2] = vl_clicksegment 2 | % VL_CLICKSEGMENT Select a segment by clicking 3 | % [P1,P2] = VL_CLICKSEGMENT() lets the user select a segment in the 4 | % current figure and returns the starting and ending point P1 and P2. 5 | % 6 | % The user can abort the operation by pressing any key. In this case 7 | % the function returns the empty matrix. 8 | % 9 | % See also: VL_CLICK(), VL_CLICKPOINT(), VL_HELP(). 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | % Click first segment 18 | P1=vl_click ; 19 | if isempty(P1) 20 | P2=P1 ; 21 | return ; 22 | end 23 | 24 | was_hold = ishold(gca) ; 25 | hold on ; 26 | h=plot(P1(1),P1(2),'rx') ; 27 | 28 | % Click second segment 29 | P2=vl_click ; 30 | if isempty(P2) 31 | P1=P2 ; 32 | end 33 | delete(h) ; 34 | if ~was_hold, hold off ; end 35 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_figaspect.m: -------------------------------------------------------------------------------- 1 | function vl_figaspect(a) 2 | % VL_FIGASPECT Set figure aspect ratio 3 | % VL_FIGASPECT(A) sets the current figure aspect ratio to A. It 4 | % leaves the length of the shortest side unaltered. Both the 5 | % screen and paper positions are affected. 6 | % 7 | % See also: VL_PRINTSIZE(), VL_HELP(). 8 | 9 | % Authors: Andrea Vedaldi 10 | 11 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | pos = get(gcf, 'Position') ; 18 | 19 | if a >= 1 20 | pos(3) = a * pos(4) ; 21 | else 22 | pos(4) = pos(3) / a ; 23 | end 24 | 25 | set(gcf,'Position',pos) ; 26 | 27 | pos = get(gcf, 'PaperPosition') ; 28 | 29 | if a >= 1 30 | pos(3) = a * pos(4) ; 31 | else 32 | pos(4) = pos(3) / a ; 33 | end 34 | 35 | set(gcf,'PaperPosition', pos) ; 36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_linespec2prop.m: -------------------------------------------------------------------------------- 1 | function prop=vl_linespec2prop(spec) 2 | % VL_LINESPEC2PROP Convert PLOT style line specs to line properties 3 | % PROPR = VL_LINESPEC2PROP(SPEC) converts the string SPEC to a cell 4 | % array of properties PROPR. SPEC is in the format of PLOT(). 5 | % 6 | % If SPEC is not a line spec, the string SPEC is returned unaltered 7 | % as the only element of the cell array PROPR. 8 | % 9 | % See also: VL_PLOTFRAME(), PLOT(), VL_HELP(). 10 | 11 | % Authors: Andrea Vedaldi 12 | 13 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 14 | % Copyright (C) 2013 Andrea Vedaldi 15 | % All rights reserved. 16 | % 17 | % This file is part of the VLFeat library and is made available under 18 | % the terms of the BSD license (see the COPYING file). 19 | 20 | prop = {} ; 21 | 22 | if ~ ischar(spec) 23 | error('SPEC must be a string') ; 24 | end 25 | 26 | spec_ = spec ; 27 | 28 | switch spec(1:min(numel(spec),1)) 29 | case {'b' 'g' 'r' 'c' 'm' 'y' 'k' 'w'} 30 | prop = {prop{:}, 'Color', spec(1)} ; 31 | spec(1) = [] ; 32 | end 33 | 34 | switch spec(1:min(numel(spec),1)) 35 | case {'.' 'o' 'x' '+' '*' 's' 'd' 'v' '^' '<' '>' 'p' 'h'} 36 | prop = {prop{:}, 'Marker', spec(1)} ; 37 | spec(1) = [] ; 38 | end 39 | 40 | if isempty(spec) 41 | return ; 42 | end 43 | 44 | switch spec 45 | case {'-' ':' '-.' '--'} 46 | prop = {prop{:}, 'LineStyle', spec} ; 47 | otherwise 48 | prop = {spec_} ; 49 | end 50 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_plotgrid.m: -------------------------------------------------------------------------------- 1 | function h=vl_plotgrid(x,y,varargin) 2 | % VL_PLOTGRID Plot a 2-D grid 3 | % VL_PLOTGRID(X,Y) plots a grid with vertices (X,Y). X and Y are MxN 4 | % matrices, with one entry per vertex. 5 | % 6 | % H=VL_PLOTGRID(...) returns the handle to the grid object. 7 | % 8 | % See also: VL_HELP(). 9 | 10 | washold = ishold ; 11 | 12 | [M,N] = size(x) ; 13 | 14 | hold on ; 15 | 16 | xh = [x' ; nan*ones(1,M) ] ; 17 | yh = [y' ; nan*ones(1,M) ] ; 18 | 19 | xh = xh(:) ; 20 | yh = yh(:) ; 21 | 22 | xv = [x ; nan*ones(1,N) ] ; 23 | yv = [y ; nan*ones(1,N) ] ; 24 | 25 | xv = xv(:) ; 26 | yv = yv(:) ; 27 | 28 | lineprop = {} ; 29 | if length(varargin) > 0 30 | lineprop = vl_linespec2prop(varargin{1}) ; 31 | lineprop = {lineprop{:}, varargin{2:end}} ; 32 | end 33 | 34 | h = line([xh' xv'], [yh' yv'],lineprop{:}) ; 35 | 36 | if ~washold 37 | hold off ; 38 | end 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/plotop/vl_plotpoint.m: -------------------------------------------------------------------------------- 1 | function h=vl_plotpoint(V,varargin) 2 | % VL_PLOTPOINT Plot 2 or 3 dimensional points 3 | % VL_PLOTPOINT(V) plots the 2 or 3 dimensional points V. V is a 2xK or 4 | % 3xK array, with one point per column. 5 | % 6 | % H=VL_PLOTPOINT(...) returns the handle H of the plot. 7 | % 8 | % VL_PLOTPOINT() is a simple wrapper around the PLOT() and PLOT3() 9 | % functions. By default, VL_PLOTPOINT(V) plots the points with line 10 | % style '.'. VL_PLOTPOINT(V,...) does not use the default line style; 11 | % rather it passess any extra argument to the underlying plot 12 | % function. 13 | % 14 | % See also: PLOT(), PLOT3(), VL_HELP(). 15 | 16 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | if length(varargin) == 0 23 | varargin = {'.'}; 24 | end 25 | 26 | switch size(V,1) 27 | case 2 28 | h=plot(V(1,:),V(2,:),varargin{:}) ; 29 | case 3 30 | h=plot3(V(1,:),V(2,:),V(3,:),varargin{:}) ; 31 | otherwise 32 | error(['V must be either 2xK or 3xK.']) ; 33 | end 34 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/quickshift/vl_flatmap.m: -------------------------------------------------------------------------------- 1 | function [map, C] = vl_flatmap(map) 2 | % VL_FLATMAP Flatten a tree, assigning the label of the root to each node 3 | % [LABELS CLUSTERS] = VL_FLATMAP(MAP) labels each tree of the forest contained 4 | % in MAP. LABELS contains the linear index of the root node in MAP, CLUSTERS 5 | % instead contains a label between 1 and the number of clusters. 6 | % 7 | % See also: VL_HELP(). 8 | 9 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 10 | % All rights reserved. 11 | % 12 | % This file is part of the VLFeat library and is made available under 13 | % the terms of the BSD license (see the COPYING file). 14 | 15 | % follow the parents list to the root nodes (where nothing changes) 16 | while 1 17 | map_ = map(map) ; 18 | if isequal(map_,map) ; break ; end 19 | map = map_ ; 20 | end 21 | 22 | [drop,drop,C] = unique(map) ; 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/quickshift/vl_imseg.m: -------------------------------------------------------------------------------- 1 | function Q = vl_imseg(I,labels) 2 | % VL_IMSEG Color an image based on the segmentation 3 | % ISEG = VL_IMSEG(I,LABELS) labels ISEG with the average color from I of 4 | % each cluster indicated by LABELS. 5 | % 6 | % See also: VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | [M,N,K] = size(I) ; 15 | Q = 0*I ; 16 | for k=1:size(I,3) 17 | acc = zeros(M,N) ; 18 | nrm = zeros(M,N) ; 19 | acc = vl_binsum(acc, I(:,:,k), labels) ; 20 | nrm = vl_binsum(nrm, ones(M,N), labels) ; 21 | acc = acc ./ (nrm+eps) ; 22 | Q(:,:,k) = acc(labels) ; 23 | end 24 | 25 | Q = min(1,Q); 26 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/sift/vl_liop.m: -------------------------------------------------------------------------------- 1 | % VL_LIOP Local Intensity Order Pattern descriptor 2 | % D = VL_LIOP(I) computes the LIOP descriptor of an image I, as 3 | % described by [1]. I is a gray-scale square image with odd side 4 | % length of class SINGLE. D is a column vector containing the LIOP 5 | % descriptor of I. Note that LIOP is also integrated in the VL_COVDET() 6 | % function for feature extraction. 7 | % 8 | % VL_LIOP() accepts the following options: 9 | % 10 | % NumNeighbours:: 4 11 | % Set the number of neighbours sampled to consruct the orer 12 | % pattern of each image pixel. 13 | % 14 | % Radius:: 5 15 | % Set the radius of the circular neighbourhood used to sampled 16 | % the local order pattern of each pixel. 17 | % 18 | % NumSpatialBins:: 6 19 | % Set the number of spatial pooling regions. The LIOP descriptor 20 | % has dimension factorial(NumNeighbours) * NumSpatialBins. 21 | % 22 | % IntensityThreshold:: -0.02 23 | % Set the intensity threshold used to weight oder patterns as they 24 | % are pooled into a histogram. A negative value is interpreted 25 | % as a fraction of the difference between the maximum and minimum 26 | % intesity in each local patch. 27 | % 28 | % Verbose:: 29 | % If specified, be verbose 30 | % 31 | % REFERENCES:: 32 | % [1] Z. Wang, B. Fan, F. Wu. Local Intensity Order Pattern for feature 33 | % description. In ICCV, 2011 34 | % 35 | % See: LIOP, VL_COVDET(), 36 | % VL_HELP(). 37 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/sift/vl_ubcmatch.m: -------------------------------------------------------------------------------- 1 | % VL_UBCMATCH Match SIFT features 2 | % MATCHES = VL_UBCMATCH(DESCR1, DESCR2) matches the two sets of SIFT 3 | % descriptors DESCR1 and DESCR2. 4 | % 5 | % [MATCHES,SCORES] = VL_UBCMATCH(DESCR1, DESCR2) retuns the matches and 6 | % also the squared Euclidean distance between the matches. 7 | % 8 | % The function uses the algorithm suggested by D. Lowe [1] to reject 9 | % matches that are too ambiguous. 10 | % 11 | % VL_UBCMATCH(DESCR1, DESCR2, THRESH) uses the specified threshold 12 | % THRESH. A descriptor D1 is matched to a descriptor D2 only if the 13 | % distance d(D1,D2) multiplied by THRESH is not greater than the 14 | % distance of D1 to all other descriptors. The default value of 15 | % THRESH is 1.5. 16 | % 17 | % The storage class of the descriptors can be either DOUBLE, FLOAT, 18 | % INT8 or UINT8. Usually integer classes are faster. 19 | % 20 | % REFERENCES:: 21 | % [1] D. G. Lowe, Distinctive image features from scale-invariant 22 | % keypoints. IJCV, vol. 2, no. 60, pp. 91-110, 2004. 23 | % 24 | % See also: VL_HELP(), VL_SIFT(). 25 | 26 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 27 | % All rights reserved. 28 | % 29 | % This file is part of the VLFeat library and is made available under 30 | % the terms of the BSD license (see the COPYING file). 31 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/slic/vl_slic.m: -------------------------------------------------------------------------------- 1 | % VL_SLIC SLIC superpixels 2 | % SEGMENTS = VL_SLIC(IM, REGIONSIZE, REGULARIZER) extracts the SLIC 3 | % superpixes [1] from image IM. REGIONSIZE is the starting size of 4 | % the superpixels and REGULARIZER is the trades-off appearance for 5 | % spatial regularity when clustering (a larger value results in more 6 | % spatial regularization). SEGMENTS is a UINT32 array containing the 7 | % superpixel identifier for each image pixel. 8 | % 9 | % The image IM is a SINGLE array with two or three dimensions. The 10 | % third dimension is arbitrary, but it is usually three for RGB or 11 | % LAB images. 12 | % 13 | % VL_SLIC() accepts the following options: 14 | % 15 | % Verbose:: 16 | % Be verbose. 17 | % 18 | % MinRegionSize:: (1/6 of REGIONSIZE)^2 19 | % The minimum size (in pixel area) of the extracted 20 | % superpixels. 21 | % 22 | % Example:: 23 | % If IM contains an RGB images, the SLIC superpixels can be 24 | % extracted as: 25 | % 26 | % REFERENCES:: 27 | % [1] R. Achanta, A. Shaji, K. Smith, A. Lucchi, P. Fua, and 28 | % S. Susstrunk. SLIC superpixels. Technical report, EPFL, 2010. 29 | % 30 | % See also:: http://www.vlfeat.org/doc/api/slic.html, VL_HELP(). 31 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_ddgaussian.m: -------------------------------------------------------------------------------- 1 | function y = vl_ddgaussian(x) 2 | % VL_DDGAUSSIAN Second derivative of the Gaussian density function 3 | % Y=VL_DDGAUSSIAN(X) computes the second derivative of the standard 4 | % Gaussian density. 5 | % 6 | % To obtain the second derivative of the Gaussian density of 7 | % standard deviation S, do 8 | % 9 | % Y = 1/S^3 * VL_DDGAUSSIAN(X/S) . 10 | % 11 | % See also: VL_GAUSSIAN(), VL_DGAUSSIAN(), VL_HELP(). 12 | 13 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 14 | % All rights reserved. 15 | % 16 | % This file is part of the VLFeat library and is made available under 17 | % the terms of the BSD license (see the COPYING file). 18 | 19 | y = (x.^2 - 1)/sqrt(2*pi) .* exp(-0.5*x.^2) ; 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_dgaussian.m: -------------------------------------------------------------------------------- 1 | function y = vl_dgaussian(x) 2 | % VL_DGAUSSIAN Derivative of the Gaussian density function 3 | % Y=VL_DGAUSSIAN(X) evaluates the derivative of the standard Gaussian 4 | % density. 5 | % 6 | % To obtain the Gaussian density of standard deviation S, do 7 | % 8 | % Y = 1/S^2 * VL_DGAUSSIAN(X/S) . 9 | % 10 | % See also: VL_GAUSSIAN(), VL_DDGAUSSIAN(), VL_HELP(). 11 | 12 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 13 | % All rights reserved. 14 | % 15 | % This file is part of the VLFeat library and is made available under 16 | % the terms of the BSD license (see the COPYING file). 17 | 18 | y = -x/sqrt(2*pi) .* exp(-0.5*x.^2) ; 19 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_dsigmoid.m: -------------------------------------------------------------------------------- 1 | function y = vl_dsigmoid(x) 2 | % VL_DSIGMOID Derivative of the sigmoid function 3 | % Y = VL_DSIGMOID(X) returns the derivative of VL_SIGMOID(X). This is 4 | % calculated as - VL_SIGMOID(X) * (1 - VL_SIGMOID(X)). 5 | % 6 | % See also: VL_SIGMOID(X), VL_HELP(). 7 | 8 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 9 | % All rights reserved. 10 | % 11 | % This file is part of the VLFeat library and is made available under 12 | % the terms of the BSD license (see the COPYING file). 13 | 14 | t = vl_sigmoid(x) ; 15 | y = t .* (1 - t) ; 16 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_gaussian.m: -------------------------------------------------------------------------------- 1 | function y = vl_gaussian(x) 2 | % VL_GAUSSIAN Standard Gaussian density function 3 | % Y=VL_GAUSSIAN(X) computes the standard (zero mean, unit variance) 4 | % Gaussian density. 5 | % 6 | % To obtain the Gaussian density of standard deviation S do 7 | % 8 | % Y = 1/S * VL_GAUSSIAN(X/S). 9 | % 10 | % See also: VL_DGAUSSIAN(), VL_DDGAUSSIAN(), VL_HELP(). 11 | 12 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 13 | % All rights reserved. 14 | % 15 | % This file is part of the VLFeat library and is made available under 16 | % the terms of the BSD license (see the COPYING file). 17 | 18 | y = 1/sqrt(2*pi)*exp(-0.5*x.^2) ; 19 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_rcos.m: -------------------------------------------------------------------------------- 1 | function y = vl_rcos(r,x) 2 | % VL_RCOS RCOS function 3 | % Y = VL_RCOS(R,X) computes the RCOS function with roll-off R. 4 | % 5 | % See also: VL_HELP(). 6 | 7 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | % All rights reserved. 9 | % 10 | % This file is part of the VLFeat library and is made available under 11 | % the terms of the BSD license (see the COPYING file). 12 | 13 | x = abs(x) ; 14 | if(r > 0) 15 | y = (x < (1 - r)) + ... 16 | 0.5 * (1 + cos((1 - r - x)/r*pi)) .* ... 17 | (x <= 1) .* (x >= 1 - r) ; 18 | else 19 | y = (abs(x) <= 1) ; 20 | end 21 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/special/vl_sigmoid.m: -------------------------------------------------------------------------------- 1 | function y = vl_sigmoid(x) 2 | % VL_SIGMOID Sigmoid function 3 | % Y = VL_SIGMOID(X) returns 4 | % 5 | % Y = 1 ./ (1 + EXP(X)) ; 6 | % 7 | % Remark:: 8 | % Useful properties of the sigmoid function are: 9 | % 10 | % - 1 - VL_SIGMOID(X) = VL_SIGMOID(-X) 11 | % - Centered sigmoid: 2 * VL_SIGMOID(X) - 1 ; 12 | % - VL_SIGMOID(X) = (EXP(X/2) - EXP(X/2)) / (EXP(X/2) + EXP(X/2)) 13 | % 14 | % See also: VL_DSIGMOID(), VL_HELP(). 15 | 16 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | y = 1 ./ (1 + exp(-x)) ; 23 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/vl_demo.m: -------------------------------------------------------------------------------- 1 | function vl_demo 2 | % VL_DEMO Run VLFeat demos 3 | % VL_DEMO runs all VLFeat demos in a row, exporting figures for 4 | % the documentation. Edit this file to see a list of the vailable 5 | % demos, or look into the toolbox/demo directory. 6 | 7 | % Author: Andrea Vedaldi 8 | 9 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 10 | % All rights reserved. 11 | % 12 | % This file is part of the VLFeat library and is made available under 13 | % the terms of the BSD license (see the COPYING file). 14 | 15 | if vl_isoctave() 16 | more off ; 17 | end 18 | 19 | root = vl_root ; 20 | demo_path = fullfile(root,'toolbox','demo') ; 21 | addpath(demo_path) ; 22 | 23 | vl_demo_frame ; 24 | vl_demo_covdet ; 25 | 26 | vl_demo_sift_basic ; 27 | vl_demo_sift_peak ; 28 | vl_demo_sift_edge ; 29 | %vl_demo_sift_cmd ; 30 | vl_demo_sift_or ; 31 | vl_demo_sift_match ; 32 | vl_demo_sift_vs_ubc ; 33 | 34 | vl_demo_mser_basic ; 35 | vl_demo_mser_delta ; 36 | %vl_demo_mser_cmd ; 37 | 38 | vl_demo_aib ; 39 | vl_demo_quickshift ; 40 | vl_demo_slic ; 41 | vl_demo_dsift ; 42 | vl_demo_hog ; 43 | 44 | vl_demo_svm ; 45 | 46 | vl_demo_kdtree ; 47 | vl_demo_kdtree_sift ; 48 | vl_demo_kdtree_self ; 49 | vl_demo_kdtree_forest ; 50 | vl_demo_kdtree_ann ; 51 | 52 | vl_demo_kmeans_2d ; 53 | 54 | vl_demo_imdisttf ; 55 | 56 | vl_demo_plots_rank ; 57 | 58 | vl_demo_gmm_2d_rand; 59 | vl_demo_gmm_2d_twist; 60 | vl_demo_gmm_3d; 61 | 62 | vl_demo_kmeans_ann_speed; 63 | 64 | rmpath(demo_path); 65 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/vl_root.m: -------------------------------------------------------------------------------- 1 | function path = vl_root 2 | % VL_ROOT Obtain VLFeat root path 3 | % PATH = VL_ROOT() returns the path to the VLFeat installation. 4 | % 5 | % See also: VL_SETUP(), VL_HELP(). 6 | 7 | % Authors: Andrea Vedaldi and Brian Fulkerson 8 | 9 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 10 | % All rights reserved. 11 | % 12 | % This file is part of the VLFeat library and is made available under 13 | % the terms of the BSD license (see the COPYING file). 14 | 15 | [a,b,c] = fileparts(mfilename('fullpath')) ; 16 | [a,b,c] = fileparts(a) ; 17 | path = a ; 18 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_assert_almost_equal.m: -------------------------------------------------------------------------------- 1 | function vl_assert_almost_equal(x, y, varargin) 2 | epsilon = 1e-6 ; 3 | if length(varargin) > 0 4 | if isnumeric(varargin{1}) 5 | epsilon = varargin{1} ; 6 | varargin(1) = [] ; 7 | end 8 | end 9 | assert(isequal(class(x), class(y)), varargin{:}) ; 10 | assert(isequal(size(x), size(y)), varargin{:}) ; 11 | if isstruct(x) 12 | fx = fieldnames(x) ; 13 | fy = fieldnames(y) ; 14 | assert(isequal(fx,fy), varargin{:}) ; 15 | for i=1:numel(fx) 16 | vl_assert_almost_equal(x.(fx{i}), y.(fy{i}), epsilon, varargin{:}) ; 17 | end 18 | else 19 | i = isnan(x) ; 20 | j = isnan(y) ; 21 | assert(isequal(i,j), varargin{:}) ; 22 | assert(max(abs(x(~i) - y(~i))) < epsilon, varargin{:}) ; 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_assert_equal.m: -------------------------------------------------------------------------------- 1 | function vl_assert_equal(x, y, varargin) 2 | assert(isequalwithequalnans(x,y),varargin{:}) ; 3 | end 4 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_assert_exception.m: -------------------------------------------------------------------------------- 1 | function vl_assert_exception(func, errorId, errorMessage) 2 | % VL_ASSERT_EXCEPTION 3 | 4 | try 5 | func() ; 6 | catch 7 | e = lasterror ; 8 | if nargin >= 2 9 | assert(isequal(e.identifier, errorId), ... 10 | 'Exception ID ''%s'' is not ''%s''.', ... 11 | e.identifier, errorId) ; 12 | end 13 | if nargin >= 3 14 | assert(isequal(e.message, errorMessage), ... 15 | 'Exception message ''%s'' is not ''%s''.', ... 16 | e.message, errorMessage) ; 17 | end 18 | return ; 19 | end 20 | assert(0, 'The function did not generate an exception.') ; 21 | end 22 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_aib.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_aib(varargin) 2 | % VL_TEST_AIB 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s = [] ; 7 | 8 | function test_basic(s) 9 | Pcx = [.3 .3 0 0 10 | 0 0 .2 .2] ; 11 | 12 | % This results in the AIB tree 13 | % 14 | % 1 - \ 15 | % 5 - \ 16 | % 2 - / \ 17 | % - 7 18 | % 3 - \ / 19 | % 6 - / 20 | % 4 - / 21 | % 22 | % coded by the map [5 5 6 6 7 1] (1 denotes the root). 23 | 24 | [parents,cost] = vl_aib(Pcx) ; 25 | vl_assert_equal(parents, [5 5 6 6 7 7 1]) ; 26 | vl_assert_almost_equal(mi(Pcx)*[1 1 1], cost(1:3), 1e-3) ; 27 | 28 | [cut,map,short] = vl_aibcut(parents,2) ; 29 | vl_assert_equal(cut, [5 6]) ; 30 | vl_assert_equal(map, [1 1 2 2 1 2 0]) ; 31 | vl_assert_equal(short, [5 5 6 6 5 6 7]) ; 32 | 33 | function test_cluster_null(s) 34 | Pcx = [.5 .5 0 0 35 | 0 0 0 0] ; 36 | 37 | % This results in the AIB tree 38 | % 39 | % 1 - \ 40 | % 5 41 | % 2 - / 42 | % 43 | % 3 x 44 | % 45 | % 4 x 46 | % 47 | % If ClusterNull is specified, the values 3 and 4 48 | % which have zero probability are merged first 49 | % 50 | % 1 ----------\ 51 | % 7 52 | % 2 ----- \ / 53 | % 6-/ 54 | % 3 -\ / 55 | % 5 -/ 56 | % 4 -/ 57 | 58 | parents1 = vl_aib(Pcx) ; 59 | parents2 = vl_aib(Pcx,'ClusterNull') ; 60 | vl_assert_equal(parents1, [5 5 0 0 1 0 0]) ; 61 | vl_assert_equal(parents2(3), parents2(4)) ; 62 | 63 | function x = mi(P) 64 | % mutual information 65 | P1 = sum(P,1) ; 66 | P2 = sum(P,2) ; 67 | x = sum(sum(P .* log(max(P,1e-10) ./ (P2*P1)))) ; 68 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_argparse.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_argparse(varargin) 2 | % VL_TEST_ARGPARSE 3 | vl_test_init ; 4 | 5 | function test_basic() 6 | opts.field1 = 1 ; 7 | opts.field2 = 2 ; 8 | opts.field3 = 3 ; 9 | 10 | opts_ = opts ; 11 | opts_.field1 = 3 ; 12 | opts_.field2 = 10 ; 13 | 14 | opts = vl_argparse(opts, {'field2', 10, 'field1', 3}) ; 15 | assert(isequal(opts, opts_)) ; 16 | 17 | opts_.field1 = 9 ; 18 | opts = vl_argparse(opts, {'field1', 4, 'field1', 9}) ; 19 | assert(isequal(opts, opts_)) ; 20 | 21 | function test_error() 22 | opts.field1 = 1 ; 23 | try 24 | opts = vl_argparse(opts, {'field2', 5}) ; 25 | catch e 26 | return ; 27 | end 28 | assert(false) ; 29 | 30 | function test_leftovers() 31 | opts1.field1 = 1 ; 32 | opts2.field2 = 1 ; 33 | opts1_.field1 = 2 ; 34 | opts2_.field2 = 2 ; 35 | 36 | [opts1,args] = vl_argparse(opts1, {'field1', 2, 'field2', 2}) ; 37 | opts2 = vl_argparse(opts2, args) ; 38 | 39 | assert(isequal(opts1,opts1_), isequal(opts2,opts2_)) ; 40 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_binsearch.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_binsearch(varargin) 2 | % VL_TEST_BINSEARCH 3 | vl_test_init ; 4 | 5 | function test_inf_bins() 6 | x = [-inf -1 0 1 +inf] ; 7 | vl_assert_equal(vl_binsearch([], x), [0 0 0 0 0]) ; 8 | vl_assert_equal(vl_binsearch([-inf 0], x), [1 1 2 2 2]) ; 9 | vl_assert_equal(vl_binsearch([-inf], x), [1 1 1 1 1]) ; 10 | vl_assert_equal(vl_binsearch([-inf +inf], x), [1 1 1 1 2]) ; 11 | 12 | function test_empty() 13 | vl_assert_equal(vl_binsearch([], []), []) ; 14 | 15 | function test_bnd() 16 | vl_assert_equal(vl_binsearch([], [1]), [0]) ; 17 | vl_assert_equal(vl_binsearch([], [-inf]), [0]) ; 18 | vl_assert_equal(vl_binsearch([], [+inf]), [0]) ; 19 | 20 | vl_assert_equal(vl_binsearch([1], [.9]), [0]) ; 21 | vl_assert_equal(vl_binsearch([1], [1]), [1]) ; 22 | vl_assert_equal(vl_binsearch([1], [-inf]), [0]) ; 23 | vl_assert_equal(vl_binsearch([1], [+inf]), [1]) ; 24 | 25 | function test_basic() 26 | vl_assert_equal(vl_binsearch(-10:10, -10:10), 1:21) ; 27 | vl_assert_equal(vl_binsearch(-10:10, -11:10), 0:21) ; 28 | vl_assert_equal(vl_binsearch(-10:10, [-inf, -11:10, +inf]), [0 0:21 21]) ; 29 | 30 | function test_frac() 31 | vl_assert_equal(vl_binsearch(1:10, 1:.5:10), floor(1:.5:10)) 32 | vl_assert_equal(vl_binsearch(1:10, fliplr(1:.5:10)), ... 33 | fliplr(floor(1:.5:10))) ; 34 | 35 | function test_array() 36 | a = reshape(1:100,10,10) ; 37 | b = reshape(1:.5:100.5, 2, []) ; 38 | c = floor(b) ; 39 | vl_assert_equal(vl_binsearch(a,b), c) ; 40 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_binsum.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_binsum(varargin) 2 | % VL_TEST_BINSUM 3 | vl_test_init ; 4 | 5 | function test_three_args() 6 | vl_assert_almost_equal(... 7 | vl_binsum([0 0], 1, 2), [0 1]) ; 8 | vl_assert_almost_equal(... 9 | vl_binsum([1 7], -1, 1), [0 7]) ; 10 | vl_assert_almost_equal(... 11 | vl_binsum([1 7], -1, [1 2 2 2 2 2 2 2]), [0 0]) ; 12 | 13 | function test_four_args() 14 | vl_assert_almost_equal(... 15 | vl_binsum(eye(3), [1 1 1], [1 2 3], 1), 2*eye(3)) ; 16 | vl_assert_almost_equal(... 17 | vl_binsum(eye(3), [1 1 1]', [1 2 3]', 2), 2*eye(3)) ; 18 | vl_assert_almost_equal(... 19 | vl_binsum(eye(3), 1, [1 2 3], 1), 2*eye(3)) ; 20 | vl_assert_almost_equal(... 21 | vl_binsum(eye(3), 1, [1 2 3]', 2), 2*eye(3)) ; 22 | 23 | function test_3d_one() 24 | Z = zeros(3,3,3) ; 25 | B = 3*ones(3,1,3) ; 26 | R = Z ; R(:,3,:) = 17 ; 27 | vl_assert_almost_equal(... 28 | vl_binsum(Z, 17, B, 2), R) ; 29 | 30 | function test_3d_two() 31 | Z = zeros(3,3,3) ; 32 | B = 3*ones(3,3,1) ; 33 | X = zeros(3,3,1) ; X(:,:,1) = 17 ; 34 | R = Z ; R(:,:,3) = 17 ; 35 | vl_assert_almost_equal(... 36 | vl_binsum(Z, X, B, 3), R) ; 37 | 38 | function test_storage_classes() 39 | types = {@double, @single, ... 40 | @int32, @uint32, ... 41 | @int16, @uint16, ... 42 | @int8, @uint8} ; 43 | if vl_matlabversion() > 71000 44 | types = horzcat(types, {@int64, @uint64}) ; 45 | end 46 | for a = types 47 | a = a{1} ; 48 | for b = types 49 | b = b{1} ; 50 | vl_assert_almost_equal(... 51 | vl_binsum(a(eye(3)), a([1 1 1]), b([1 2 3]), 1), a(2*eye(3))) ; 52 | end 53 | end 54 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_colsubset.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_colsubset(varargin) 2 | % VL_TEST_COLSUBSET 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.x = [5 2 3 6 4 7 1 9 8 0] ; 7 | 8 | function test_beginning(s) 9 | vl_assert_equal(1:5, vl_colsubset(1:10, 5, 'beginning')) ; 10 | vl_assert_equal(1:5, vl_colsubset(1:10, .5, 'beginning')) ; 11 | 12 | function test_ending(s) 13 | vl_assert_equal(6:10, vl_colsubset(1:10, 5, 'ending')) ; 14 | vl_assert_equal(6:10, vl_colsubset(1:10, .5, 'ending')) ; 15 | 16 | function test_largest(s) 17 | vl_assert_equal([5 6 7 9 8], vl_colsubset(s.x, 5, 'largest')) ; 18 | vl_assert_equal([5 6 7 9 8], vl_colsubset(s.x, .5, 'largest')) ; 19 | 20 | function test_smallest(s) 21 | vl_assert_equal([2 3 4 1 0], vl_colsubset(s.x, 5, 'smallest')) ; 22 | vl_assert_equal([2 3 4 1 0], vl_colsubset(s.x, .5, 'smallest')) ; 23 | 24 | function test_random(s) 25 | assert(numel(intersect(s.x, vl_colsubset(s.x, 5, 'random'))) == 5) ; 26 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_cummax.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_cummax(varargin) 2 | % VL_TEST_CUMMAX 3 | vl_test_init ; 4 | 5 | function test_basic() 6 | vl_assert_almost_equal(... 7 | vl_cummax(1), 1) ; 8 | vl_assert_almost_equal(... 9 | vl_cummax([1 2 3 4], 2), [1 2 3 4]) ; 10 | 11 | function test_multidim() 12 | a = [1 2 3 4 3 2 1] ; 13 | b = [1 2 3 4 4 4 4] ; 14 | for k=1:6 15 | dims = ones(1,6) ; 16 | dims(k) = numel(a) ; 17 | a = reshape(a, dims) ; 18 | b = reshape(b, dims) ; 19 | vl_assert_almost_equal(... 20 | vl_cummax(a, k), b) ; 21 | end 22 | 23 | function test_storage_classes() 24 | types = {@double, @single, ... 25 | @int32, @uint32, ... 26 | @int16, @uint16, ... 27 | @int8, @uint8} ; 28 | if vl_matlabversion() > 71000 29 | types = horzcat(types, {@int64, @uint64}) ; 30 | end 31 | for a = types 32 | a = a{1} ; 33 | for b = types 34 | b = b{1} ; 35 | vl_assert_almost_equal(... 36 | vl_cummax(a(eye(3))), a(toeplitz([1 1 1], [1 0 0 ]))) ; 37 | end 38 | end 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_gmm.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_gmm(varargin) 2 | % VL_TEST_GMM 3 | 4 | % Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 5 | % All rights reserved. 6 | % 7 | % This file is part of the VLFeat library and is made available under 8 | % the terms of the BSD license (see the COPYING file). 9 | 10 | vl_test_init ; 11 | 12 | end 13 | 14 | function s = setup() 15 | randn('state',0) ; 16 | s.X = randn(128, 1000) ; 17 | end 18 | 19 | function test_multithreading(s) 20 | dataTypes = {'single','double'} ; 21 | 22 | for dataType = dataTypes 23 | conversion = str2func(char(dataType)) ; 24 | X = conversion(s.X) ; 25 | vl_twister('state',0) ; 26 | vl_threads(0) ; 27 | [means, covariances, priors, ll, posteriors] = ... 28 | vl_gmm(X, 10, ... 29 | 'NumRepetitions', 1, ... 30 | 'MaxNumIterations', 10, ... 31 | 'Initialization', 'rand') ; 32 | vl_twister('state',0) ; 33 | vl_threads(1) ; 34 | [means_, covariances_, priors_, ll_, posteriors_] = ... 35 | vl_gmm(X, 10, ... 36 | 'NumRepetitions', 1, ... 37 | 'MaxNumIterations', 10, ... 38 | 'Initialization', 'rand') ; 39 | 40 | vl_assert_almost_equal(means, means_, 1e-2) ; 41 | vl_assert_almost_equal(covariances, covariances_, 1e-2) ; 42 | vl_assert_almost_equal(priors, priors_, 1e-2) ; 43 | vl_assert_almost_equal(ll, ll_, 1e-2 * abs(ll)) ; 44 | vl_assert_almost_equal(posteriors, posteriors_, 1e-2) ; 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_grad.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_grad(varargin) 2 | % VL_TEST_GRAD 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.I = rand(150,253) ; 7 | s.I_small = rand(2,2) ; 8 | 9 | function test_equiv(s) 10 | vl_assert_equal(gradient(s.I), vl_grad(s.I)) ; 11 | 12 | function test_equiv_small(s) 13 | vl_assert_equal(gradient(s.I_small), vl_grad(s.I_small)) ; 14 | 15 | function test_equiv_forward(s) 16 | Ix = diff(s.I,2,1) ; 17 | Iy = diff(s.I,2,1) ; 18 | 19 | vl_assert_equal(gradient(s.I_small), vl_grad(s.I_small)) ; 20 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_hikmeans.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_hikmeans(varargin) 2 | % VL_TEST_IKMEANS 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | rand('state',0) ; 7 | s.data = uint8(rand(2,1000) * 255) ; 8 | 9 | function test_basic(s) 10 | [tree, assign] = vl_hikmeans(s.data,3,100) ; 11 | assign_ = vl_hikmeanspush(tree, s.data) ; 12 | vl_assert_equal(assign,assign_) ; 13 | 14 | function test_elkan(s) 15 | [tree, assign] = vl_hikmeans(s.data,3,100,'method','elkan') ; 16 | assign_ = vl_hikmeanspush(tree, s.data) ; 17 | vl_assert_equal(assign,assign_) ; 18 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_ihashsum.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_ihashsum(varargin) 2 | % VL_TEST_IHASHSUM 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | rand('state',0) ; 7 | s.data = uint8(round(16*rand(2,100))) ; 8 | sel = find(all(s.data==0)) ; 9 | s.data(1,sel)=1 ; 10 | 11 | function test_hash(s) 12 | D = size(s.data,1) ; 13 | K = 5 ; 14 | h = zeros(1,K,'uint32') ; 15 | id = zeros(D,K,'uint8'); 16 | next = zeros(1,K,'uint32') ; 17 | [h,id,next] = vl_ihashsum(h,id,next,K,s.data) ; 18 | 19 | sel = vl_ihashfind(id,next,K,s.data) ; 20 | count = double(h(sel)) ; 21 | 22 | [drop,i,j] = unique(s.data','rows') ; 23 | for k=1:size(s.data,2) 24 | count_(k) = sum(j == j(k)) ; 25 | end 26 | vl_assert_equal(count,count_) ; 27 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_ikmeans.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_ikmeans(varargin) 2 | % VL_TEST_IKMEANS 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | rand('state',0) ; 7 | s.data = uint8(rand(2,1000) * 255) ; 8 | 9 | function test_basic(s) 10 | [centers, assign] = vl_ikmeans(s.data,100) ; 11 | assign_ = vl_ikmeanspush(s.data, centers) ; 12 | vl_assert_equal(assign,assign_) ; 13 | 14 | function test_elkan(s) 15 | [centers, assign] = vl_ikmeans(s.data,100,'method','elkan') ; 16 | assign_ = vl_ikmeanspush(s.data, centers) ; 17 | vl_assert_equal(assign,assign_) ; 18 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_imarray.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_imarray(varargin) 2 | % VL_TEST_IMARRAY 3 | vl_test_init ; 4 | 5 | function test_movie_rgb(s) 6 | A = rand(23,15,3,4) ; 7 | B = vl_imarray(A,'movie',true) ; 8 | 9 | function test_movie_indexed(s) 10 | cmap = get(0,'DefaultFigureColormap') ; 11 | A = uint8(size(cmap,1)*rand(23,15,4)) ; 12 | A = min(A,size(cmap,1)-1) ; 13 | B = vl_imarray(A,'movie',true) ; 14 | 15 | function test_movie_gray_indexed(s) 16 | A = uint8(255*rand(23,15,4)) ; 17 | B = vl_imarray(A,'movie',true,'cmap',gray(256)) ; 18 | 19 | for k=1:size(A,3) 20 | vl_assert_equal(squeeze(A(:,:,k)), ... 21 | frame2im(B(k))) ; 22 | end 23 | 24 | function test_basic(s) 25 | M = 3 ; 26 | N = 4 ; 27 | width = 32 ; 28 | height = 15 ; 29 | for i=1:M 30 | for j=1:N 31 | A{i,j} = rand(width,height) ; 32 | end 33 | end 34 | A1 = A'; 35 | A1 = cat(3,A1{:}) ; 36 | A2 = cell2mat(A) ; 37 | B = vl_imarray(A1, 'layout', [M N]) ; 38 | vl_assert_equal(A2,B) ; 39 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_imintegral.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_imintegral(varargin) 2 | % VL_TEST_IMINTEGRAL 3 | vl_test_init ; 4 | 5 | function state = setup() 6 | state.I = ones(5,6) ; 7 | state.correct = [ 1 2 3 4 5 6 ; 8 | 2 4 6 8 10 12 ; 9 | 3 6 9 12 15 18 ; 10 | 4 8 12 16 20 24 ; 11 | 5 10 15 20 25 30 ; ] ; 12 | 13 | function test_matlab_equivalent(s) 14 | vl_assert_equal(slow_imintegral(s.I), s.correct) ; 15 | 16 | function test_basic(s) 17 | vl_assert_equal(vl_imintegral(s.I), s.correct) ; 18 | 19 | function test_multi_dimensional(s) 20 | vl_assert_equal(vl_imintegral(repmat(s.I, [1 1 3])), ... 21 | repmat(s.correct, [1 1 3])) ; 22 | 23 | function test_random(s) 24 | numTests = 50 ; 25 | for i = 1:numTests 26 | I = rand(5) ; 27 | vl_assert_almost_equal(vl_imintegral(s.I), ... 28 | slow_imintegral(s.I)) ; 29 | end 30 | 31 | function test_datatypes(s) 32 | vl_assert_equal(single(vl_imintegral(s.I)), single(s.correct)) ; 33 | vl_assert_equal(double(vl_imintegral(s.I)), double(s.correct)) ; 34 | vl_assert_equal(uint32(vl_imintegral(s.I)), uint32(s.correct)) ; 35 | vl_assert_equal(int32(vl_imintegral(s.I)), int32(s.correct)) ; 36 | vl_assert_equal(int32(vl_imintegral(-s.I)), -int32(s.correct)) ; 37 | 38 | function integral = slow_imintegral(I) 39 | integral = zeros(size(I)); 40 | for k = 1:size(I,3) 41 | for r = 1:size(I,1) 42 | for c = 1:size(I,2) 43 | integral(r,c,k) = sum(sum(I(1:r,1:c,k))); 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_imwbackward.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_imwbackward(varargin) 2 | % VL_TEST_IMWBACKWARD 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ; 7 | 8 | function test_identity(s) 9 | xr = 1:size(s.I,2) ; 10 | yr = 1:size(s.I,1) ; 11 | [x,y] = meshgrid(xr,yr) ; 12 | vl_assert_almost_equal(s.I, vl_imwbackward(xr,yr,s.I,x,y)) ; 13 | 14 | function test_invalid_args(s) 15 | xr = 1:size(s.I,2) ; 16 | yr = 1:size(s.I,1) ; 17 | [x,y] = meshgrid(xr,yr) ; 18 | vl_assert_exception(@() vl_imwbackward(xr,yr,single(s.I),x,y), 'vl:invalidArgument') ; 19 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_inthist.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_inthist(varargin) 2 | % VL_TEST_INTHIST 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | rand('state',0) ; 7 | s.labels = uint32(8*rand(123, 76, 3)) ; 8 | 9 | function test_basic(s) 10 | l = 10 ; 11 | hist = vl_inthist(s.labels, 'numlabels', l) ; 12 | hist_ = inthist_slow(s.labels, l) ; 13 | vl_assert_equal(double(hist),hist_) ; 14 | 15 | function test_sample(s) 16 | rand('state',0) ; 17 | boxes = 10 * rand(4,20) + .5 ; 18 | boxes(3:4,:) = boxes(3:4,:) + boxes(1:2,:) ; 19 | boxes = min(boxes, 10) ; 20 | boxes = uint32(boxes) ; 21 | inthist = vl_inthist(s.labels) ; 22 | hist = vl_sampleinthist(inthist, boxes) ; 23 | 24 | function hist = inthist_slow(labels, numLabels) 25 | m = size(labels,1) ; 26 | n = size(labels,2) ; 27 | l = numLabels ; 28 | b = zeros(m*n,l) ; 29 | b = vl_binsum(b, 1, reshape(labels,m*n,[]), 2) ; 30 | b = reshape(b,m,n,l) ; 31 | for k=1:l 32 | hist(:,:,k) = cumsum(cumsum(b(:,:,k)')') ; 33 | end 34 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_lbp.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_lbp(varargin) 2 | % VL_TEST_TWISTER 3 | vl_test_init ; 4 | 5 | function test_unfiorm_lbps(s) 6 | 7 | % enumerate the 56 uniform lbps 8 | q = 0 ; 9 | for i=0:7 10 | for j=1:7 11 | I = zeros(3) ; 12 | p = mod(s.pixels - i + 8, 8) + 1 ; 13 | I(p <= j) = 1 ; 14 | f = vl_lbp(single(I), 3) ; 15 | q = q + 1 ; 16 | vl_assert_equal(find(f), q) ; 17 | end 18 | end 19 | 20 | % constant lbps 21 | I = [1 1 1 ; 1 0 1 ; 1 1 1] ; 22 | f = vl_lbp(single(I), 3) ; 23 | vl_assert_equal(find(f), 57) ; 24 | 25 | I = [1 1 1 ; 1 1 1 ; 1 1 1] ; 26 | f = vl_lbp(single(I), 3) ; 27 | vl_assert_equal(find(f), 57) ; 28 | 29 | % other lbps 30 | I = [1 0 1 ; 0 0 0 ; 1 0 1] ; 31 | f = vl_lbp(single(I), 3) ; 32 | vl_assert_equal(find(f), 58) ; 33 | 34 | function test_fliplr(s) 35 | randn('state',0) ; 36 | I = randn(256,256,1,'single') ; 37 | f = vl_lbp(fliplr(I), 8) ; 38 | f_ = vl_lbpfliplr(vl_lbp(I, 8)) ; 39 | vl_assert_almost_equal(f,f_,1e-3) ; 40 | 41 | function s = setup() 42 | s.pixels = [5 6 7 ; 43 | 4 NaN 0 ; 44 | 3 2 1] ; 45 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_liop.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_liop(varargin) 2 | % VL_TEST_SIFT 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | randn('state',0) ; 7 | s.patch = randn(65,'single') ; 8 | xr = -32:32 ; 9 | [x,y] = meshgrid(xr) ; 10 | s.blob = - single(x.^2+y.^2) ; 11 | 12 | function test_basic(s) 13 | d = vl_liop(s.patch) ; 14 | 15 | function test_blob(s) 16 | % with a blob, all local intensity order pattern are equal. In 17 | % particular, if the blob intensity decreases away from the center, 18 | % then all local intensities sampled in a neighbourhood of 2 elements 19 | % are already sorted (see LIOP details). 20 | d = vl_liop(s.blob, ... 21 | 'IntensityThreshold', 0, ... 22 | 'NumNeighbours', 2, ... 23 | 'NumSpatialBins', 1) ; 24 | assert(isequal(d, single([1;0]))) ; 25 | 26 | function test_neighbours(s) 27 | for n=2:5 28 | for p=1:3 29 | d = vl_liop(s.patch, 'NumNeighbours', n, 'NumSpatialBins', p) ; 30 | assert(numel(d) == p * factorial(n)) ; 31 | end 32 | end 33 | 34 | function test_multiple(s) 35 | x = randn(31,31,3, 'single') ; 36 | d = vl_liop(x) ; 37 | for i=1:3 38 | d_(:,i) = vl_liop(squeeze(x(:,:,i))) ; 39 | end 40 | assert(isequal(d,d_)) ; 41 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_mser.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_mser(varargin) 2 | % VL_TEST_MSER 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.im = im2uint8(rgb2gray(vl_impattern('roofs1'))) ; 7 | 8 | function test_mser(s) 9 | [regions,frames] = vl_mser(s.im) ; 10 | mask = vl_erfill(s.im, regions(1)) ; 11 | 12 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_phow.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_phow(varargin) 2 | % VL_TEST_PHOPW 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.I = im2double(imread(fullfile(vl_root,'data','spots.jpg'))) ; 7 | s.I = single(s.I) ; 8 | 9 | function test_gray(s) 10 | [f,d] = vl_phow(s.I, 'color', 'gray') ; 11 | assert(size(d,1) == 128) ; 12 | 13 | function test_rgb(s) 14 | [f,d] = vl_phow(s.I, 'color', 'rgb') ; 15 | assert(size(d,1) == 128*3) ; 16 | 17 | function test_hsv(s) 18 | [f,d] = vl_phow(s.I, 'color', 'hsv') ; 19 | assert(size(d,1) == 128*3) ; 20 | 21 | function test_opponent(s) 22 | [f,d] = vl_phow(s.I, 'color', 'opponent') ; 23 | assert(size(d,1) == 128*3) ; 24 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_plotbox.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_plotbox(varargin) 2 | % VL_TEST_PLOTBOX 3 | vl_test_init ; 4 | 5 | function test_basic(s) 6 | figure(1) ; clf ; 7 | vl_plotbox([-1 -1 1 1]') ; 8 | xlim([-2 2]) ; 9 | ylim([-2 2]) ; 10 | close(1) ; 11 | 12 | function test_multiple(s) 13 | figure(1) ; clf ; 14 | randn('state', 0) ; 15 | vl_plotbox(randn(4,10)) ; 16 | close(1) ; 17 | 18 | function test_style(s) 19 | figure(1) ; clf ; 20 | randn('state', 0) ; 21 | vl_plotbox(randn(4,10), 'r-.', 'LineWidth', 3) ; 22 | close(1) ; 23 | 24 | 25 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_roc.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_roc(varargin) 2 | % VL_TEST_ROC 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.scores0 = [5 4 3 2 1] ; 7 | s.scores1 = [5 3 4 2 1] ; 8 | s.labels = [1 1 -1 -1 -1] ; 9 | 10 | function test_perfect_tptn(s) 11 | [tpr,tnr] = vl_roc(s.labels,s.scores0) ; 12 | vl_assert_almost_equal(tpr, [0 1 2 2 2 2] / 2) ; 13 | vl_assert_almost_equal(tnr, [3 3 3 2 1 0] / 3) ; 14 | 15 | function test_perfect_metrics(s) 16 | [tpr,tnr,info] = vl_roc(s.labels,s.scores0) ; 17 | vl_assert_almost_equal(info.eer, 0) ; 18 | vl_assert_almost_equal(info.auc, 1) ; 19 | 20 | function test_swap1_tptn(s) 21 | [tpr,tnr] = vl_roc(s.labels,s.scores1) ; 22 | vl_assert_almost_equal(tpr, [0 1 1 2 2 2] / 2) ; 23 | vl_assert_almost_equal(tnr, [3 3 2 2 1 0] / 3) ; 24 | 25 | function test_swap1_tptn_stable(s) 26 | [tpr,tnr] = vl_roc(s.labels,s.scores1,'stable',true) ; 27 | vl_assert_almost_equal(tpr, [1 2 1 2 2] / 2) ; 28 | vl_assert_almost_equal(tnr, [3 2 2 1 0] / 3) ; 29 | 30 | function test_swap1_metrics(s) 31 | [tpr,tnr,info] = vl_roc(s.labels,s.scores1) ; 32 | vl_assert_almost_equal(info.eer, 1/3) ; 33 | vl_assert_almost_equal(info.auc, 1 - 1/(2*3)) ; 34 | 35 | 36 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_sift.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_sift(varargin) 2 | % VL_TEST_SIFT 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.I = im2single(imread(fullfile(vl_root,'data','box.pgm'))) ; 7 | [s.ubc.f, s.ubc.d] = ... 8 | vl_ubcread(fullfile(vl_root,'data','box.sift')) ; 9 | 10 | function test_ubc_descriptor(s) 11 | err = [] ; 12 | [f, d] = vl_sift(s.I,... 13 | 'firstoctave', -1, ... 14 | 'frames', s.ubc.f) ; 15 | D2 = vl_alldist(f, s.ubc.f) ; 16 | [drop, perm] = min(D2) ; 17 | f = f(:,perm) ; 18 | d = d(:,perm) ; 19 | error = mean(sqrt(sum((single(s.ubc.d) - single(d)).^2))) ... 20 | / mean(sqrt(sum(single(s.ubc.d).^2))) ; 21 | assert(error < 0.1, ... 22 | 'sift descriptor did not produce desctiptors similar to UBC ones') ; 23 | 24 | function test_ubc_detector(s) 25 | [f, d] = vl_sift(s.I,... 26 | 'firstoctave', -1, ... 27 | 'peakthresh', .01, ... 28 | 'edgethresh', 10) ; 29 | 30 | s.ubc.f(4,:) = mod(s.ubc.f(4,:), 2*pi) ; 31 | f(4,:) = mod(f(4,:), 2*pi) ; 32 | 33 | % scale the components so that 1 pixel erro in x,y,z is equal to a 34 | % 10-th of angle. 35 | S = diag([1 1 1 20/pi]); 36 | D2 = vl_alldist(S * s.ubc.f, S * f) ; 37 | [d2,perm] = sort(min(D2)) ; 38 | error = sqrt(d2) ; 39 | quant80 = round(.8 * size(f,2)) ; 40 | 41 | % check for less than one pixel error at 80% quantile 42 | assert(error(quant80) < 1, ... 43 | 'sift detector did not produce enough keypoints similar to UBC ones') ; 44 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_slic.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_slic(varargin) 2 | % VL_TEST_SLIC 3 | vl_test_init ; 4 | 5 | function s = setup() 6 | s.im = im2single(vl_impattern('roofs1')) ; 7 | 8 | function test_slic(s) 9 | segmentation = vl_slic(s.im, 10, 0.1) ; 10 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_twister.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_twister(varargin) 2 | % VL_TEST_TWISTER 3 | vl_test_init ; 4 | 5 | function test_illegal_args() 6 | vl_assert_exception(@() vl_twister(-1), 'vl:invalidArgument') ; 7 | vl_assert_exception(@() vl_twister(1, -1), 'vl:invalidArgument') ; 8 | vl_assert_exception(@() vl_twister([1, -1]), 'vl:invalidArgument') ; 9 | 10 | function test_seed_by_scalar() 11 | rand('twister',1) ; a = rand ; 12 | vl_twister('state',1) ; b = vl_twister ; 13 | vl_assert_equal(a,b,'seed by scalar + VL_TWISTER()') ; 14 | 15 | function test_get_set_state() 16 | rand('twister',1) ; a = rand('twister') ; 17 | vl_twister('state',1) ; b = vl_twister('state') ; 18 | vl_assert_equal(a,b,'read state') ; 19 | 20 | a(1) = a(1) + 1 ; 21 | vl_twister('state',a) ; b = vl_twister('state') ; 22 | vl_assert_equal(a,b,'set state') ; 23 | 24 | function test_multi_dimensions() 25 | b = rand('twister') ; 26 | rand('twister',b) ; 27 | vl_twister('state',b) ; 28 | a=rand([1 2 3 4 5]) ; 29 | b=vl_twister([1 2 3 4 5]) ; 30 | vl_assert_equal(a,b,'VL_TWISTER([M N P ...])') ; 31 | 32 | function test_multi_multi_args() 33 | rand('twister',1) ; a=rand(1, 2, 3, 4, 5) ; 34 | vl_twister('state',1) ; b=vl_twister(1, 2, 3, 4, 5) ; 35 | vl_assert_equal(a,b,'VL_TWISTER(M, N, P, ...)') ; 36 | 37 | function test_square() 38 | rand('twister',1) ; a=rand(10) ; 39 | vl_twister('state',1) ; b=vl_twister(10) ; 40 | vl_assert_equal(a,b,'VL_TWISTER(N)') ; 41 | 42 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/toolbox/xtest/vl_test_whistc.m: -------------------------------------------------------------------------------- 1 | function results = vl_test_whistc(varargin) 2 | % VL_TEST_WHISTC 3 | vl_test_init ; 4 | 5 | function test_acc() 6 | x = ones(1, 10) ; 7 | e = 1 ; 8 | o = 1:10 ; 9 | vl_assert_equal(vl_whistc(x, o, e), 55) ; 10 | 11 | function test_basic() 12 | x = 1:10 ; 13 | e = 1:10 ; 14 | o = ones(1, 10) ; 15 | vl_assert_equal(histc(x, e), vl_whistc(x, o, e)) ; 16 | 17 | x = linspace(-1,11,100) ; 18 | o = ones(size(x)) ; 19 | vl_assert_equal(histc(x, e), vl_whistc(x, o, e)) ; 20 | 21 | function test_multidim() 22 | x = rand(10, 20, 30) ; 23 | e = linspace(0,1,10) ; 24 | o = ones(size(x)) ; 25 | 26 | vl_assert_equal(histc(x, e), vl_whistc(x, o, e)) ; 27 | vl_assert_equal(histc(x, e, 1), vl_whistc(x, o, e, 1)) ; 28 | vl_assert_equal(histc(x, e, 2), vl_whistc(x, o, e, 2)) ; 29 | vl_assert_equal(histc(x, e, 3), vl_whistc(x, o, e, 3)) ; 30 | 31 | function test_nan() 32 | x = rand(10, 20, 30) ; 33 | e = linspace(0,1,10) ; 34 | o = ones(size(x)) ; 35 | x(1:7:end) = NaN ; 36 | 37 | vl_assert_equal(histc(x, e), vl_whistc(x, o, e)) ; 38 | vl_assert_equal(histc(x, e, 1), vl_whistc(x, o, e, 1)) ; 39 | vl_assert_equal(histc(x, e, 2), vl_whistc(x, o, e, 2)) ; 40 | vl_assert_equal(histc(x, e, 3), vl_whistc(x, o, e, 3)) ; 41 | 42 | function test_no_edges() 43 | x = rand(10, 20, 30) ; 44 | o = ones(size(x)) ; 45 | vl_assert_equal(histc(1, []), vl_whistc(1, 1, [])) ; 46 | vl_assert_equal(histc(x, []), vl_whistc(x, o, [])) ; 47 | vl_assert_equal(histc(x, [], 1), vl_whistc(x, o, [], 1)) ; 48 | vl_assert_equal(histc(x, [], 2), vl_whistc(x, o, [], 2)) ; 49 | vl_assert_equal(histc(x, [], 3), vl_whistc(x, o, [], 3)) ; 50 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vl/lbp.h: -------------------------------------------------------------------------------- 1 | /** @file lbp.h 2 | ** @brief Local Binary Patterns (LBP) descriptor (@ref lbp) 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #ifndef VL_LBP_H 15 | #define VL_LBP_H 16 | 17 | #include "generic.h" 18 | 19 | /** @brief Type of quantization for the LBP descriptors 20 | ** @see @ref lbp-quantization 21 | **/ 22 | typedef enum _VlLbpMappingType 23 | { 24 | VlLbpUniform /**< Uniform local binary patterns. */ 25 | } VlLbpMappingType ; 26 | 27 | /** @brief Local Binary Pattern extractor */ 28 | typedef struct VlLbp_ 29 | { 30 | vl_size dimension ; 31 | vl_uint8 mapping [256] ; 32 | vl_bool transposed ; 33 | } VlLbp ; 34 | 35 | VL_EXPORT VlLbp * vl_lbp_new(VlLbpMappingType type, vl_bool transposed) ; 36 | VL_EXPORT void vl_lbp_delete(VlLbp * self) ; 37 | VL_EXPORT void vl_lbp_process(VlLbp * self, 38 | float * features, 39 | float * image, vl_size width, vl_size height, 40 | vl_size cellSize) ; 41 | VL_EXPORT vl_size vl_lbp_get_dimension(VlLbp * self) ; 42 | 43 | /* VL_LBP_H */ 44 | #endif 45 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vl/mathop_avx.h: -------------------------------------------------------------------------------- 1 | /** @file mathop_avx.h 2 | ** @brief mathop for avx 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | /* ---------------------------------------------------------------- */ 15 | #ifndef VL_MATHOP_AVX_H_INSTANTIATING 16 | 17 | #ifndef VL_MATHOP_AVX_H 18 | #define VL_MATHOP_AVX_H 19 | 20 | #undef FLT 21 | #define FLT VL_TYPE_DOUBLE 22 | #define VL_MATHOP_AVX_H_INSTANTIATING 23 | #include "mathop_avx.h" 24 | 25 | #undef FLT 26 | #define FLT VL_TYPE_FLOAT 27 | #define VL_MATHOP_AVX_H_INSTANTIATING 28 | #include "mathop_avx.h" 29 | 30 | /* VL_MATHOP_AVX_H */ 31 | #endif 32 | 33 | /* ---------------------------------------------------------------- */ 34 | /* VL_MATHOP_AVX_H_INSTANTIATING */ 35 | #else 36 | 37 | #ifndef VL_DISABLE_AVX 38 | #include "generic.h" 39 | #include "float.th" 40 | 41 | VL_EXPORT T 42 | VL_XCAT(_vl_distance_mahalanobis_sq_avx_, SFX) 43 | (vl_size dimension, T const * X, T const * MU, T const * S); 44 | 45 | VL_EXPORT T 46 | VL_XCAT(_vl_distance_l2_avx_, SFX) 47 | (vl_size dimension, T const * X, T const * Y); 48 | 49 | VL_EXPORT void 50 | VL_XCAT(_vl_weighted_sigma_avx_, SFX) 51 | (vl_size dimension, T * S, T const * X, T const * Y, T const W); 52 | 53 | VL_EXPORT void 54 | VL_XCAT(_vl_weighted_mean_avx_, SFX) 55 | (vl_size dimension, T * MU, T const * X, T const W); 56 | 57 | /* ! VL_DISABLE_AVX */ 58 | #endif 59 | 60 | #undef VL_MATHOP_AVX_H_INSTANTIATING 61 | #endif 62 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vl/rodrigues.h: -------------------------------------------------------------------------------- 1 | /** @file rodrigues.h 2 | ** @brief Rodrigues formulas 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-13 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | /** @file rodrigues.h 15 | 16 | @section rodrigues Rodrigues formulas 17 | 18 | - Use ::vl_rodrigues to compute the Rodrigues formula and its derivative. 19 | - Use ::vl_irodrigues to compute the inverse Rodrigues formula and 20 | its derivative. 21 | 22 | **/ 23 | 24 | #ifndef VL_RODRIGUES 25 | #define VL_RODRIGUES 26 | 27 | #include "generic.h" 28 | 29 | VL_EXPORT void vl_rodrigues (double* R_pt, double* dR_pt, const double* om_pt) ; 30 | VL_EXPORT void vl_irodrigues (double* om_pt, double* dom_pt, const double* R_pt) ; 31 | 32 | /* VL_RODRIGUES */ 33 | #endif 34 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vl/slic.h: -------------------------------------------------------------------------------- 1 | /** @file slic.h 2 | ** @brief SLIC superpixels (@ref slic) 3 | ** @author Andrea Vedaldi 4 | **/ 5 | 6 | /* 7 | Copyright (C) 2007-12 Andrea Vedaldi and Brian Fulkerson. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #ifndef VL_SLIC_H 15 | #define VL_SLIC_H 16 | 17 | #include "generic.h" 18 | 19 | VL_EXPORT void 20 | vl_slic_segment (vl_uint32 * segmentation, 21 | float const * image, 22 | vl_size width, 23 | vl_size height, 24 | vl_size numChannels, 25 | vl_size regionSize, 26 | float regularization, 27 | vl_size minRegionSize) ; 28 | 29 | /* VL_SLIC_H */ 30 | #endif 31 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vl/vlad.h: -------------------------------------------------------------------------------- 1 | /** @file vlad.h 2 | ** @brief VLAD encoding (@ref vlad) 3 | ** @author David Novotny 4 | ** @author Andrea Vedaldi 5 | ** @see @ref vlad 6 | **/ 7 | 8 | /* 9 | Copyright (C) 2013 David Novotny and Andera Vedaldi. 10 | All rights reserved. 11 | 12 | This file is part of the VLFeat library and is made available under 13 | the terms of the BSD license (see the COPYING file). 14 | */ 15 | 16 | #ifndef VL_VLAD_H 17 | #define VL_VLAD_H 18 | 19 | #include "generic.h" 20 | 21 | /** @name VLAD options 22 | ** @{ */ 23 | #define VL_VLAD_FLAG_NORMALIZE_COMPONENTS (0x1 << 0) 24 | #define VL_VLAD_FLAG_SQUARE_ROOT (0x1 << 1) 25 | #define VL_VLAD_FLAG_UNNORMALIZED (0x1 << 2) 26 | #define VL_VLAD_FLAG_NORMALIZE_MASS (0x1 << 3) 27 | 28 | /** @def VL_VLAD_FLAG_NORMALIZE_COMPONENTS 29 | ** @brief Normalize each VLAD component individually. 30 | **/ 31 | 32 | /** @def VL_VLAD_FLAG_SQUARE_ROOT 33 | ** @brief Use signed squared-root. 34 | **/ 35 | 36 | /** @def VL_VLAD_FLAG_UNNORMALIZED 37 | ** @brief Do not globally normalize the VLAD descriptor. 38 | **/ 39 | 40 | /** @def VL_VLAD_FLAG_NORMALIZE_MASS 41 | ** @brief Normalize each component by the number of features assigned to it. 42 | **/ 43 | /** @} */ 44 | 45 | VL_EXPORT void vl_vlad_encode 46 | (void * enc, vl_type dataType, 47 | void const * means, vl_size dimension, vl_size numClusters, 48 | void const * data, vl_size numData, 49 | void const * assignments, 50 | int flags) ; 51 | 52 | /* VL_VLAD_H */ 53 | #endif 54 | -------------------------------------------------------------------------------- /vlfeat-0.9.19/vlfeat.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual Studio 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vlfeat", "vlfeat.vcproj", "{07367665-DCDA-4044-94CE-ABC01CC4119D}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {07367665-DCDA-4044-94CE-ABC01CC4119D}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {07367665-DCDA-4044-94CE-ABC01CC4119D}.Debug|Win32.Build.0 = Debug|Win32 14 | {07367665-DCDA-4044-94CE-ABC01CC4119D}.Release|Win32.ActiveCfg = Release|Win32 15 | {07367665-DCDA-4044-94CE-ABC01CC4119D}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | --------------------------------------------------------------------------------