This is a Stanhope viewer. They were invented by Rene Dagron in 1857 to enable viewing of microphotographs.
Microphotos are about 3mm squared and were developed as a novelty but you might know microphotography in the form of microfiche or film. It has also been used in cases of espionage.
Dagron modified a Stanhope lens and attached the microphotographs at the end, bypassing the need for a microscope. The lens was small enough to be mounted in jewellery and all sorts of miniature objects.
The Stanhope viewer in Dacorum Heritage’s collection is in the form of a pipe and has a view of St Mary's Church, Hemel Hempstead.