├── Processing ├── Detection.m ├── FilterUpdate.m ├── Get_SSAR.m ├── PrepareData.m ├── RidgeRrgression.m ├── SetParams.m ├── Visualization.m ├── energy_w.m ├── getFilterSetup.m ├── getSelector.m ├── get_APCE.m ├── get_PSR.m ├── get_pixels2.m ├── normalizing.m ├── saliency_RA10 │ ├── RGB2Lab.m │ ├── get_saliency_RA.asv │ ├── get_saliency_RA.m │ ├── run_RA10_allsets.m │ ├── saliencyMeasure.m │ ├── segmenting salient objects from images and videos │ │ ├── saliencyMeasure.m │ │ └── 新建文本文档.txt │ └── 新建文本文档.txt ├── saliency_SCA │ ├── SCAfun.m │ ├── get_saliency_SCA.m │ ├── get_saliency_SCA2.m │ ├── others │ │ ├── AdjcProcloop.m │ │ ├── RGB2Lab.m │ │ ├── ReadDAT.m │ │ ├── adjacency.m │ │ ├── calculateRegionProps.m │ │ ├── colorspace.m │ │ ├── extractSupfeat.m │ │ ├── extract_bg_sp.m │ │ ├── form_codebook.m │ │ ├── labelCluster.m │ │ ├── makeweights.m │ │ ├── mexLasso.m │ │ ├── normalization.m │ │ ├── normalize.m │ │ ├── normalize_1.m │ │ ├── removeframe.m │ │ ├── vgg_argparse.m │ │ ├── vgg_kmeans.m │ │ ├── vgg_kmiter.cxx │ │ ├── vgg_kmiter.dll │ │ ├── vgg_kmiter.mexglx │ │ └── vgg_kmiter.mexw64 │ ├── saliency.asv │ ├── slicmex.c │ └── slicmex.mexw64 ├── saliency_wCtr │ ├── Data │ │ ├── GT │ │ │ ├── 0_0_272.bmp │ │ │ ├── 0_0_579.bmp │ │ │ ├── 0_0_840.bmp │ │ │ ├── 0_11_11852.bmp │ │ │ ├── 0_11_11881.bmp │ │ │ ├── 0_12_12344.bmp │ │ │ ├── 0_1_1664.bmp │ │ │ ├── 0_1_1696.bmp │ │ │ ├── 0_3_3654.bmp │ │ │ ├── 0_4_4328.bmp │ │ │ ├── 0_5_5463.bmp │ │ │ ├── 0_5_5586.bmp │ │ │ └── 0_6_6791.bmp │ │ ├── Res │ │ │ ├── 0_0_272_GS.png │ │ │ ├── 0_0_272_MR_stage2.png │ │ │ ├── 0_0_272_SF.png │ │ │ ├── 0_0_272_wCtr_Optimized.png │ │ │ ├── 0_0_579_GS.png │ │ │ ├── 0_0_579_MR_stage2.png │ │ │ ├── 0_0_579_SF.png │ │ │ ├── 0_0_579_wCtr_Optimized.png │ │ │ ├── 0_0_840_GS.png │ │ │ ├── 0_0_840_MR_stage2.png │ │ │ ├── 0_0_840_SF.png │ │ │ ├── 0_0_840_wCtr_Optimized.png │ │ │ ├── 0_11_11852_GS.png │ │ │ ├── 0_11_11852_MR_stage2.png │ │ │ ├── 0_11_11852_SF.png │ │ │ ├── 0_11_11852_wCtr_Optimized.png │ │ │ ├── 0_11_11881_GS.png │ │ │ ├── 0_11_11881_MR_stage2.png │ │ │ ├── 0_11_11881_SF.png │ │ │ ├── 0_11_11881_wCtr_Optimized.png │ │ │ ├── 0_12_12344_GS.png │ │ │ ├── 0_12_12344_MR_stage2.png │ │ │ ├── 0_12_12344_SF.png │ │ │ ├── 0_12_12344_wCtr_Optimized.png │ │ │ ├── 0_1_1664_GS.png │ │ │ ├── 0_1_1664_MR_stage2.png │ │ │ ├── 0_1_1664_SF.png │ │ │ ├── 0_1_1664_wCtr_Optimized.png │ │ │ ├── 0_1_1696_GS.png │ │ │ ├── 0_1_1696_MR_stage2.png │ │ │ ├── 0_1_1696_SF.png │ │ │ ├── 0_1_1696_wCtr_Optimized.png │ │ │ ├── 0_3_3654_GS.png │ │ │ ├── 0_3_3654_MR_stage2.png │ │ │ ├── 0_3_3654_SF.png │ │ │ ├── 0_3_3654_wCtr_Optimized.png │ │ │ ├── 0_4_4328_GS.png │ │ │ ├── 0_4_4328_MR_stage2.png │ │ │ ├── 0_4_4328_SF.png │ │ │ ├── 0_4_4328_wCtr_Optimized.png │ │ │ ├── 0_5_5463_GS.png │ │ │ ├── 0_5_5463_MR_stage2.png │ │ │ ├── 0_5_5463_SF.png │ │ │ ├── 0_5_5463_wCtr_Optimized.png │ │ │ ├── 0_5_5586_GS.png │ │ │ ├── 0_5_5586_MR_stage2.png │ │ │ ├── 0_5_5586_SF.png │ │ │ ├── 0_5_5586_wCtr_Optimized.png │ │ │ ├── 0_6_6791_GS.png │ │ │ ├── 0_6_6791_MR_stage2.png │ │ │ ├── 0_6_6791_SF.png │ │ │ └── 0_6_6791_wCtr_Optimized.png │ │ └── SRC │ │ │ ├── 0_0_272.jpg │ │ │ ├── 0_0_579.jpg │ │ │ ├── 0_0_840.jpg │ │ │ ├── 0_11_11852.jpg │ │ │ ├── 0_11_11881.jpg │ │ │ ├── 0_12_12344.jpg │ │ │ ├── 0_1_1664.jpg │ │ │ ├── 0_1_1696.jpg │ │ │ ├── 0_3_3654.jpg │ │ │ ├── 0_4_4328.jpg │ │ │ ├── 0_5_5463.jpg │ │ │ ├── 0_5_5586.jpg │ │ │ └── 0_6_6791.jpg │ ├── Funcs │ │ ├── BoundaryConnectivity.m │ │ ├── CalMAE.m │ │ ├── CalMeanMAE.m │ │ ├── CalPR.m │ │ ├── CalWeightedContrast.m │ │ ├── CreateImageFromSPs.m │ │ ├── Dist2WeightMatrix.m │ │ ├── DrawPRCurve.m │ │ ├── EstimateBgProb.m │ │ ├── EstimateDynamicParas.m │ │ ├── GetAdjMatrix.m │ │ ├── GetBndPatchIds.m │ │ ├── GetDistanceMatrix.m │ │ ├── GetMeanColor.m │ │ ├── GetMeanMinAndMeanTop.m │ │ ├── GetNormedMeanPos.m │ │ ├── Grid_Split.m │ │ ├── LinkBoundarySPs.m │ │ ├── LinkNNAndBoundary.m │ │ ├── SLIC │ │ │ ├── Rgb2Lab.h │ │ │ ├── SLIC.cpp │ │ │ ├── SLIC.h │ │ │ ├── SLIC_mex.cpp │ │ │ ├── SLIC_mex.mexw64 │ │ │ ├── compile.m │ │ │ └── image │ │ │ │ ├── ImageConcept.h │ │ │ │ └── ImageSimple.h │ │ ├── SLIC_Split.m │ │ ├── SaveSaliencyMap.m │ │ ├── colorspace.m │ │ └── removeframe_wCtr.m │ ├── GeodesicSaliency.m │ ├── ManifoldRanking.m │ ├── ReadMe.txt │ ├── SaliencyFilter.m │ ├── SaliencyOptimization.m │ ├── Saliency_Dataset_Code │ │ ├── Running_dataset │ │ │ ├── DUT_OMRON_image │ │ │ │ └── images │ │ │ │ │ ├── 0001.jpg │ │ │ │ │ ├── 0002.jpg │ │ │ │ │ ├── 0003.jpg │ │ │ │ │ ├── 0004.jpg │ │ │ │ │ └── 0005.jpg │ │ │ ├── ECSSD │ │ │ │ └── images │ │ │ │ │ ├── 0001.jpg │ │ │ │ │ ├── 0002.jpg │ │ │ │ │ ├── 0003.jpg │ │ │ │ │ ├── 0004.jpg │ │ │ │ │ └── 0005.jpg │ │ │ ├── MSRA1000 │ │ │ │ └── images │ │ │ │ │ ├── 0001.jpg │ │ │ │ │ ├── 0002.jpg │ │ │ │ │ ├── 0003.jpg │ │ │ │ │ ├── 0004.jpg │ │ │ │ │ └── 0005.jpg │ │ │ ├── MSRA5000 │ │ │ │ └── images │ │ │ │ │ ├── 0001.jpg │ │ │ │ │ ├── 0002.jpg │ │ │ │ │ ├── 0003.jpg │ │ │ │ │ ├── 0004.jpg │ │ │ │ │ └── 0005.jpg │ │ │ └── PASCAL_S │ │ │ │ └── images │ │ │ │ ├── 0001.jpg │ │ │ │ ├── 0002.jpg │ │ │ │ ├── 0003.jpg │ │ │ │ ├── 0004.jpg │ │ │ │ └── 0005.jpg │ │ └── Running_result │ │ │ ├── GS │ │ │ ├── DUT_OMRON_image │ │ │ │ ├── 0001_GS.png │ │ │ │ ├── 0002_GS.png │ │ │ │ ├── 0003_GS.png │ │ │ │ ├── 0004_GS.png │ │ │ │ └── 0005_GS.png │ │ │ ├── ECSSD │ │ │ │ ├── 0001_GS.png │ │ │ │ ├── 0002_GS.png │ │ │ │ ├── 0003_GS.png │ │ │ │ ├── 0004_GS.png │ │ │ │ └── 0005_GS.png │ │ │ ├── MSRA1000 │ │ │ │ ├── 0001_GS.png │ │ │ │ ├── 0002_GS.png │ │ │ │ ├── 0003_GS.png │ │ │ │ ├── 0004_GS.png │ │ │ │ └── 0005_GS.png │ │ │ ├── MSRA5000 │ │ │ │ ├── 0001_GS.png │ │ │ │ ├── 0002_GS.png │ │ │ │ ├── 0003_GS.png │ │ │ │ ├── 0004_GS.png │ │ │ │ └── 0005_GS.png │ │ │ └── PASCAL_S │ │ │ │ ├── 0001_GS.png │ │ │ │ ├── 0002_GS.png │ │ │ │ ├── 0003_GS.png │ │ │ │ ├── 0004_GS.png │ │ │ │ └── 0005_GS.png │ │ │ ├── SF │ │ │ ├── DUT_OMRON_image │ │ │ │ ├── 0001_SF.png │ │ │ │ ├── 0002_SF.png │ │ │ │ ├── 0003_SF.png │ │ │ │ ├── 0004_SF.png │ │ │ │ └── 0005_SF.png │ │ │ ├── ECSSD │ │ │ │ ├── 0001_SF.png │ │ │ │ ├── 0002_SF.png │ │ │ │ ├── 0003_SF.png │ │ │ │ ├── 0004_SF.png │ │ │ │ └── 0005_SF.png │ │ │ ├── MSRA1000 │ │ │ │ ├── 0001_SF.png │ │ │ │ ├── 0002_SF.png │ │ │ │ ├── 0003_SF.png │ │ │ │ ├── 0004_SF.png │ │ │ │ └── 0005_SF.png │ │ │ ├── MSRA5000 │ │ │ │ ├── 0001_SF.png │ │ │ │ ├── 0002_SF.png │ │ │ │ ├── 0003_SF.png │ │ │ │ ├── 0004_SF.png │ │ │ │ └── 0005_SF.png │ │ │ └── PASCAL_S │ │ │ │ ├── 0001_SF.png │ │ │ │ ├── 0002_SF.png │ │ │ │ ├── 0003_SF.png │ │ │ │ ├── 0004_SF.png │ │ │ │ └── 0005_SF.png │ │ │ └── wCtr │ │ │ └── DUT_OMRON_image │ │ │ ├── 0001_wCtr.png │ │ │ ├── 0002_wCtr.png │ │ │ ├── 0003_wCtr.png │ │ │ ├── 0004_wCtr.png │ │ │ └── 0005_wCtr.png │ ├── Test │ │ ├── GridSearch_geoSigma_neiSigma.m │ │ ├── Time_Geodesic.m │ │ ├── Time_MR.m │ │ ├── Time_SalOpt.m │ │ ├── Veri_ASD.m │ │ ├── Veri_MSRA.m │ │ ├── Veri_SED.m │ │ └── Veri_SOD.m │ ├── demo.m │ ├── demo1.m │ ├── get_saliency_wCtr.m │ ├── run_wCtr_allsets.m │ ├── saliency_wCtr.m │ └── wCtr_code │ │ ├── Data │ │ ├── GT │ │ │ ├── 0_0_272.bmp │ │ │ ├── 0_0_579.bmp │ │ │ ├── 0_0_840.bmp │ │ │ ├── 0_11_11852.bmp │ │ │ ├── 0_11_11881.bmp │ │ │ ├── 0_12_12344.bmp │ │ │ ├── 0_1_1664.bmp │ │ │ ├── 0_1_1696.bmp │ │ │ ├── 0_3_3654.bmp │ │ │ ├── 0_4_4328.bmp │ │ │ ├── 0_5_5463.bmp │ │ │ ├── 0_5_5586.bmp │ │ │ └── 0_6_6791.bmp │ │ ├── Res │ │ │ ├── 0_0_272_GS.png │ │ │ ├── 0_0_272_MR_stage2.png │ │ │ ├── 0_0_272_SF.png │ │ │ ├── 0_0_272_wCtr_Optimized.png │ │ │ ├── 0_0_579_GS.png │ │ │ ├── 0_0_579_MR_stage2.png │ │ │ ├── 0_0_579_SF.png │ │ │ ├── 0_0_579_wCtr_Optimized.png │ │ │ ├── 0_0_840_GS.png │ │ │ ├── 0_0_840_MR_stage2.png │ │ │ ├── 0_0_840_SF.png │ │ │ ├── 0_0_840_wCtr_Optimized.png │ │ │ ├── 0_11_11852_GS.png │ │ │ ├── 0_11_11852_MR_stage2.png │ │ │ ├── 0_11_11852_SF.png │ │ │ ├── 0_11_11852_wCtr_Optimized.png │ │ │ ├── 0_11_11881_GS.png │ │ │ ├── 0_11_11881_MR_stage2.png │ │ │ ├── 0_11_11881_SF.png │ │ │ ├── 0_11_11881_wCtr_Optimized.png │ │ │ ├── 0_12_12344_GS.png │ │ │ ├── 0_12_12344_MR_stage2.png │ │ │ ├── 0_12_12344_SF.png │ │ │ ├── 0_12_12344_wCtr_Optimized.png │ │ │ ├── 0_1_1664_GS.png │ │ │ ├── 0_1_1664_MR_stage2.png │ │ │ ├── 0_1_1664_SF.png │ │ │ ├── 0_1_1664_wCtr_Optimized.png │ │ │ ├── 0_1_1696_GS.png │ │ │ ├── 0_1_1696_MR_stage2.png │ │ │ ├── 0_1_1696_SF.png │ │ │ ├── 0_1_1696_wCtr_Optimized.png │ │ │ ├── 0_3_3654_GS.png │ │ │ ├── 0_3_3654_MR_stage2.png │ │ │ ├── 0_3_3654_SF.png │ │ │ ├── 0_3_3654_wCtr_Optimized.png │ │ │ ├── 0_4_4328_GS.png │ │ │ ├── 0_4_4328_MR_stage2.png │ │ │ ├── 0_4_4328_SF.png │ │ │ ├── 0_4_4328_wCtr_Optimized.png │ │ │ ├── 0_5_5463_GS.png │ │ │ ├── 0_5_5463_MR_stage2.png │ │ │ ├── 0_5_5463_SF.png │ │ │ ├── 0_5_5463_wCtr_Optimized.png │ │ │ ├── 0_5_5586_GS.png │ │ │ ├── 0_5_5586_MR_stage2.png │ │ │ ├── 0_5_5586_SF.png │ │ │ ├── 0_5_5586_wCtr_Optimized.png │ │ │ ├── 0_6_6791_GS.png │ │ │ ├── 0_6_6791_MR_stage2.png │ │ │ ├── 0_6_6791_SF.png │ │ │ └── 0_6_6791_wCtr_Optimized.png │ │ └── SRC │ │ │ ├── 0_0_272.jpg │ │ │ ├── 0_0_579.jpg │ │ │ ├── 0_0_840.jpg │ │ │ ├── 0_11_11852.jpg │ │ │ ├── 0_11_11881.jpg │ │ │ ├── 0_12_12344.jpg │ │ │ ├── 0_1_1664.jpg │ │ │ ├── 0_1_1696.jpg │ │ │ ├── 0_3_3654.jpg │ │ │ ├── 0_4_4328.jpg │ │ │ ├── 0_5_5463.jpg │ │ │ ├── 0_5_5586.jpg │ │ │ └── 0_6_6791.jpg │ │ ├── Funcs │ │ ├── BoundaryConnectivity.m │ │ ├── CalMAE.m │ │ ├── CalMeanMAE.m │ │ ├── CalPR.m │ │ ├── CalWeightedContrast.m │ │ ├── CreateImageFromSPs.m │ │ ├── Dist2WeightMatrix.m │ │ ├── DrawPRCurve.m │ │ ├── EstimateBgProb.m │ │ ├── EstimateDynamicParas.m │ │ ├── GetAdjMatrix.m │ │ ├── GetBndPatchIds.m │ │ ├── GetDistanceMatrix.m │ │ ├── GetMeanColor.m │ │ ├── GetMeanMinAndMeanTop.m │ │ ├── GetNormedMeanPos.m │ │ ├── Grid_Split.m │ │ ├── LinkBoundarySPs.m │ │ ├── LinkNNAndBoundary.m │ │ ├── SLIC │ │ │ ├── Rgb2Lab.h │ │ │ ├── SLIC.cpp │ │ │ ├── SLIC.h │ │ │ ├── SLIC_mex.cpp │ │ │ ├── SLIC_mex.mexw64 │ │ │ ├── compile.m │ │ │ └── image │ │ │ │ ├── ImageConcept.h │ │ │ │ └── ImageSimple.h │ │ ├── SLIC_Split.m │ │ ├── SaveSaliencyMap.m │ │ ├── colorspace.m │ │ └── removeframe.m │ │ ├── GeodesicSaliency.m │ │ ├── ManifoldRanking.m │ │ ├── ReadMe.txt │ │ ├── SaliencyFilter.m │ │ ├── SaliencyOptimization.m │ │ ├── Test │ │ ├── GridSearch_geoSigma_neiSigma.m │ │ ├── Time_Geodesic.m │ │ ├── Time_MR.m │ │ ├── Time_SalOpt.m │ │ ├── Veri_ASD.m │ │ ├── Veri_MSRA.m │ │ ├── Veri_SED.m │ │ └── Veri_SOD.m │ │ └── demo.m └── update_w.m ├── README.md ├── figs ├── example.png ├── readme └── res.png ├── results_DSAR-CF_OTB15.zip ├── run_DSARCF.m └── utils ├── CNnorm.mat ├── MxArray.cpp ├── MxArray.hpp ├── README.md ├── SRDCF_VOT_settings.m ├── average_feature_region.m ├── cconvmtx2.m ├── compile_mexResize.m ├── compilemex_linux.m ├── compilemex_win.m ├── dft2dfs_matrix.m ├── fhog.m ├── get_cnn.m ├── get_colorspace.m ├── get_features.m ├── get_fhog.m ├── get_pixels.m ├── get_table_feature.m ├── get_threshold.m ├── gradient2.m ├── gradientHist.m ├── gradientMag.m ├── gradientMex.cpp ├── gradientMex.mexa64 ├── gradientMex.mexw64 ├── integralVecImage.m ├── intensityChannelNorm11.mat ├── libopencv_core.a ├── libopencv_core.so ├── libopencv_imgproc.a ├── libopencv_imgproc.so ├── load_video_info_zc.m ├── mexResize.cpp ├── mexResize.mexa64 ├── mexResize.mexw64 ├── mtimesx.c ├── mtimesx.m ├── mtimesx.mexa64 ├── mtimesx.mexw64 ├── mtimesx_RealTimesReal.c ├── mtimesx_build.m ├── mtimesx_sparse.m ├── opencv_core242.dll ├── opencv_core242.lib ├── opencv_imgproc242.dll ├── opencv_imgproc242.lib ├── partition_spectrum2.m ├── reflect_spectrum2.m ├── resizeDFT2.m ├── resp_newton.m ├── setnonzeros.c ├── setnonzeros.mexa64 ├── setnonzeros.mexw64 ├── sse.hpp ├── table_lookup.m ├── tracker.m ├── tracker_SRDCF.m ├── vot_initialize.m ├── vot_quit.m ├── vot_wrapper.m └── wrappers.hpp /Processing/RidgeRrgression.m: -------------------------------------------------------------------------------- 1 | function data = RidgeRrgression(data, params) 2 | 3 | % Get multi-resolution image 4 | for scale_ind = 1:params.number_of_scales 5 | data.setup.multires_pixel_template(:,:,:,scale_ind) = ... 6 | get_pixels(data.seq.im, data.obj.pos, round(data.obj.sz*data.obj.currentScaleFactor*data.setup.scaleFactors(scale_ind)), data.obj.sz); 7 | end 8 | 9 | xt = bsxfun(@times,get_features(data.setup.multires_pixel_template,params.t_features,params.t_global),data.setup.cos_window); 10 | 11 | xtf = fft2(xt); 12 | 13 | responsef = permute(sum(bsxfun(@times, data.objf.hf, xtf), 3), [1 2 4 3]); 14 | 15 | if params.interpolate_response == 2 16 | % use dynamic interp size 17 | data.interp_sz = floor(size(data.y) * data.setup.featureRatio * data.obj.currentScaleFactor); 18 | end 19 | responsef_padded = resizeDFT2(responsef, data.obj.interp_sz); 20 | 21 | % response 22 | response = ifft2(responsef_padded, 'symmetric'); 23 | 24 | resp = fftshift(response); 25 | max_response = max(resp(:)); 26 | [~,~,k] = size(response); 27 | max_layer = 1; 28 | for layer = 1 : k 29 | if(max(resp(:,:,layer)) == max_response) 30 | max_layer = layer; 31 | end 32 | end 33 | 34 | data.reg = jud_overlap([data.obj.pos([2,1]), data.obj.target_sz([2,1])],resp(:,:,max_layer)); 35 | 36 | end -------------------------------------------------------------------------------- /Processing/Visualization.m: -------------------------------------------------------------------------------- 1 | function Visualization(bSaveImage, slector, frame, im, pos, target_sz) 2 | % figure(1) 3 | if bSaveImage 4 | rect_position_vis = [pos([2,1]) - (target_sz([2,1]) - 1)/2, target_sz([2,1])]; 5 | im_to_show = double(im)/255; 6 | if size(im_to_show,3) == 1 7 | im_to_show = repmat(im_to_show, [1 1 3]); 8 | end 9 | if frame == 1 10 | imagesc(im_to_show); 11 | hold on; 12 | rectangle('Position',rect_position_vis, 'EdgeColor','g', 'LineWidth',2); 13 | text(10, 10, int2str(frame), 'color', [0 1 1]); 14 | hold off; 15 | axis off;axis image;set(gca, 'Units', 'normalized', 'Position', [0 0 1 1]) 16 | else 17 | imagesc(im_to_show); 18 | hold on; 19 | if slector == 1 20 | edgecolor = 'g'; 21 | elseif slector == 0 22 | edgecolor = 'b'; 23 | else 24 | edgecolor = 'r'; 25 | end 26 | rectangle('Position',rect_position_vis, 'EdgeColor',edgecolor, 'LineWidth',2); 27 | text(10, 10, int2str(frame), 'color', [0 1 1]); 28 | hold off; 29 | axis off;axis image;set(gca, 'Units', 'normalized', 'Position', [0 0 1 1]) 30 | end 31 | drawnow 32 | end 33 | 34 | end -------------------------------------------------------------------------------- /Processing/getSelector.m: -------------------------------------------------------------------------------- 1 | function s=getSelector(params, data, ss) 2 | 3 | lamda = params.s_lamda; 4 | 5 | ref_window_power = params.reg_window_power; 6 | 7 | % normalization factor 8 | reg_scale = 0.5 * data.obj.base_target_sz/data.setup.featureRatio; 9 | 10 | % construct grid 11 | wrg = -(data.obj.use_sz(1)-1)/2:(data.obj.use_sz(1)-1)/2; 12 | wcg = -(data.obj.use_sz(2)-1)/2:(data.obj.use_sz(2)-1)/2; 13 | [wrs, wcs] = ndgrid(wrg, wcg); 14 | 15 | % construct the regukarization window 16 | reg_window = (params.reg_window_edge - params.reg_window_min) * (abs(wrs/reg_scale(1)).^ref_window_power + abs(wcs/reg_scale(2)).^ref_window_power) + params.reg_window_min; 17 | 18 | W_o = reg_window; 19 | maxmax = max(max(reg_window)); 20 | minmin = min(min(reg_window)); 21 | mmdiff = maxmax + minmin; 22 | W_c(:,:) = mmdiff - reg_window(:,:); 23 | 24 | switch params.selector 25 | case -1 % context filter 26 | F = data.conf.hf; 27 | case 0 % mix filter 28 | F = data.mixf.hf; 29 | case 1 % object filter 30 | F = data.objf.hf; 31 | end 32 | 33 | f = real(ifft2(F)); 34 | P = sum(sum(sum(W_c.*(W_o - W_c) .* f))); 35 | Q = sum(sum(sum((W_o - W_c).^2 .* f))); 36 | 37 | PP = P/(P+Q); 38 | QQ = Q/(P+Q); 39 | 40 | s= (lamda * ss - PP)./ (QQ + lamda) ; 41 | 42 | end 43 | -------------------------------------------------------------------------------- /Processing/get_APCE.m: -------------------------------------------------------------------------------- 1 | function [max_res,APCE] = get_APCE(C) 2 | 3 | C_max=max(max(C)); 4 | C_min=min(min(C)); 5 | max_res = C_max; 6 | APCE=(C_max-C_min)^2/mean((C(:)-C_min).^2); 7 | 8 | end -------------------------------------------------------------------------------- /Processing/get_PSR.m: -------------------------------------------------------------------------------- 1 | function [max_response,PSR] = get_PSR(response_map) 2 | 3 | [max_resp_row, max_rows] = max(response_map, [], 1); 4 | [max_response, max_col] = max(max_resp_row, [], 2); 5 | max_row=max_rows(max_col); 6 | % size_r=size(response_map); 7 | % maxregion_index = [max_row-5:max_row+5;max_col-5:max_col+5]; 8 | 9 | 10 | response_map(max(1,max_row-5):max_row+5,max(1,max_col-5):max_col+5)=2; 11 | response_map((response_map==2))=[]; 12 | mean_sidelobe=mean(response_map); 13 | std_response_map=std(response_map); 14 | PSR= (max_response-mean_sidelobe)/std_response_map; 15 | 16 | -------------------------------------------------------------------------------- /Processing/get_pixels2.m: -------------------------------------------------------------------------------- 1 | function [ resized_patch ] = get_pixels2( im, pos, sz, resize_target ) 2 | 3 | if isscalar(sz), %square sub-window 4 | sz = [sz, sz]; 5 | end; 6 | 7 | %make sure the size is not to small 8 | if sz(1) < 1 9 | sz(1) = 2; 10 | end; 11 | if sz(2) < 1 12 | sz(2) = 2; 13 | end; 14 | 15 | 16 | xs = floor(pos(2)) + (1:sz(2)) - floor(sz(2)/2); 17 | ys = floor(pos(1)) + (1:sz(1)) - floor(sz(1)/2); 18 | 19 | %check for out-of-bounds coordinates, and set them to the values at 20 | %the borders 21 | xs(xs < 1) = size(im,2); 22 | ys(ys < 1) = size(im,1); 23 | xs(xs > size(im,2)) = 1; 24 | ys(ys > size(im,1)) = 1; 25 | 26 | %extract image 27 | % im_path=zeros(sz(1),sz(2)); 28 | im_patch = im(ys, xs, :); 29 | 30 | if isempty(resize_target) 31 | resized_patch = im_patch; 32 | else 33 | resized_patch = mexResize(im_patch,resize_target,'auto'); 34 | end 35 | 36 | end 37 | 38 | -------------------------------------------------------------------------------- /Processing/normalizing.m: -------------------------------------------------------------------------------- 1 | function Y = normalizing(X,a,b) 2 | minX=min(min(X)); 3 | maxX=max(max(X)); 4 | Y=(X-minX)*((b-a)/(maxX-minX))+a; 5 | end -------------------------------------------------------------------------------- /Processing/saliency_RA10/RGB2Lab.m: -------------------------------------------------------------------------------- 1 | function [L,a,b] = RGB2Lab(R,G,B) 2 | %RGB2LAB Convert an image from RGB to CIELAB 3 | % 4 | % function [L, a, b] = RGB2Lab(R, G, B) 5 | % function [L, a, b] = RGB2Lab(I) 6 | % function I = RGB2Lab(...) 7 | % 8 | % RGB2Lab takes red, green, and blue matrices, or a single M x N x 3 image, 9 | % and returns an image in the CIELAB color space. RGB values can be 10 | % either between 0 and 1 or between 0 and 255. Values for L are in the 11 | % range [0,100] while a and b are roughly in the range [-110,110]. The 12 | % output is of type double. 13 | % 14 | % This transform is based on ITU-R Recommendation BT.709 using the D65 15 | % white point reference. The error in transforming RGB -> Lab -> RGB is 16 | % approximately 10^-5. 17 | % 18 | % See also LAB2RGB. 19 | 20 | % By Mark Ruzon from C code by Yossi Rubner, 23 September 1997. 21 | % Updated for MATLAB 5 28 January 1998. 22 | % Updated for MATLAB 7 30 March 2009. 23 | 24 | if nargin == 1 25 | B = double(R(:,:,3)); 26 | G = double(R(:,:,2)); 27 | R = double(R(:,:,1)); 28 | end 29 | 30 | if max(max(R)) > 1.0 || max(max(G)) > 1.0 || max(max(B)) > 1.0 31 | R = double(R) / 255; 32 | G = double(G) / 255; 33 | B = double(B) / 255; 34 | end 35 | 36 | % Set a threshold 37 | T = 0.008856; 38 | 39 | [M, N] = size(R); 40 | s = M * N; 41 | RGB = [reshape(R,1,s); reshape(G,1,s); reshape(B,1,s)]; 42 | 43 | % RGB to XYZ 44 | MAT = [0.412453 0.357580 0.180423; 45 | 0.212671 0.715160 0.072169; 46 | 0.019334 0.119193 0.950227]; 47 | XYZ = MAT * RGB; 48 | 49 | % Normalize for D65 white point 50 | X = XYZ(1,:) / 0.950456; 51 | Y = XYZ(2,:); 52 | Z = XYZ(3,:) / 1.088754; 53 | 54 | XT = X > T; 55 | YT = Y > T; 56 | ZT = Z > T; 57 | 58 | Y3 = Y.^(1/3); 59 | 60 | fX = XT .* X.^(1/3) + (~XT) .* (7.787 .* X + 16/116); 61 | fY = YT .* Y3 + (~YT) .* (7.787 .* Y + 16/116); 62 | fZ = ZT .* Z.^(1/3) + (~ZT) .* (7.787 .* Z + 16/116); 63 | 64 | L = reshape(YT .* (116 * Y3 - 16.0) + (~YT) .* (903.3 * Y), M, N); 65 | a = reshape(500 * (fX - fY), M, N); 66 | b = reshape(200 * (fY - fZ), M, N); 67 | 68 | if nargout < 2 69 | L = cat(3,L,a,b); 70 | end -------------------------------------------------------------------------------- /Processing/saliency_RA10/get_saliency_RA.asv: -------------------------------------------------------------------------------- 1 | 2 | imgRoot='D:\tracking\Saliency_Detection\MR\';% test image path 3 | imname=[imgRoot 'im005.jpg']; 4 | name = 'im005.jpg'; 5 | img=imread(imname); 6 | [L,a,b]=RGB2Lab(img); 7 | [salMat,salMatInd]=saliencyMeasure({L,a,b}); 8 | imwrite(salMat,'saliency.','png'); 9 | 10 | -------------------------------------------------------------------------------- /Processing/saliency_RA10/get_saliency_RA.m: -------------------------------------------------------------------------------- 1 | 2 | function saliency_img = get_saliency_RA(img) 3 | 4 | [L,a,b]=RGB2Lab(img); 5 | [salMat,salMatInd]=saliencyMeasure({L,a,b}); 6 | saliency_img = salMat; 7 | % imwrite(salMat,'saliency.png'); 8 | 9 | end 10 | 11 | -------------------------------------------------------------------------------- /Processing/saliency_RA10/run_RA10_allsets.m: -------------------------------------------------------------------------------- 1 | clear all; 2 | close all; 3 | clc; 4 | 5 | %addpath('F:\Saliency_Dataset_Code\Running_code\HS\hsaliencyexe'); 6 | 7 | setname={'ECSSD'}; 8 | savepath1='C:\Users\scm\Desktop\tietu\runningtime\res\'; 9 | imagepath1='C:\Users\scm\Desktop\tietu\runningtime\'; 10 | imagetype='*.jpg'; 11 | inputimagetype='.jpg'; 12 | 13 | %tempfile='F:\Saliency_Dataset_Code\Running_code_2\DSR\temp_bmp\'; 14 | tic; 15 | for k = 1:10 16 | for i=1:length(setname) 17 | imagepath=[imagepath1 setname{i} '\' 'images\']; 18 | images=dir([imagepath imagetype]); 19 | number_images=length(images); 20 | savepath=[savepath1 setname{i} '\']; 21 | if(~exist(savepath,'file')) 22 | mkdir(savepath); 23 | end 24 | 25 | %imagepath='F:\Saliency_Dataset&Code\Running_code\HS\hsaliencyexe\src\'; 26 | 27 | for j=1:number_images 28 | image_name=[imagepath images(j).name]; 29 | savename=[savepath images(j).name(1:length(images(j).name)-4) '_RA10.png']; 30 | 31 | if(~exist(savename,'file')) 32 | try 33 | img=imread(image_name); 34 | [L,a,b]=RGB2Lab(img); 35 | [salMat,salMatInd]=saliencyMeasure({L,a,b}); 36 | imwrite(salMat,savename,'png'); 37 | disp(image_name); 38 | catch 39 | errorfile=[savepath 'errorfile\']; 40 | if(~exist(errorfile,'file')) 41 | mkdir(errorfile); 42 | end 43 | copyfile(image_name,[errorfile images(j).name]); 44 | end 45 | end 46 | end 47 | % param_str1=[imagepath imagetype]; 48 | % param_str2=[savepath]; 49 | % dos(['HSaliency.exe' ' "' param_str1 '" "' param_str2 '\"']); 50 | % for j=1:number_images 51 | % param_str1=[imagepath images(j).name]; 52 | % param_str2=[savepath '\']; 53 | % dos(['HSaliency.exe ' param_str1 ' ' param_str2]); 54 | % %eval(['!HSaliency ' imagepath images(j).name ' ' savepath '\']); 55 | % end 56 | end 57 | end 58 | toc; 59 | -------------------------------------------------------------------------------- /Processing/saliency_RA10/segmenting salient objects from images and videos/新建文本文档.txt: -------------------------------------------------------------------------------- 1 | http://www.cse.oulu.fi/CMV/Downloads/saliency -------------------------------------------------------------------------------- /Processing/saliency_RA10/新建文本文档.txt: -------------------------------------------------------------------------------- 1 | http://www.cse.oulu.fi/CMV/Downloads/saliency -------------------------------------------------------------------------------- /Processing/saliency_SCA/get_saliency_SCA.m: -------------------------------------------------------------------------------- 1 | 2 | function res=get_saliency_SCA(img,pixels) 3 | 4 | % imgpath=fullfile(path_img,strcat('img (',num2str(i),').jpg')); 5 | % img=imread(imgpath); 6 | im_size=size(img); 7 | mask=zeros(im_size(1),im_size(2)); 8 | box_l=round(im_size(1)/4); 9 | box_t=round(im_size(2)/4); 10 | mask(box_l:box_l*3,box_t:box_t*3)=1; 11 | sal=mask; 12 | [superpixel, ~] = slicmex(img,pixels,5); 13 | superpixel=superpixel+1; 14 | res=SCAfun(img, superpixel, sal); 15 | % savepath=fullfile('results',strcat('res(',num2str(i),').jpg')); 16 | % imwrite(res,savepath); 17 | % level = graythresh(res); 18 | % bw_slcimg=im2bw(res,level); 19 | % savepath1=fullfile('results',strcat('bw(',num2str(i),').jpg')); 20 | % imwrite(bw_slcimg,savepath1); 21 | 22 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/get_saliency_SCA2.m: -------------------------------------------------------------------------------- 1 | 2 | function res=get_saliency_SCA2(img,pixels) 3 | 4 | % imgpath=fullfile(path_img,strcat('img (',num2str(i),').jpg')); 5 | % img=imread(imgpath); 6 | im_size=size(img); 7 | mask=zeros(im_size(1),im_size(2)); 8 | box_l=round(im_size(1)/8); 9 | box_t=round(im_size(2)/8); 10 | mask(box_l*3:box_l*5,box_t*3:box_t*5)=1; 11 | sal=mask; 12 | [superpixel, ~] = slicmex(img,pixels,5); 13 | superpixel=superpixel+1; 14 | res=SCAfun(img, superpixel, sal); 15 | % savepath=fullfile('results',strcat('res(',num2str(i),').jpg')); 16 | % imwrite(res,savepath); 17 | % level = graythresh(res); 18 | % bw_slcimg=im2bw(res,level); 19 | % savepath1=fullfile('results',strcat('bw(',num2str(i),').jpg')); 20 | % imwrite(bw_slcimg,savepath1); 21 | 22 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/AdjcProcloop.m: -------------------------------------------------------------------------------- 1 | function adjcMerge = AdjcProcloop(M,N) 2 | % $Description: 3 | % -compute the adjacent matrix 4 | % $Agruments 5 | % Input; 6 | % -M: superpixel label matrix 7 | % -N: superpixel number 8 | % Output: 9 | % -adjcMerge: adjacent matrix 10 | 11 | adjcMerge = zeros(N,N); 12 | [m n] = size(M); 13 | 14 | for i = 1:m-1 15 | for j = 1:n-1 16 | if(M(i,j)~=M(i,j+1)) 17 | adjcMerge(M(i,j),M(i,j+1)) = 1; 18 | adjcMerge(M(i,j+1),M(i,j)) = 1; 19 | end; 20 | if(M(i,j)~=M(i+1,j)) 21 | adjcMerge(M(i,j),M(i+1,j)) = 1; 22 | adjcMerge(M(i+1,j),M(i,j)) = 1; 23 | end; 24 | if(M(i,j)~=M(i+1,j+1)) 25 | adjcMerge(M(i,j),M(i+1,j+1)) = 1; 26 | adjcMerge(M(i+1,j+1),M(i,j)) = 1; 27 | end; 28 | if(M(i+1,j)~=M(i,j+1)) 29 | adjcMerge(M(i+1,j),M(i,j+1)) = 1; 30 | adjcMerge(M(i,j+1),M(i+1,j)) = 1; 31 | end; 32 | end; 33 | end; 34 | bd=unique([M(1,:),M(m,:),M(:,1)',M(:,n)']); 35 | for i=1:length(bd) 36 | for j=i+1:length(bd) 37 | adjcMerge(bd(i),bd(j))=1; 38 | adjcMerge(bd(j),bd(i))=1; 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/RGB2Lab.m: -------------------------------------------------------------------------------- 1 | function [L,a,b] = RGB2Lab(R,G,B) 2 | %RGB2LAB Convert an image from RGB to CIELAB 3 | % 4 | % function [L, a, b] = RGB2Lab(R, G, B) 5 | % function [L, a, b] = RGB2Lab(I) 6 | % function I = RGB2Lab(...) 7 | % 8 | % RGB2Lab takes red, green, and blue matrices, or a single M x N x 3 image, 9 | % and returns an image in the CIELAB color space. RGB values can be 10 | % either between 0 and 1 or between 0 and 255. Values for L are in the 11 | % range [0,100] while a and b are roughly in the range [-110,110]. The 12 | % output is of type double. 13 | % 14 | % This transform is based on ITU-R Recommendation BT.709 using the D65 15 | % white point reference. The error in transforming RGB -> Lab -> RGB is 16 | % approximately 10^-5. 17 | % 18 | % See also LAB2RGB. 19 | 20 | % By Mark Ruzon from C code by Yossi Rubner, 23 September 1997. 21 | % Updated for MATLAB 5 28 January 1998. 22 | % Updated for MATLAB 7 30 March 2009. 23 | 24 | if nargin == 1 25 | B = double(R(:,:,3)); 26 | G = double(R(:,:,2)); 27 | R = double(R(:,:,1)); 28 | end 29 | 30 | if max(max(R)) > 1.0 || max(max(G)) > 1.0 || max(max(B)) > 1.0 31 | R = double(R) / 255; 32 | G = double(G) / 255; 33 | B = double(B) / 255; 34 | end 35 | 36 | % Set a threshold 37 | T = 0.008856; 38 | 39 | [M, N] = size(R); 40 | s = M * N; 41 | RGB = [reshape(R,1,s); reshape(G,1,s); reshape(B,1,s)]; 42 | 43 | % RGB to XYZ 44 | MAT = [0.412453 0.357580 0.180423; 45 | 0.212671 0.715160 0.072169; 46 | 0.019334 0.119193 0.950227]; 47 | XYZ = MAT * RGB; 48 | 49 | % Normalize for D65 white point 50 | X = XYZ(1,:) / 0.950456; 51 | Y = XYZ(2,:); 52 | Z = XYZ(3,:) / 1.088754; 53 | 54 | XT = X > T; 55 | YT = Y > T; 56 | ZT = Z > T; 57 | 58 | Y3 = Y.^(1/3); 59 | 60 | fX = XT .* X.^(1/3) + (~XT) .* (7.787 .* X + 16/116); 61 | fY = YT .* Y3 + (~YT) .* (7.787 .* Y + 16/116); 62 | fZ = ZT .* Z.^(1/3) + (~ZT) .* (7.787 .* Z + 16/116); 63 | 64 | L = reshape(YT .* (116 * Y3 - 16.0) + (~YT) .* (903.3 * Y), M, N); 65 | a = reshape(500 * (fX - fY), M, N); 66 | b = reshape(200 * (fY - fZ), M, N); 67 | 68 | if nargout < 2 69 | L = cat(3,L,a,b); 70 | end 71 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/ReadDAT.m: -------------------------------------------------------------------------------- 1 | function B = ReadDAT(image_size,data_path) 2 | 3 | row = image_size(1); 4 | colomn = image_size(2); 5 | fid = fopen(data_path,'r'); 6 | A = fread(fid, row * colomn, 'uint32')'; 7 | A = A + 1; 8 | B = reshape(A,[colomn, row]); 9 | B = B'; 10 | fclose(fid); -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/calculateRegionProps.m: -------------------------------------------------------------------------------- 1 | function regions = calculateRegionProps(sup_num,sulabel_im) 2 | % function regions = calculateRegionProps(sup_num,sulabel_im) can 3 | % calculate the region pixel index for each superpixel. 4 | % 5 | % Input: sup_num - the number of superpixels 6 | % sublabel_im - the superpixel labels for all pixels 7 | % 8 | % Output: regions - the region pixel index for each superpixel 9 | 10 | for r = 1:sup_num 11 | indxy = find(sulabel_im==r); 12 | [indx indy] = find(sulabel_im==r); 13 | regions{r}.pixelInd = indxy; 14 | regions{r}.pixelIndxy = [indx indy]; 15 | end -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/extractSupfeat.m: -------------------------------------------------------------------------------- 1 | function [sup_feat] = extractSupfeat(input_imlab,regions,sup_num) 2 | % The function can extract the LAB features of each superpixel. 3 | % 4 | % Input; 5 | % input_imlab - the input image with LAB information 6 | % regions - the region pixel index for each superpixel 7 | % sup_num - the number of superpixels 8 | % 9 | % Output: sup_feat - the normalized LAB features of 10 | % each superpixel 11 | 12 | L = input_imlab(:,:,1); 13 | A = input_imlab(:,:,2); 14 | B = input_imlab(:,:,3); 15 | 16 | % normalize the LAB color feature 17 | L = (L-min(L(:)))/(max(L(:))-min(L(:))); 18 | A = (A-min(A(:)))/(max(A(:))-min(A(:))); 19 | B = (B-min(B(:)))/(max(B(:))-min(B(:))); 20 | 21 | sup_feat = []; 22 | for r = 1:sup_num 23 | ind = regions{r}.pixelInd; 24 | meanall = [mean(L(ind)),mean(A(ind)),mean(B(ind))]; 25 | sup_feat = [sup_feat;meanall]; 26 | end 27 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/extract_bg_sp.m: -------------------------------------------------------------------------------- 1 | function boundary_sp = extract_bg_sp(sulabel,r,c) 2 | % function bg_sp = extract_bg_sp(sulabel,r,c) can find the label 3 | % for each boundary superpixels. 4 | % 5 | % Input: sulabel - the superpixel label for all pixels 6 | % r - the number of pixel rows 7 | % c - the number of pixel columns 8 | % 9 | % Output:boundary_sp - the labels for boundary superpixels 10 | 11 | r1=unique(sulabel(1,:)); 12 | rend=unique(sulabel(r,:)); 13 | c1=unique(sulabel(:,1)); 14 | cend=unique(sulabel(:,c)); 15 | boundary_sp=[r1 rend c1' cend']; 16 | boundary_sp = unique(boundary_sp); -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/form_codebook.m: -------------------------------------------------------------------------------- 1 | function centers = form_codebook(descriptors, codebook_size, Max_Iterations) 2 | %% function centers = form_codebook(descriptors, codebook_size) 3 | %% 4 | %% This function uses input features to form a codebook by k-means clustering 5 | %% algorithm. The code is modified from part of R. Fergus's bag of features code. 6 | %% The clustering is performed using VGG code from Oxford written by Mark 7 | %% Everingham. The source is provided, which must be compiled to a MEX file 8 | %% for your given platform. 9 | %% 10 | %% Function specification: 11 | %% Input 12 | %% descriptors : input features [dim x num] 13 | %% codebook_size : size of codebook 14 | %% Max_Iterations : Max number of k-means iterations 15 | %% Output 16 | %% centers : formed codebook [dim x codebook size] 17 | 18 | Verbosity = 0; %% Verbsoity of Mark's code 19 | 20 | %% form options structure for clustering 21 | cluster_options.maxiters = Max_Iterations; 22 | cluster_options.verbose = Verbosity; 23 | 24 | %% call kmeans clustering routine by Mark Everingham 25 | [centers,sse] = vgg_kmeans(double(descriptors), codebook_size, cluster_options); -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/labelCluster.m: -------------------------------------------------------------------------------- 1 | function [ featLabel ] = labelCluster( centers, LAB_feature, N_sample, K ) 2 | % function [ featLabel ] sort the input superpixels into K clusters based on 3 | % the their CIE LAB color features. 4 | % 5 | % Input; 6 | % -centers: formed codebook 7 | % -LAB_feature: the LAB features of the boundary superpixels 8 | % -N_sample: the number of the boundary superpixels 9 | % -K: the number of clusters 10 | % Output: 11 | % -featLabel: a row vector of the boundary superpixels' cluster label 12 | 13 | 14 | distance = zeros(K,N_sample); 15 | 16 | for i=1:K 17 | for j=1:N_sample 18 | distance(i,j) = norm(LAB_feature(:,j)-centers(:,i)); 19 | end 20 | end 21 | 22 | [minval , featLabel] = min(distance); -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/makeweights.m: -------------------------------------------------------------------------------- 1 | function weights=makeweights(edges,vals,valScale) 2 | valDistances=sqrt(sum((vals(edges(:,1),:)-vals(edges(:,2),:)).^2,2)); 3 | valDistances=normalize(valDistances); %Normalize to [0,1] 4 | weights=exp(-valScale*valDistances); 5 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/normalization.m: -------------------------------------------------------------------------------- 1 | function matrix = normalization(mat, flag) 2 | % INPUT : 3 | % flag: 1 denotes that the mat is a cell; 4 | % 0 denotes that the mat is a matrix; 5 | % 6 | if flag ~= 0 7 | dim = length(mat); 8 | for i = 1:dim 9 | matrix{i} = ( mat{i} - min(min(mat{i}))) / ( max(max(mat{i})) - min(min( mat{i}))); 10 | end 11 | else 12 | matrix = ( mat - min(min(mat)))/( max(max(mat)) - min(min(mat))); 13 | end -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/normalize_1.m: -------------------------------------------------------------------------------- 1 | function matrix = normalize_1(mat, flag) 2 | % INPUT : 3 | % mat 4 | % flag: 1 denotes that the mat is a cell; 5 | % 0 denotes that the mat is a matrix; 6 | % OUTPUT: 7 | % matrix 8 | % 9 | if flag ~= 0 10 | dim = length(mat); 11 | for i = 1:dim 12 | matrix{i} = ( mat{i} - min(min(mat{i})) +0.001) / ( max(max(mat{i})) - min(min( mat{i}))+0.002 ); 13 | end 14 | else 15 | matrix = ( mat - min(min(mat))+0.001 )/( max(max(mat)) - min(min(mat))+0.002 ); 16 | end -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/removeframe.m: -------------------------------------------------------------------------------- 1 | function [input_im,w]=removeframe(imname) 2 | 3 | threshold=0.6; 4 | input_im=imread(imname); 5 | input_im=im2double(input_im); 6 | gray=rgb2gray(input_im); 7 | edgemap = edge(gray,'canny'); 8 | [m,n]=size(edgemap); 9 | flagt=0; 10 | flagd=0; 11 | flagr=0; 12 | flagl=0; 13 | t=1; 14 | d=1; 15 | l=1; 16 | r=1; 17 | 18 | for k=1:30 % we assume that the frame is not wider than 30 pixels. 19 | pbt=mean(edgemap(k,:)); 20 | pbd=mean(edgemap(m-k+1,:)); 21 | pbl=mean(edgemap(:,k)); 22 | pbr=mean(edgemap(:,n-k+1)); 23 | if pbt>threshold 24 | t=k; 25 | flagt=1; 26 | end 27 | if pbd>threshold 28 | d=k; 29 | flagd=1; 30 | end 31 | if pbl>threshold 32 | l=k; 33 | flagl=1; 34 | end 35 | if pbr>threshold 36 | r=k; 37 | flagr=1; 38 | end 39 | end 40 | 41 | flagrm=flagt+flagd+flagl+flagr; 42 | % we assume that there exists a frame when one more lines parallel to the image side are detected 43 | if flagrm>1 44 | maxwidth=max([t,d,l,r]); 45 | % 46 | if t==1 47 | t=maxwidth; 48 | end 49 | if d==1 50 | d=maxwidth; 51 | end 52 | if l==1 53 | l=maxwidth; 54 | end 55 | if r==1 56 | r=maxwidth; 57 | end 58 | input_im=input_im(t:m-d+1,l:n-r+1,:); 59 | w=[m,n,t,m-d+1,l,n-r+1]; 60 | else 61 | w=[m,n,1,m,1,n]; 62 | end 63 | outname=[imname(1:end-4) '.bmp']; 64 | imwrite(input_im,outname); 65 | 66 | 67 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/vgg_argparse.m: -------------------------------------------------------------------------------- 1 | function [opts,rem_opts] = vgg_argparse(opts,varargin) 2 | 3 | %VGG_ARGPARSE Parse variable arguments into a structure 4 | % opts = vgg_argparse(inopts,varargin) 5 | % inopts: structure (cells array) listing valid members and default values 6 | % varargin: variable arguments of form '',,... 7 | % opts: opts modified by varargin 8 | % 9 | % Example: 10 | % function f = foo(varargin) 11 | % opts = vgg_argparse(struct('maxiters',10,'verbose',0), varargin) 12 | % ... 13 | % 14 | % An unknown option (ie, present in varargin but absent in inopts) 15 | % causes an error. Calling the function as 16 | % [opts,rem_opts] = vgg_argparse(inopts,varargin) returns the unknown 17 | % option(s) in rem_opts for later use rather than causes an error. 18 | % 19 | % May also use OPTS = VGG_ARGPARSE(OPTS, ASTRUCT) where ASTRUCT is a struct 20 | % of options. 21 | 22 | % Author: Mark Everingham 23 | % modified by werner, Jan 03 24 | % Date: 16 Jan 02 25 | 26 | if iscell(opts) 27 | opts=struct(opts{:}); 28 | end 29 | 30 | if length(varargin) & iscell(varargin{1}) 31 | if isempty(varargin{1}) 32 | inopts = struct([]); 33 | else 34 | inopts=struct(varargin{1}{:}); 35 | end 36 | else 37 | if isempty(varargin) 38 | inopts = struct([]); 39 | elseif isstruct(varargin{1}) 40 | inopts = varargin{1}; 41 | else 42 | inopts=struct(varargin{:}); 43 | end 44 | end 45 | 46 | rem_opts = []; 47 | fn = fieldnames(inopts); 48 | for i=1:length(fn) 49 | if isfield(opts,fn{i}) 50 | %opts.(fn{i})=inopts.(fn{i}); 51 | opts = setfield(opts,fn{i},getfield(inopts,fn{i})); 52 | else 53 | if nargout < 2 54 | error(sprintf('bad argument: ''%s''', fn{i})); 55 | else 56 | %rem_opts.(fn{i}) = inopts.(fn{i}); 57 | rem_opts = setfield(rem_opts,fn{i},getfield(inopts,fn{i})); 58 | end 59 | end 60 | end -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/vgg_kmeans.m: -------------------------------------------------------------------------------- 1 | function [CX, sse] = vgg_kmeans(X, nclus, varargin) 2 | 3 | % VGG_KMEANS initialize K-means clustering 4 | % [CX, sse] = vgg_kmeans(X, nclus, optname, optval, ...) 5 | % 6 | % - X: input points (one per column) 7 | % - nclus: number of clusters 8 | % - opts (defaults): 9 | % maxiters (inf): maxmimum number of iterations 10 | % mindelta (eps): minimum change in SSE per iteration 11 | % verbose (1): 1=print progress 12 | % 13 | % - CX: cluster centers 14 | % - sse: SSE 15 | 16 | % Author: Mark Everingham 17 | % Date: 13 Jan 03 18 | % Modified by wanghe 2014/08/24 19 | opts = struct('maxiters', inf, 'mindelta', eps, 'verbose', 1); 20 | if nargin > 2 21 | opts=vgg_argparse(opts,varargin); 22 | end 23 | 24 | % perm=randperm(size(X,2)); 25 | % CX=X(:,perm(1:nclus)); 26 | if nclus==3 27 | perm= size(X,2); 28 | CX=X(:,[2 round(perm/2) perm-1]); 29 | end 30 | if nclus==2 31 | perm= size(X,2); 32 | CX=X(:,[2 perm-1]); 33 | end 34 | sse0 = inf; 35 | iter = 0; 36 | while iter < opts.maxiters 37 | 38 | tic; 39 | [CX, sse] = vgg_kmiter(X, CX); 40 | t=toc; 41 | 42 | if opts.verbose 43 | fprintf('iter %d: sse = %g (%g secs)\n', iter, sse, t) 44 | end 45 | 46 | if sse0-sse < opts.mindelta 47 | break 48 | end 49 | 50 | sse0=sse; 51 | iter=iter+1; 52 | 53 | end 54 | 55 | -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/vgg_kmiter.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_SCA/others/vgg_kmiter.dll -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/vgg_kmiter.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_SCA/others/vgg_kmiter.mexglx -------------------------------------------------------------------------------- /Processing/saliency_SCA/others/vgg_kmiter.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_SCA/others/vgg_kmiter.mexw64 -------------------------------------------------------------------------------- /Processing/saliency_SCA/saliency.asv: -------------------------------------------------------------------------------- 1 | 2 | path_img='C:\Users\mcg000\Desktop\saliency_SCA\images\' 3 | for i=1:51 4 | imgpath=fullfile(path_img,strcat('img (',num2str(i),').jpg')); 5 | img=imread(imgpath); 6 | im_size=size(img); 7 | mask=zeros(im_size(1),im_size(2)); 8 | box_l=round(im_size(1)/4); 9 | box_t=round(im_size(2)/4); 10 | mask(box_l:box_l*3,box_t:box_t*3)=1; 11 | sal=mask; 12 | % figure(1);imshow(sal); 13 | %figure(2);imshow(img); 14 | [superpixel, ~] = slicmex(img,300,5); 15 | superpixel=superpixel+1; 16 | res=SCAfun(img, superpixel, sal); 17 | savepath=fullfile('results',strcat('res(',num2str(i),').jpg')); 18 | imwrite(res,savepath); 19 | level = graythresh(res); 20 | bw_slcimg=im2bw(res,level); 21 | savepath1=fullfile('results',strcat('bw(',num2str(i),').jpg')); 22 | % figure(3);imshow(res); 23 | end -------------------------------------------------------------------------------- /Processing/saliency_SCA/slicmex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_SCA/slicmex.mexw64 -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_0_272.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_0_272.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_0_579.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_0_579.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_0_840.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_0_840.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_11_11852.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_11_11852.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_11_11881.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_11_11881.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_12_12344.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_12_12344.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_1_1664.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_1_1664.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_1_1696.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_1_1696.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_3_3654.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_3_3654.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_4_4328.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_4_4328.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_5_5463.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_5_5463.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_5_5586.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_5_5586.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/GT/0_6_6791.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/GT/0_6_6791.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_272_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_272_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_272_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_272_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_272_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_272_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_272_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_272_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_579_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_579_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_579_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_579_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_579_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_579_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_579_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_579_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_840_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_840_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_840_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_840_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_840_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_840_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_0_840_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_0_840_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11852_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11852_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11852_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11852_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11852_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11852_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11852_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11852_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11881_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11881_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11881_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11881_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11881_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11881_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_11_11881_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_11_11881_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_12_12344_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_12_12344_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_12_12344_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_12_12344_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_12_12344_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_12_12344_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_12_12344_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_12_12344_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1664_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1664_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1664_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1664_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1664_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1664_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1664_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1664_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1696_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1696_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1696_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1696_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1696_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1696_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_1_1696_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_1_1696_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_3_3654_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_3_3654_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_3_3654_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_3_3654_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_3_3654_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_3_3654_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_3_3654_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_3_3654_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_4_4328_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_4_4328_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_4_4328_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_4_4328_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_4_4328_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_4_4328_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_4_4328_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_4_4328_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5463_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5463_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5463_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5463_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5463_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5463_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5463_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5463_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5586_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5586_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5586_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5586_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5586_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5586_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_5_5586_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_5_5586_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_6_6791_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_6_6791_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_6_6791_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_6_6791_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_6_6791_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_6_6791_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/Res/0_6_6791_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/Res/0_6_6791_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_0_272.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_0_272.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_0_579.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_0_579.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_0_840.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_0_840.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_11_11852.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_11_11852.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_11_11881.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_11_11881.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_12_12344.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_12_12344.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_1_1664.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_1_1664.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_1_1696.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_1_1696.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_3_3654.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_3_3654.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_4_4328.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_4_4328.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_5_5463.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_5_5463.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_5_5586.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_5_5586.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Data/SRC/0_6_6791.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Data/SRC/0_6_6791.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/BoundaryConnectivity.m: -------------------------------------------------------------------------------- 1 | function [bdCon, Len_bnd, Area] = BoundaryConnectivity(adjcMatrix, weightMatrix, bdIds, clipVal, geo_sigma, link_boundary) 2 | % Compute boundary connecity values for all superpixels 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | if (nargin < 6) 8 | link_boundary = true; 9 | end 10 | if (link_boundary) 11 | adjcMatrix = LinkBoundarySPs(adjcMatrix, bdIds); 12 | end 13 | 14 | adjcMatrix = tril(adjcMatrix, -1); 15 | edgeWeight = weightMatrix(adjcMatrix > 0); 16 | edgeWeight = max(0, edgeWeight - clipVal); 17 | 18 | % Cal pair-wise shortest path cost (geodesic distance) 19 | geoDistMatrix = graphallshortestpaths(sparse(adjcMatrix), 'directed', false, 'Weights', edgeWeight); 20 | 21 | Wgeo = Dist2WeightMatrix(geoDistMatrix, geo_sigma); 22 | Len_bnd = sum( Wgeo(:, bdIds), 2); %length of perimeters on boundary 23 | Area = sum(Wgeo, 2); %soft area 24 | bdCon = Len_bnd ./ sqrt(Area); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/CalMAE.m: -------------------------------------------------------------------------------- 1 | function mae = CalMAE(smap, gtImg) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | if size(smap, 1) ~= size(gtImg, 1) || size(smap, 2) ~= size(gtImg, 2) 6 | error('Saliency map and gt Image have different sizes!\n'); 7 | end 8 | 9 | if ~islogical(gtImg) 10 | gtImg = gtImg(:,:,1) > 128; 11 | end 12 | 13 | smap = im2double(smap(:,:,1)); 14 | fgPixels = smap(gtImg); 15 | fgErrSum = length(fgPixels) - sum(fgPixels); 16 | bgErrSum = sum(smap(~gtImg)); 17 | mae = (fgErrSum + bgErrSum) / numel(gtImg); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/CalMeanMAE.m: -------------------------------------------------------------------------------- 1 | function mae = CalMeanMAE(SRC, srcSuffix, GT, gtSuffix) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | files = dir(fullfile(SRC, strcat('*', srcSuffix))); 6 | if isempty(files) 7 | error('No saliency maps are found: %s\n', fullfile(SRC, strcat('*', srcSuffix))); 8 | end 9 | 10 | MAE = zeros(length(files), 1); 11 | parfor k = 1:length(files) 12 | srcName = files(k).name; 13 | srcImg = imread(fullfile(SRC, srcName)); 14 | 15 | gtName = strrep(srcName, srcSuffix, gtSuffix); 16 | gtImg = imread(fullfile(GT, gtName)); 17 | 18 | MAE(k) = CalMAE(srcImg, gtImg); 19 | end 20 | 21 | mae = mean(MAE); 22 | fprintf('MAE for %s: %f\n', srcSuffix, mae); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/CalPR.m: -------------------------------------------------------------------------------- 1 | function [precision, recall] = CalPR(smapImg, gtImg, targetIsFg, targetIsHigh) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | smapImg = smapImg(:,:,1); 6 | if ~islogical(gtImg) 7 | gtImg = gtImg(:,:,1) > 128; 8 | end 9 | if any(size(smapImg) ~= size(gtImg)) 10 | error('saliency map and ground truth mask have different size'); 11 | end 12 | 13 | if ~targetIsFg 14 | gtImg = ~gtImg; 15 | end 16 | 17 | gtPxlNum = sum(gtImg(:)); 18 | if 0 == gtPxlNum 19 | error('no foreground region is labeled'); 20 | end 21 | 22 | targetHist = histc(smapImg(gtImg), 0:255); 23 | nontargetHist = histc(smapImg(~gtImg), 0:255); 24 | 25 | if targetIsHigh 26 | targetHist = flipud(targetHist); 27 | nontargetHist = flipud(nontargetHist); 28 | end 29 | targetHist = cumsum( targetHist ); 30 | nontargetHist = cumsum( nontargetHist ); 31 | 32 | precision = targetHist ./ (targetHist + nontargetHist); 33 | if any(isnan(precision)) 34 | warning('there exists NAN in precision, this is because your saliency map do not range from 0 to 255\n'); 35 | end 36 | recall = targetHist / gtPxlNum; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/CalWeightedContrast.m: -------------------------------------------------------------------------------- 1 | function wCtr = CalWeightedContrast(colDistM, posDistM, bgProb) 2 | % Calculate background probability weighted contrast 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | spaSigma = 0.4; %sigma for spatial weight 9 | posWeight = Dist2WeightMatrix(posDistM, spaSigma); 10 | 11 | %bgProb weighted contrast 12 | wCtr = colDistM .* posWeight * bgProb; 13 | wCtr = (wCtr - min(wCtr)) / (max(wCtr) - min(wCtr) + eps); 14 | 15 | %post-processing for cleaner fg cue 16 | removeLowVals = true; 17 | if removeLowVals 18 | thresh = graythresh(wCtr); %automatic threshold 19 | wCtr(wCtr < thresh) = 0; 20 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/CreateImageFromSPs.m: -------------------------------------------------------------------------------- 1 | function [img, spValues] = CreateImageFromSPs(spValues, pixelList, height, width, doNormalize) 2 | % create an image from its superpixels' values 3 | % spValues is all superpixel's values, e.g., saliency 4 | % pixelList is a cell (with the same size as spValues) of pixel index arrays 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | if (~iscell(pixelList)) 11 | error('pixelList should be a cell'); 12 | end 13 | 14 | if (length(pixelList) ~= length(spValues)) 15 | error('different sizes in spValues and pixelList'); 16 | end 17 | 18 | if (nargin < 5) 19 | doNormalize = true; 20 | end 21 | 22 | minVal = min(spValues); 23 | maxVal = max(spValues); 24 | if doNormalize 25 | spValues = (spValues - minVal) / (maxVal - minVal + eps); 26 | else 27 | if minVal < -1e-6 || maxVal > 1 + 1e-6 28 | error('feature values do not range from 0 to 1'); 29 | end 30 | end 31 | 32 | img = zeros(height, width); 33 | for i=1:length(pixelList) 34 | img(pixelList{i}) = spValues(i); 35 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/Dist2WeightMatrix.m: -------------------------------------------------------------------------------- 1 | function weightMatrix = Dist2WeightMatrix(distMatrix, distSigma) 2 | % Transform pair-wise distance to pair-wise weight using 3 | % exp(-d^2/(2*sigma^2)); 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | spNum = size(distMatrix, 1); 10 | 11 | distMatrix(distMatrix > 3 * distSigma) = Inf; %cut off > 3 * sigma distances 12 | weightMatrix = exp(-distMatrix.^2 ./ (2 * distSigma * distSigma)); 13 | 14 | % if any(1 ~= weightMatrix(1:spNum+1:end)) 15 | % error('Diagonal elements in the weight matrix should be 1'); 16 | % end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/DrawPRCurve.m: -------------------------------------------------------------------------------- 1 | function [rec, prec] = DrawPRCurve(SMAP, smapSuffix, GT, gtSuffix, targetIsFg, targetIsHigh, color) 2 | % Draw PR Curves for all the image with 'smapSuffix' in folder SMAP 3 | % GT is the folder for ground truth masks 4 | % targetIsFg = true means we draw PR Curves for foreground, and otherwise 5 | % we draw PR Curves for background 6 | % targetIsHigh = true means feature values for our interest region (fg or 7 | % bg) is higher than the remaining regions. 8 | % color specifies the curve color 9 | 10 | % Code Author: Wangjiang Zhu 11 | % Email: wangjiang88119@gmail.com 12 | % Date: 3/24/2014 13 | 14 | files = dir(fullfile(SMAP, strcat('*', smapSuffix))); 15 | num = length(files); 16 | if 0 == num 17 | error('no saliency map with suffix %s are found in %s', smapSuffix, SMAP); 18 | end 19 | 20 | %precision and recall of all images 21 | ALLPRECISION = zeros(num, 256); 22 | ALLRECALL = zeros(num, 256); 23 | parfor k = 1:num 24 | smapName = files(k).name; 25 | smapImg = imread(fullfile(SMAP, smapName)); 26 | 27 | gtName = strrep(smapName, smapSuffix, gtSuffix); 28 | gtImg = imread(fullfile(GT, gtName)); 29 | 30 | [precision, recall] = CalPR(smapImg, gtImg, targetIsFg, targetIsHigh); 31 | 32 | ALLPRECISION(k, :) = precision; 33 | ALLRECALL(k, :) = recall; 34 | end 35 | 36 | prec = mean(ALLPRECISION, 1); %function 'mean' will give NaN for columns in which NaN appears. 37 | rec = mean(ALLRECALL, 1); 38 | 39 | % plot 40 | if nargin > 5 41 | plot(rec, prec, color, 'linewidth', 2); 42 | else 43 | plot(rec, prec, 'r', 'linewidth', 2); 44 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/EstimateBgProb.m: -------------------------------------------------------------------------------- 1 | function [bgProb, bdCon, bgWeight] = EstimateBgProb(colDistM, adjcMatrix, bdIds, clipVal, geoSigma) 2 | % Estimate background probability using boundary connectivity 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | bdCon = BoundaryConnectivity(adjcMatrix, colDistM, bdIds, clipVal, geoSigma, true); 9 | 10 | bdConSigma = 1; %sigma for converting bdCon value to background probability 11 | fgProb = exp(-bdCon.^2 / (2 * bdConSigma * bdConSigma)); %Estimate bg probability 12 | bgProb = 1 - fgProb; 13 | 14 | bgWeight = bgProb; 15 | % Give a very large weight for very confident bg sps can get slightly 16 | % better saliency maps, you can turn it off. 17 | fixHighBdConSP = true; 18 | highThresh = 3; 19 | if fixHighBdConSP 20 | bgWeight(bdCon > highThresh) = 1000; 21 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/EstimateDynamicParas.m: -------------------------------------------------------------------------------- 1 | function [clipVal, geoSigma, neiSigma] = EstimateDynamicParas(adjcMatrix, colDistM) 2 | % Estimate dynamic paras can slightly improve overall performance, but in 3 | % fact, influence of those paras is very small, you can just use fixed 4 | % paras, and we suggest you to set geoSigma = 7, neiSigma = 10. 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | [meanMin1, meanTop, meanMin2] = GetMeanMinAndMeanTop(adjcMatrix, colDistM, 0.01); 11 | clipVal = meanMin2; 12 | 13 | % Emperically choose adaptive sigma for converting geodesic distance to 14 | % weight 15 | geoSigma = min([10, meanMin1 * 3, meanTop / 10]); 16 | geoSigma = max(geoSigma, 5); 17 | 18 | % Emperically choose adaptive sigma for smoothness term in Equa(9) of our 19 | % paper. 20 | neiSigma = min([3 * meanMin1, 0.2 * meanTop, 20]); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetAdjMatrix.m: -------------------------------------------------------------------------------- 1 | function adjMatrix = GetAdjMatrix(idxImg, spNum) 2 | % Get adjacent matrix of super-pixels 3 | % idxImg is an integer image, values in [1..spNum] 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | [h, w] = size(idxImg); 10 | 11 | %Get edge pixel locations (4-neighbor) 12 | topbotDiff = diff(idxImg, 1, 1) ~= 0; 13 | topEdgeIdx = find( padarray(topbotDiff, [1 0], false, 'post') ); %those pixels on the top of an edge 14 | botEdgeIdx = topEdgeIdx + 1; 15 | 16 | leftrightDiff = diff(idxImg, 1, 2) ~= 0; 17 | leftEdgeIdx = find( padarray(leftrightDiff, [0 1], false, 'post') ); %those pixels on the left of an edge 18 | rightEdgeIdx = leftEdgeIdx + h; 19 | 20 | %Get adjacent matrix of super-pixels 21 | adjMatrix = zeros(spNum, spNum); 22 | adjMatrix( sub2ind([spNum, spNum], idxImg(topEdgeIdx), idxImg(botEdgeIdx)) ) = 1; 23 | adjMatrix( sub2ind([spNum, spNum], idxImg(leftEdgeIdx), idxImg(rightEdgeIdx)) ) = 1; 24 | adjMatrix = adjMatrix + adjMatrix'; 25 | adjMatrix(1:spNum+1:end) = 1;%set diagonal elements to 1 26 | adjMatrix = sparse(adjMatrix); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetBndPatchIds.m: -------------------------------------------------------------------------------- 1 | function bdIds = GetBndPatchIds(idxImg, thickness) 2 | % Get super-pixels on image boundary 3 | % idxImg is an integer image, values in [1..spNum] 4 | % thickness means boundary band width 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | if nargin < 2 11 | thickness = 8; 12 | end 13 | 14 | bdIds=unique([ 15 | unique( idxImg(1:thickness,:) ); 16 | unique( idxImg(end-thickness+1:end,:) ); 17 | unique( idxImg(:,1:thickness) ); 18 | unique( idxImg(:,end-thickness+1:end) ) 19 | ]); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetDistanceMatrix.m: -------------------------------------------------------------------------------- 1 | function distM = GetDistanceMatrix(feature) 2 | % Get pair-wise distance matrix between each rows in feature 3 | % Each row of feature correspond to a sample 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | spNum = size(feature, 1); 10 | DistM2 = zeros(spNum, spNum); 11 | 12 | for n = 1:size(feature, 2) 13 | DistM2 = DistM2 + ( repmat(feature(:,n), [1, spNum]) - repmat(feature(:,n)', [spNum, 1]) ).^2; 14 | end 15 | distM = sqrt(DistM2); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetMeanColor.m: -------------------------------------------------------------------------------- 1 | function meanCol = GetMeanColor(image, pixelList) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | 6 | [h, w, chn] = size(image); 7 | tmpImg=reshape(image, h*w, chn); 8 | 9 | spNum = length(pixelList); 10 | meanCol=zeros(spNum, chn); 11 | for i=1:spNum 12 | meanCol(i, :)=mean(tmpImg(pixelList{i},:), 1); 13 | end 14 | if chn ==1 %for gray images 15 | meanCol = repmat(meanCol, [1, 3]); 16 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetMeanMinAndMeanTop.m: -------------------------------------------------------------------------------- 1 | function [meanMin1, meanTop, meanMin2] = GetMeanMinAndMeanTop(adjcMatrix, colDistM, topRate) 2 | % Do statistics analysis on color distances between neighbor patches 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | spNum = size(adjcMatrix, 1); 9 | 10 | % 1. Min distance analysis (between neighbor patches) 11 | adjcMatrix(1:spNum+1:end) = 0; %patches do not link with itself for min distance analysis 12 | minDist = zeros(spNum, 1); %minDist(i) means the min distance from sp_i to its neighbors 13 | for id = 1:spNum 14 | isNeighbor = adjcMatrix(id,:) > 0; 15 | minDist(id) = min(colDistM(id, isNeighbor)); 16 | end 17 | meanMin1 = mean(minDist); 18 | 19 | % 2. Largest distance analysis (this measure can reflect image contrast level) 20 | tmp = sort(colDistM(tril(adjcMatrix, -1) > 0), 'descend'); 21 | meanTop = mean(tmp(1:round(topRate * length(tmp)))); 22 | 23 | % 3. Min distance analysis (between 2 layer neighbors) 24 | adjcMatrix = double( (adjcMatrix * adjcMatrix + adjcMatrix) > 0 ); %Reachability matrix 25 | adjcMatrix(1:spNum+1:end) = 0; 26 | minDist = zeros(spNum, 1); %minDist(i) means the min distance from sp_i to its neighbors 27 | for id = 1:spNum 28 | isNeighbor = adjcMatrix(id,:) > 0; 29 | minDist(id) = min(colDistM(id, isNeighbor)); 30 | end 31 | meanMin2 = mean(minDist); 32 | 33 | if meanMin2 > meanMin1 %as meanMin2 considered more neighbors, its min value should be no larger than meanMin1 34 | error('meanMin2 should <= meanMin1'); 35 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/GetNormedMeanPos.m: -------------------------------------------------------------------------------- 1 | function meanPos = GetNormedMeanPos(pixelList, height, width) 2 | % averaged x(y) coordinates of each superpixel, normalized with respect to 3 | % image dimension 4 | % return N*2 vector, row i is superpixel i's coordinate [y x] 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | spNum = length(pixelList); 11 | meanPos = zeros(spNum, 2); 12 | 13 | for n = 1 : spNum 14 | [rows, cols] = ind2sub([height, width], pixelList{n}); 15 | meanPos(n,1) = mean(rows) / height; 16 | meanPos(n,2) = mean(cols) / width; 17 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/Grid_Split.m: -------------------------------------------------------------------------------- 1 | function [idxImg, adjcMatrix, pixelList] = Grid_Split(inputImg, spnumber) 2 | % Segment rgb image into regular grid patches 3 | 4 | % Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | [h, w, chn] = size(inputImg); 9 | pixInEachGrid = h * w / spnumber; 10 | gridSize = round( sqrt(pixInEachGrid) ); 11 | 12 | xSplitPt = 1:gridSize:w; 13 | if w - xSplitPt(end) + 1 < gridSize / 3 14 | xSplitPt(end) = []; 15 | end 16 | xNum = length(xSplitPt); 17 | 18 | ySplitPt = 1:gridSize:h; 19 | if h - ySplitPt(end) + 1 < gridSize / 3 20 | ySplitPt(end) = []; 21 | end 22 | yNum = length(ySplitPt); 23 | 24 | % horizontal direction 25 | cnt = zeros(1, w); 26 | cnt(xSplitPt) = 1; 27 | ind_h = cumsum(cnt); 28 | 29 | % vertical direction 30 | cnt = zeros(h, 1); 31 | cnt(ySplitPt) = 1; 32 | ind_v = cumsum(cnt) - 1; 33 | 34 | idxImg = repmat(ind_h, [h, 1]) + repmat(ind_v, [1, w]) * xNum; 35 | spNum = idxImg(end); 36 | 37 | %Method 1 to get adjacent matrix 38 | %adjcMatrix = GetAdjMatrix(idxImg, spNum); 39 | 40 | %Method 2 to get adjacent matrix, this one is faster 41 | adjcMatrix = diag(ones(spNum-1, 1), 1) + diag(ones(spNum-1, 1), -1) + ... 42 | diag(ones(spNum-xNum, 1), xNum) + diag(ones(spNum-xNum, 1), -xNum) + ... 43 | eye(spNum); 44 | adjcMatrix = sparse(adjcMatrix); 45 | 46 | %Get pixel list in each super-pixel 47 | pixelList = cell(spNum, 1); 48 | ySplitPt(end+1) = h+1; 49 | xSplitPt(end+1) = w+1; 50 | for y = 1:yNum 51 | for x = 1:xNum 52 | id = (y-1) * xNum + x; 53 | s_x = xSplitPt(x+1) - xSplitPt(x); 54 | s_y = ySplitPt(y+1) - ySplitPt(y); 55 | 56 | %Method 1 to get pixelList: 28ms 57 | %pixelList{id} = reshape( repmat( (ySplitPt(y):ySplitPt(y+1)-1)', [1, s_x] ) + h * (repmat( xSplitPt(x):xSplitPt(x+1)-1, [s_y, 1]) - 1), [], 1); 58 | 59 | %Method 2 to get pixelList, this one is faster: 15ms 60 | list = zeros(s_x*s_y, 1); 61 | tmpId = (ySplitPt(y):ySplitPt(y+1)-1)' + (xSplitPt(x) - 1) * h; 62 | pos = 1; 63 | for n = 1:s_x 64 | list(pos:pos+s_y-1) = tmpId; 65 | tmpId = tmpId + h; 66 | pos = pos + s_y; 67 | end 68 | pixelList{id} = list; 69 | end 70 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/LinkBoundarySPs.m: -------------------------------------------------------------------------------- 1 | function adjcMatrix = LinkBoundarySPs(adjcMatrix, bdIds) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | 6 | adjcMatrix(bdIds, bdIds) = 1; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/LinkNNAndBoundary.m: -------------------------------------------------------------------------------- 1 | function adjcMatrix = LinkNNAndBoundary(adjcMatrix, bdIds) 2 | %link 2 layers of neighbor super-pixels and boundary patches 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | adjcMatrix = (adjcMatrix * adjcMatrix + adjcMatrix) > 0; 9 | adjcMatrix = double(adjcMatrix); 10 | 11 | adjcMatrix(bdIds, bdIds) = 1; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC/Rgb2Lab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "image\ImageSimple.h" 4 | 5 | inline double Fxyz(const double t) 6 | { 7 | return ((t > 0.008856)? pow(t, (1.0/3.0)) : (7.787*t + 16.0/116.0)); 8 | } 9 | 10 | inline void RgbPix2Lab(unsigned char byR, unsigned char byG, unsigned char byB, float &fL, float &fa, float &fb) 11 | { 12 | // RGBtoXYZ 13 | // Normalize red, green, blue values. 14 | double rLinear = (double)byR/255.0; 15 | double gLinear = (double)byG/255.0; 16 | double bLinear = (double)byB/255.0; 17 | 18 | // Convert to a sRGB form 19 | double r = (rLinear > 0.04045)? pow((rLinear + 0.055)/(1 + 0.055), 2.2) : (rLinear/12.92) ; 20 | double g = (gLinear > 0.04045)? pow((gLinear + 0.055)/(1 + 0.055), 2.2) : (gLinear/12.92) ; 21 | double b = (bLinear > 0.04045)? pow((bLinear + 0.055)/(1 + 0.055), 2.2) : (bLinear/12.92) ; 22 | 23 | // Converts 24 | double x = r*0.4124 + g*0.3576 + b*0.1805; 25 | double y = r*0.2126 + g*0.7152 + b*0.0722; 26 | double z = r*0.0193 + g*0.1192 + b*0.9505; 27 | 28 | x = (x>0.9505)? 0.9505 : ((x<0)? 0 : x); 29 | y = (y>1.0)? 1.0 : ((y<0)? 0 : y); 30 | z = (z>1.089)? 1.089 : ((z<0)? 0 : z); 31 | 32 | // XYZ to LAB 33 | double dD65_X = 0.9505; 34 | double dD65_Y = 1.0; 35 | double dD65_Z = 1.0890; 36 | 37 | double dL = 116.0 * Fxyz( y/dD65_Y ) - 16; 38 | double dA = 500.0 * ( Fxyz( x/dD65_X ) - Fxyz( y/dD65_Y) ); 39 | double dB = 200.0 * ( Fxyz( y/dD65_Y ) - Fxyz( z/dD65_Z) ); 40 | 41 | fL = (float) dL; 42 | fa = (float) dA; 43 | fb = (float) dB; 44 | } 45 | 46 | inline void Rgb2Lab(ImageSimpleUChar &rImg, ImageSimpleUChar &gImg, ImageSimpleUChar &bImg, ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg) 47 | { 48 | int w = rImg.Width(); 49 | int h = rImg.Height(); 50 | int pixNum = w * h; 51 | 52 | if (LImg.Width() != w || LImg.Height() != h) 53 | LImg.Create(w, h); 54 | if (AImg.Width() != w || AImg.Height() != h) 55 | AImg.Create(w, h); 56 | if (BImg.Width() != w || BImg.Height() != h) 57 | BImg.Create(w, h); 58 | 59 | for (int x = 0; x < pixNum; x ++) 60 | { 61 | RgbPix2Lab(rImg[x], gImg[x], bImg[x], LImg[x], AImg[x], BImg[x]); 62 | } 63 | } -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC/SLIC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "image/ImageSimple.h" 4 | 5 | int Run_SLIC_GivenPatchNum(ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg, unsigned int iPatchNum, float compactness, ImageSimpleUInt &idxImg); 6 | 7 | int Run_SLIC_GivenPatchSize(ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg, unsigned int iPatchSize, float compactness, ImageSimpleUInt &idxImg); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC/SLIC_mex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SLIC.h" 4 | #include "Rgb2Lab.h" 5 | 6 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 7 | { 8 | char usageStr[] = "Usage: idxImg = SLIC_mex(image(3-Channel uint8 image), spNum(double scalar), compactness(double scalar))\n"; 9 | 10 | //Check input 11 | const mxArray *pmxImg = prhs[0]; 12 | if (nrhs != 3 || !mxIsUint8(pmxImg) || !mxIsDouble(prhs[1]) || !mxIsDouble(prhs[2])) 13 | mexErrMsgTxt(usageStr); 14 | 15 | mwSize chn = mxGetNumberOfDimensions(pmxImg); 16 | if (3 != chn) 17 | mexErrMsgTxt(usageStr); 18 | const mwSize *sz = mxGetDimensions(pmxImg); 19 | mwSize height = sz[0], width = sz[1], num_pix = height * width; 20 | unsigned int iPatchNum = unsigned int( mxGetScalar(prhs[1]) ); 21 | float compactness = float( mxGetScalar(prhs[2]) ); 22 | 23 | //Transfer matlab matrix 24 | ImageSimpleUChar img_r, img_g, img_b; 25 | img_r.Create(width, height); 26 | img_g.Create(width, height); 27 | img_b.Create(width, height); 28 | 29 | unsigned char *pImgData = (unsigned char*)mxGetData(pmxImg); 30 | for (int x = 0; x < width; x++) 31 | { 32 | for (int y = 0; y < height; y++) 33 | { 34 | img_r.Pixel(x,y) = pImgData[y]; 35 | img_g.Pixel(x,y) = pImgData[y + num_pix]; 36 | img_b.Pixel(x,y) = pImgData[y + num_pix * 2]; 37 | } 38 | pImgData += height; 39 | } 40 | 41 | //Rgb --> Lab 42 | ImageSimpleFloat img_L, img_A, img_B; 43 | Rgb2Lab(img_r, img_g, img_b, img_L, img_A, img_B); 44 | 45 | //Do SLIC 46 | ImageSimpleUInt idxImg; 47 | idxImg.Create(width, height); 48 | int iSuperPixelNum = Run_SLIC_GivenPatchNum(img_L, img_A, img_B, iPatchNum, compactness, idxImg); 49 | 50 | //Transfer back to matlab 51 | plhs[0] = mxCreateDoubleMatrix(height, width, mxREAL); 52 | double *pdIdxImg = mxGetPr(plhs[0]); 53 | for (int x = 0; x < width; x++) 54 | { 55 | for (int y = 0; y < height; y++) 56 | { 57 | unsigned int id = idxImg.Pixel(x, y); 58 | pdIdxImg[y] = double(id) + 1; 59 | } 60 | pdIdxImg += height; 61 | } 62 | 63 | plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL); 64 | *mxGetPr(plhs[1]) = double(iSuperPixelNum); 65 | 66 | return; 67 | } -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC/SLIC_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Funcs/SLIC/SLIC_mex.mexw64 -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC/compile.m: -------------------------------------------------------------------------------- 1 | function compile 2 | mex SLIC_mex.cpp SLIC.cpp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SLIC_Split.m: -------------------------------------------------------------------------------- 1 | function [idxImg, adjcMatrix, pixelList] = SLIC_Split(noFrameImg, spnumber_input) 2 | % Segment rgb image into super-pixels using SLIC algorithm: 3 | 4 | % R.Achanta, A.Shaji, K.Smith, A.Lucchi, P.Fua, and S.Susstrunk. Slic 5 | % superpixels compared to state-of-the-art superpixel methods. IEEE 6 | % Transactions on Pattern Analysis and Machine Intelligence, 2012. 7 | 8 | % Author: Wangjiang Zhu 9 | % Email: wangjiang88119@gmail.com 10 | % Date: 3/24/2014 11 | 12 | %% Segment using SLIC: 13 | compactness = 20; %the larger, the more regular patches will get 14 | [idxImg, spNum] = SLIC_mex(noFrameImg, spnumber_input, compactness); 15 | 16 | %% 17 | adjcMatrix = GetAdjMatrix(idxImg, spNum); 18 | 19 | %% 20 | pixelList = cell(spNum, 1); 21 | for n = 1:spNum 22 | pixelList{n} = find(idxImg == n); 23 | end 24 | -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/SaveSaliencyMap.m: -------------------------------------------------------------------------------- 1 | function saliency_img=SaveSaliencyMap(feaVec, pixelList, frameRecord, doNormalize, fill_value) 2 | % Fill back super-pixel values to image pixels and save into .png images 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | if (~iscell(pixelList)) 9 | error('pixelList should be a cell'); 10 | end 11 | 12 | % if (~ischar(imgName)) 13 | % error('imgName should be a string'); 14 | % end 15 | 16 | if (nargin < 5) 17 | doNormalize = true; 18 | end 19 | 20 | if (nargin < 6) 21 | fill_value = 0; 22 | end 23 | 24 | h = frameRecord(1); 25 | w = frameRecord(2); 26 | 27 | top = frameRecord(3); 28 | bot = frameRecord(4); 29 | left = frameRecord(5); 30 | right = frameRecord(6); 31 | 32 | partialH = bot - top + 1; 33 | partialW = right - left + 1; 34 | partialImg = CreateImageFromSPs(feaVec, pixelList, partialH, partialW, doNormalize); 35 | 36 | if partialH ~= h || partialW ~= w 37 | feaImg = ones(h, w) * fill_value; 38 | feaImg(top:bot, left:right) = partialImg; 39 | %imwrite(feaImg, imgName); 40 | saliency_img=feaImg; 41 | else 42 | %imwrite(partialImg, imgName); 43 | saliency_img=partialImg; 44 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Funcs/removeframe_wCtr.m: -------------------------------------------------------------------------------- 1 | function [noFrameImg, frameRecord] = removeframe_wCtr(input_im, edgeMethod) 2 | % Remove image frames 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | if size(input_im, 3) == 3 9 | grayImg=rgb2gray(input_im); 10 | else 11 | grayImg = input_im; 12 | end 13 | [height, width] = size(grayImg); 14 | 15 | threshold=0.6; 16 | MAXWIDTH = 30; % we assume that the frame is not wider than 30 pixels 17 | edgemap = edge(grayImg, edgeMethod); 18 | haveFrame = false; 19 | frameWidth = zeros(4, 1); 20 | 21 | % TOP 22 | edgeDensity = mean( edgemap(1:MAXWIDTH, :), 2); % average density per row 23 | % find the largest row index with large enough edge density 24 | top_row_idx = find(edgeDensity > threshold, 1, 'last'); 25 | if ~isempty(top_row_idx) 26 | frameWidth(1) = top_row_idx; 27 | haveFrame = true; 28 | end 29 | 30 | % BOTTOM 31 | edgeDensity = mean( edgemap(end - MAXWIDTH + 1:end, :), 2); 32 | bottom_row_idx = find(edgeDensity > threshold, 1, 'first'); 33 | if ~isempty(bottom_row_idx) 34 | frameWidth(2) = MAXWIDTH - bottom_row_idx + 1; 35 | haveFrame = true; 36 | end 37 | 38 | %LEFT 39 | edgeDensity = mean( edgemap(:, 1:MAXWIDTH, :), 1); 40 | left_col_idx = find(edgeDensity > threshold, 1, 'last'); 41 | if ~isempty(left_col_idx) 42 | frameWidth(3) = left_col_idx; 43 | haveFrame = true; 44 | end 45 | 46 | % RIGHT 47 | edgeDensity = mean( edgemap(:, end - MAXWIDTH + 1:end), 1); 48 | right_col_idx = find(edgeDensity > threshold, 1, 'first'); 49 | if ~isempty(right_col_idx) 50 | frameWidth(4) = MAXWIDTH - right_col_idx + 1; 51 | haveFrame = true; 52 | end 53 | 54 | frameRecord = [height,width,1,height,1,width]; 55 | if haveFrame 56 | frameWidth(frameWidth == 0) = max(frameWidth); 57 | 58 | frameRecord(3) = frameWidth(1) + 1; 59 | frameRecord(4) = height - frameWidth(2); 60 | frameRecord(5) = frameWidth(3) + 1; 61 | frameRecord(6) = width - frameWidth(4); 62 | end 63 | 64 | noFrameImg = input_im(frameRecord(3):frameRecord(4), frameRecord(5):frameRecord(6), :); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/ReadMe.txt: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % This code is for [1], and can only be used for non-comercial purpose. If 3 | % you use our code, please cite [1]. 4 | % 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | 10 | % Run demo.m to learn how to use Saliency Optimization[1], as well as 11 | % Saliency Filter[2], Geodesic Saliency[3], and Manifold Ranking[4]. 12 | 13 | % [1] Wangjiang Zhu, Shuang Liang, Yichen Wei, and Jian Sun. Saliency 14 | % Optimization from Robust Background Detection. In CVPR, 2014. 15 | 16 | % [2] F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung. Saliency 17 | % filters: Contrast based filtering for salient region detection. 18 | % In CVPR, 2012. 19 | 20 | % [3] Y.Wei, F.Wen,W. Zhu, and J. Sun. Geodesic saliency using 21 | % background priors. In ECCV, 2012. 22 | 23 | % [4] C. Yang, L. Zhang, H. Lu, X. Ruan, and M.-H. Yang. Saliency 24 | % detection via graph-based manifold ranking. In CVPR, 2013. -------------------------------------------------------------------------------- /Processing/saliency_wCtr/SaliencyFilter.m: -------------------------------------------------------------------------------- 1 | function [cmbVal, Contrast, Distribution] = SaliencyFilter(colDistM, posDistM, meanPos) 2 | % The core function for Saliency Filter: 3 | % F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung. Saliency filters: 4 | % Contrast based filtering for salient region detection. In CVPR, 2012. 5 | % 6 | % Note that we didn't implement the last upsampling step, which is very 7 | % slow 8 | 9 | % Code Author: Wangjiang Zhu 10 | % Email: wangjiang88119@gmail.com 11 | % Date: 3/24/2014 12 | 13 | spaSigma = 0.25; %sigma for spatial weight 14 | colSigma = 20; %sigma for color weight 15 | k = 6; %coefficient for combining contrast and distribution 16 | 17 | posWeight = Dist2WeightMatrix(posDistM, spaSigma); 18 | spNum = size(colDistM, 1); 19 | 20 | %% Calculate Contrast 21 | Contrast = sum( colDistM .* posWeight, 2 ); 22 | Contrast = (Contrast - min(Contrast)) / (max(Contrast) - min(Contrast) + eps); 23 | 24 | %% Calculate Distribution 25 | colSimW = Dist2WeightMatrix(colDistM, colSigma); 26 | centerPos = colSimW * meanPos ./ repmat(sum(colSimW, 2), 1, 2); %mass center 27 | Distribution = zeros(spNum, 2); 28 | 29 | for n = 1:spNum 30 | Distribution(n, :) = colSimW(n,:) * (meanPos - repmat(centerPos(n, :), spNum, 1)).^2; 31 | end 32 | Distribution = sum(Distribution, 2); 33 | Distribution = (Distribution - min(Distribution)) / (max(Distribution) - min(Distribution) + eps); 34 | 35 | %% Combine Contrast with Distribution, on SP level 36 | cmbVal = Contrast .* exp(- Distribution * k); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/SaliencyOptimization.m: -------------------------------------------------------------------------------- 1 | function optwCtr = SaliencyOptimization(adjcMatrix, bdIds, colDistM, neiSigma, bgWeight, fgWeight) 2 | % Solve the least-square problem in Equa(9) in our paper 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | adjcMatrix_nn = LinkNNAndBoundary(adjcMatrix, bdIds); 9 | colDistM(adjcMatrix_nn == 0) = Inf; 10 | 11 | Wn = Dist2WeightMatrix(colDistM, neiSigma); %smoothness term 12 | mu = 0.1; %small coefficients for regularization term 13 | W = Wn + adjcMatrix * mu; %add regularization term 14 | D = diag(sum(W)); 15 | 16 | bgLambda = 5; %global weight for background term, bgLambda > 1 means we rely more on bg cue than fg cue. 17 | E_bg = diag(bgWeight * bgLambda); %background term 18 | E_fg = diag(fgWeight); %foreground term 19 | 20 | spNum = length(bgWeight); 21 | optwCtr =(D - W + E_bg + E_fg) \ (E_fg * ones(spNum, 1)); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0001.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0002.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0003.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0004.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/DUT_OMRON_image/images/0005.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0001.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0002.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0003.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0004.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/ECSSD/images/0005.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0001.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0002.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0003.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0004.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA1000/images/0005.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0001.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0002.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0003.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0004.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/MSRA5000/images/0005.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0001.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0002.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0003.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0004.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_dataset/PASCAL_S/images/0005.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0001_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0001_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0002_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0002_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0003_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0003_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0004_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0004_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0005_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/DUT_OMRON_image/0005_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0001_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0001_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0002_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0002_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0003_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0003_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0004_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0004_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0005_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/ECSSD/0005_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0001_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0001_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0002_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0002_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0003_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0003_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0004_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0004_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0005_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA1000/0005_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0001_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0001_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0002_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0002_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0003_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0003_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0004_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0004_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0005_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/MSRA5000/0005_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0001_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0001_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0002_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0002_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0003_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0003_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0004_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0004_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0005_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/GS/PASCAL_S/0005_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0001_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0001_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0002_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0002_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0003_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0003_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0004_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0004_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0005_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/DUT_OMRON_image/0005_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0001_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0001_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0002_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0002_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0003_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0003_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0004_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0004_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0005_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/ECSSD/0005_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0001_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0001_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0002_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0002_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0003_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0003_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0004_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0004_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0005_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA1000/0005_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0001_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0001_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0002_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0002_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0003_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0003_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0004_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0004_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0005_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/MSRA5000/0005_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0001_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0001_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0002_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0002_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0003_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0003_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0004_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0004_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0005_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/SF/PASCAL_S/0005_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0001_wCtr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0001_wCtr.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0002_wCtr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0002_wCtr.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0003_wCtr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0003_wCtr.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0004_wCtr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0004_wCtr.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0005_wCtr.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/Saliency_Dataset_Code/Running_result/wCtr/DUT_OMRON_image/0005_wCtr.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/run_wCtr_allsets.m: -------------------------------------------------------------------------------- 1 | clear all; 2 | close all; 3 | clc; 4 | 5 | addpath('F:\Saliency_Dataset_Code\Running_code\HS\hsaliencyexe'); 6 | 7 | setname={'DUT_OMRON_image'};%;'ECSSD';'MSRA1000';'MSRA5000';'PASCAL_S' 8 | savepath1='D:\tracking\saliency\wCtr\Saliency_Dataset_Code\Running_result\wCtr\'; 9 | savepath1_SF='D:\tracking\saliency\wCtr\Saliency_Dataset_Code\Running_result\SF\'; 10 | savepath1_GS='D:\tracking\saliency\wCtr\Saliency_Dataset_Code\Running_result\GS\'; 11 | imagepath1='D:\tracking\saliency\wCtr\Saliency_Dataset_Code\Running_dataset\'; 12 | imagetype='*.jpg'; 13 | 14 | for i=1:length(setname) 15 | imagepath=[imagepath1 setname{i} '\' 'images']; 16 | images=dir([imagepath imagetype]); 17 | number_images=length(images); 18 | savepath=[savepath1 setname{i} ]; 19 | if(~exist(savepath,'file')) 20 | mkdir(savepath); 21 | end 22 | savepath_SF=[savepath1_SF setname{i}]; 23 | savepath_GS=[savepath1_GS setname{i}]; 24 | if(~exist(savepath_SF,'file')) 25 | mkdir(savepath_SF); 26 | end 27 | if(~exist(savepath_GS,'file')) 28 | mkdir(savepath_GS); 29 | end 30 | %imagepath='F:\Saliency_Dataset&Code\Running_code\HS\hsaliencyexe\src\'; 31 | param_str1=[imagepath]; 32 | param_str2=[savepath]; 33 | demo(param_str1,param_str2,savepath_SF,savepath_GS); 34 | % dos(['HSaliency.exe' ' "' param_str1 '" "' param_str2 '\"']); 35 | % for j=1:number_images 36 | % param_str1=[imagepath images(j).name]; 37 | % param_str2=[savepath '\']; 38 | % dos(['HSaliency.exe ' param_str1 ' ' param_str2]); 39 | % %eval(['!HSaliency ' imagepath images(j).name ' ' savepath '\']); 40 | % end 41 | end 42 | -------------------------------------------------------------------------------- /Processing/saliency_wCtr/saliency_wCtr.m: -------------------------------------------------------------------------------- 1 | clear all; 2 | close all; 3 | clc; 4 | 5 | 6 | imagepath1='D:\tracking\Saliency_Detection\wCtr\Saliency_Dataset_Code\Running_dataset\DUT_OMRON_image\images\0001.jpg'; 7 | srcImg = imread(imagepath1); 8 | saliency_img=get_saliency_wCtr(srcImg); 9 | imshow(saliency_img); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_272.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_272.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_579.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_579.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_840.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_0_840.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_11_11852.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_11_11852.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_11_11881.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_11_11881.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_12_12344.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_12_12344.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_1_1664.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_1_1664.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_1_1696.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_1_1696.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_3_3654.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_3_3654.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_4_4328.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_4_4328.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_5_5463.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_5_5463.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_5_5586.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_5_5586.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/GT/0_6_6791.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/GT/0_6_6791.bmp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_272_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_579_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_0_840_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11852_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_11_11881_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_12_12344_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1664_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_1_1696_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_3_3654_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_4_4328_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5463_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_5_5586_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_GS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_GS.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_MR_stage2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_MR_stage2.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_SF.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_SF.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_wCtr_Optimized.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/Res/0_6_6791_wCtr_Optimized.png -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_272.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_272.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_579.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_579.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_840.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_0_840.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_11_11852.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_11_11852.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_11_11881.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_11_11881.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_12_12344.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_12_12344.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_1_1664.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_1_1664.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_1_1696.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_1_1696.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_3_3654.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_3_3654.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_4_4328.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_4_4328.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_5_5463.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_5_5463.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_5_5586.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_5_5586.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Data/SRC/0_6_6791.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Data/SRC/0_6_6791.jpg -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/BoundaryConnectivity.m: -------------------------------------------------------------------------------- 1 | function [bdCon, Len_bnd, Area] = BoundaryConnectivity(adjcMatrix, weightMatrix, bdIds, clipVal, geo_sigma, link_boundary) 2 | % Compute boundary connecity values for all superpixels 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | if (nargin < 6) 8 | link_boundary = true; 9 | end 10 | if (link_boundary) 11 | adjcMatrix = LinkBoundarySPs(adjcMatrix, bdIds); 12 | end 13 | 14 | adjcMatrix = tril(adjcMatrix, -1); 15 | edgeWeight = weightMatrix(adjcMatrix > 0); 16 | edgeWeight = max(0, edgeWeight - clipVal); 17 | 18 | % Cal pair-wise shortest path cost (geodesic distance) 19 | geoDistMatrix = graphallshortestpaths(sparse(adjcMatrix), 'directed', false, 'Weights', edgeWeight); 20 | 21 | Wgeo = Dist2WeightMatrix(geoDistMatrix, geo_sigma); 22 | Len_bnd = sum( Wgeo(:, bdIds), 2); %length of perimeters on boundary 23 | Area = sum(Wgeo, 2); %soft area 24 | bdCon = Len_bnd ./ sqrt(Area); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/CalMAE.m: -------------------------------------------------------------------------------- 1 | function mae = CalMAE(smap, gtImg) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | if size(smap, 1) ~= size(gtImg, 1) || size(smap, 2) ~= size(gtImg, 2) 6 | error('Saliency map and gt Image have different sizes!\n'); 7 | end 8 | 9 | if ~islogical(gtImg) 10 | gtImg = gtImg(:,:,1) > 128; 11 | end 12 | 13 | smap = im2double(smap(:,:,1)); 14 | fgPixels = smap(gtImg); 15 | fgErrSum = length(fgPixels) - sum(fgPixels); 16 | bgErrSum = sum(smap(~gtImg)); 17 | mae = (fgErrSum + bgErrSum) / numel(gtImg); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/CalMeanMAE.m: -------------------------------------------------------------------------------- 1 | function mae = CalMeanMAE(SRC, srcSuffix, GT, gtSuffix) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | files = dir(fullfile(SRC, strcat('*', srcSuffix))); 6 | if isempty(files) 7 | error('No saliency maps are found: %s\n', fullfile(SRC, strcat('*', srcSuffix))); 8 | end 9 | 10 | MAE = zeros(length(files), 1); 11 | parfor k = 1:length(files) 12 | srcName = files(k).name; 13 | srcImg = imread(fullfile(SRC, srcName)); 14 | 15 | gtName = strrep(srcName, srcSuffix, gtSuffix); 16 | gtImg = imread(fullfile(GT, gtName)); 17 | 18 | MAE(k) = CalMAE(srcImg, gtImg); 19 | end 20 | 21 | mae = mean(MAE); 22 | fprintf('MAE for %s: %f\n', srcSuffix, mae); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/CalPR.m: -------------------------------------------------------------------------------- 1 | function [precision, recall] = CalPR(smapImg, gtImg, targetIsFg, targetIsHigh) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | smapImg = smapImg(:,:,1); 6 | if ~islogical(gtImg) 7 | gtImg = gtImg(:,:,1) > 128; 8 | end 9 | if any(size(smapImg) ~= size(gtImg)) 10 | error('saliency map and ground truth mask have different size'); 11 | end 12 | 13 | if ~targetIsFg 14 | gtImg = ~gtImg; 15 | end 16 | 17 | gtPxlNum = sum(gtImg(:)); 18 | if 0 == gtPxlNum 19 | error('no foreground region is labeled'); 20 | end 21 | 22 | targetHist = histc(smapImg(gtImg), 0:255); 23 | nontargetHist = histc(smapImg(~gtImg), 0:255); 24 | 25 | if targetIsHigh 26 | targetHist = flipud(targetHist); 27 | nontargetHist = flipud(nontargetHist); 28 | end 29 | targetHist = cumsum( targetHist ); 30 | nontargetHist = cumsum( nontargetHist ); 31 | 32 | precision = targetHist ./ (targetHist + nontargetHist); 33 | if any(isnan(precision)) 34 | warning('there exists NAN in precision, this is because your saliency map do not range from 0 to 255\n'); 35 | end 36 | recall = targetHist / gtPxlNum; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/CalWeightedContrast.m: -------------------------------------------------------------------------------- 1 | function wCtr = CalWeightedContrast(colDistM, posDistM, bgProb) 2 | % Calculate background probability weighted contrast 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | spaSigma = 0.4; %sigma for spatial weight 9 | posWeight = Dist2WeightMatrix(posDistM, spaSigma); 10 | 11 | %bgProb weighted contrast 12 | wCtr = colDistM .* posWeight * bgProb; 13 | wCtr = (wCtr - min(wCtr)) / (max(wCtr) - min(wCtr) + eps); 14 | 15 | %post-processing for cleaner fg cue 16 | removeLowVals = true; 17 | if removeLowVals 18 | thresh = graythresh(wCtr); %automatic threshold 19 | wCtr(wCtr < thresh) = 0; 20 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/CreateImageFromSPs.m: -------------------------------------------------------------------------------- 1 | function [img, spValues] = CreateImageFromSPs(spValues, pixelList, height, width, doNormalize) 2 | % create an image from its superpixels' values 3 | % spValues is all superpixel's values, e.g., saliency 4 | % pixelList is a cell (with the same size as spValues) of pixel index arrays 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | if (~iscell(pixelList)) 11 | error('pixelList should be a cell'); 12 | end 13 | 14 | if (length(pixelList) ~= length(spValues)) 15 | error('different sizes in spValues and pixelList'); 16 | end 17 | 18 | if (nargin < 5) 19 | doNormalize = true; 20 | end 21 | 22 | minVal = min(spValues); 23 | maxVal = max(spValues); 24 | if doNormalize 25 | spValues = (spValues - minVal) / (maxVal - minVal + eps); 26 | else 27 | if minVal < -1e-6 || maxVal > 1 + 1e-6 28 | error('feature values do not range from 0 to 1'); 29 | end 30 | end 31 | 32 | img = zeros(height, width); 33 | for i=1:length(pixelList) 34 | img(pixelList{i}) = spValues(i); 35 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/Dist2WeightMatrix.m: -------------------------------------------------------------------------------- 1 | function weightMatrix = Dist2WeightMatrix(distMatrix, distSigma) 2 | % Transform pair-wise distance to pair-wise weight using 3 | % exp(-d^2/(2*sigma^2)); 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | spNum = size(distMatrix, 1); 10 | 11 | distMatrix(distMatrix > 3 * distSigma) = Inf; %cut off > 3 * sigma distances 12 | weightMatrix = exp(-distMatrix.^2 ./ (2 * distSigma * distSigma)); 13 | 14 | if any(1 ~= weightMatrix(1:spNum+1:end)) 15 | error('Diagonal elements in the weight matrix should be 1'); 16 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/DrawPRCurve.m: -------------------------------------------------------------------------------- 1 | function [rec, prec] = DrawPRCurve(SMAP, smapSuffix, GT, gtSuffix, targetIsFg, targetIsHigh, color) 2 | % Draw PR Curves for all the image with 'smapSuffix' in folder SMAP 3 | % GT is the folder for ground truth masks 4 | % targetIsFg = true means we draw PR Curves for foreground, and otherwise 5 | % we draw PR Curves for background 6 | % targetIsHigh = true means feature values for our interest region (fg or 7 | % bg) is higher than the remaining regions. 8 | % color specifies the curve color 9 | 10 | % Code Author: Wangjiang Zhu 11 | % Email: wangjiang88119@gmail.com 12 | % Date: 3/24/2014 13 | 14 | files = dir(fullfile(SMAP, strcat('*', smapSuffix))); 15 | num = length(files); 16 | if 0 == num 17 | error('no saliency map with suffix %s are found in %s', smapSuffix, SMAP); 18 | end 19 | 20 | %precision and recall of all images 21 | ALLPRECISION = zeros(num, 256); 22 | ALLRECALL = zeros(num, 256); 23 | parfor k = 1:num 24 | smapName = files(k).name; 25 | smapImg = imread(fullfile(SMAP, smapName)); 26 | 27 | gtName = strrep(smapName, smapSuffix, gtSuffix); 28 | gtImg = imread(fullfile(GT, gtName)); 29 | 30 | [precision, recall] = CalPR(smapImg, gtImg, targetIsFg, targetIsHigh); 31 | 32 | ALLPRECISION(k, :) = precision; 33 | ALLRECALL(k, :) = recall; 34 | end 35 | 36 | prec = mean(ALLPRECISION, 1); %function 'mean' will give NaN for columns in which NaN appears. 37 | rec = mean(ALLRECALL, 1); 38 | 39 | % plot 40 | if nargin > 5 41 | plot(rec, prec, color, 'linewidth', 2); 42 | else 43 | plot(rec, prec, 'r', 'linewidth', 2); 44 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/EstimateBgProb.m: -------------------------------------------------------------------------------- 1 | function [bgProb, bdCon, bgWeight] = EstimateBgProb(colDistM, adjcMatrix, bdIds, clipVal, geoSigma) 2 | % Estimate background probability using boundary connectivity 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | bdCon = BoundaryConnectivity(adjcMatrix, colDistM, bdIds, clipVal, geoSigma, true); 9 | 10 | bdConSigma = 1; %sigma for converting bdCon value to background probability 11 | fgProb = exp(-bdCon.^2 / (2 * bdConSigma * bdConSigma)); %Estimate bg probability 12 | bgProb = 1 - fgProb; 13 | 14 | bgWeight = bgProb; 15 | % Give a very large weight for very confident bg sps can get slightly 16 | % better saliency maps, you can turn it off. 17 | fixHighBdConSP = true; 18 | highThresh = 3; 19 | if fixHighBdConSP 20 | bgWeight(bdCon > highThresh) = 1000; 21 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/EstimateDynamicParas.m: -------------------------------------------------------------------------------- 1 | function [clipVal, geoSigma, neiSigma] = EstimateDynamicParas(adjcMatrix, colDistM) 2 | % Estimate dynamic paras can slightly improve overall performance, but in 3 | % fact, influence of those paras is very small, you can just use fixed 4 | % paras, and we suggest you to set geoSigma = 7, neiSigma = 10. 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | [meanMin1, meanTop, meanMin2] = GetMeanMinAndMeanTop(adjcMatrix, colDistM, 0.01); 11 | clipVal = meanMin2; 12 | 13 | % Emperically choose adaptive sigma for converting geodesic distance to 14 | % weight 15 | geoSigma = min([10, meanMin1 * 3, meanTop / 10]); 16 | geoSigma = max(geoSigma, 5); 17 | 18 | % Emperically choose adaptive sigma for smoothness term in Equa(9) of our 19 | % paper. 20 | neiSigma = min([3 * meanMin1, 0.2 * meanTop, 20]); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetAdjMatrix.m: -------------------------------------------------------------------------------- 1 | function adjMatrix = GetAdjMatrix(idxImg, spNum) 2 | % Get adjacent matrix of super-pixels 3 | % idxImg is an integer image, values in [1..spNum] 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | [h, w] = size(idxImg); 10 | 11 | %Get edge pixel locations (4-neighbor) 12 | topbotDiff = diff(idxImg, 1, 1) ~= 0; 13 | topEdgeIdx = find( padarray(topbotDiff, [1 0], false, 'post') ); %those pixels on the top of an edge 14 | botEdgeIdx = topEdgeIdx + 1; 15 | 16 | leftrightDiff = diff(idxImg, 1, 2) ~= 0; 17 | leftEdgeIdx = find( padarray(leftrightDiff, [0 1], false, 'post') ); %those pixels on the left of an edge 18 | rightEdgeIdx = leftEdgeIdx + h; 19 | 20 | %Get adjacent matrix of super-pixels 21 | adjMatrix = zeros(spNum, spNum); 22 | adjMatrix( sub2ind([spNum, spNum], idxImg(topEdgeIdx), idxImg(botEdgeIdx)) ) = 1; 23 | adjMatrix( sub2ind([spNum, spNum], idxImg(leftEdgeIdx), idxImg(rightEdgeIdx)) ) = 1; 24 | adjMatrix = adjMatrix + adjMatrix'; 25 | adjMatrix(1:spNum+1:end) = 1;%set diagonal elements to 1 26 | adjMatrix = sparse(adjMatrix); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetBndPatchIds.m: -------------------------------------------------------------------------------- 1 | function bdIds = GetBndPatchIds(idxImg, thickness) 2 | % Get super-pixels on image boundary 3 | % idxImg is an integer image, values in [1..spNum] 4 | % thickness means boundary band width 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | if nargin < 2 11 | thickness = 8; 12 | end 13 | 14 | bdIds=unique([ 15 | unique( idxImg(1:thickness,:) ); 16 | unique( idxImg(end-thickness+1:end,:) ); 17 | unique( idxImg(:,1:thickness) ); 18 | unique( idxImg(:,end-thickness+1:end) ) 19 | ]); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetDistanceMatrix.m: -------------------------------------------------------------------------------- 1 | function distM = GetDistanceMatrix(feature) 2 | % Get pair-wise distance matrix between each rows in feature 3 | % Each row of feature correspond to a sample 4 | 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | 9 | spNum = size(feature, 1); 10 | DistM2 = zeros(spNum, spNum); 11 | 12 | for n = 1:size(feature, 2) 13 | DistM2 = DistM2 + ( repmat(feature(:,n), [1, spNum]) - repmat(feature(:,n)', [spNum, 1]) ).^2; 14 | end 15 | distM = sqrt(DistM2); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetMeanColor.m: -------------------------------------------------------------------------------- 1 | function meanCol = GetMeanColor(image, pixelList) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | 6 | [h, w, chn] = size(image); 7 | tmpImg=reshape(image, h*w, chn); 8 | 9 | spNum = length(pixelList); 10 | meanCol=zeros(spNum, chn); 11 | for i=1:spNum 12 | meanCol(i, :)=mean(tmpImg(pixelList{i},:), 1); 13 | end 14 | if chn ==1 %for gray images 15 | meanCol = repmat(meanCol, [1, 3]); 16 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetMeanMinAndMeanTop.m: -------------------------------------------------------------------------------- 1 | function [meanMin1, meanTop, meanMin2] = GetMeanMinAndMeanTop(adjcMatrix, colDistM, topRate) 2 | % Do statistics analysis on color distances between neighbor patches 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | spNum = size(adjcMatrix, 1); 9 | 10 | % 1. Min distance analysis (between neighbor patches) 11 | adjcMatrix(1:spNum+1:end) = 0; %patches do not link with itself for min distance analysis 12 | minDist = zeros(spNum, 1); %minDist(i) means the min distance from sp_i to its neighbors 13 | for id = 1:spNum 14 | isNeighbor = adjcMatrix(id,:) > 0; 15 | minDist(id) = min(colDistM(id, isNeighbor)); 16 | end 17 | meanMin1 = mean(minDist); 18 | 19 | % 2. Largest distance analysis (this measure can reflect image contrast level) 20 | tmp = sort(colDistM(tril(adjcMatrix, -1) > 0), 'descend'); 21 | meanTop = mean(tmp(1:round(topRate * length(tmp)))); 22 | 23 | % 3. Min distance analysis (between 2 layer neighbors) 24 | adjcMatrix = double( (adjcMatrix * adjcMatrix + adjcMatrix) > 0 ); %Reachability matrix 25 | adjcMatrix(1:spNum+1:end) = 0; 26 | minDist = zeros(spNum, 1); %minDist(i) means the min distance from sp_i to its neighbors 27 | for id = 1:spNum 28 | isNeighbor = adjcMatrix(id,:) > 0; 29 | minDist(id) = min(colDistM(id, isNeighbor)); 30 | end 31 | meanMin2 = mean(minDist); 32 | 33 | if meanMin2 > meanMin1 %as meanMin2 considered more neighbors, its min value should be no larger than meanMin1 34 | error('meanMin2 should <= meanMin1'); 35 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/GetNormedMeanPos.m: -------------------------------------------------------------------------------- 1 | function meanPos = GetNormedMeanPos(pixelList, height, width) 2 | % averaged x(y) coordinates of each superpixel, normalized with respect to 3 | % image dimension 4 | % return N*2 vector, row i is superpixel i's coordinate [y x] 5 | 6 | % Code Author: Wangjiang Zhu 7 | % Email: wangjiang88119@gmail.com 8 | % Date: 3/24/2014 9 | 10 | spNum = length(pixelList); 11 | meanPos = zeros(spNum, 2); 12 | 13 | for n = 1 : spNum 14 | [rows, cols] = ind2sub([height, width], pixelList{n}); 15 | meanPos(n,1) = mean(rows) / height; 16 | meanPos(n,2) = mean(cols) / width; 17 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/LinkBoundarySPs.m: -------------------------------------------------------------------------------- 1 | function adjcMatrix = LinkBoundarySPs(adjcMatrix, bdIds) 2 | % Code Author: Wangjiang Zhu 3 | % Email: wangjiang88119@gmail.com 4 | % Date: 3/24/2014 5 | 6 | adjcMatrix(bdIds, bdIds) = 1; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/LinkNNAndBoundary.m: -------------------------------------------------------------------------------- 1 | function adjcMatrix = LinkNNAndBoundary(adjcMatrix, bdIds) 2 | %link 2 layers of neighbor super-pixels and boundary patches 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | adjcMatrix = (adjcMatrix * adjcMatrix + adjcMatrix) > 0; 9 | adjcMatrix = double(adjcMatrix); 10 | 11 | adjcMatrix(bdIds, bdIds) = 1; -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/Rgb2Lab.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "image\ImageSimple.h" 4 | 5 | inline double Fxyz(const double t) 6 | { 7 | return ((t > 0.008856)? pow(t, (1.0/3.0)) : (7.787*t + 16.0/116.0)); 8 | } 9 | 10 | inline void RgbPix2Lab(unsigned char byR, unsigned char byG, unsigned char byB, float &fL, float &fa, float &fb) 11 | { 12 | // RGBtoXYZ 13 | // Normalize red, green, blue values. 14 | double rLinear = (double)byR/255.0; 15 | double gLinear = (double)byG/255.0; 16 | double bLinear = (double)byB/255.0; 17 | 18 | // Convert to a sRGB form 19 | double r = (rLinear > 0.04045)? pow((rLinear + 0.055)/(1 + 0.055), 2.2) : (rLinear/12.92) ; 20 | double g = (gLinear > 0.04045)? pow((gLinear + 0.055)/(1 + 0.055), 2.2) : (gLinear/12.92) ; 21 | double b = (bLinear > 0.04045)? pow((bLinear + 0.055)/(1 + 0.055), 2.2) : (bLinear/12.92) ; 22 | 23 | // Converts 24 | double x = r*0.4124 + g*0.3576 + b*0.1805; 25 | double y = r*0.2126 + g*0.7152 + b*0.0722; 26 | double z = r*0.0193 + g*0.1192 + b*0.9505; 27 | 28 | x = (x>0.9505)? 0.9505 : ((x<0)? 0 : x); 29 | y = (y>1.0)? 1.0 : ((y<0)? 0 : y); 30 | z = (z>1.089)? 1.089 : ((z<0)? 0 : z); 31 | 32 | // XYZ to LAB 33 | double dD65_X = 0.9505; 34 | double dD65_Y = 1.0; 35 | double dD65_Z = 1.0890; 36 | 37 | double dL = 116.0 * Fxyz( y/dD65_Y ) - 16; 38 | double dA = 500.0 * ( Fxyz( x/dD65_X ) - Fxyz( y/dD65_Y) ); 39 | double dB = 200.0 * ( Fxyz( y/dD65_Y ) - Fxyz( z/dD65_Z) ); 40 | 41 | fL = (float) dL; 42 | fa = (float) dA; 43 | fb = (float) dB; 44 | } 45 | 46 | inline void Rgb2Lab(ImageSimpleUChar &rImg, ImageSimpleUChar &gImg, ImageSimpleUChar &bImg, ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg) 47 | { 48 | int w = rImg.Width(); 49 | int h = rImg.Height(); 50 | int pixNum = w * h; 51 | 52 | if (LImg.Width() != w || LImg.Height() != h) 53 | LImg.Create(w, h); 54 | if (AImg.Width() != w || AImg.Height() != h) 55 | AImg.Create(w, h); 56 | if (BImg.Width() != w || BImg.Height() != h) 57 | BImg.Create(w, h); 58 | 59 | for (int x = 0; x < pixNum; x ++) 60 | { 61 | RgbPix2Lab(rImg[x], gImg[x], bImg[x], LImg[x], AImg[x], BImg[x]); 62 | } 63 | } -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/SLIC.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "image/ImageSimple.h" 4 | 5 | int Run_SLIC_GivenPatchNum(ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg, unsigned int iPatchNum, float compactness, ImageSimpleUInt &idxImg); 6 | 7 | int Run_SLIC_GivenPatchSize(ImageSimpleFloat &LImg, ImageSimpleFloat &AImg, ImageSimpleFloat &BImg, unsigned int iPatchSize, float compactness, ImageSimpleUInt &idxImg); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/SLIC_mex.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "SLIC.h" 4 | #include "Rgb2Lab.h" 5 | 6 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 7 | { 8 | char usageStr[] = "Usage: idxImg = SLIC_mex(image(3-Channel uint8 image), spNum(double scalar), compactness(double scalar))\n"; 9 | 10 | //Check input 11 | const mxArray *pmxImg = prhs[0]; 12 | if (nrhs != 3 || !mxIsUint8(pmxImg) || !mxIsDouble(prhs[1]) || !mxIsDouble(prhs[2])) 13 | mexErrMsgTxt(usageStr); 14 | 15 | mwSize chn = mxGetNumberOfDimensions(pmxImg); 16 | if (3 != chn) 17 | mexErrMsgTxt(usageStr); 18 | const mwSize *sz = mxGetDimensions(pmxImg); 19 | mwSize height = sz[0], width = sz[1], num_pix = height * width; 20 | unsigned int iPatchNum = unsigned int( mxGetScalar(prhs[1]) ); 21 | float compactness = float( mxGetScalar(prhs[2]) ); 22 | 23 | //Transfer matlab matrix 24 | ImageSimpleUChar img_r, img_g, img_b; 25 | img_r.Create(width, height); 26 | img_g.Create(width, height); 27 | img_b.Create(width, height); 28 | 29 | unsigned char *pImgData = (unsigned char*)mxGetData(pmxImg); 30 | for (int x = 0; x < width; x++) 31 | { 32 | for (int y = 0; y < height; y++) 33 | { 34 | img_r.Pixel(x,y) = pImgData[y]; 35 | img_g.Pixel(x,y) = pImgData[y + num_pix]; 36 | img_b.Pixel(x,y) = pImgData[y + num_pix * 2]; 37 | } 38 | pImgData += height; 39 | } 40 | 41 | //Rgb --> Lab 42 | ImageSimpleFloat img_L, img_A, img_B; 43 | Rgb2Lab(img_r, img_g, img_b, img_L, img_A, img_B); 44 | 45 | //Do SLIC 46 | ImageSimpleUInt idxImg; 47 | idxImg.Create(width, height); 48 | int iSuperPixelNum = Run_SLIC_GivenPatchNum(img_L, img_A, img_B, iPatchNum, compactness, idxImg); 49 | 50 | //Transfer back to matlab 51 | plhs[0] = mxCreateDoubleMatrix(height, width, mxREAL); 52 | double *pdIdxImg = mxGetPr(plhs[0]); 53 | for (int x = 0; x < width; x++) 54 | { 55 | for (int y = 0; y < height; y++) 56 | { 57 | unsigned int id = idxImg.Pixel(x, y); 58 | pdIdxImg[y] = double(id) + 1; 59 | } 60 | pdIdxImg += height; 61 | } 62 | 63 | plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL); 64 | *mxGetPr(plhs[1]) = double(iSuperPixelNum); 65 | 66 | return; 67 | } -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/SLIC_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/SLIC_mex.mexw64 -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC/compile.m: -------------------------------------------------------------------------------- 1 | function compile 2 | mex SLIC_mex.cpp SLIC.cpp -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SLIC_Split.m: -------------------------------------------------------------------------------- 1 | function [idxImg, adjcMatrix, pixelList] = SLIC_Split(noFrameImg, spnumber_input) 2 | % Segment rgb image into super-pixels using SLIC algorithm: 3 | 4 | % R.Achanta, A.Shaji, K.Smith, A.Lucchi, P.Fua, and S.Susstrunk. Slic 5 | % superpixels compared to state-of-the-art superpixel methods. IEEE 6 | % Transactions on Pattern Analysis and Machine Intelligence, 2012. 7 | 8 | % Author: Wangjiang Zhu 9 | % Email: wangjiang88119@gmail.com 10 | % Date: 3/24/2014 11 | 12 | %% Segment using SLIC: 13 | compactness = 20; %the larger, the more regular patches will get 14 | [idxImg, spNum] = SLIC_mex(noFrameImg, spnumber_input, compactness); 15 | 16 | %% 17 | adjcMatrix = GetAdjMatrix(idxImg, spNum); 18 | 19 | %% 20 | pixelList = cell(spNum, 1); 21 | for n = 1:spNum 22 | pixelList{n} = find(idxImg == n); 23 | end 24 | -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/SaveSaliencyMap.m: -------------------------------------------------------------------------------- 1 | function SaveSaliencyMap(feaVec, pixelList, frameRecord, imgName, doNormalize, fill_value) 2 | % Fill back super-pixel values to image pixels and save into .png images 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | if (~iscell(pixelList)) 9 | error('pixelList should be a cell'); 10 | end 11 | 12 | if (~ischar(imgName)) 13 | error('imgName should be a string'); 14 | end 15 | 16 | if (nargin < 5) 17 | doNormalize = true; 18 | end 19 | 20 | if (nargin < 6) 21 | fill_value = 0; 22 | end 23 | 24 | h = frameRecord(1); 25 | w = frameRecord(2); 26 | 27 | top = frameRecord(3); 28 | bot = frameRecord(4); 29 | left = frameRecord(5); 30 | right = frameRecord(6); 31 | 32 | partialH = bot - top + 1; 33 | partialW = right - left + 1; 34 | partialImg = CreateImageFromSPs(feaVec, pixelList, partialH, partialW, doNormalize); 35 | 36 | if partialH ~= h || partialW ~= w 37 | feaImg = ones(h, w) * fill_value; 38 | feaImg(top:bot, left:right) = partialImg; 39 | imwrite(feaImg, imgName); 40 | else 41 | imwrite(partialImg, imgName); 42 | end -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/Funcs/removeframe.m: -------------------------------------------------------------------------------- 1 | function [noFrameImg, frameRecord] = removeframe(input_im, edgeMethod) 2 | % Remove image frames 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | if size(input_im, 3) == 3 9 | grayImg=rgb2gray(input_im); 10 | else 11 | grayImg = input_im; 12 | end 13 | [height, width] = size(grayImg); 14 | 15 | threshold=0.6; 16 | MAXWIDTH = 30; % we assume that the frame is not wider than 30 pixels 17 | edgemap = edge(grayImg, edgeMethod); 18 | haveFrame = false; 19 | frameWidth = zeros(4, 1); 20 | 21 | % TOP 22 | edgeDensity = mean( edgemap(1:MAXWIDTH, :), 2); % average density per row 23 | % find the largest row index with large enough edge density 24 | top_row_idx = find(edgeDensity > threshold, 1, 'last'); 25 | if ~isempty(top_row_idx) 26 | frameWidth(1) = top_row_idx; 27 | haveFrame = true; 28 | end 29 | 30 | % BOTTOM 31 | edgeDensity = mean( edgemap(end - MAXWIDTH + 1:end, :), 2); 32 | bottom_row_idx = find(edgeDensity > threshold, 1, 'first'); 33 | if ~isempty(bottom_row_idx) 34 | frameWidth(2) = MAXWIDTH - bottom_row_idx + 1; 35 | haveFrame = true; 36 | end 37 | 38 | %LEFT 39 | edgeDensity = mean( edgemap(:, 1:MAXWIDTH, :), 1); 40 | left_col_idx = find(edgeDensity > threshold, 1, 'last'); 41 | if ~isempty(left_col_idx) 42 | frameWidth(3) = left_col_idx; 43 | haveFrame = true; 44 | end 45 | 46 | % RIGHT 47 | edgeDensity = mean( edgemap(:, end - MAXWIDTH + 1:end), 1); 48 | right_col_idx = find(edgeDensity > threshold, 1, 'first'); 49 | if ~isempty(right_col_idx) 50 | frameWidth(4) = MAXWIDTH - right_col_idx + 1; 51 | haveFrame = true; 52 | end 53 | 54 | frameRecord = [height,width,1,height,1,width]; 55 | if haveFrame 56 | frameWidth(frameWidth == 0) = max(frameWidth); 57 | 58 | frameRecord(3) = frameWidth(1) + 1; 59 | frameRecord(4) = height - frameWidth(2); 60 | frameRecord(5) = frameWidth(3) + 1; 61 | frameRecord(6) = width - frameWidth(4); 62 | end 63 | 64 | noFrameImg = input_im(frameRecord(3):frameRecord(4), frameRecord(5):frameRecord(6), :); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/ReadMe.txt: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | % This code is for [1], and can only be used for non-comercial purpose. If 3 | % you use our code, please cite [1]. 4 | % 5 | % Code Author: Wangjiang Zhu 6 | % Email: wangjiang88119@gmail.com 7 | % Date: 3/24/2014 8 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 9 | 10 | % Run demo.m to learn how to use Saliency Optimization[1], as well as 11 | % Saliency Filter[2], Geodesic Saliency[3], and Manifold Ranking[4]. 12 | 13 | % [1] Wangjiang Zhu, Shuang Liang, Yichen Wei, and Jian Sun. Saliency 14 | % Optimization from Robust Background Detection. In CVPR, 2014. 15 | 16 | % [2] F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung. Saliency 17 | % filters: Contrast based filtering for salient region detection. 18 | % In CVPR, 2012. 19 | 20 | % [3] Y.Wei, F.Wen,W. Zhu, and J. Sun. Geodesic saliency using 21 | % background priors. In ECCV, 2012. 22 | 23 | % [4] C. Yang, L. Zhang, H. Lu, X. Ruan, and M.-H. Yang. Saliency 24 | % detection via graph-based manifold ranking. In CVPR, 2013. -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/SaliencyFilter.m: -------------------------------------------------------------------------------- 1 | function [cmbVal, Contrast, Distribution] = SaliencyFilter(colDistM, posDistM, meanPos) 2 | % The core function for Saliency Filter: 3 | % F. Perazzi, P. Krahenbuhl, Y. Pritch, and A. Hornung. Saliency filters: 4 | % Contrast based filtering for salient region detection. In CVPR, 2012. 5 | % 6 | % Note that we didn't implement the last upsampling step, which is very 7 | % slow 8 | 9 | % Code Author: Wangjiang Zhu 10 | % Email: wangjiang88119@gmail.com 11 | % Date: 3/24/2014 12 | 13 | spaSigma = 0.25; %sigma for spatial weight 14 | colSigma = 20; %sigma for color weight 15 | k = 6; %coefficient for combining contrast and distribution 16 | 17 | posWeight = Dist2WeightMatrix(posDistM, spaSigma); 18 | spNum = size(colDistM, 1); 19 | 20 | %% Calculate Contrast 21 | Contrast = sum( colDistM .* posWeight, 2 ); 22 | Contrast = (Contrast - min(Contrast)) / (max(Contrast) - min(Contrast) + eps); 23 | 24 | %% Calculate Distribution 25 | colSimW = Dist2WeightMatrix(colDistM, colSigma); 26 | centerPos = colSimW * meanPos ./ repmat(sum(colSimW, 2), 1, 2); %mass center 27 | Distribution = zeros(spNum, 2); 28 | 29 | for n = 1:spNum 30 | Distribution(n, :) = colSimW(n,:) * (meanPos - repmat(centerPos(n, :), spNum, 1)).^2; 31 | end 32 | Distribution = sum(Distribution, 2); 33 | Distribution = (Distribution - min(Distribution)) / (max(Distribution) - min(Distribution) + eps); 34 | 35 | %% Combine Contrast with Distribution, on SP level 36 | cmbVal = Contrast .* exp(- Distribution * k); -------------------------------------------------------------------------------- /Processing/saliency_wCtr/wCtr_code/SaliencyOptimization.m: -------------------------------------------------------------------------------- 1 | function optwCtr = SaliencyOptimization(adjcMatrix, bdIds, colDistM, neiSigma, bgWeight, fgWeight) 2 | % Solve the least-square problem in Equa(9) in our paper 3 | 4 | % Code Author: Wangjiang Zhu 5 | % Email: wangjiang88119@gmail.com 6 | % Date: 3/24/2014 7 | 8 | adjcMatrix_nn = LinkNNAndBoundary(adjcMatrix, bdIds); 9 | colDistM(adjcMatrix_nn == 0) = Inf; 10 | Wn = Dist2WeightMatrix(colDistM, neiSigma); %smoothness term 11 | mu = 0.1; %small coefficients for regularization term 12 | W = Wn + adjcMatrix * mu; %add regularization term 13 | D = diag(sum(W)); 14 | 15 | bgLambda = 5; %global weight for background term, bgLambda > 1 means we rely more on bg cue than fg cue. 16 | E_bg = diag(bgWeight * bgLambda); %background term 17 | E_fg = diag(fgWeight); %foreground term 18 | 19 | spNum = length(bgWeight); 20 | optwCtr =(D - W + E_bg + E_fg) \ (E_fg * ones(spNum, 1)); -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DSAR-CF 2 | Public code of DSAR-CF (Dynamic Saliency-Aware Regularization for Correlation Filter based Object Tracking), published in TIP 2019. 3 | ``` 4 | @article{han2019dynamic, 5 | title={Dynamic Saliency-Aware Regularization for Correlation Filter based Object Tracking}, 6 | author={Feng, Wei and Han, Ruize and Guo, Qing and Zhu, Jianke and Wang, Song}, 7 | year={2019}, 8 | journal={IEEE Transactions on Image Processing} 9 | } 10 | ``` 11 | 12 | ## Method 13 | 14 | ![example](https://github.com/HanRuize/DSAR-CF/blob/master/figs/example.png) 15 | 16 | In the proposed DSAR-CF, we first introduce object saliency information into the regularization weight map to highlight the appearance of the player as well as suppressing the background information around the player at the first frame. 17 | We then propose a strategy to dynamically update the regularization weight map to reflect the player’s shape variations in the subsequent frames. 18 | We then develop a level-set algorithm to iteratively optimize the regularization weight map in each frame. 19 | 20 | ## Experiments 21 | The experimental results on OTB-2013/2015: (We put the raw results in results_DSAR-CF_OTB15.zip) 22 | 23 | ![res](https://github.com/HanRuize/DSAR-CF/blob/master/figs/res.png) 24 | -------------------------------------------------------------------------------- /figs/example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/figs/example.png -------------------------------------------------------------------------------- /figs/readme: -------------------------------------------------------------------------------- 1 | Some figures to illustrate DSAR-CF. 2 | -------------------------------------------------------------------------------- /figs/res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/figs/res.png -------------------------------------------------------------------------------- /results_DSAR-CF_OTB15.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/results_DSAR-CF_OTB15.zip -------------------------------------------------------------------------------- /run_DSARCF.m: -------------------------------------------------------------------------------- 1 | function results = run_DSARCF(seq, ~, ~, ~) 2 | 3 | % By RuizeHan 4 | % Dynamic Saliency-Aware Regularization for Correlation Filter based Object Tracking 5 | % In TIP 2019 6 | 7 | close all 8 | addpath(genpath('Processing/')); 9 | 10 | seq.format = 'otb'; 11 | % set the parameters of the method 12 | params = SetParams(seq); 13 | 14 | % prepare the data of the method 15 | [params, data] = PrepareData(params); 16 | 17 | time = 0; 18 | timeF = 0; 19 | timeD = 0; 20 | 21 | for frame = 1:data.seq.num_frames 22 | data.seq.frame = frame; 23 | data.seq.im = imread(params.s_frames{data.seq.frame}); 24 | if size(data.seq.im,3) > 1 && data.seq.colorImage == false 25 | data.seq.im = data.seq.im(:,:,1); 26 | end 27 | 28 | tic(); 29 | % Detection process of CF tracking 30 | [params, data] = Detection(params, data); 31 | timeD = timeD + toc(); 32 | 33 | time = toc; 34 | 35 | if rem(frame+params.update-1,params.update) == 0 36 | % initial the correlation filter 37 | if params.selector == -1 && params.selector_last == 1 38 | data.conf = getFilterSetup(params,data,'conf'); 39 | end 40 | 41 | % update the correlation filter 42 | [params, data] = FilterUpdate(params, data); 43 | end 44 | timeF = timeF + toc() -time; 45 | timeW = data.time.timeW; 46 | timeS = data.time.timeS; 47 | time = timeD + timeF; 48 | 49 | Visualization(params.visualization, params.selector, data.seq.frame, data.seq.im, data.obj.pos, data.obj.target_sz); 50 | 51 | end 52 | 53 | % get the running fps of DSARCF 54 | fps = numel(params.s_frames) / time; 55 | 56 | % compute the running time of each component 57 | % disp(['fps: ' num2str(fps)]) 58 | results.time.timeF = timeF; 59 | results.time.timeD = timeD; 60 | results.time.time = time; 61 | results.time.timeW = timeW; 62 | results.time.timeS = timeS; 63 | results.type = 'rect'; 64 | results.res = data.obj.rects; % each row is a rectangle 65 | results.fps = fps; 66 | 67 | end -------------------------------------------------------------------------------- /utils/CNnorm.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/CNnorm.mat -------------------------------------------------------------------------------- /utils/README.md: -------------------------------------------------------------------------------- 1 | This MATLAB code implements the SRDCF [1], additional scripts integrates the tracker into the VOT2015 toolkit. 2 | 3 | The file "tracker_SRDCF.m" integrates the tracker into the VOT2015 toolkit. 4 | 5 | Installation: 6 | If the pre-compiled mexfiles do not work, the provided compilemex_[linux|windows] should compile them from the provided source code. Alternatively, you can try to modify them for your system. 7 | 8 | Contact: 9 | Martin Danelljan 10 | martin.danelljan@liu.se 11 | http://users.isy.liu.se/cvl/marda26/ 12 | 13 | 14 | Third party code used in the implementation of this tracker is: 15 | * Piotrs image processing toolbox [2] 16 | * mtimesx [3] 17 | * opencv [4] 18 | * lightspeed toolbox [5] 19 | 20 | 21 | [1] Martin Danelljan, Gustav Häger, Fahad Shahbaz Khan and Michael Felsberg. 22 | Learning Spatially Regularized Correlation Filters for Visual Tracking. 23 | In Proceedings of the International Conference in Computer Vision (ICCV), 2015. 24 | 25 | [2] Piotr Dollár. 26 | "Piotr’s Image and Video Matlab Toolbox (PMT)." 27 | http://vision.ucsd.edu/~pdollar/toolbox/doc/index.html. 28 | 29 | [3] http://www.mathworks.com/matlabcentral/fileexchange/25977-mtimesx-fast-matrix-multiply-with-multi-dimensional-support 30 | 31 | [4] http://opencv.org/ 32 | 33 | [5] http://research.microsoft.com/en-us/um/people/minka/software/lightspeed/ 34 | -------------------------------------------------------------------------------- /utils/average_feature_region.m: -------------------------------------------------------------------------------- 1 | function [ region_image ] = average_feature_region(im, region_size) 2 | %compute cell wise averages, where a cell is a region_size*region_sized 3 | %region in the image. Input can be uint8t, single or double matrices 4 | %of arbitrary dimension 5 | 6 | 7 | % region_image = zeros(floor(size(im,1)/region_size),... 8 | % floor(size(im,2)/region_size),... 9 | % size(im,3), 'single'); 10 | 11 | region_area = region_size.^2; 12 | 13 | if isa(im,'double') || isa(im,'single') 14 | maxval = 1.0; 15 | elseif isa(im,'unit8') 16 | maxval = 255; 17 | end; 18 | 19 | % for n = 1:size(im,3); 20 | 21 | %compute the integral image 22 | iImage = integralVecImage(im); 23 | %region indices 24 | i1 = (region_size:region_size:size(im,1)) + 1; 25 | i2 = (region_size:region_size:size(im,2)) + 1; 26 | %sum over region, divided by number of elements, and normalize to [0,1] 27 | %range if integer image 28 | region_image = (iImage(i1,i2,:,:) - iImage(i1,i2-region_size,:,:) - iImage(i1-region_size,i2,:,:) + iImage(i1-region_size,i2-region_size,:,:)) ./ (region_area * maxval); 29 | % end; 30 | 31 | end 32 | 33 | -------------------------------------------------------------------------------- /utils/cconvmtx2.m: -------------------------------------------------------------------------------- 1 | function H = cconvmtx2(h) 2 | 3 | [block_size, num_blocks] = size(h); 4 | num_elem = block_size*num_blocks; 5 | 6 | H1 = spalloc(num_elem, block_size, block_size*nnz(h)); 7 | H = spalloc(num_elem, num_elem, num_elem*nnz(h)); 8 | 9 | % create the first n columns 10 | for col = 1:block_size 11 | H1(:,col) = reshape(circshift(h, [col-1 0]), num_elem, 1); 12 | end 13 | 14 | % construct all blocks in H 15 | for block = 1:num_blocks 16 | H(:,block_size*(block-1)+1:block_size*block) = circshift(H1, [(block-1)*block_size 0]); 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /utils/compile_mexResize.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/compile_mexResize.m -------------------------------------------------------------------------------- /utils/compilemex_linux.m: -------------------------------------------------------------------------------- 1 | % Run this file to build the needed mex-files on windows 2 | 3 | % Build merResize 4 | mex -lopencv_core -lopencv_imgproc -L./ -I./ mexResize.cpp MxArray.cpp 5 | 6 | % Build setnonzeros from the lightspeed matlab toolbox 7 | mex setnonzeros.c 8 | 9 | % Build gradientMex from Piotrs toolbox 10 | mex gradientMex.cpp -I./ 11 | 12 | % Build mtimesx 13 | mex -DDEFINEUNIX -largeArrayDims -L/usr/local/MATLAB/R2015a/bin/glnxa64/ -lmwblas mtimesx.c -------------------------------------------------------------------------------- /utils/compilemex_win.m: -------------------------------------------------------------------------------- 1 | % Run this file to build the needed mex-files on windows 2 | 3 | % Build merResize 4 | mex -lopencv_core242 -lopencv_imgproc242 -L./ -I./ mexResize.cpp MxArray.cpp 5 | 6 | % Build setnonzeros from the lightspeed matlab toolbox 7 | mex setnonzeros.c 8 | 9 | % Build gradientMex from Piotrs toolbox 10 | mex gradientMex.cpp -I./ 11 | 12 | % Build mtimesx 13 | mtimesx_build -------------------------------------------------------------------------------- /utils/dft2dfs_matrix.m: -------------------------------------------------------------------------------- 1 | % Constructs a sparse matrix that transforms the discrete fourier transform 2 | % (DFT) to the real discrete fourier series (DFS), given the input and 3 | % output index permutations. 4 | 5 | function dfs_matrix = dft2dfs_matrix(dft_sym_ind, dft_pos_ind, dft_neg_ind, dfs_sym_ind, dfs_real_ind, dfs_imag_ind) 6 | 7 | i_sym = dfs_sym_ind; 8 | j_sym = dft_sym_ind; 9 | v_sym = ones(length(dft_sym_ind) ,1); 10 | 11 | i_real_pos = dfs_real_ind; 12 | j_real_pos = dft_pos_ind; 13 | v_real_pos = 1/sqrt(2) * ones(length(dft_pos_ind), 1); 14 | 15 | i_real_neg = dfs_real_ind; 16 | j_real_neg = dft_neg_ind; 17 | v_real_neg = 1/sqrt(2) * ones(length(dft_neg_ind), 1); 18 | 19 | i_imag_pos = dfs_imag_ind; 20 | j_imag_pos = dft_pos_ind; 21 | v_imag_pos = 1/(1i * sqrt(2)) * ones(length(dft_pos_ind), 1); 22 | 23 | i_imag_neg = dfs_imag_ind; 24 | j_imag_neg = dft_neg_ind; 25 | v_imag_neg = -1/(1i * sqrt(2)) * ones(length(dft_neg_ind), 1); 26 | 27 | i_tot = [i_sym; i_real_pos; i_real_neg; i_imag_pos; i_imag_neg]; 28 | j_tot = [j_sym; j_real_pos; j_real_neg; j_imag_pos; j_imag_neg]; 29 | v_tot = [v_sym; v_real_pos; v_real_neg; v_imag_pos; v_imag_neg]; 30 | 31 | dft_length = length(dft_sym_ind) + length(dft_pos_ind) + length(dft_neg_ind); 32 | 33 | dfs_matrix = sparse(i_tot, j_tot, v_tot, dft_length, dft_length); -------------------------------------------------------------------------------- /utils/get_cnn.m: -------------------------------------------------------------------------------- 1 | function [features, support_sz] = get_cnn( im, fparam, gparam ) 2 | % extract neural net features from the image 3 | persistent current_net; 4 | persistent net_; 5 | persistent average_; 6 | persistent output_layer; 7 | persistent net_info; 8 | 9 | if isempty(net_) 10 | net = load(['networks/' fparam.nn_name]); 11 | current_net = fparam.nn_name; 12 | net_.layers = net.layers(1:fparam.output_layer); 13 | average_ = single(net.normalization.averageImage); 14 | output_layer = fparam.output_layer; 15 | net_info = vl_simplenn_display(net_); 16 | if isfield(fparam, 'scale') && fparam.scale ~= 1 17 | average_ = imresize(average_, fparam.scale); 18 | end 19 | else 20 | if ~strcmp(current_net,fparam.nn_name) || fparam.output_layer ~= output_layer 21 | net = load(['networks/' fparam.nn_name]); 22 | current_net = fparam.nn_name; 23 | net_.layers = net.layers(1:fparam.output_layer); 24 | average_ = single(net.normalization.averageImage); 25 | output_layer = fparam.output_layer; 26 | net_info = vl_simplenn_display(net_); 27 | if isfield(fparam, 'scale') && fparam.scale ~= 1 28 | average_ = imresize(average_, fparam.scale); 29 | end 30 | end; 31 | end; 32 | 33 | if size(im,3) == 1 34 | im = repmat(im, [1 1 3]); 35 | end 36 | 37 | %preprocess the image 38 | im_ = imresize(single(im),[size(average_,1),size(average_,2)]) - average_; 39 | % im_ = single(mexResize(im,[size(average_,1),size(average_,2)],'auto')) - average_; 40 | 41 | result = vl_simplenn(net_,im_); 42 | 43 | features = result(fparam.output_layer + 1).x; 44 | 45 | if fparam.output_layer > 0 46 | stride = net_info.receptiveFieldStride(:,end)'; 47 | support_sz = [size(features,1) size(features,2)] .* stride .* [size(im,1) size(im,2)] ./ [size(im_,1) size(im_,2)]; 48 | else 49 | support_sz = [size(im,1) size(im,2)]; 50 | end 51 | 52 | -------------------------------------------------------------------------------- /utils/get_colorspace.m: -------------------------------------------------------------------------------- 1 | function [ colorspace ] = get_colorspace( im, fparam, gparam ) 2 | 3 | [im_height, im_width, num_im_chan, num_images] = size(im); 4 | 5 | single_im = single(im)/255; 6 | 7 | if strcmp(fparam.colorspace,'gray') 8 | if num_im_chan == 3 9 | if num_images == 1 10 | t_colorspace = rgb2gray(single_im) - 0.5; 11 | else 12 | t_colorspace = zeros(im_height, im_width, 1, num_images, 'single'); 13 | for k = 1:num_images 14 | t_colorspace(:,:,:,k) = rgb2gray(single_im(:,:,:,k)) - 0.5; 15 | end 16 | end 17 | elseif num_im_chan == 1 18 | t_colorspace = single_im - 0.5; 19 | else 20 | except = MException('get_colorspace','Invalid input data, must have 1 or 3 dimensions'); 21 | throw(except); 22 | end; 23 | elseif strcmp(fparam.colorspace,'rgb') 24 | if num_im_chan == 3 25 | t_colorspace = single_im - 0.5; 26 | else 27 | except = MException('get_colorspace','Invalid input data, must have 3 dimensions for rgb'); 28 | throw(except); 29 | end; 30 | end; 31 | 32 | if gparam.cell_size > 1 33 | colorspace = average_feature_region(t_colorspace,gparam.cell_size); 34 | else 35 | colorspace = t_colorspace; 36 | end; 37 | end 38 | 39 | -------------------------------------------------------------------------------- /utils/get_features.m: -------------------------------------------------------------------------------- 1 | function [feature_pixels, support_sz] = get_features(image, features, gparams, fg_size ) 2 | 3 | if ~ iscell(features) 4 | features = {features}; 5 | end; 6 | 7 | [im_height, im_width, num_im_chan, num_images] = size(image); 8 | 9 | colorImage = num_im_chan == 3; 10 | 11 | 12 | %compute total dimension of all features 13 | tot_feature_dim = 0; 14 | for n = 1:length(features) 15 | 16 | if ~isfield(features{n}.fparams,'useForColor') 17 | features{n}.fparams.useForColor = true; 18 | end; 19 | 20 | if ~isfield(features{n}.fparams,'useForGray') 21 | features{n}.fparams.useForGray = true; 22 | end; 23 | 24 | if (features{n}.fparams.useForColor && colorImage) || (features{n}.fparams.useForGray && ~colorImage) 25 | tot_feature_dim = tot_feature_dim + features{n}.fparams.nDim; 26 | end; 27 | 28 | end; 29 | 30 | if nargin < 4 || isempty(fg_size) 31 | if gparams.cell_size == -1 32 | fg_size = size(features{1}.getFeature(image,features{1}.fparams,gparams)); 33 | else 34 | fg_size = [floor(im_height/gparams.cell_size), floor(im_width/gparams.cell_size)]; 35 | end 36 | end 37 | 38 | % temporary hack for fixing deep features 39 | if gparams.cell_size == -1 40 | cf = features{1}; 41 | if (cf.fparams.useForColor && colorImage) || (cf.fparams.useForGray && ~colorImage) 42 | [feature_pixels, support_sz] = cf.getFeature(image,cf.fparams,gparams); 43 | end; 44 | else 45 | %compute the feature set 46 | feature_pixels = zeros(fg_size(1),fg_size(2),tot_feature_dim, num_images, 'single'); 47 | 48 | currDim = 1; 49 | for n = 1:length(features) 50 | cf = features{n}; 51 | if (cf.fparams.useForColor && colorImage) || (cf.fparams.useForGray && ~colorImage) 52 | feature_pixels(:,:,currDim:(currDim+cf.fparams.nDim-1),:) = cf.getFeature(image,cf.fparams,gparams); 53 | currDim = currDim + cf.fparams.nDim; 54 | end; 55 | end; 56 | support_sz = [im_height, im_width]; 57 | end 58 | 59 | end -------------------------------------------------------------------------------- /utils/get_fhog.m: -------------------------------------------------------------------------------- 1 | function [ feature_image ] = get_fhog( im, fparam, gparam ) 2 | %extract fhog features using piotrs toolbox. Currently takes no parameters 3 | %except hog-cell-size 4 | if ~isfield(fparam, 'nOrients') 5 | fparam.nOrients = 9; 6 | end 7 | [im_height, im_width, num_im_chan, num_images] = size(im); 8 | feature_image = zeros(floor(im_height/gparam.cell_size), floor(im_width/gparam.cell_size), fparam.nDim, num_images, 'single'); 9 | for k = 1:num_images 10 | hog_image = fhog(single(im(:,:,:,k)), gparam.cell_size, fparam.nOrients); 11 | %the last dimension is all 0 so we can discard it 12 | feature_image(:,:,:,k) = hog_image(:,:,1:end-1); 13 | end 14 | end -------------------------------------------------------------------------------- /utils/get_pixels.m: -------------------------------------------------------------------------------- 1 | function [ resized_patch ] = get_pixels( im, pos, sz, resize_target ) 2 | 3 | if isscalar(sz), %square sub-window 4 | sz = [sz, sz]; 5 | end; 6 | 7 | %make sure the size is not to small 8 | if sz(1) < 1 9 | sz(1) = 2; 10 | end; 11 | if sz(2) < 1 12 | sz(2) = 2; 13 | end; 14 | 15 | 16 | xs = floor(pos(2)) + (1:sz(2)) - floor(sz(2)/2); 17 | ys = floor(pos(1)) + (1:sz(1)) - floor(sz(1)/2); 18 | 19 | %check for out-of-bounds coordinates, and set them to the values at 20 | %the borders 21 | xs(xs < 1) = 1; 22 | ys(ys < 1) = 1; 23 | xs(xs > size(im,2)) = size(im,2); 24 | ys(ys > size(im,1)) = size(im,1); 25 | 26 | %extract image 27 | im_patch = im(ys, xs, :); 28 | 29 | if isempty(resize_target) 30 | resized_patch = im_patch; 31 | else 32 | resized_patch = mexResize(im_patch,resize_target,'auto'); 33 | end 34 | 35 | end 36 | 37 | -------------------------------------------------------------------------------- /utils/get_table_feature.m: -------------------------------------------------------------------------------- 1 | function [ features ] = get_table_feature( im, fparam, gparam) 2 | %get per-pixel features using a lookup table, if the gparam feature cell 3 | %size is set to something large than one, the resulting data will be 4 | %averaged in cells of the specified size. 5 | % 6 | %tables are loaded dynamically when needed from the lookup_tables folder, 7 | %and stored in a persistent variable 8 | 9 | persistent tables; 10 | 11 | if isempty(tables) 12 | tables = {}; 13 | end 14 | 15 | tab_ind = 0; 16 | for k = 1:length(tables) 17 | if isfield(tables{k}, fparam.tablename) 18 | tab_ind = k; 19 | break; 20 | end 21 | end 22 | 23 | if tab_ind == 0 24 | tables{end+1} = load(fparam.tablename); 25 | tab_ind = length(tables); 26 | end 27 | 28 | if strcmp(tables{tab_ind}.inputType,'color') 29 | if size(im,3) ~= 3 30 | except = MException('cannot get colorfeature from non color image'); 31 | raise(except); 32 | end 33 | elseif strcmp(tables{tab_ind}.inputType,'gray') 34 | if size(im,3) == 3 35 | im_gray = zeros(size(im,1),size(im,2),1,size(im,4),'uint8'); 36 | for k = 1:size(im,4) 37 | im_gray(:,:,:,k) = rgb2gray(im(:,:,:,k)); 38 | end 39 | im = im_gray; 40 | end 41 | end 42 | 43 | %else extract the feature and return it 44 | temp_features = table_lookup(im,tables{tab_ind}.(fparam.tablename)); 45 | 46 | if gparam.cell_size > 1 47 | features = average_feature_region(temp_features,gparam.cell_size); 48 | else 49 | features = temp_features; 50 | end 51 | 52 | end 53 | 54 | -------------------------------------------------------------------------------- /utils/get_threshold.m: -------------------------------------------------------------------------------- 1 | function [ thresh_im ] = get_threshold( im, fparam, gparam ) 2 | 3 | if isinteger(im) 4 | thresh_im = single(im)/255; 5 | end 6 | 7 | if isfield(fparam, 'diff_im') && ~isempty(fparam.diff_im) 8 | if isinteger(im) 9 | thresh_im = thresh_im - single(fparam.diff_im)/255; 10 | else 11 | thresh_im = thresh_im - fparam.diff_im; 12 | end 13 | end 14 | 15 | if isfield(fparam, 'pre_mapping') && ~isempty(fparam.pre_mapping) 16 | thresh_im = fparam.pre_mapping(thresh_im); 17 | end 18 | 19 | switch fparam.threshold_type 20 | case 'larger_than' 21 | binary_im = thresh_im > fparam.threshold; 22 | case 'smaller_than' 23 | binary_im = thresh_im < fparam.threshold; 24 | otherwise 25 | error('Unknown threshold type'); 26 | end 27 | 28 | thresh_im = single(binary_im); 29 | 30 | if isfield(fparam, 'post_mapping') && ~isempty(fparam.post_mapping) 31 | thresh_im = fparam.post_mapping(thresh_im); 32 | end 33 | 34 | if isfield(fparam, 'post_mapping_chan') && ~isempty(fparam.post_mapping_chan) 35 | for k = 1:size(thresh_im,3) 36 | for l = 1:size(thresh_im,4) 37 | thresh_im(:,:,k,l) = fparam.post_mapping_chan(thresh_im(:,:,k,l)); 38 | end 39 | end 40 | end 41 | 42 | if gparam.cell_size > 1 43 | thresh_im = average_feature_region(thresh_im, gparam.cell_size); 44 | end; 45 | end 46 | 47 | -------------------------------------------------------------------------------- /utils/gradient2.m: -------------------------------------------------------------------------------- 1 | function [Gx,Gy] = gradient2( I ) 2 | % Compute numerical gradients along x and y directions. 3 | % 4 | % For 2D arrays identical to Matlab's gradient() with a spacing value of 5 | % h=1 but ~10-20x faster (due to mexed implementation). Like gradient(), 6 | % computes centered derivatives in interior of image and uncentered 7 | % derivatives along boundaries. For 3D arrays computes x and y gradient 8 | % separately for each channel and concatenates the results. 9 | % 10 | % This code requires SSE2 to compile and run (most modern Intel and AMD 11 | % processors support SSE2). Please see: http://en.wikipedia.org/wiki/SSE2. 12 | % 13 | % USAGE 14 | % [Gx,Gy] = gradient2( I ) 15 | % 16 | % INPUTS 17 | % I - [hxwxk] input k channel single image 18 | % 19 | % OUTPUTS 20 | % Gx - [hxwxk] x-gradient (horizontal) 21 | % Gy - [hxwxk] y-gradient (vertical) 22 | % 23 | % EXAMPLE 24 | % I=single(imread('peppers.png'))/255; 25 | % tic, [Gx1,Gy1]=gradient(I,1); toc 26 | % tic, [Gx2,Gy2]=gradient2(I); toc 27 | % isequal(Gx1,Gx2), isequal(Gy1,Gy2) 28 | % 29 | % See also gradient, gradientMag 30 | % 31 | % Piotr's Computer Vision Matlab Toolbox Version 3.00 32 | % Copyright 2014 Piotr Dollar & Ron Appel. [pdollar-at-gmail.com] 33 | % Licensed under the Simplified BSD License [see external/bsd.txt] 34 | 35 | [Gx,Gy]=gradientMex('gradient2',I); 36 | -------------------------------------------------------------------------------- /utils/gradientHist.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/gradientHist.m -------------------------------------------------------------------------------- /utils/gradientMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/gradientMex.mexa64 -------------------------------------------------------------------------------- /utils/gradientMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/gradientMex.mexw64 -------------------------------------------------------------------------------- /utils/integralVecImage.m: -------------------------------------------------------------------------------- 1 | function intImage = integralVecImage(I) 2 | %integralImage Compute integral image. 3 | % J = integralImage(I) computes integral image of an intensity image I. 4 | % The output integral image, J, is zero padded on top and left, resulting 5 | % in size(J) = size(I) + 1. This facilitates easy computation of pixel 6 | % sums along all image boundaries. Integral image, J, is essentially 7 | % a padded version of CUMSUM(CUMSUM(I),2). 8 | % 9 | % Class Support 10 | % ------------- 11 | % Intensity image I can be any numeric class. The class of output 12 | % integral image, J, is double. 13 | % 14 | % Example 15 | % ------- 16 | % % Compute the integral image and use it to compute sum of pixels 17 | % % over a rectangular region in I. 18 | % I = magic(5) 19 | % 20 | % % define rectangular region as 21 | % % [startingRow, startingColumn, endingRow, endingColumn] 22 | % [sR sC eR eC] = deal(1, 3, 2, 4); 23 | % 24 | % % compute the sum over the region using the integral image 25 | % J = integralImage(I); 26 | % regionSum = J(eR+1,eC+1) - J(eR+1,sC) - J(sR,eC+1) + J(sR,sC) 27 | % 28 | % See also integralFilter, CUMSUM 29 | 30 | % Copyright 2010 The MathWorks, Inc. 31 | 32 | % References: 33 | % P.A. Viola and M.J. Jones. Rapid object detection using boosted 34 | % cascade of simple features. In CVPR (1), pages 511-518, 2001. 35 | % 36 | %#codegen 37 | %#ok<*EMCLS> 38 | %#ok<*EMCA> 39 | 40 | % validateattributes(I, {'numeric','logical'}, {'2d', 'nonsparse', 'real'},... 41 | % 'integralImage', 'I'); 42 | 43 | if ~isempty(I) 44 | intImage = zeros(size(I,1)+1, size(I,2)+1, size(I,3), size(I,4), 'single'); 45 | intImage(2:end, 2:end, :, :) = cumsum(cumsum(I,1),2); 46 | else 47 | intImage = []; 48 | end 49 | 50 | -------------------------------------------------------------------------------- /utils/intensityChannelNorm11.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/intensityChannelNorm11.mat -------------------------------------------------------------------------------- /utils/libopencv_core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/libopencv_core.a -------------------------------------------------------------------------------- /utils/libopencv_core.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/libopencv_core.so -------------------------------------------------------------------------------- /utils/libopencv_imgproc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/libopencv_imgproc.a -------------------------------------------------------------------------------- /utils/libopencv_imgproc.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/libopencv_imgproc.so -------------------------------------------------------------------------------- /utils/load_video_info_zc.m: -------------------------------------------------------------------------------- 1 | function [seq, ground_truth] = load_video_info(video_path) 2 | 3 | ground_truth = dlmread([video_path '/groundtruth_rect.txt']); 4 | 5 | seq.len = size(ground_truth, 1); 6 | seq.init_rect = ground_truth(1,:); 7 | 8 | img_path = [video_path '/img/']; 9 | 10 | if exist([img_path num2str(1, '%08i.png')], 'file'), 11 | img_files = num2str((1:seq.len)', [img_path '%08i.png']); 12 | elseif exist([img_path num2str(1, '%04i.jpg')], 'file'), 13 | img_files = num2str((1:seq.len)', [img_path '%04i.jpg']); 14 | elseif exist([img_path num2str(1, '%04i.bmp')], 'file'), 15 | img_files = num2str((1:seq.len)', [img_path '%04i.bmp']); 16 | else 17 | error('No image files to load.') 18 | end 19 | 20 | seq.s_frames = cellstr(img_files); 21 | 22 | end 23 | 24 | -------------------------------------------------------------------------------- /utils/mexResize.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "mex.h" 5 | #include "MxArray.hpp" 6 | #include 7 | 8 | #include 9 | 10 | using namespace std; 11 | using namespace cv; 12 | 13 | /* 14 | * Use opencv function to resample image quickly 15 | */ 16 | 17 | // matlab entry point 18 | // dst = resize(src, scale) 19 | // image should be color with double values 20 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { 21 | if (nrhs < 2){ 22 | mexErrMsgTxt("Wrong number of inputs"); 23 | } 24 | if (nlhs != 1){ 25 | mexErrMsgTxt("Wrong number of outputs"); 26 | } 27 | 28 | vector rhs(prhs,prhs+nrhs); 29 | 30 | //convert input data to opencv matrix 31 | Mat img = rhs[0].toMat(); 32 | Mat imgr; 33 | Size s = rhs[1].toSize(); 34 | Size newSize = Size(s.height,s.width); 35 | Size oldSize = img.size(); 36 | //interpolation method 37 | int interpolation = INTER_LINEAR; 38 | 39 | //if interpolation method provided set it 40 | if(nrhs == 3){ 41 | string interp = rhs[2].toString(); 42 | if(interp.compare("antialias") == 0){ 43 | interpolation = INTER_AREA; 44 | }else if(interp.compare("linear") == 0){ 45 | interpolation = INTER_LINEAR; 46 | }else if(interp.compare("auto") == 0){ //if we are zooming, use linear else use area interpolation 47 | //old array has width and height swapped, newArray does not 48 | if(newSize.width > oldSize.height){ 49 | interpolation = INTER_LINEAR; 50 | }else{ 51 | interpolation = INTER_AREA; 52 | } 53 | }else{ 54 | mexErrMsgTxt("Invalid interpolation provided, valid is linear (default), antialias, auto"); 55 | } 56 | } 57 | 58 | //use opencv resize function 59 | resize(img,imgr,newSize,0,0,interpolation); 60 | //convert back to matlab representation 61 | plhs[0] = MxArray(imgr); 62 | } 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /utils/mexResize.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mexResize.mexa64 -------------------------------------------------------------------------------- /utils/mexResize.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mexResize.mexw64 -------------------------------------------------------------------------------- /utils/mtimesx.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mtimesx.c -------------------------------------------------------------------------------- /utils/mtimesx.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mtimesx.m -------------------------------------------------------------------------------- /utils/mtimesx.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mtimesx.mexa64 -------------------------------------------------------------------------------- /utils/mtimesx.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/mtimesx.mexw64 -------------------------------------------------------------------------------- /utils/opencv_core242.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/opencv_core242.dll -------------------------------------------------------------------------------- /utils/opencv_core242.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/opencv_core242.lib -------------------------------------------------------------------------------- /utils/opencv_imgproc242.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/opencv_imgproc242.dll -------------------------------------------------------------------------------- /utils/opencv_imgproc242.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/opencv_imgproc242.lib -------------------------------------------------------------------------------- /utils/partition_spectrum2.m: -------------------------------------------------------------------------------- 1 | % Partitions the spectrum of a 2-dimensional signal with dimensions dft_sz into 2 | % the real part, a set of "positive" frequencies and the corresponding 3 | % "negative" frequencies. 4 | 5 | function [dft_sym_ind, dft_pos_ind, dft_neg_ind] = partition_spectrum2(dft_sz) 6 | 7 | % construct the index vector for the half of the spectrum to be saved 8 | spec_dim = ceil((dft_sz+1)/2); 9 | dim_even = mod(dft_sz, 2) == 0; 10 | if dim_even(2) 11 | % linear indecies of the part of the spectrum that is needed [g_0, g_+] 12 | dft_ind = [1:spec_dim(1), dft_sz(1)+1:(spec_dim(2)-1)*dft_sz(1)+spec_dim(1)]'; 13 | % linear indecies of the part of the spectrum that have a symmetric 14 | % counterpart g_+ 15 | dft_pos_ind = [2:spec_dim(1)-dim_even(1), dft_sz(1)+1:(spec_dim(2)-1)*dft_sz(1), (spec_dim(2)-1)*dft_sz(1)+(2:spec_dim(1)-dim_even(1))]'; 16 | else 17 | dft_ind = [1:spec_dim(1), dft_sz(1)+1:spec_dim(2)*dft_sz(1)]'; 18 | dft_pos_ind = [2:spec_dim(1)-dim_even(1), dft_sz(1)+1:spec_dim(2)*dft_sz(1)]'; 19 | end 20 | % linear indices for the part of the spectrum that is real, g_0 21 | dft_sym_ind = setdiff(dft_ind, dft_pos_ind); 22 | 23 | % construct the indeced for the corresponding negative frequencies 24 | pos_dft_id = zeros(dft_sz); 25 | pos_dft_id(dft_pos_ind) = 1:length(dft_pos_ind); % give the positive frequencies id:s corresponding to the order 26 | neg_dft_loc = reflect_spectrum2(pos_dft_id); % reflect to get the locations of corresponding negative indices 27 | [dft_neg_ind_unsorted, ~, corresponding_dft_pos_id] = find(neg_dft_loc(:)); % find the indices and corresponding positive id:s 28 | [~, dft_neg_ind_order] = sort(corresponding_dft_pos_id); % sort the id:s 29 | dft_neg_ind = dft_neg_ind_unsorted(dft_neg_ind_order); % get the corresopnding negative indices -------------------------------------------------------------------------------- /utils/reflect_spectrum2.m: -------------------------------------------------------------------------------- 1 | % Do a reflection in the fourier domain for a 2-dimensional signal 2 | 3 | function xf_reflected = reflect_spectrum2(xf) 4 | 5 | xf_reflected = circshift(flip(flip(xf, 1), 2), [1 1 0]); -------------------------------------------------------------------------------- /utils/resizeDFT2.m: -------------------------------------------------------------------------------- 1 | function resizeddft = resizeDFT2(inputdft, desiredSize) 2 | 3 | [imh, imw, n1, n2] = size(inputdft); 4 | imsz = [imh, imw]; 5 | 6 | if any(desiredSize ~= imsz) 7 | minsz = min(imsz, desiredSize); 8 | 9 | scaling = prod(desiredSize)/prod(imsz); 10 | 11 | resizeddft = complex(zeros([desiredSize n1 n2], 'single')); 12 | 13 | mids = ceil(minsz/2); 14 | mide = floor((minsz-1)/2) - 1; 15 | 16 | resizeddft(1:mids(1), 1:mids(2), :, :) = scaling * inputdft(1:mids(1), 1:mids(2), :, :); 17 | resizeddft(1:mids(1), end - mide(2):end, :, :) = scaling * inputdft(1:mids(1), end - mide(2):end, :, :); 18 | resizeddft(end - mide(1):end, 1:mids(2), :, :) = scaling * inputdft(end - mide(1):end, 1:mids(2), :, :); 19 | resizeddft(end - mide(1):end, end - mide(2):end, :, :) = scaling * inputdft(end - mide(1):end, end - mide(2):end, :, :); 20 | else 21 | resizeddft = inputdft; 22 | end 23 | end -------------------------------------------------------------------------------- /utils/setnonzeros.c: -------------------------------------------------------------------------------- 1 | /* setnonzeros(s,v) where s is sparse and numel(v)==nnz(s) 2 | * returns a new sparse matrix having the structure of s but nonzero values 3 | * equal to the elements of v(:), in order. 4 | * Written by Tom Minka 5 | */ 6 | #include "mex.h" 7 | #include "string.h" 8 | 9 | void mexFunction(int nlhs, mxArray *plhs[], 10 | int nrhs, const mxArray *prhs[]) 11 | { 12 | const mxArray *s, *v; 13 | mwSize m,n; 14 | mwIndex nnz; 15 | if(nrhs != 2) { 16 | mexErrMsgTxt("Usage: s = setnonzeros(s,v) where numel(v) == nnz(s)"); 17 | } 18 | if(nlhs > 1) { 19 | mexErrMsgTxt("Too many output arguments."); 20 | } 21 | if(!(mxIsSparse(prhs[0]))) { 22 | mexErrMsgTxt("Input argument 1 must be sparse."); 23 | } 24 | if(!(mxIsDouble(prhs[0]))) { 25 | mexErrMsgTxt("Input argument 1 must be of type double."); 26 | } 27 | if(mxIsSparse(prhs[1])) { 28 | mexErrMsgTxt("Input argument 2 must not be sparse."); 29 | } 30 | if(!(mxIsDouble(prhs[1]))) { 31 | mexErrMsgTxt("Input argument 2 must be of type double."); 32 | } 33 | s = prhs[0]; 34 | v = prhs[1]; 35 | m = mxGetM(s); 36 | n = mxGetN(s); 37 | nnz = mxGetJc(s)[n]; 38 | if(mxGetNumberOfElements(v) != nnz) { 39 | mexErrMsgTxt("numel(v) != nnz(s)"); 40 | } 41 | plhs[0] = mxCreateSparse(m,n,nnz,mxIsComplex(v)?mxCOMPLEX:mxREAL); 42 | memcpy(mxGetPr(plhs[0]), mxGetPr(v), nnz*sizeof(double)); 43 | if(mxIsComplex(v)) memcpy(mxGetPi(plhs[0]), mxGetPi(v), nnz*sizeof(double)); 44 | memcpy(mxGetIr(plhs[0]), mxGetIr(s), nnz*sizeof(mwIndex)); 45 | memcpy(mxGetJc(plhs[0]), mxGetJc(s), (n+1)*sizeof(mwIndex)); 46 | } 47 | -------------------------------------------------------------------------------- /utils/setnonzeros.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/setnonzeros.mexa64 -------------------------------------------------------------------------------- /utils/setnonzeros.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RuizeHan/DSAR-CF/0441e3ee9c1ed46cf4ab9a1d88ea66c497839c7b/utils/setnonzeros.mexw64 -------------------------------------------------------------------------------- /utils/table_lookup.m: -------------------------------------------------------------------------------- 1 | function out=table_lookup(im,table) 2 | 3 | if isa(im,'uint8') 4 | im = int32(im); 5 | end; 6 | 7 | [im_height, im_width, num_im_chan, num_images] = size(im); 8 | 9 | den = int32(8); 10 | fac = int32(32); 11 | offset = int32(1); 12 | 13 | if num_im_chan == 3 14 | RR=im(:,:,1,:);GG=im(:,:,2,:);BB=im(:,:,3,:); 15 | index_im = offset + idivide(RR,den) + fac*idivide(GG,den) + fac*fac*idivide(BB,den); 16 | out = permute(reshape(table(index_im(:),:), im_height, im_width, num_images, size(table,2)), [1 2 4 3]); 17 | else 18 | out = permute(reshape(table(im(:)+1,:), im_height, im_width, num_images, size(table,2)), [1 2 4 3]); 19 | end; 20 | -------------------------------------------------------------------------------- /utils/tracker_SRDCF.m: -------------------------------------------------------------------------------- 1 | % Set the path to your trackers 2 | path_to_your_trackers = ''; 3 | 4 | if isempty(path_to_your_trackers) 5 | error('Set the path to your trackers!'); 6 | end 7 | 8 | tracker_label = 'SRDCF'; 9 | tracker_command = generate_matlab_command('vot_wrapper(''SRDCF'', ''SRDCF_VOT_settings'')', {[path_to_your_trackers '/SRDCF/']}); 10 | tracker_interpreter = 'matlab'; 11 | tracker_trax = false; -------------------------------------------------------------------------------- /utils/vot_initialize.m: -------------------------------------------------------------------------------- 1 | function [images, region] = vot_initialize() 2 | 3 | % read the image file paths 4 | fid = fopen('images.txt','r'); 5 | images = textscan(fid, '%s', 'delimiter', '\n'); 6 | fclose(fid); 7 | 8 | images = images{1}; 9 | 10 | % read the region 11 | region = dlmread('region.txt'); 12 | region = region(:); 13 | end -------------------------------------------------------------------------------- /utils/vot_quit.m: -------------------------------------------------------------------------------- 1 | function vot_quit(regions) 2 | 3 | fid = fopen('output.txt', 'w'); 4 | 5 | for i = 1:numel(regions) 6 | region = regions{i}; 7 | 8 | if numel(region) == 1 9 | fprintf(fid, '%f\n', region); 10 | elseif numel(region) == 4 11 | fprintf(fid, '%f,%f,%f,%f\n', region(1), region(2), region(3), region(4)); 12 | elseif numel(region) >= 6 && mod(numel(region), 2) == 0 13 | fprintf(fid, '%f,', region(1:end-1)); 14 | fprintf(fid, '%f\n', region(end)); 15 | else 16 | error('VOT: Illegal result format'); 17 | end; 18 | 19 | end; 20 | 21 | fclose(fid); -------------------------------------------------------------------------------- /utils/wrappers.hpp: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Piotr's Computer Vision Matlab Toolbox Version 3.00 3 | * Copyright 2014 Piotr Dollar. [pdollar-at-gmail.com] 4 | * Licensed under the Simplified BSD License [see external/bsd.txt] 5 | *******************************************************************************/ 6 | #ifndef _WRAPPERS_HPP_ 7 | #define _WRAPPERS_HPP_ 8 | #ifdef MATLAB_MEX_FILE 9 | 10 | // wrapper functions if compiling from Matlab 11 | #include "mex.h" 12 | inline void wrError(const char *errormsg) { mexErrMsgTxt(errormsg); } 13 | inline void* wrCalloc( size_t num, size_t size ) { return mxCalloc(num,size); } 14 | inline void* wrMalloc( size_t size ) { return mxMalloc(size); } 15 | inline void wrFree( void * ptr ) { mxFree(ptr); } 16 | 17 | #else 18 | 19 | // wrapper functions if compiling from C/C++ 20 | inline void wrError(const char *errormsg) { throw errormsg; } 21 | inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); } 22 | inline void* wrMalloc( size_t size ) { return malloc(size); } 23 | inline void wrFree( void * ptr ) { free(ptr); } 24 | 25 | #endif 26 | 27 | // platform independent aligned memory allocation (see also alFree) 28 | void* alMalloc( size_t size, int alignment ) { 29 | const size_t pSize = sizeof(void*), a = alignment-1; 30 | void *raw = wrMalloc(size + a + pSize); 31 | void *aligned = (void*) (((size_t) raw + pSize + a) & ~a); 32 | *(void**) ((size_t) aligned-pSize) = raw; 33 | return aligned; 34 | } 35 | 36 | // platform independent alignned memory de-allocation (see also alMalloc) 37 | void alFree(void* aligned) { 38 | void* raw = *(void**)((char*)aligned-sizeof(void*)); 39 | wrFree(raw); 40 | } 41 | 42 | #endif 43 | --------------------------------------------------------------------------------