When I, sitting, heard the astronomer, where he lectured with much applause in the lecture-room, (line 4)
In many ways, a "lecture" goes against the spirit of the virtue of self-reliance, most famously described by the American transcendentalist Ralph Waldo Emerson, but also practiced by Whitman. In a lecture, you aren't learning something from direct experience; you're having it transmitted to you passively in words.
Look'd up in perfect silence at the stars. (line 8)
The end of the poem contrasts the speaker's wisdom with the dry knowledge of the astronomer. He discovers the beauty of the stars for himself, on his own terms.