Houses and rooms are full of perfumes, the shelves are crowded with perfumes.
In this first example of a metaphor, the "perfumes" represent memories. Indeed, it is often said that the sense of smell is the sense most closely linked to memory. The particular smell of a room or a house, for example, can evoke memories of moments spent in that room or house. Likewise, each book on a shelf contains memories, and thus the shelves are "crowded with perfumes."
You shall no longer . . . look through the eyes of the dead, nor feed on the spectres in books.
In this second example of a metaphor, Whitman is encouraging people to live life directly, rather than through books. The "dead" he refers to possibly represent dead authors or characters in books that are never really alive. He also refers to these "dead" authors or characters as "spectres," compounding the idea that they are not alive in the here and now. They are "spectres" from the past. Spectres are also insubstantial, and thus to "feed" on them is poor nourishment for one's mind.
This is the grass that grows wherever the land is and the Water is, / This the common air that bathes the globe.
In this third example from stanza seventeen, Whitman metaphorically describes the thoughts that he has been outlining previously in the poem as "the grass," "the Water," and "the common air." In other words, Whitman implies that thoughts about life and thoughts about who we are and what we might be are as common, as natural, and as ubiquitous as "the grass," "the Water," and "the common air." We should not neglect these thoughts, as we should not neglect the elements that sustain us—rather, we should celebrate and embrace them.
There are almost countless examples of metaphor in Walt Whitman's long poem, "Song of Myself." Indeed, even if you were to narrow your options down to a single image - the central leaf of grass, for instance - you'd still find that Whitman employs numerous metaphors to describe his subject matter. One of my personal favorites, however, occurs in section 31 when Whitman uses metaphor to conceive of a leaf of grass as a manifestation of the infinite cosmos.
In the first line of section 31, Whitman says "I believe a leaf of grass is no less than the journey-work of the stars" (663). With this metaphor, Whitman likens a tiny, insignificant blade of grass to the whole expanse of the heavens. In doing so, Whitman asserts that even the smallest of things, even something as insignificant as grass, possesses infinite complexity and beauty. Additionally, because the leaf of grass is "the journey-work of the stars," it's also connected to a vast network of infinite importance that transcends its seeming insignificance. This metaphor is central to "Song of Myself," as it communicates Whitman's belief that everything is connected, everything is important, and everything, even a tiny leaf of grass, possesses a vast and complex beauty all its own.