Estimating the Height of a Person from a Known Object Height in a Photograph

David Morgan
3 min readOct 26, 2024

--

Link to the app:

https://y3kthz.csb.app/

Getting Started

  1. Upload Image
  • Click “Choose File” to upload a photograph
  • Ensure the image contains:
    - A person whose height you want to measure
    - A reference object of known height (e.g., door, furniture)
  • Image should be clear and uncropped

2. Enter Reference Height

  • Input the exact height (in centimeters) of your reference object
  • Example: If using a door, enter standard door height (200cm)

3. Mark Reference Points

  • First Mode: Reference Selection (Red)
  • Click at the bottom of reference object
  • Click at the top of reference object
  • Red line appears showing reference measurement

4. Mark Person Points

  • Second Mode: Person Selection (Blue)
  • Click at the person’s feet
  • Click at the top of person’s head
  • Blue line appears showing person measurement
  1. Calculate Result
  • Click “Calculate Height” button
  • Estimated height appears below

Theory Behind the Application

Mathematical Principle The app uses the principle of similar triangles and perspective scaling to calculate height:

javascript

Person's Height = (Person's pixel height / Reference pixel height) × Reference real height

Key Concepts

  1. Perspective Geometry
  2. javascript:
Known height (reference) : Pixel height (reference) = Unknown height (person) : Pix
el height (pers
  1. Distance Calculation
  2. javascript:
pixelHeight = Math.sqrt(     Math.pow(end.y - start.y, 2) +      Math.pow(end.x - start.x, 2) );

Accuracy Factors

  1. Reference Selection

Choose reference objects that are:

  • In the same plane as the person
  • Clear and measurable
  • Of known exact height
  1. Camera Position

Best results when:

  • Camera is level
  • Subject and reference are at similar distances
  • Minimal perspective distortion
  1. Common Reference Objects
  2. javascript
Standard Heights: - Doors: 200cm (typical) - Tables: 75cm - Chairs: 45cm (seat height) - Counter tops: 90cm

Best Practices

  1. Image Quality
  • Use clear, well-lit photos
  • Avoid extreme angles
  • Ensure full visibility of subject and reference

2. Reference Selection

  • Choose references that are:
  • Clearly visible
  • Vertical (not angled)
  • Close to the person

3. Point Marking

  • Be precise when clicking points
  • Ensure vertical alignment
  • Account for perspective

Error Handling

Common issues and solutions:

  1. Inaccurate Results
  • Verify reference height input
  • Check point placement
  • Ensure proper perspective

2. Image Problems

  • Use higher resolution images
  • Avoid blurry photos
  • Ensure good lighting

Technical Implementation Details

javascript:

// Core calculation
const heightEstimate = (personPixelHeight / referencePixelHeight) * referenceHeight;
// Where:
// personPixelHeight = distance between person points
// referencePixelHeight = distance between reference points
// referenceHeight = known height in cm

Limitations

  1. Accuracy Constraints
  • Results are estimates
  • Accuracy depends on:
  • Image quality
  • Reference accuracy
  • Point placement precision

2. Technical Limitations

  • 2D analysis of 3D space
  • Perspective distortion
  • Camera lens effects

Tips for Best Results

  1. Photography
  • Stand at medium distance
  • Keep camera level
  • Ensure good lighting
  1. Reference Selection
  • Use vertical objects
  • Choose clear reference points
  • Use accurately measured references
  1. Measurement
  • Mark points carefully
  • Use consistent reference points
  • Double-check reference height

This application provides a practical solution for height estimation from photographs, based on fundamental principles of geometry and perspective. While not as accurate as direct measurement, it can provide useful estimates when physical measurement isn’t possible.

--

--

David Morgan
David Morgan

Written by David Morgan

Was developing apps for social good e.g. Zung Test, Accident Book. BA Hons and student of criminology. Writing about true crime. Next cancer patient.

No responses yet