The distinction between Primary and Secondary Imagination is something that Coleridge writes about in his book of criticism entitled Biographia Literaria. For Coleridge, the Primary Imagination is the spontaneous act of creation that overtakes the poet, when an experience or emotions force him to write. Secondary Imagination, by contrast, is when the poet consciously dreams up his work and forces himself to write without the natural impulse of Primary Imagination.
Secondary Imagination can perhaps be seen when Coleridge in the first stanza of this poem consciously imagines what natural wonders and delights his friends are seeing whilst they go on a walk and he is "trapped" in his prison. Coleridge rather peevishly expresses his envy and annoyance at being forced to stay at home by imagining what amazing sights his friends will be enoying. However, particularly in the final stanza, the Primary Imagination is shown to manifest itself as Coleridge takes comfort and joy in the wonders of nature that he can see from his seat in the garden:
Pale beneath the blaze
Hung the transparent foliage; and I watch'd
Some broad and sunny leaf, and lov'd to see
The shadow of the leaf and stem above
Dappling its sunshine!
The Primary Imagination shows itself through the natural and spontaneous description of nature that Coleridge evidently finds deeply moving as he becomes more and more aware of what is going on around him. Instead of being governed by envy, he recognises that it was a good thing that he was not able to go with his friends, as now he has learned an important lesson: he now appreciates the beauty of nature that is on his doorstep.