function [ num ] = salientNumCnt( filesDir, totalNum )
%SALIENTNUMCNT Summary of this function goes here
%   Detailed explanation goes here
    
    allPoints = zeros(1,totalNum);

    fileExt = '*.txt';
    
    files = dir(fullfile(filesDir,fileExt));  
        
    for i=0:length(files)-1
        fileCnt = num2str(i);
        fileName = [filesDir, fileCnt, '.txt'];
        
        file_t = fopen(fileName);
        pointID = fscanf(file_t, '%d');
        fclose(file_t);
        
        if length(pointID) > 0
            allPoints(sub2ind(size(allPoints), ones(1, length(pointID)), (pointID)')) = 1;
        end

    end
    
    disp('salient predicted:');
    disp(sum(allPoints));
    disp(sum(allPoints) / length(allPoints));
    
    num = sum(allPoints);
        
end


HuanYin94
github-repos/MATLAB/HuanYin94-map_compression/map_compression-3c126a5cc832bf51f0c313c6ad8aa58a2930312c/gurobi/before/q_ILP/DP_cut_run/salientNumCnt.m
map_compression
github-repos/MATLAB/HuanYin94-map_compression
3c126a5cc832bf51f0c313c6ad8aa58a2930312c