The thing to remember about frames is that the top of the seat tube opens up slightly when there's no collar on it, so measuring the diameter will give you a rough idea of the seatpost size. I usually try a size up and one down to be certain.
Don't forget the manufacturing tolerances of the seatpost come into this as well. Rarely are seatposts the exact size that's printed on them. For example the Specialized S-Works Pave carbon seatpost (27.2mm diameter) has an acceptable tolerance range from 27.05mm to 27.25mm.
This means if your frame is 27.25mm and you get a seatpost that's 27.05mm it'll be slightly loose in the frame.
Don't forget the manufacturing tolerances of the seatpost come into this as well. Rarely are seatposts the exact size that's printed on them. For example the Specialized S-Works Pave carbon seatpost (27.2mm diameter) has an acceptable tolerance range from 27.05mm to 27.25mm.
This means if your frame is 27.25mm and you get a seatpost that's 27.05mm it'll be slightly loose in the frame.