Sadly, out of my own experience on a client project, what you suggest is the only reliable option.
The only truly reliable way to do this is to ask the user to calibrate the size against an object of fixed size (a ruler for example). We've tried several other solutions but nothing else worked all of the time.
I made users only do it once when they registered so it was not too big of a hassle (the system had a relatively low number of users who used it a lot of times).
As for how, I had a resizeable div which the user had to calibrate to 1cm, I've made the user calibrate two different divs this way and validated that the difference in size between them was not bigger than x (where x is some accepted value of tolerance). Calibration was done with keyboard keys or dragging the div corner although keyboard keys usually provide better result a lot of people are not that good with a mouse and we got complaints, allowing keyboard input (increase/decrease size) solved most of the complaints. Adding a text box where you specify an amount of pixels (and see the result) might also work.