https://github.com/bertinetto/staple
Raw File
Tip revision: 7b6b5b579a7cd25acae6bcabe93f8dfb78040215 authored by Luca Bertinetto on 25 April 2017, 16:35:58 UTC
added cfnet link
Tip revision: 7b6b5b5
getP.m
function P = getP(histogram, h, w, bin_indices, grayscale_sequence)
%GETP computes the scores given the histogram
	% query the hist for the probability of each pixel
	if grayscale_sequence
		hist_indices = bin_indices;
	else
		hist_indices = sub2ind(size(histogram), bin_indices(:,1), bin_indices(:,2), bin_indices(:,3));
	end

	% shape it as a matrix
	P = reshape(histogram(hist_indices), h, w);
end
back to top