Print pixels after segmentation

I am a beginner and I would like to know what function is needed, and in which line to write a function that will show the size of the frame in mm