Usually the black body radiation (at a certain temperature $T$) is given by
$$\rho ( \nu ) = \frac{8 \pi h \nu^3}{c^3 \left( e^{h \nu / (k_B T)} - 1 \right)}$$
This quantity $\rho ( \nu )$ should be the density of energy, that is: the energy per unit volume and per unit frequency, so its unit measure should be
$$\mathrm{\frac{J}{Hz \cdot cm^3}}$$
As adviced in a comment to this answer, the density of photons should be easily obtained from $\rho ( \nu )$. If each photon has energy $h \nu$, from the density of energy (per unit frequency, per unit volume) the corresponding density of photons (number of photons per unit frequency, per unit volume) should be
$$n( \nu ) = \frac{\rho ( \nu )}{h \nu}$$
But this document (page 14) is not agreeing with this. It derives the number of photons not from $\rho ( \nu )$, but from the radiation intensity $I ( \nu )$, which is density of power (not energy) per unit frequency per unit volume. It states
$$n (\nu ) = \frac{I( \nu )}{h \nu}$$
Even the unit measures seem not to match in this case. So, what is the correct definition for $n (\nu )$ and why?