/normalizeAnnularHistogram.m

http://github.com/gallamine/Photonator · Objective C · 24 lines · 19 code · 5 blank · 0 comment · 1 complexity · 2c5a42e0f5c61bbbd878d85946fd88b9 MD5 · raw file

  1. %%
  2. % Determine correct normalization for a 2d histogram of points on the x/y
  3. % plane. By taking the histogram of the radius, the data is skewed by the
  4. % area of the annular rings. This needs to be corrected. - WCC 6/7/11
  5. % figure(4);
  6. % cnt = hist3([rec_loc_final(:,1) rec_loc_final(:,2)],'Edges',{-2:1e-3:2 -2:1e-3:2});
  7. % finalPdf = cnt./max(max(cnt));
  8. %
  9. % imshow(finalPdf);
  10. % colormap(jet);
  11. figure(4);
  12. cnt = hist3([recPosY' recPosX'],'Edges',{-0.3:1e-2:0.3 -0.3:1e-2:0.3});
  13. % finalPdf = cnt./max(max(cnt));
  14. imshow(finalPdf,[0 1])
  15. colormap(jet);
  16. [cnt,bins] = hist(distances,100);
  17. binDelta = [bins] - [0 bins(1:end-1)];
  18. cntNorm = cnt./(pi.*(2.*bins.*binDelta - binDelta.^2));
  19. bar(bins,cntNorm);