compareHogsVisually.m 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. function compareHogsVisually ( hog1, hog2, idxDimsToShow )
  2. % function compareHogsVisually ( hog1, hog2, idxStart, idxEnd )
  3. %
  4. % brief: compute dim-wise differences between two hog features and plot
  5. % the results into an image
  6. % author: Alexander Freytag
  7. % date: 05-02-2014 (dd-mm-yyyy)
  8. %
  9. % INPUT: hog1 and hog2 two hog features of corresponding size
  10. % idxDimsToShow (optionally) vector with dim indices
  11. if ( nargin < 3 )
  12. idxDimsToShow = 1:size(hog1,3);
  13. end
  14. for i=1:length(idxDimsToShow)
  15. % create new figure
  16. fig1=figure;
  17. % set title indicating current dimension
  18. s_titleHoG = sprintf('Dim %d', idxDimsToShow(i) );
  19. set ( fig1, 'name', s_titleHoG);
  20. % plot actual differences
  21. imagesc( (hog1(:,:,idxDimsToShow(i) ) - hog2(:,:, idxDimsToShow(i) )));
  22. % don't miss a colorbar indicating the actual values
  23. colorbar;
  24. % wait for user input
  25. pause;
  26. % close current figure and switch to next dimension
  27. close(fig1);
  28. end
  29. end