Search code examples
pythonimagearea

Approximating surface area from an image with Python


I plan to calculate the surface area of this cone by

  1. Splitting the image into top/bottom halves of the cone
  2. Finding the brightest spot on top/bottom halves
  3. Finding the distance between brightest spots on top/bottom halves as a diameter for every pixel along the x axis and using it to calculate a dS for the total S, surface area

However, this appears unreliable at the extremities (tip and base). How can I make it more reliable at base/tip? or is my approach entirely wrong?

Edit: I want it to truncate in the black space, on both ends


Solution

  • I would try applying a filter that will make cone pixels white and other pixels black (e.g. provide a binary image). After that the area of the cone is just the sum of the white pixels.