Image processing getting the pixels per inch of an object based on referential inches


Simply put:

I have a image of a human body. I have two reference points which are the left and right waist locations. Let's say for example: (100,100) and (200,100) are the respective left and right waist locations.

In addition to those two points, I also know the "real life" inches value of the waist.

I am trying to take those three data points and extrapolate how many pixels = one inch in "real life". This shouldn't be that hard, but I'm having some type of brain block on this.

Looking for the simple formula. The one I started with is:

(RightPoint.X - LeftPoint.X) / 34"

This does not work. The smaller the waist gets, the larger the pixels per inch value. In the above, it would be 2.9 pixels == 1".

If I change the 34" to 10", it shoots up to 10 pixels == 1". Or maybe that's correct? Ugh...brain where are you tonight!?!?

<img alt="enter image description here" class="b-lazy" data-src="https://i.stack.imgur.com/FtyJ7.png" data-original="https://i.stack.imgur.com/FtyJ7.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />

The Question:

I'm looking for the correct formula that based on those three referential data points will allow me to determine how many pixels in the image == 1". So if I know in real life that the person's waist is 34 inches, I want to determine that in the image...let's say 2.5 pixels == 1 inch relative to the picture.


Unfortunately you don't have enough information to work it out. Firstly, the waist measurement in real life is 3-D and goes all the way around the body, so for a start you would have to divide it by 2 to allow for the tape-measure going both across the front and the back of the body - so your 34" waist would mean your 100 pixels correspond to 17" - if the body was flat - which it isn't! And that is the problem.

Imagine the person had two thick pillows down the front of their trousers... that would affect their waist measurement (make it miles bigger) but, as they are down the FRONT of their trousers, it wouldn't affect the pixel width.

Sorry, you can't do it accurately. You could assume their waist was perfectly circular, then the 100 pixels would correspond to the projection of their waist, so 34" would be the circumference of the waist, which is pi x d. So you would say that 100 pixels = 34/pi or around 11".

So, in concrete terms:

34/pi inches = 100 pixels 10.8 inches = 100 pixels 1 inch = 100/10.8 pixels 1 inch = 9.25 pixels

But remember this is an approximation based on the waist being circular.


  • Unity Disorted Audio
  • Ensure web app access from a single computer per user
  • Reactive variables in Shiny for later calculations
  • working with Nested IF statement in excel
  • How to predict a new value using simple linear regression log(y)=b0+b1*log(x)
  • Check if one value in one column is in another column
  • Pivot table calculated Field from count of values
  • VBA vlookup with defined range and file from other workbook
  • How to get (-8)^0.333333 = -2 in MATLAB?
  • Xcode 6 - Press button to play sound
  • How to calculate total Fridays between two dates in excel on weekly, biweekly and monthly basis?
  • JavaScript - Can we set javascript objects in cookies?
  • Pandas - find nearest dates between two DataFrames without loop
  • Finding number of samples in a .wav header
  • How to delete column from range if cell contains specific value in VBA/Excel
  • Get or convert Week of year to ISO week
  • Is it possible to “shrink” a PdfPtable?
  • Use allowDiskUse in criteria query with Grails and the MongoDB plugin?
  • What exactly is the height of modalPresentationStyle - FormSheet on iPad?
  • Custom Nav Title offset ios 11
  • calculating number of bytes of each row in an image
  • Excel distinct count with conditions
  • Efficient & Pythonic way of finding all possible sublists of a list in given range and the minim
  • Responsive left sidebar open close
  • Prevent page break in text block with iText, XMLWorker
  • C++ friend class std::vector
  • SyntaxError: (irb):26: both block arg and actual block given
  • How can I replace the server in Web Component Tester
  • Clear activity stack before launching another activity
  • Jenkins: FATAL: Could not initialize class hudson.util.ProcessTree$UnixReflection
  • Unable to install Git-core+svn by MacPorts
  • Django simple Captcha “No module named fields” error
  • Could not find rake using whenever rails
  • Record samples being played with OpenAL
  • Ajax Loaded meta Tags
  • R: gsub and capture
  • jqPlot EnhancedLegendRenderer plugin does not toggle series for Pie charts
  • Comma separated Values
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How to load view controller without button in storyboard?